issues integrating seam and facelets to myfaces, spring and hibernate app
odomitchi Jan 15, 2009 7:02 PMPlease I need help
I have issues integrating seam and facelets to myfaces, spring and hibernate app. Config details and error below.
The combination Hibernate 3.4 + Spring 2.5.5 + Myfaces 1.2.5 was already working. And I included the jars:
Facelets 1.1.14: jsf-facelets.jar, el-api-1.0.jar, el-impl-1.0.jar
Seam 2.1.1: jboss-seam.jar, jboss-seam-ui.jar, persistence-api.jar, javaassist.jar
FACES-CONFIG.XML
<faces-config version="1.2"
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_1_2.xsd">
<application>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<message-bundle>com.west.wic.wssi.resources.messages</message-bundle>
<resource-bundle>
<base-name>com.west.wic.wssi.resources.messages</base-name>
<var>msgs</var>
</resource-bundle>
</application>
<!-- seam -->
<lifecycle>
<phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
</lifecycle>
...
WEB.XML
...
<!-- facelets-->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<!-- Seam -->
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.web.SeamFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
...
COMPONENETS.XML
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:web="http://jboss.com/products/seam/web"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd
http://jboss.com/products/seam/web http://jboss.com/products/seam/web-1.2.xsd">
<web:exception-filter url-pattern="*.seam"/>
<web:redirect-filter url-pattern="*.seam"/>
<web:multipart-filter create-temp-files="true"
max-request-size="1000000"
url-pattern="*.seam"/>
<web:character-encoding-filter encoding="UTF-16"
override-client="true"
url-pattern="*.seam"/>
<!-- <web:context-filter url-pattern="/media/*"/> -->
</components>
[b]ERROR:[/b]
Jan 15, 2009 11:35:31 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.addELResolver(Ljavax/el/ELResolver;)V" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/apache/myfaces/webapp/Jsp21FacesInitializer, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ELResolver used in the signature
Since tomcat 6 has el-api.jar I tried removing el-api and el-impl jars from facelets. and I still didn't work. I tried replcing them with jboss-el still same thing; also replaced with el-api jar shipped with seam and still didn't work. If I remove el-api from tomcat lib I get a classNotFound exception.
I have spent a long time trying to figure it out. I would really appreciate your help.
Thanks
mitchi
I have issues integrating seam and facelets to myfaces, spring and hibernate app. Config details and error below.
The combination Hibernate 3.4 + Spring 2.5.5 + Myfaces 1.2.5 was already working. And I included the jars:
Facelets 1.1.14: jsf-facelets.jar, el-api-1.0.jar, el-impl-1.0.jar
Seam 2.1.1: jboss-seam.jar, jboss-seam-ui.jar, persistence-api.jar, javaassist.jar
FACES-CONFIG.XML
<faces-config version="1.2"
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_1_2.xsd">
<application>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<message-bundle>com.west.wic.wssi.resources.messages</message-bundle>
<resource-bundle>
<base-name>com.west.wic.wssi.resources.messages</base-name>
<var>msgs</var>
</resource-bundle>
</application>
<!-- seam -->
<lifecycle>
<phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
</lifecycle>
...
WEB.XML
...
<!-- facelets-->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<!-- Seam -->
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.web.SeamFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
...
COMPONENETS.XML
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:web="http://jboss.com/products/seam/web"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd
http://jboss.com/products/seam/web http://jboss.com/products/seam/web-1.2.xsd">
<web:exception-filter url-pattern="*.seam"/>
<web:redirect-filter url-pattern="*.seam"/>
<web:multipart-filter create-temp-files="true"
max-request-size="1000000"
url-pattern="*.seam"/>
<web:character-encoding-filter encoding="UTF-16"
override-client="true"
url-pattern="*.seam"/>
<!-- <web:context-filter url-pattern="/media/*"/> -->
</components>
[b]ERROR:[/b]
Jan 15, 2009 11:35:31 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.addELResolver(Ljavax/el/ELResolver;)V" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/apache/myfaces/webapp/Jsp21FacesInitializer, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ELResolver used in the signature
Since tomcat 6 has el-api.jar I tried removing el-api and el-impl jars from facelets. and I still didn't work. I tried replcing them with jboss-el still same thing; also replaced with el-api jar shipped with seam and still didn't work. If I remove el-api from tomcat lib I get a classNotFound exception.
I have spent a long time trying to figure it out. I would really appreciate your help.
Thanks
mitchi