3 Replies Latest reply on Aug 29, 2008 1:44 PM by Georges Goebel

    Problem with StandardDeploymentStrategy in Seam 2.1.0.BETA1

    Robert Yokota Newbie

      I'm getting the following error with Seam 2.1.0.BETA1 and Tomcat 6, whereas it was working with a Seam 2.1.0-SNAPSHOT from about a week ago:


      java.lang.IllegalStateException: Cannot load WEB-INF/classes/schemaorg_apache_xmlbeans/system/s91E100311FD7B2754860C7FE37BCF739/TypeSystemHolder.class from WebappClassLoader
        delegate: false
        repositories:
          /WEB-INF/classes/
      ----------> Parent Classloader:
      org.apache.catalina.loader.StandardClassLoader@b5dac4
       (using getResourceAsStream() returned null)
              at org.jboss.seam.deployment.AbstractDeploymentHandler.getClassFile(AbstractDeploymentHandler.java:41)
              at org.jboss.seam.deployment.ComponentDeploymentHandler.handle(ComponentDeploymentHandler.java:57)
              at org.jboss.seam.deployment.DeploymentStrategy.handle(DeploymentStrategy.java:177)
              at org.jboss.seam.deployment.AbstractScanner.handleItem(AbstractScanner.java:30)
              at org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:141)
              at org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
              at org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
              at org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
              at org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
              at org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
              at org.jboss.seam.deployment.URLScanner.scanDirectories(URLScanner.java:40)
              at org.jboss.seam.deployment.StandardDeploymentStrategy.scan(StandardDeploymentStrategy.java:107)
              at org.jboss.seam.init.Initialization.create(Initialization.java:113)
              at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
              at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
              at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
              at org.apache.catalina.core.StandardService.start(StandardService.java:516)
              at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
              at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
              at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      



      As you can see, the ClassLoader is incorrectly trying to load a class that starts with WEB-INF/classes/schemaorg_apache_xmlbeans instead of just schemaorg_apache_xmlbeans.


      I have traced the issue to the following line in Initialization:


         public Initialization create()
         {
            standardDeploymentStrategy = new StandardDeploymentStrategy(Thread.currentThread().getContextClassLoader());
      
            // THE FOLLOWING LINE HAS BEEN ADDED IN SEAM-2.1.0.BETA1
            standardDeploymentStrategy.getFiles().add(warRootDirectory);
      
            standardDeploymentStrategy.scan();
            addNamespaces();
            initComponentsFromXmlDocument("/WEB-INF/components.xml");
            initComponentsFromXmlDocument("/WEB-INF/events.xml"); //deprecated
            initComponentsFromXmlDocuments();
            initPropertiesFromServletContext();
            initPropertiesFromResource();
            initJndiProperties();
            return this;
         }
      



      As you can see, I have specified a path for the docBase in server.xml instead of a war file.


      Any suggestions?  Thanks in advance.