[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Re: Unwaring web app - leaves some files in the war

PeterJ do-not-reply at jboss.com
Tue Dec 18 14:27:06 EST 2007


Wait a minute, I think I understand now. What you posted is the code that gets the base directory, and the code that opens the properties file appends "conf/config.properties" top the base to get the file location.

I added your code to my servlet, and here is the output (when all of my classes are in the WEB-INF/classes directory:

11:12:42,640 INFO  [STDOUT] ProjectRootClass: Probe URL is vfsfile:/opt/jboss/jboss-5.0.0.Beta2/server/webapp/deploy/inear.ear/webapp.war/WEB-INF/classes/peter/ProjectRootClass.class
11:12:42,641 INFO  [STDOUT] ProjectRootClass: The project root was detected at /opt/jboss/jboss-5.0.0.Beta2/server/webapp/deploy/inear.ear/webapp.war

And then I packaged my classes in a jar file and placed it into WEB-INF/lib:

11:17:26,260 INFO  [STDOUT] ProjectRootClass: Probe URL is jar:vfsfile:/opt/jboss/jboss-5.0.0.Beta2/server/webapp/deploy/inear.ear/webapp.war/WEB-INF/lib/stuff.jar!/peter/ProjectRootClass.class
11:17:26,260 INFO  [STDOUT] ProjectRootClass: The project root was detected at /opt/jboss/jboss-5.0.0.Beta2/server/webapp/deploy/inear.ear/webapp.war

In both cases the base location is webapp.war directory (both the ear and war  are exploded).

So it appears that if the ear and war are exploded that it should work (that is, the code should not be looking in the tmp or work files for the base.

So some more questions - where did the code you posted come from? I hope it did not come from a JSP! If it did, you might have to precompile the JSP and package it in the jar file, or put it in the classes directory. If the code is not from a JSP, then I need to see the output from the code, and the code that opens the properties file.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113924#4113924

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113924



More information about the jboss-user mailing list