grails tomcat 7 deployment - oracle

So I have a grails 2.0.4 application that works exactly the way I want. I created the war file and deployed it to Tomcat 7. I'm getting an error saying that the application can't find the jar I'm using to connect to oracle (ojdbc6.jar). The jar is listed under mywebapp/WEB-INF/lib. WHY can't it be found?? Any help would be greatly appreciated!

The jar file should be in the toplevel lib directory of your project (or specified as a dependency in a repository), not webapp/WEB-INF/lib. Is the jar file actually inside the warfile? You can test this by opening the war as a zip file, or by running jar tf target/mywebapp*.war and looking for ojdbc6.jar. If it is, it should get deployed and you should see it in tomcat7/webapps/mywebapp/WEB-INF/lib.
The default environment for grails war is production instead of development. Make sure you've got the production data source configured correctly in grails-app/conf/DataSource.groovy

Related

ClassNotFoundException in spring project with maven

I have created a spring project with maven and it works fine. I am trying to add a jar file to the project, eclipse does not give any errors but when i start the server and try to access to the page which uses a class from that jar file i get a classNotFound exception.
My steps are..
1 - I put the jar file in src->main->resources
2 - I added it to build path by right clicking and saying add to build path.
3 - I add the project to tomcat and start the server
The thing is i looked at the tomcat deployment directory and the .jar file appears in classes directory. When i take copy the file from classes to lib (which has libraries downloaded by maven) project works fine.

Placeholder in banner.txt are not replaced when deploying war file

I've built a spring boot application and I'm trying to customize the banner to display the version of my application.
After reading the documentation, I've managed to create a banner.txt in the classpath and added the ${application.formatted-version} placeholder inside.
I've also managed to create a manifest file (using Gradle) containing the Implementation-Version.
Everything works fine when executing a jar file directly but when creating a war file, the banner is displayed but the version placeholder is not replaced.
After a bit of debugging, this method seems to be the source of the problem
org.springframework.boot.ResourceBanner.getApplicationVersion()
When running a war file, the call to
sourcePackage.getImplementationVersion() always return null
The manifest file is located at the root of the war file /META-INF/MANIFEST.MF
The application is deployed in a standalone tomcat 8.0.15
Any idea of what's wrong ?
It's a bug/limitation in Tomcat. It fails to find the /META-INF/MANIFEST.MF from an exploded WAR file which causes its ClassLoader to define the package with a null implementation version. This has been fixed in Tomcat, but the fix hasn't made it into a release yet. It'll be in 8.0.25.
There's some more information in this Spring Boot issue and this is the change that was made to Tomcat if you're interested.

Locally installed jar is not included in my IDEA tomcat deployment

My IDEA project compiles and builds just fine when I compile using IntelliJ.
For some reason, when I deploy to tomcat using an exploded-war, 1 jar I have isn't included in the deployment and my spring app fails to load because it can't find the class.
The jar in question is a locally installed maven dependency i.e. on my laptop
Could this be the reason why it is being skipped by IDEA? It maybe tries to find the jar using maven, but since it is local is can't and skips it?
How can I fix this?
The IDEA project is a maven module and builds fine.
Put that jar into the libs folder of tomcat or embed it into your own jar using maven assembly plugin. https://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html

Maven JBOSS application deployment

I followed this tutorial http://www.mastertheboss.com/jboss-maven/jboss-maven-example-building-a-java-ee-6-application/ in order to have a simple web application to better understand Java EE and JBOSS. I set up the example project (by archetype) and compiled it.
However, I am stuck after running mvn compile. I want to deploy my application as a war file to my JBOSS webroot directory (in my case /usr/share/jboss-as/standalone/deployments/).
I think mvn package and mvn install must be executed. Where can I specify that I want a war file and that it should be copied to my deployment location on JBOSS?
Obviously, I can use the jboss maven plugin http://docs.jboss.org/jbossas/7/plugins/maven/latest/, which is addressed via console
jboss-as:deploy
Configuration is read from the POM file.

Weblogic Maven Plugin Deployment Issue

I'm using eclipse Kepler, Weblogic 10.3.5 and Maven 3.0.5 with the Weblogic-Maven-Plugin. When I deploy my application using eclipse Run As...Run On Server, this is what I get:
When I deploy this way, you see the application on the Weblogic Server and I'm able to reach my application through my localhost link.
When I use the Weblogic-Maven-Plugin, this is what I get:
You see the application has been placed under the adminServer and I get an error when I try to reach the application through my localhost link (Yes, I even ran the start-app command).
I have few questions:
Why is it that when I use the weblogic-maven-plugin, it deploys under the adminServer?
Is there a way to have the weblogic-maven-plugin deploy in a similar fashion as the Run As option in eclipse?
Why can I not reach the application with my localhost link after deploying with the plugin?
Any help is greatly appreciated.
I face this problem some weeks ago but in another environment Jdeveloper 12c with Maven and OJMake and OJDeploy.
The deployment is the last step on your way to run our application on WLS(WebLogic Server)
How do i solve the issue?
I create an Maven Ear projet
I create also Maven War project
I add the war project in the ear project also dependency and later also web_module
My deploy(to WLS) Configuration is in the pom from Ear project.
I you use run as from Eclipse or Jdeveloper there is a complex mechanism which do the work for us. If we want maven to do the job for us, then we must tell him what to do. We must also know what type of archive file we suppose to send/deploy to WLS

Resources