1 2 3 4 Previous Next 47 Replies Latest reply on Sep 8, 2005 7:17 PM by starksm64 Go to original post
      • 45. Re: HARDeployer removal proposal
        starksm64

        Yes, this is the expected result of the nightmare that is the default servlet 2.4 class loading model. Nothing in a war is visible to other components, even other components its ear. This was made the default class loading configuration for wars in 4.0.2. You can configure tomcat to use a jboss class loader to provide the normal flat jboss view of a deployment, but this leads to other problems when you have multiple wars within an ear, especially with the bizzare stuff people tend to through in a war.

        Unfortunately you have to draw out the class loading tree for a given deployment AND think about redeployment to know where classes should be placed in a deployment. I myself am rather tired of fighting with the deployment packaging affecting the type system and resource visibility.

        • 46. Re: HARDeployer removal proposal

          This happens regardless of how the classloader of the WAR is set up. The problem is that the directory of the WAR file is added to the hibernate MBean, which is incorrect, and neither WEB-INF/classes nor any of the jars in WEB-INF/lib are ever added to the hibernate configuration. (regardless of what the tomcat classloader configuration is)

          This is particularly annoying because a .hbm.xml file that happens in WEB-INF/classes will be seen because the WAR file is incorrectly put in the classpath (this would have been seen even if it were along side the JSP files). However, the classes can't be found since the WAR classloader is not used. I would expect the classes in the WAR file to have their normal visibility/invisibility as defined by the tomcat classloader configuration.

          • 47. Re: HARDeployer removal proposal
            starksm64

            Give me the example deployment then as the jboss class loader version certainly does add the WEB-INF/classes and WEB-INF/lib contents to the RepositoryClassLoader associated with the war:

             public void setWarURL(URL warURL) throws MalformedURLException
             {
             this.warURL = warURL;
             String path = warURL.getFile();
             File classesDir = new File(path, "WEB-INF/classes");
             if (classesDir.exists())
             {
             delegate.addURL(classesDir.toURL());
             ctxLoader.addURLInternal(classesDir.toURL());
             }
             File libDir = new File(path, "WEB-INF/lib");
             if (libDir.exists())
             {
             File[] jars = libDir.listFiles();
             int length = jars != null ? jars.length : 0;
             for (int j = 0; j < length; j++)
             {
             delegate.addURL(jars[j].toURL());
             ctxLoader.addURLInternal(jars[j].toURL());
             }
             }
             }
            



            1 2 3 4 Previous Next