1 Reply Latest reply on Jun 7, 2010 5:39 AM by Alexander Jesse

    Problem with JSFUnit static analysis tests

    easy rider Newbie

      Hi,

       

      we would like to run some static analysis test but i can't even start my Tomcat (from Eclipse) if i add the following dependency in pom.xml:

       

       

             <dependency>
                <groupId>org.jboss.jsfunit</groupId>
                <artifactId>jboss-jsfunit-analysis</artifactId>
                <version>1.2.0.Final</version>
                <scope>compile</scope>
              </dependency>

       

      By starting of Tomcat i got:

       

      04.06.2010 18:52:07 org.apache.catalina.startup.Embedded start
      INFO: Starting tomcat server
      04.06.2010 18:52:07 org.apache.catalina.core.StandardEngine start
      INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
      04.06.2010 18:52:08 org.apache.catalina.core.StandardContext addApplicationListener
      INFO: The listener "org.springframework.web.context.ContextLoaderListener" is already configured for this context. The duplicate definition has been ignored.
      04.06.2010 18:52:08 org.apache.catalina.core.StandardContext addApplicationListener
      INFO: The listener "org.springframework.web.context.request.RequestContextListener" is already configured for this context. The duplicate definition has been ignored.
      04.06.2010 18:52:08 com.sun.faces.config.ConfigureListener contextInitialized
      INFO: Initializing Mojarra (1.2_13-b01-FCS) for context '/ServiceRepo'
      04.06.2010 18:52:10 com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor <init>
      INFO: Monitoring jndi:/localhost/ServiceRepo/WEB-INF/faces-config.xml for modifications
      04.06.2010 18:52:10 org.apache.catalina.core.StandardContext listenerStart


      ERROR: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
      java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, com/sun/faces/config/ConfigureListener, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature

          at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:581)
          at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:212)
          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.startup.Embedded.start(Embedded.java:825)
          at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:385)
          at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:144)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:577)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:324)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:427)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:157)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:121)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      04.06.2010 18:52:10 org.apache.catalina.core.ApplicationContext log
      INFO: Initializing Spring root WebApplicationContext

       

      We use Spring 3.0.2.

       

      The entry in faces-config.xml:

       

      <application>

         <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>

      </application>

       

      In web.xml

       

      <listener>
          <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
      <listener>
          <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
      </listener> 

       

      Any ideas?

       

      Thanx in advance

        • 1. Re: Problem with JSFUnit static analysis tests
          Alexander Jesse Newbie

          Can you try to put the dependency on static analysis in test-scope?

          <dependency>
                      <groupId>org.jboss.jsfunit</groupId>
                      <artifactId>jboss-jsfunit-analysis</artifactId>
                      <version>1.2.0.Final</version>
                      <scope>test</scope>
                  </dependency>

          If that works, then I guess I have to add this to the documentation wiki.