4 Replies Latest reply on Oct 8, 2007 5:00 AM by Alexei Novikov

    [NamespaceScanner] Cannot load package

    Martin Krajci Newbie

      Hi All,

      I'm using Jboss 4.2.1.GA, Seam 1.2.1.GA and sun faces. During the deployment I have the warning in the console:

      11:57:57,642 WARN [NamespaceScanner] Cannot load package Dinfo for org.jboss.se
      am.core
      11:57:57,652 WARN [NamespaceScanner] Cannot load package Dinfo for org.jboss.se
      am.drools
      11:57:57,662 WARN [NamespaceScanner] Cannot load package Dinfo for org.jboss.se
      am.framework
      11:57:57,662 WARN [NamespaceScanner] Cannot load package Dinfo for org.jboss.se
      am.jms
      11:57:57,672 WARN [NamespaceScanner] Cannot load package Dinfo for org.jboss.se
      am.mail
      11:57:57,682 WARN [NamespaceScanner] Cannot load package Dinfo for org.jboss.se
      am.security
      11:57:57,682 WARN [NamespaceScanner] Cannot load package Dinfo for org.jboss.se
      am.theme
      11:57:57,692 WARN [NamespaceScanner] Cannot load package Dinfo for org.jboss.se
      am.web

      My problem is that when I declare something in components.xml it is not read. The only components that are read are core components. But security, framework, spring, mail are alwas missing.

      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
       xmlns:core="http://jboss.com/products/seam/core"
       xmlns:security="http://jboss.com/products/seam/security"
       xmlns:framework="http://jboss.com/products/seam/framework"
       xmlns:mail="http://jboss.com/products/seam/mail"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation=
       "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd
       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd
       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.2.xsd
       http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-1.2.xsd
       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.2.xsd">
      
       <core:init jndi-pattern="@jndiPattern@"/>
       <core:ejb installed="@embeddedEjb@"/>
       <core:dispatcher />
      
       <component name="org.jboss.seam.core.manager">
       <!-- half second wait for conversation lock on concurrent requests -->
       <property name="concurrentRequestTimeout">500</property>
       <!-- 20 minutes conversation timeout -->
       <property name="conversationTimeout">1200000</property>
       <property name="conversationIdParameter">cid</property>
       <property name="conversationIsLongRunningParameter">clr</property>
       </component>
      
       <security:identity authenticate-method="#{authenticator.authenticate}"/>
      
       <event type="org.jboss.seam.notLoggedIn">
       <action expression="#{redirect.captureCurrentView}"/>
       </event>
      
       <event type="org.jboss.seam.postAuthenticate">
       <action expression="#{redirect.returnToCapturedView}"/>
       </event>
      
       <!--
       <mail:mail-session host="mailcz.systinet.com" debug="true"/>
       <mail:mail-session host="localhost" port="2525" username="test" password="test" />
       <mail:mail-session session-jndi-name="java:/CechieMailService" debug="true"/>
       -->
      
      </components>


      In case on security the identity is unknown in JSF.

      In case of spring the applicationContext.xml is not loaded.

      <spring:context-loader context-locations="/WEB-INF/applicationContext.xml"/>


      In case of mail the mail-session is not loaded in any case.

      But in case of core components everyting works fine.

      My components.xml is located in ear/war/WEB-INF and jboss-seam.jar in ear.

      My application.xml

      <?xml version="1.0" encoding="utf-8"?>
      <application>
       <display-name>CechieApplication</display-name>
       <module>
       <web>
       <web-uri>cechie.war</web-uri>
       <context-root>/cechie</context-root>
       </web>
       </module>
       <module>
       <ejb>cechie.jar</ejb>
       </module>
       <module>
       <java>jboss-seam.jar</java>
       </module>
       <module>
       <java>commons-lang-2.1.jar</java>
       </module>
      </application>


      I suspect that warnings have something to do with it, but I have no idea what.

      Can you please help me.

      Thanx

      Martin

        • 1. Re: [NamespaceScanner] Cannot load package
          Martin Krajci Newbie

          I just realized that fore core components the configuration is not working either. Only thing that is working is:

          <component name="org.jboss.seam.core.manager">
           <!-- half second wait for conversation lock on concurrent requests -->
           <property name="concurrentRequestTimeout">500</property>
           <!-- 20 minutes conversation timeout -->
           <property name="conversationTimeout">1200000</property>
           <property name="conversationIdParameter">cid</property>
           <property name="conversationIsLongRunningParameter">clr</property>
           </component>


          That doesn't have any namespace.

          • 2. Re: [NamespaceScanner] Cannot load package
            Pete Muir Master

            You'll need to debug NamespaceScanner to find out why it's not able to load the package info. Alternatively just use the non-namespaced declarations.

            • 3. Re: [NamespaceScanner] Cannot load package
              Alexei Novikov Newbie

              I found out that the described effect occurs when JBoss is started with Sun's jdk1.5.0_12 JVM. Running it with JRockit 1.5 or with Sun's jdk1.6.0_2 does not lead to this problem.

              Debugging of NameScanner have shown that the method getPackage() cannot obtain a package info.

               protected Package getPackage(String name)
               {
               try
               {
               Class c = classLoader.loadClass(name + ".package-info");
               return c != null ? c.getPackage() : null;
               }
               catch (Exception e)
               {
               return null;
               }
               }
              


              The loadClass() method throw exceptions like this:
              java.lang.ClassNotFoundException: org.jboss.seam.drools.package-info


              As a result of this error no namespace-prefixed components are initialized in component.xml, after that lots of things go wrong. For instance, core:init component will be uninitialized, which makes that jndiPattern is not set, which in turn makes that no application components can be accessed in an EJB module.

              • 4. Re: [NamespaceScanner] Cannot load package
                Alexei Novikov Newbie

                Forgot to mention that Seam version that was used in the previous test was 1.2.1 GA

                Now, I have tested deploying seam-booking demo from Seam 2.0.0 CR1, and the problem does not appear any more.