Grails default app not deploying to tomcat - java

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.

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.

Spring Boot runtime configuration no longer running embedded Tomcat

I'm working on an application that utilizes the Spring Boot framework. I work exclusively out of IntelliJ, in which I've created a runtime configuration for Spring Boot. This configuration is IntelliJ-based and is capable of running and debugging the application utilizing the settings specified in both the project's application.properties and pom.xml files.
Up until about a week ago, my runtime configuration (upon debugging/running) launched the Spring Boot application, which in turn launched an embedded instance of Tomcat. Last week, without making any project-level setting changes, this configuration has started to run Jetty rather than Tomcat. Has anyone seen this?
Unfortunately, I'm not at liberty to share the properties or pom files in-depth, but I will point out that I have no mention of Jetty in either, and the following are listed as dependencies:
Thanks for taking a look!

JavaAgentDetector error while deploying to Elastic Beanstalk

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.

How to deploy jbpm-console 3.3.1 on jboss web server3.0.0 beta-1

I want to deploy jbpm-console on jboss web server,
but the following error message appears.
Can anyone tell me what's wrong?
2010-01-22 08:11:21,416 ERROR [org.jboss.system.server.profileservice.ProfileServiceBootstrap] (Thread-2) Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS IN ERROR:
Deployment "vfsfile:/E:/app/jboss-web-3.0.0-beta-1-zip/jboss-web-3.0.0-beta-1/server/default/deploy/jsf-console.war/" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/E:/app/jboss-web-3.0.0-beta-1-zip/jboss-web-3.0.0-beta-1/server/default/deploy/jsf-console.war/ deployment failed
You are really trying experimental things here and, to be honest, I wonder why you're not using one of the supported container (well, the matrix is actually not up to date and if I remember well, the installer of jBPM 3.3.1 suggests JBoss 4.2.2, JBoss 4.2.3, JBoss 5.0.0).
Anyway, JBoss Web being based on Tomcat, did you try to follow the steps of JbpmOnTomcat? It seems that you need to build a jbpm-console.war customized for deployment on TC. There is no guarantee that all this will work though. If it doesn't, just use a supported platform.

Categories

Resources