- This topic has 5 replies, 2 voices, and was last updated 18 years, 11 months ago by Riyad Kalla.
-
AuthorPosts
-
kurobtMemberOne of JARs that my project uses is a JNI library. That means it must be put in the web container’s shared library area, not the per-webapp area, so that the container’s class loader loads it, to avoid UnsatisfiedLinkError exception. (Visit
http://wiki.apache.org/tomcat/Tomcat/Howto?highlight=%28JNI%29
and look for “JNI” for this issue.)When I make a WAR file by Project Deployment (“Externally Launched”, “Packaged Archive”), it puts all the JAR files in WEB-INF/lib, including this JNI JAR that I don’t want to be loaded by the web application loader.
Is there any way to instruct MyEclipse Project Deployment wizard to exclude this .jar? Removing this .jar from the Java Bult path is not an option because that would cause compilation errors.
Riyad KallaMemberThe best way to do this is to create a /lib dir off the root of your project and move that one JAR into it, then remove and re-add it to your build pathj for the project, it will no longer be deployed, but you will have it for development time resolution.
kurobtMemberI’m not sure if I understand this.
Did you mean,
1. Remove the JNI JAR, that is outside of the prject directory, from the build path
2. Crate a lib dir inside the Web App project
3. Copy the JNI JAR there
4. Add that JNI JAR within the project to the build path
?I did these steps and did the “Externally Launched” deploy to a new directory but I still see a copy of the JNI JAR in WEB-INF/lib. Is there a magic button to tell MyEclipse not to copy the jar?
Riyad KallaMember/MyProject /lib <-- put the JAR in here /WebRoot /WEB-INF /classes /lib <-- I did not mean here just incase you thought this is what I meant
I did these steps and did the “Externally Launched” deploy to a new directory but I still see a copy of the JNI JAR in WEB-INF/lib. Is there a magic button to tell MyEclipse not to copy the jar?
I should have been more clear. Go ahead and remove the deployment and recreate it. If your JAR is infact in the directory I mentioned above and added normally to your build path, it should not be deployed. If it is however in your WebRoot/WEB-INF/lib directory, it will be deployed.
kurobtMemberActually, you were quite clear about the location of the lib. I did lay out the stuff exactly as you mentioned, but things weren’t working.
The reason, that I found out later, was that the dependent project also had this JNI JAR in its build and its export box was checked. I turned it off and now I no longer see the JAR in the deployment directory tree.
Thanks!
Riyad KallaMemberAhh very cool, glad it’s working!
-
AuthorPosts