views:

65

answers:

2

I'm having trouble with adding Richfaces to my Maven project, which is deploying to JBoss AS 6. Here is my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.test</groupId>
    <artifactId>WyreBase</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>Wyre Base</name>
    <url>http://maven.apache.org&lt;/url&gt;
    <properties>
        <jbossHome>/home/drew/Development/Servers/jboss/</jbossHome>
        <arquillian.version>1.0.0.Alpha2</arquillian.version>
        <org.richfaces.ui.version>4.0.0.20100715-M1</org.richfaces.ui.version>
    </properties>
    <repositories>
        <repository>
            <id>java.net2</id>
            <name>Repository hosting the jee6 artifacts</name>
            <url>http://download.java.net/maven/2&lt;/url&gt;
        </repository>
        <repository>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Maven Repository Group</name>
            <url>https://repository.jboss.org/nexus/content/groups/public/&lt;/url&gt;
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Maven Repository Group</name>
            <url>https://repository.jboss.org/nexus/content/groups/public/&lt;/url&gt;
        </pluginRepository>
    </pluginRepositories>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.richfaces.ui</groupId>
                <artifactId>richfaces-components-bom</artifactId>
                <version>${org.richfaces.ui.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.spec</groupId>
            <artifactId>jboss-javaee-6.0</artifactId>
            <version>1.0.0.Beta5</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.1.0.Beta1</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.richfaces.ui</groupId>
            <artifactId>richfaces-components-ui</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.12</version>
        </dependency>
        <dependency>
            <groupId>org.jasypt</groupId>
            <artifactId>jasypt</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.1</version>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-junit</artifactId>
            <version>${arquillian.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jboss-maven-plugin</artifactId>
                <version>1.4</version>
                <configuration>
                    <jbossHome>${jbossHome}</jbossHome>
                    <serverName>default</serverName>
                    <fileName>target/${project.artifactId}.war</fileName>
                </configuration>
            </plugin>
        </plugins>
        <finalName>${project.artifactId}</finalName>
    </build>
    <profiles>
        <profile>
            <id>jbossas-local-60</id>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.arquillian.container</groupId>
                    <artifactId>arquillian-jbossas-local-60</artifactId>
                    <version>1.0.0.Alpha2</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.jbossas</groupId>
                    <artifactId>jboss-server-manager</artifactId>
                    <version>1.0.3.GA</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.jbossas</groupId>
                    <artifactId>jboss-as-client</artifactId>
                    <version>6.0.0.20100429-M3</version>
                    <type>pom</type>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>

Here are the, hopefully, more relevant portions of the stack trace (too big to put it all in here.)

02:30:57,314 INFO  [javax.enterprise.resource.webcontainer.jsf.config] Initializing Mojarra 2.0.2 (FCS b10) for context '/WyreBase'
02:30:57,831 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] Unable to process annotations for url, vfs:/home/drew/Development/Servers/jboss-6.0.0.20100429-M3/server/default/deploy/WyreBase.war/WEB-INF/lib/richfaces-core-impl-4.0.0.20100715-M1.jar/META-INF/initialization-listener.faces-config.xml.  Reason: java.util.zip.ZipException: error in opening zip file
02:30:57,831 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] : java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method) [:1.6.0_18]
    at java.util.zip.ZipFile.<init>(ZipFile.java:131) [:1.6.0_18]
    at java.util.jar.JarFile.<init>(JarFile.java:150) [:1.6.0_18]
    at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:85) [:1.6.0_18]
    at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:232) [:1.6.0_18]
    at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_18]
    at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:216) [:1.6.0_18]
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:68) [:1.6.0_18]
    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:86) [:1.6.0_18]
    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) [:1.6.0_18]
    at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) [:1.6.0_18]
    at com.sun.faces.config.AnnotationScanner.processClasspath(AnnotationScanner.java:290) [:2.0.2-FCS]
    at com.sun.faces.config.AnnotationScanner.getAnnotatedClasses(AnnotationScanner.java:215) [:2.0.2-FCS]
    at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:765) [:2.0.2-FCS]
    at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:736) [:2.0.2-FCS]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [:1.6.0_18]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [:1.6.0_18]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:329) [:2.0.2-FCS]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) [:2.0.2-FCS]
    at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:72) [:6.0.0.20100429-M3]
    ...more

