JavaAgentDetector error while deploying to Elastic Beanstalk - java

I have a Java 8, Spring boot application that has an embedded Tomcat (it is actually a JHipster 3.0.0 monolithic app). I want to deploy it to AWS Elastic Beanstalk.
My approaches:
On a Java environment, with a Procfile.
On a Tomcat environment, with a Procfile.
On a Java environment, without a Procfile.
On a Tomcat environment, without a Procfile.
No matter the approach I always get this error.
I am not using ever in my project that JavaAgentDetector.class that Elastic Beanstalk fails to inflate.
Of course, when I execute that .war locally there are no problems.
Thoughts?

could be a difference in your production profile and dev profile?

What made the trick: I finally deployed my app on a Tomcat environment without a Procfile. The error was a caps lock difference between my pom.xml and my application-prod.properties in the name of the database.

Related

grails 4.x: Creating a WAR with a custom env always runs under development

I can't get my custom environment to run under Tomcat. It always loads the development profile.
I create a WAR with the following under Grails 4.0.5:
grails -Dgrails.env=qa war
The resulting grails.build.info looks correct:
info.app.version=2.0.7
info.app.name=myapp
grails.env=qa
info.app.grailsVersion=4.0.5
However, when I drop it into Tomcat 8 and run, I get this:
[ost-startStop-1] com.myapp.ApplicationLoader : The following profiles are active: development
Running standalone, though, works just fine:
./gradlew -Dgrails.env=qa bootRun
grails.util.Environment, defines a number of pre-configured environments.
Environment APPLICATION
Environment CUSTOM
Environment DEVELOPMENT
Environment PRODUCTION
Environment TEST
In application.yml we get pre-configured development, test, and production environments. So if we want to add custom environments we add similarly. In your case it will be qa.
With Grails command line we can execute any command within the context of a specific environment. The format is:
grails [environment] [command name]
Suppose if want to create a WAR for the test environment you wound run:
grails test war
To target other environments you can pass a grails.env variable to any command:
grails -Dgrails.env=UAT run-app
I create a WAR with the following under Grails 4.0.5:
grails -Dgrails.env=qa war
Yes, all looks good as per grails documentation and configuration.
I have Created POC app for same with Grails 4.0.5 and also downloaded external tomcat apache-tomcat-8.5.63.
My application.yml with qa ENV:
Running standalone, though, works just fine:
./gradlew -Dgrails.env=qa bootRun
Yes. This also works fine.
So, now i have created war file with grails -Dgrails.env=qa war
Then i started my tomcat and dropped my poc-app-0.1.war file into tomcat.
when tomcat deployed/extracted my war, entered local url into browser.
You can see in above image, Environment is qa
So everything is running as i passed to env while creating war.
I tested with multiple environments, both pre-configured and custom environments. But did not got any issue like created war for qa and running on dev.
Also i have tested with java -jar poc-app-0.1.war and it's running on same env as we given.
Application details:
and tomcat version is apache-tomcat-8.5.63
It may be some versions or configuration issue with your app.
Please refer this link of my poc. Can you please try to create war and deploy in same way to your tomcat and let me know.
If you are still getting issue, then please share your minimal code or poc.
Even i got one more similar kind of issue on grails repo, please do refer this.
I have followed lot of documentation and references but still not able to reproduce your issue.
Links:
Environment class
Upgrade Doc
Command Line
API Doc
Conf Doc

Could not find implementation of liquibase.logging.Logger on Tomcat 8.5

I am working on a WebApp with Vaadin and Hibernate which is using Version 3.2.3 of Liquibase as a dependency.
When I build this App and test it with the Tomcat7 Maven Plugin everything works fine.
When I deploy the .war file manually to Azure (running Tomcat 8.5) or a Tomcat 8.5 on my local machine I get the following error:
liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
When I deploy the .war manually to a Tomcat 7.0 running locally it works again.
The database is the same in all cases.
What might be the reason for this?
How can I fix this?
Looks like it's a should-be-fixed-but-still-reproduced issue.
There are two issues in Liquibase's Jira:
CORE-2003
CORE-2042
Try updating liquibase. Version 3.2.3 is very old already.

What is the correct way to deploy a spring boot application

I just faced a strange problem,
this is the first time i deploy a spring boot application on server
As usual i ran the application using java command java -jar myApp.jar
after while, i see the application got stop without leaving any error message.
so i don't know what is the problem,
possible reason is java memory is not enough so i increased it to 7GB due it has socket
but the problem still exist
note that i dont have docker and the server is Linux ubuntu provided by Amazon light sail
The server is running a weblogic, jboss, glassfish, tomcat or something else?
You dont use maven in this project? Try to build it using maven, with 'mvn clean install' in the root of the project.

Grails default app not deploying to tomcat

I have a very basic grails app which was generated using create-app and creating a simple controller. It works locally, but when I use 'grails war' and deploy it in a tomcat server, there seems to be a database issue. The last 'caused by' in the tomcat logs is
Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
I have not made any changes to the database configuration generated by create-app (thus using an embedded DB).
The environment is: grails 3, debian 9, tomcat 8.
How to solve this ?
Running grails war causes the production environment configuration to be used, by default. The db config is different for production and is probably the cause of the problem. You should try grails -Dgrails.env=development war or grails dev war instead.

setting development environment of Heroku template java application

I have installed Heroku java plug-in and trying to set example application i.e. "Web & Asynchronous worker with Spring, CloudAMQP". This project is following maven and application gets deployed on heroku thru maven.
Would it be possible to run same application using local java container, rabbitmq and worker running in same and/or different JVM?
Yes, Foreman will start any project that has a Procfile. If there are multiple processes defined it will start them all.
https://devcenter.heroku.com/articles/procfile#developing-locally-with-foreman
You'll have to build the project locally with Maven first. You can either set the config info for your rabbitmq instance into environment variable or save them in a .env file which foreman will pick up. You can look at your Heroku app with 'heroku config' to see the variables that the app is expecting.

Categories

Resources