Skip to content

Blu Age L3: Go-Live / Error messages in logs when carddemo app is started in M2.

0

When I start the carddemo application in M2, it started successfully but I see these error messages in the logs:

  1. Caused by: org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException: Failed to look up JNDI DataSource with name 'java:comp/env/jdbc/primary'

  2. Caused by: javax.naming.NameNotFoundException: Name [jdbc/primary] is not bound in this Context. Unable to find [jdbc].

  3. Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cbact04c': Unsatisfied dependency expressed through field 'transactionManager': Error creating bean with name 'platformTransactionManager' defined in aws.bluage.l3.workshop.SpringBootLauncher: Unsatisfied dependency expressed through method 'platformTransactionManager' parameter 0: Error creating bean with name 'primaryDataSource' defined in aws.bluage.l3.workshop.SpringBootLauncher: Failed to instantiate [javax.sql.DataSource]: Factory method 'primaryDataSource' threw exception with message: Failed to look up JNDI DataSource with name 'java:comp/env/jdbc/primary'

... which I think could be the main reason why the batch job TRANBKP keeps on failing with 'Unknown groovy script'.

asked 9 months ago105 views
2 Answers
1

The error messages you're seeing in the logs when starting the carddemo application in M2 are related to database configuration issues, specifically with the primary datasource. These errors can indeed lead to batch job failures like the one you're experiencing with TRANBKP.

The main problem appears to be that the application is unable to find or connect to the primary datasource. This is evident from the JNDI lookup failure for 'jdbc/primary'.

To resolve this issue, you should:

  1. Check your application.yml or application.properties file to ensure the datasource configurations are correct. Make sure the primary datasource is properly defined with the correct URL, username, and password.

  2. Verify that all necessary database servers are started and running correctly.

  3. Double-check the JNDI configuration if you're using JNDI for datasource lookup. Ensure that the JNDI name 'java:comp/env/jdbc/primary' is correctly set up in your application server configuration.

  4. Review your database connection settings, including the database URL, port, and credentials.

  5. Ensure that all required dependencies for database connectivity are present in your project's build file (pom.xml for Maven or build.gradle for Gradle).

  6. If you're using AWS Secrets Manager for database credentials, verify that the ARN is correct and that your application has the necessary permissions to access the secrets.

If after checking these points the issue persists, you may need to review your application's datasource configuration more thoroughly. Sometimes, the problem can be as simple as a typo in a configuration file or a mismatch between the expected and actual datasource names.

The 'Unknown groovy script' error for the TRANBKP batch job is likely a consequence of these database connection issues. Once you resolve the primary datasource problem, the batch job should be able to run successfully.
Sources
AWS BluAge L3 workshop. Go-Live->Deploy->Start application. Application fails to start. | AWS re:Post
BluAGE L3 workshop issue with Go-Live Test batches and Online | AWS re:Post

answered 9 months ago
EXPERT
reviewed 9 months ago
0

Hi: Can you check changes indicated in this step: Go Live->Prepare->Package For class SpringBootLauncher.java

answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.