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

lovelyliatroim do-not-reply at jboss.com
Tue Dec 18 04:15:43 EST 2007


anonymous wrote : 
  | Did you really mean the the WAR is as follows: 
  | 

First off I had everything packed in the war, then i did like you suggested and exploded the WAR in a directory so it looked like 

  | deploy 
  | +myapp.war
  |      +conf
  |           +config.properties
  | +WEB-INF
  | 

anonymous wrote : 
  | In other words, within your WAR there is not a base directory named myapp and that instead both conf and WEB-INF are base directories. 
  | 
When you say this i assume that you think i exploded the war into the deploy directory without a base directory.(I assume thats what you mean).No it does have a base directory
anonymous wrote : 
  | deploy
  | +myapp.war (The dir is called myapp.war)
  | 
and inside myapp.war is the sub-directories.

Heres the code, sorry it uses Class.getResource and not class.getResourceAS



  | static 
  |     {
  |         try
  |         {
  |             Class class1 = (new ProjectRootClass()).getClass();
  |             URL url = class1.getResource("ProjectRootClass.class");
  |             String s = url.toString();
  |             System.out.println((new StringBuilder()).append("ProjectRootClass: Probe URL is ").append(s).toString());
  |             theProjectRoot = s.substring(s.indexOf("file:") + 5, s.lastIndexOf("/WEB-INF/"));
  |             System.out.println((new StringBuilder()).append("ProjectRootClass: The project root was detected at ").append(theProjectRoot).toString());
  |         }
  |         catch(Throwable throwable)
  |         {
  |             System.err.println("ProjectRootClass: Initialisation failed");
  |             throwable.printStackTrace();
  |             theProjectRoot = "";
  |         }
  |     }

The code works out where the root directory of the war file is and from here uses the root to find the config.properties but because it loads the class from the work directory and not the tmp directory it wont find the properties file.

anonymous wrote : 
  | I noticed you are using 5.0 beta2. Have you tried your app in 4.2.x? Does it work there? The reason I ask is because the deployer in beta2 is broken in so many ways, in which case you might have been lucky enough to find another way that it is broken.
  | 

I will download 4.2.x and will post my findings later today. 


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

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



More information about the jboss-user mailing list