02:30:57,842 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] Unable to process annotations for url, vfs:/home/drew/Development/Servers/jboss-6.0.0.20100429-M3/server/default/deploy/WyreBase.war/WEB-INF/lib/richfaces-components-ui-4.0.0.20100715-M1.jar/META-INF/behaviors-handler-delegate.faces-config.xml.  Reason: java.util.zip.ZipException: error in opening zip file
02:30:57,843 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] : java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method) [:1.6.0_18]
    at java.util.zip.ZipFile.<init>(ZipFile.java:131) [:1.6.0_18]
    at java.util.jar.JarFile.<init>(JarFile.java:150) [:1.6.0_18]
    at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:85) [:1.6.0_18]
    at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:232) [:1.6.0_18]
    at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_18]
    at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:216) [:1.6.0_18]
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:68) [:1.6.0_18]
    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:86) [:1.6.0_18]
    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) [:1.6.0_18]
    at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) [:1.6.0_18]
    at com.sun.faces.config.AnnotationScanner.processClasspath(AnnotationScanner.java:290) [:2.0.2-FCS]
    at com.sun.faces.config.AnnotationScanner.getAnnotatedClasses(AnnotationScanner.java:215) [:2.0.2-FCS]
    at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:765) [:2.0.2-FCS]
    at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:736) [:2.0.2-FCS]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [:1.6.0_18]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [:1.6.0_18]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:329) [:2.0.2-FCS]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) [:2.0.2-FCS]
    at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:72) [:6.0.0.20100429-M3]
    ...more

02:30:57,849 INFO  [javax.enterprise.resource.webcontainer.jsf.config] Unsanitized stacktrace from failed start...: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.
    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305) [:2.0.2-FCS]
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:220) [:2.0.2-FCS]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:335) [:2.0.2-FCS]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) [:2.0.2-FCS]
    at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:72) [:6.0.0.20100429-M3]
    ...more

Caused by: javax.faces.FacesException: org.jboss.weld.integration.webtier.jsf.WeldApplicationFactory
    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:593) [:2.0.2-FCS]
    at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:472) [:2.0.2-FCS]
    at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139) [:2.0.2-FCS]
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:796) [:2.0.2-FCS]
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306) [:2.0.2-FCS]
    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [:2.0.2-FCS]
    ... 70 more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_18]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [:1.6.0_18]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [:1.6.0_18]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532) [:1.6.0_18]
    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:586) [:2.0.2-FCS]
    ... 75 more

02:30:57,854 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WyreBase]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! argument type mismatch
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:354) [:2.0.2-FCS]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) [:2.0.2-FCS]
    at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:72) [:6.0.0.20100429-M3]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3733) [:6.0.0.20100429-M3]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4197) [:6.0.0.20100429-M3]
    ...more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_18]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [:1.6.0_18]
    ... more

02:30:57,858 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WyreBase]] Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.ClassCastException: com.sun.faces.config.WebConfiguration cannot be cast to com.sun.faces.config.WebConfiguration
    at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:170) [:2.0.2-FCS]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:161) [:2.0.2-FCS]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3733) [:6.0.0.20100429-M3]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4197) [:6.0.0.20100429-M3]
    ... more

02:30:57,860 ERROR [org.apache.catalina.core.StandardContext] Error listenerStart
02:30:57,860 ERROR [org.apache.catalina.core.StandardContext] Context [/WyreBase] startup failed due to previous errors
02:30:57,863 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
+1  A: 

You have several corrupted JARs that can't be opened, namely richfaces-core-impl-4.0.0.20100715-M1.jar and richfaces-components-ui-4.0.0.20100715-M1.jar. Try to delete them from your local repository and to redownload them.

Pascal Thivent
That makes sense (should've read the stack trace a little better) but redownloading them doesn't help. I've also tried downloading the release from the website and manually putting those jars in the repository. Still getting the same problem.
Drew
+1  A: 

Apparently this is a bug in JBossAS6.M3. https://jira.jboss.org/browse/JBAS-8024

Upgrading to JBossAS6.M4 solves the problem (but, naturally, introduces new ones. ;)

Drew
Thanks for posting this. I focused too much on the Maven part of the question and totally ignored JBoss here... Very weird issue though. Maybe you could use GlassFish 3 instead.
Pascal Thivent