Hi All,

I am "playing" with Weld Servlet 2.0.0.Beta2, deploying a JSF application to Tomcat 7.0.32 and I believe I've found 2 issues.

1) If use weld-servlet as artifact in Maven, i.e.

...
        <dependency>
            <groupId>org.jboss.weld.servlet</groupId>
            <artifactId>weld-servlet</artifactId>
            <version>2.0.0.Beta2</version>
...

the presence of the el-api classes in the jar prevents the application from deploying, as the classes are already present in Tomcat. The exception is as follows:

01-Jan-2013 13:44:53 org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(E:\devel\java\tomcat\apache-tomcat-7.0.32\webapps\palindrome-weld2-jsf\WEB-INF\lib\weld-servlet-2.0.0.Beta2.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
01-Jan-2013 13:44:54 org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
01-Jan-2013 13:44:54 org.apache.catalina.core.StandardContext startInternal


2) If I use weld-servlet-core, so that I can exclude the el-api jar like this:

...
        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-core</artifactId>
            <version>2.0.0.Beta2</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.el</groupId>
                    <artifactId>el-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld.servlet</groupId>
            <artifactId>weld-servlet-core</artifactId>
            <version>2.0.0.Beta2</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.el</groupId>
                    <artifactId>el-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
...

I get the following error at application deployment:

SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener

java.lang.RuntimeException: com.sun.faces.config.ConfigurationException:
  Source Document: jar:file:/E:/devel/java/tomcat/apache-tomcat-7.0.32/webapps/palindrome-weld2-jsf/WEB-INF/lib/weld-servlet-core-2.0.0.Beta2.jar!/META-INF/faces-config.xml
  Cause: Unable to find class 'org.jboss.weld.jsf.WeldPhaseListener'
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
...

The JSF phase listener existed in weld 1.x but has been removed from weld 2.x. If I edit the faces-config.xml file and remove the phase listener reference everything works as expected. I checked github and the latest version of faces-config.xml has still got a reference to the missing class.

I hope this makes sense. Apologies if this is not the right mailing list for this message, or if it's a duplicate (I searched but I could not find anything similar).

Cheers,
Luigi