I have a project which run in tomcat.
I have this error from tomcat.
java.lang.ClassNotFoundException: net.glxn.qrgen.javaase.QRCode.
I know that this error occur because I did not import my JAR file when I was building the WAR file but then I do not have the source code anymore which mean I cannot build a WAR file again.
Just wanna to know is there a way for me to put my JAR file into tomcat so the related function will call the JAR?
Thanks.
You should be able to copy the jar straight into $CATALINA_HOME/lib and it should work.
Related
Why application is not able to read the class from the build path? I did added ojdbc6.jar in the build path of the application.
Now when I kept this jar in the WEB-INF/lib directory, it worked fine.
Can someone please explain why it was not read from the project build path.
When you add it on the build path in your IDE , it is used for compiling the code (if there is a dependency on it).
Unless you package this and deploy on the server , the server has no reference to these files that were used for compilation. When you place it on WEB-INF/lib and package it , the jar file is also packaged in your .war file that is deployed and hence at runtime you will not get a Class missing or Driver missing error.
I got a problem with generating a war file from a dynamic web project by the command line. Similar to this thread. But unfortunately I dont have maven or gradle...
If I create a war file from commandline from the main directory of my Webproject, I cant connect on any website by tomcat. If I go deeper into folder "webcontent", I am able to connect to the html welcome-page but I am not able to connect to the servlets, which are located in the src folder.
Thank you for your help!
Okay, I solved the problem with a different solution:
According to this thread, I created /WEB-INF/classes under /WebContent.
Then I was able to create the War-File really easy with
cd /to/your/Webcontent/directory
jar -cvf /destination/folder/of/war-file *
And deployed this war file in tomcat. Everything working now. Hope this will also help other people with similar problem.
I am using Stanford NLP library for an IBM Bluemix app. I have added both stanford-corenlp-3.5.1-models.jar and stanford-corenlp-3.5.1.jar to build path. And consequently, the app is running fine in the local webshpere liberty server.
When I build the WAR file through ant build of build.xml, I ensure that both the files are included. I can also see them present inside the WAR file. But when I deploy the WAR file on Bluemix, and run it, I get the following error:
ERR java.lang.NoClassDefFoundError: edu/stanford/nlp/pipeline/StanfordCoreNLP
What might be the problem?
I have ensured that the jar file is in the war file:
Please ensure that the jar files are present in the WEB-INF\lib folder in the WAR file.
I have faced the same issue and by making the jar available in WEB-INF\lib folder it was resolved.
I have a java web application name webapp,when I export it to a war,the source codes will be compiled to the WEB-INF/classes.
Now I want these classed be compressed to a jar,and put into the WEB-INF/lib.
I have tried this:
create a new java project named webapp_jar.
Copy all the source codes under the webapp/src to the webapp_jar/src,configurate the build path to make the project work.
Add the webapp_jar reference to webapp project.
However ,when I run the webapp,it seems that the classes defined at webapp_jar can not be found.
Is this possible?
BTW,I use the eclipse ee ide.
have you try ant https://ant.apache.org/ ?
you could make a jar and copy it to folder you want and build the war after.
But , if I anderstand, you would package all the app to a jar ?
I think your webapp can't work without a servlet or two ...
This is really easy to do with maven by creating two subject projects, one to build the war, and the other as a jar project and then use the jar project as a dependency on your war project which would put the jar inside the lib directory when packaging the war.
No I use the Web Deployment Assembly settings in eclipse. I worked.
You can find details here.
I'm tired by compiling and redeploying .ear file on web logic. could you please let me know how to do hot deployment. I'm using weblogice 10 as application server and ATG framework. my .ear file is withing ATG not in weblogic. I tried by changing the java file, compiled and merged updated .class file with .jar file and copied .jar file in .ear file but it is not reflected.
You should run your server via runDynamoOnWeblogic.bat which located in ATG_DIR\home\bin and use -run-in-place key when call this bat file.
But you should reslove issue with autobuilding in your IDE. For example I config my eclipse so that eclipse compile java classes after editing and put it directly to the ATG_DIR\My_module\classes.jar directory.
note: classes.jar should be exploded archive.
Hope this help you.