0

I am developing a JSF (2.2) application and using Icefaces 4.0.

During development with the myEclipse IDE I have been using the integrated Tomcat 7 server to test my application. However, when the application is ready for production purposes, the intended application server is JBoss 8 Wildfly (8.0).

When trying to deploy my maven generated war file onto the local JBoss server, I receive lots of deployment errors. My main question is...

Are @ManagedBean and @ManagedProperty compatible with use on the JBoss server, or do I have to use @named and @inject annotations?

Many of the errors are of this kind:

Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name javax.enterprise.context.conversation resolves to beans:
  - Managed Bean [class org.jboss.weld.conversation.ConversationImpl] with qualifiers [@Named @Default @Any],
  - Managed Bean [class org.jboss.weld.conversation.ConversationImpl] with qualifiers [@Named @Default @Any]

I am new to using JBoss and JSF, so any advice will be helpful.

Full stack trace is too large for stack overflow post maximum amount of characters so the link to the text file is here:

https://drive.google.com/file/d/0BxOe4O5HlWJScktaQmJGYUtldFU/view?usp=sharing

The jars in my WEB-INF/lib relating to "welds" are as follows:

webservices-api-osgi-2.0.1.jar
weld-api-1.0-SP1.jar
weld-core-1.0.1-SP3.jar
weld-osgi-bundle-1.0.1-SP3.jar
weld-spi-1.0-SP1.jar

EDIT

POM.xml as follows

<?xml version="1.0"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>oag.com.reference</groupId>
    <artifactId>web</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>ReferenceDataWeb </name>
    <packaging>war</packaging>
    <description>Reference data web project.</description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webappDirectory>src/main/webapp</webappDirectory>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>bean-validator</artifactId>
            <version>3.0-JBoss-4.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.annotation</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.ejb</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.enterprise.deploy</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.jms</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.management.j2ee</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.resource</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.security.auth.message</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.security.jacc</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.servlet</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.servlet.jsp</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.servlet.jsp.jstl</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.transaction</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api-osgi</artifactId>
            <version>2.2.1</version>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>jstl-impl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.3</version>
        </dependency>



        <dependency>
            <groupId>org.icefaces</groupId>
            <artifactId>icefaces</artifactId>
            <version>4.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.icefaces</groupId>
            <artifactId>icefaces-ace</artifactId>
            <version>4.0.0</version>
        </dependency>

        <dependency>
            <groupId>org.icepush</groupId>
            <artifactId>icepush</artifactId>
            <version>4.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.icefaces</groupId>
            <artifactId>icefaces-compat</artifactId>
            <version>3.3.0</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>com.oag.reference</groupId>
            <artifactId>business</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.7</version>
        </dependency>

        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>webservices-api-osgi</artifactId>
            <version>2.0.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-osgi-bundle</artifactId>
            <version>1.0.1-SP3</version>
            <scope>provided</scope>
        </dependency>


        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.2.7</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.2.7</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

</project>

Thanks

LiamWilson94
  • 458
  • 2
  • 7
  • 26
  • Probably has less to do with `@ManagedBean` or `@ManagedProperty` and more to do with having multiple copies of the same class (possibly as a result of having duplicate jars) in your deployment – kolossus Apr 13 '15 at 13:11
  • I cleared out the jars and rebuilt my project. There are non duplicate jars. All the exceptions seem to be relating to "WeldStartService". After googling I can see that this is related to the injection of needs (I think). – LiamWilson94 Apr 13 '15 at 13:40
  • 1
    kolossus means that you should be removing JARs from your `/WEB-INF/lib` containing classes which are already provided by the server itself. Tomcat as being a barebones JSP/Servlet container doesn't ship with Weld out the box, but JBoss as being a full fledged Java EE application server does. And this duplicates/collides. So you should remove at least those `/WEB-INF/lib/weld-*.jar` files and rebuild/redeploy. – BalusC Apr 13 '15 at 14:08
  • Are you using maven/gradle? If yes, consider change scope of these dependencies as `provided` and try again. As said by @BalusC in a JEE container these dependencies is not needed. – Bruno Ribeiro Apr 13 '15 at 14:08
  • That seems to have made some progress, thanks! Now I get this runtime exception: Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined – LiamWilson94 Apr 13 '15 at 14:26
  • @BrunoCésar I am using Maven and have edited my original post with my pom.xml file. Please you help me with identifying which dependencies need a provided scope? Thanks. – LiamWilson94 Apr 13 '15 at 15:06
  • `jsf-api` and `jsf-impl` must not be `provided`. `javax.servlet.jsp` and `javax.servlet` may be `provided`, others may be too, but test yourself and post your question :) – Bruno Ribeiro Apr 13 '15 at 15:14

0 Answers0