9 Replies Latest reply on Sep 2, 2011 3:49 PM by Jason Porter

    org.jboss.seam.logging.Logger does not exist

    Michael Claussen Newbie

      Hi,


      I'm trying to get the simplest webapp with Seam 3 to run under Tomcat 6. Unfortunately to no avail. I don't know of any example on the web, all I can find is statements like 'of course, with a little configuration it also runs in your servlet container.'
      And it's not easy to figure out if one is supposed to use seam-config-xml or seam-xml-config and what about packages like org.jboss.logging or org.jboss.seam.logging?


      I think it's time to clean this mess up or do you expect your users to spend more time configuring your framework which is supposed to run out of the box with maven than actually developing applications?


      Now, maybe I could get just a few steps further (until the next dubious exception comes up) if someone could tell me how to get maven to download org.jboss.seam.logging.Logger so that org.jboss.seam.faces.exception.CatchExceptionHandlerFactory won't throw ClassNotFoundExceptions?


      Regards,


      McLaussen



      My POM:




      ...
      <properties>
                   <seam.version>3.1.0.Beta1</seam.version>
           </properties>
           <dependencyManagement>
                <dependencies>
                     <dependency>
                          <groupId>org.jboss.seam</groupId>
                          <artifactId>seam-bom</artifactId>
                          <version>${seam.version}</version>
                          <type>pom</type>
                          <scope>import</scope>
                     </dependency>
                </dependencies>
           </dependencyManagement>
           <dependencies>
                <dependency>
                     <groupId>com.sun.faces</groupId>
                     <artifactId>jsf-api</artifactId>
                     <version>2.1.2</version>
                </dependency>
                <dependency>
                     <groupId>com.sun.faces</groupId>
                     <artifactId>jsf-impl</artifactId>
                     <version>2.1.2</version>
                </dependency>
                <dependency>
                     <groupId>jstl</groupId>
                     <artifactId>jstl</artifactId>
                     <version>1.2</version>
                </dependency>
                <dependency>
                     <groupId>org.glassfish.web</groupId>
                     <artifactId>el-impl</artifactId>
                     <version>2.2.1-b05</version>
                     <exclusions>
                          <exclusion>
                               <groupId>javax.el</groupId>
                               <artifactId>el-api</artifactId>
                          </exclusion>
                     </exclusions>
                </dependency>
                <dependency>
                     <groupId>org.jboss.weld</groupId>
                     <artifactId>weld-api</artifactId>
                     <version>1.2-SNAPSHOT</version>
                </dependency>
                <dependency>
                     <groupId>org.jboss.weld</groupId>
                     <artifactId>weld-core</artifactId>
                     <version>1.1.1.Final</version>
                </dependency>
                <dependency>
                     <groupId>org.jboss.weld.servlet</groupId>
                     <artifactId>weld-servlet</artifactId>
                     <version>1.1.2.Final</version>
                </dependency>
                <dependency>
                     <groupId>org.jboss.seam.faces</groupId>
                     <artifactId>seam-faces</artifactId>
                     <version>3.1.0.Beta2</version>
                </dependency>
                <dependency>
                     <groupId>org.jboss.seam.solder</groupId>
                     <artifactId>seam-solder</artifactId>
                     <version>3.1.0.Beta2</version>
                </dependency>
                <dependency>
                     <groupId>org.jboss.seam.config</groupId>
                     <artifactId>seam-config-xml</artifactId>
                     <version>3.1.0.Beta1</version>
                </dependency>
                
           </dependencies>...



        • 1. Re: org.jboss.seam.logging.Logger does not exist
          Shane Bryzak Master

          Well that's what you get when you use bleeding edge code, from a version of Seam that hasn't even been officially released yet ;p  To clear up the confusion, the logging classes are in Solder - just add the seam-solder-api artifact to your project and it should be ok.  If there are still issues after that, please let us know.

          • 2. Re: org.jboss.seam.logging.Logger does not exist
            Shane Bryzak Master

            Oh, btw if you updated the version of the seam-bom you are using to 3.1.0.Beta2, it should work also.

            • 3. Re: org.jboss.seam.logging.Logger does not exist
              Michael Claussen Newbie

              Hi Shane and thanks for your quick reply.
              I've changed the pom to use seam-bom version 3.1.0.Beta2.
              It now looks like this:



              ...
              <dependencyManagement>
                        <dependencies>
                             <dependency>
                                  <groupId>org.jboss.seam</groupId>
                                  <artifactId>seam-bom</artifactId>
                                  <version>${seam.version}</version>
                                  <type>pom</type>
                                  <scope>import</scope>
                             </dependency>
                        </dependencies>
                   </dependencyManagement>
              
                   <dependencies>
                        <dependency>
                             <groupId>com.sun.faces</groupId>
                             <artifactId>jsf-api</artifactId>
                             <version>2.1.2</version>
                        </dependency>
                        <dependency>
                             <groupId>com.sun.faces</groupId>
                             <artifactId>jsf-impl</artifactId>
                             <version>2.1.2</version>
                        </dependency>
                        <dependency>
                             <groupId>jstl</groupId>
                             <artifactId>jstl</artifactId>
                             <version>1.2</version>
                        </dependency>
                        <dependency>
                             <groupId>org.glassfish.web</groupId>
                             <artifactId>el-impl</artifactId>
                             <version>2.2.1-b05</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>javax.el</groupId>
                                       <artifactId>el-api</artifactId>
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.weld</groupId>
                             <artifactId>weld-api</artifactId>
                             <version>1.1.Final</version>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.weld</groupId>
                             <artifactId>weld-core</artifactId>
                             <version>1.1.1.Final</version>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.weld.servlet</groupId>
                             <artifactId>weld-servlet</artifactId>
                             <version>1.1.2.Final</version>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.seam.faces</groupId>
                             <artifactId>seam-faces</artifactId>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.seam.solder</groupId>
                             <artifactId>seam-solder</artifactId>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.seam.solder</groupId>
                             <artifactId>seam-solder-api</artifactId>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.seam.config</groupId>
                             <artifactId>seam-config-xml</artifactId>
                        </dependency>
                          </dependencies>
              ...



              And the exception like this:



              Error configuring application listener of class org.jboss.seam.faces.beanManager.BeanManagerServletContextListener
              java.lang.NoClassDefFoundError: Ljavax/enterprise/inject/spi/BeanManager;

              cdi-api-1.0.SP4.jar is on the classpath.


              web.xml:




              <?xml version="1.0" encoding="UTF-8"?>
              <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                   version="2.5">
                   <context-param>
                        <param-name>javax.faces.PROJECT_STAGE</param-name>
                        <param-value>Development</param-value>
                   </context-param>
                   <welcome-file-list>
                        <welcome-file>index.xhtml</welcome-file>
                   </welcome-file-list>
                   <context-param>
                        <param-name>com.sun.faces.expressionFactory</param-name>
                        <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
                   </context-param>
              
               <!--      <listener>
                        <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
                   </listener>  -->
                   <listener>
                        <listener-class>org.jboss.seam.faces.beanManager.BeanManagerServletContextListener</listener-class>
                   </listener>
                   <!-- <listener> <listener-class>MyListener</listener-class> </listener> -->
                   
                   <servlet>
                        <servlet-name>Faces Servlet</servlet-name>
                        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                        <load-on-startup>1</load-on-startup>
                   </servlet>
                   <servlet-mapping>
                        <servlet-name>Faces Servlet</servlet-name>
                        <url-pattern>*.xhtml</url-pattern>
                   </servlet-mapping>
                   <resource-env-ref>
                        <description>Object factory for the CDI Bean Manager</description>
                        <resource-env-ref-name>BeanManager</resource-env-ref-name>
                        <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
                   </resource-env-ref>
              </web-app>



              src/main/webapp/META-INF/context.xml:



              <Context>
                   <Resource name="BeanManager" auth="Container"
                        type="javax.enterprise.inject.spi.BeanManager" factory="org.jboss.weld.resources.ManagerObjectFactory" />
              
              </Context>



              faces-config.xml:




              <?xml version="1.0"?>
              <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
                    http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
                   version="2.0">
              </faces-config>




              empty beans.xml and seam-beans.xml in src/main/resources




              <?xml version="1.0" encoding="UTF-8"?>
              <beans xmlns="http://java.sun.com/xml/ns/javaee"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns:s="urn:java:ee"
                 xmlns:t="urn:java:org.jboss.seam.transaction"
                 xsi:schemaLocation="
                    http://java.sun.com/xml/ns/javaee
                    http://docs.jboss.org/cdi/beans_1_0.xsd">
               
              </beans>





              • 4. Re: org.jboss.seam.logging.Logger does not exist
                Ben Utzer Newbie

                Hi Michael,


                I'm experiencing the same problem. I hope someone here can give help us.


                Regards,
                Ben

                • 5. Re: org.jboss.seam.logging.Logger does not exist
                  Shane Bryzak Master

                  Michael Claussen wrote on Sep 01, 2011 04:27:


                  And the exception like this:

                  Error configuring application listener of class org.jboss.seam.faces.beanManager.BeanManagerServletContextListener
                  java.lang.NoClassDefFoundError: Ljavax/enterprise/inject/spi/BeanManager;


                  cdi-api-1.0.SP4.jar is on the classpath.



                  That's a very strange error.  Where is the cdi-api jar located?  I don't see it listed in your dependencies, and also the CDI classes (i.e. the ones contained in javax.enterprise.*) are bundled with weld-servlet.

                  • 6. Re: org.jboss.seam.logging.Logger does not exist
                    Michael Claussen Newbie

                    Thanks again. The cdi-api gets pulled by the weld-api so that I indeed have javax.enterprise.* classes both in cdi-api jar and in weld-servlet jar. Here's the dependency tree:






                    |--- maven-dependency-plugin:2.1:tree (default-cli) @ helloworld ---
                    [INFO] de.beracom:helloworld:war:0.0.1-SNAPSHOT
                    [INFO] +- com.sun.faces:jsf-api:jar:2.1.2:compile
                    [INFO] +- com.sun.faces:jsf-impl:jar:2.1.2:compile
                    [INFO] +- jstl:jstl:jar:1.2:compile
                    [INFO] +- org.glassfish.web:el-impl:jar:2.2.1-b05:compile
                    [INFO] +- org.jboss.weld:weld-api:jar:1.1.Final:compile
                    [INFO] |  \- javax.enterprise:cdi-api:jar:1.0-SP4:compile (version managed from 1.0-SP3)
                    [INFO] |     \- javax.inject:javax.inject:jar:1:compile
                    [INFO] +- org.jboss.weld:weld-core:jar:1.1.1.Final:compile
                    [INFO] |  +- org.jboss.weld:weld-spi:jar:1.1.Final:compile
                    [INFO] |  +- javax.annotation:jsr250-api:jar:1.0:compile
                    [INFO] |  +- org.javassist:javassist:jar:3.13.0-GA:compile (version managed from 3.14.0-GA)
                    [INFO] |  +- com.google.guava:guava:jar:r06:compile
                    [INFO] |  +- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:jar:1.0.0.Final:compile
                    [INFO] |  +- org.jboss.interceptor:jboss-interceptor-spi:jar:2.0.0.CR1:compile
                    [INFO] |  +- org.jboss.interceptor:jboss-interceptor-core:jar:2.0.0.CR1:compile
                    [INFO] |  +- org.slf4j:slf4j-ext:jar:1.5.10:compile
                    [INFO] |  +- ch.qos.cal10n:cal10n-api:jar:0.7.2:compile
                    [INFO] |  \- org.slf4j:slf4j-api:jar:1.5.10:compile
                    [INFO] +- org.jboss.weld.servlet:weld-servlet:jar:1.1.2.Final:compile
                    [INFO] +- org.jboss.seam.faces:seam-faces:jar:3.1.0.Beta2:runtime
                    [INFO] |  +- org.jboss.seam.faces:seam-faces-api:jar:3.1.0.Beta2:compile (scope managed from runtime)
                    [INFO] |  \- org.jboss.seam.transaction:seam-transaction-api:jar:3.1.0.Beta2:compile (scope managed from runtime)
                    [INFO] +- org.jboss.seam.solder:seam-solder:jar:3.1.0.Beta2:runtime
                    [INFO] +- org.jboss.seam.solder:seam-solder-api:jar:3.1.0.Beta2:compile
                    [INFO] |  \- org.jboss.seam.solder:seam-solder-logging:jar:3.1.0.Beta2:compile
                    [INFO] \- org.jboss.seam.config:seam-config-xml:jar:3.1.0.Beta2:runtime|







                    FYI, this configuration works under Tomcat 7.
                    Should I exclude the cdi jar and only use weld-servlet?

                    • 7. Re: org.jboss.seam.logging.Logger does not exist
                      Shane Bryzak Master

                      I would remove all the Weld dependencies except for weld-servlet - it should include all the classes contained in the other Weld jars.

                      • 8. Re: org.jboss.seam.logging.Logger does not exist
                        Michael Claussen Newbie

                        Under Tomcat7 it's still working, under Tomcat6 it isn't yet:






                        com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Failed to locate BeanManager using any of these providers: org.jboss.seam.solder.beanManager.DefaultJndiBeanManagerProvider(11), org.jboss.seam.solder.beanManager.ServletContainerJndiBeanManagerProvider(10)
                             at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:375)
                             at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
                             at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
                             at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
                             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)
                        Caused by: org.jboss.seam.solder.beanManager.BeanManagerUnavailableException: Failed to locate BeanManager using any of these providers: org.jboss.seam.solder.beanManager.DefaultJndiBeanManagerProvider(11), org.jboss.seam.solder.beanManager.ServletContainerJndiBeanManagerProvider(10)
                             at org.jboss.seam.solder.beanManager.BeanManagerLocator.getBeanManager(BeanManagerLocator.java:88)
                             at org.jboss.seam.faces.environment.SeamApplicationFactory.getApplication(SeamApplicationFactory.java:47)
                             at com.sun.faces.application.InjectionApplicationFactory.getApplication(InjectionApplicationFactory.java:91)
                             at com.sun.faces.config.processor.AbstractConfigProcessor.getApplication(AbstractConfigProcessor.java:130)
                             at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:255)
                             at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
                             at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116)
                             at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
                             at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222)
                             at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:360)
                             ... 16 more
                        02.09.2011 11:22:03 org.apache.catalina.core.StandardContext listenerStart
                        SCHWERWIEGEND: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
                        java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Failed to locate BeanManager using any of these providers: org.jboss.seam.solder.beanManager.DefaultJndiBeanManagerProvider(11), org.jboss.seam.solder.beanManager.ServletContainerJndiBeanManagerProvider(10)
                             at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
                             at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
                             at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
                             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)
                        Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Failed to locate BeanManager using any of these providers: org.jboss.seam.solder.beanManager.DefaultJndiBeanManagerProvider(11), org.jboss.seam.solder.beanManager.ServletContainerJndiBeanManagerProvider(10)
                             at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:375)
                             at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
                             ... 15 more
                        Caused by: org.jboss.seam.solder.beanManager.BeanManagerUnavailableException: Failed to locate BeanManager using any of these providers: org.jboss.seam.solder.beanManager.DefaultJndiBeanManagerProvider(11), org.jboss.seam.solder.beanManager.ServletContainerJndiBeanManagerProvider(10)
                             at org.jboss.seam.solder.beanManager.BeanManagerLocator.getBeanManager(BeanManagerLocator.java:88)
                             at org.jboss.seam.faces.environment.SeamApplicationFactory.getApplication(SeamApplicationFactory.java:47)
                             at com.sun.faces.application.InjectionApplicationFactory.getApplication(InjectionApplicationFactory.java:91)
                             at com.sun.faces.config.processor.AbstractConfigProcessor.getApplication(AbstractConfigProcessor.java:130)
                             at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:255)
                             at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
                             at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116)
                             at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
                             at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222)
                             at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:360)
                             ... 16 more
                        


                        • 9. Re: org.jboss.seam.logging.Logger does not exist
                          Jason Porter Master

                          If it's possible to use Tomcat 7 for what you're doing (or even better JBoss AS7 or Glassfish 3.1.1 / 3.2) please do. Tomcat 7 is a Servlet 3.0 container and already has some of the needed dependencies.