Question

I'm currently migrating a larger project which primarily uses Seam 2, Hibernate and JSF 1.2 from JBoss 4.2.x to JBoss 7.1 – and I've managed to solve most problems so far. The application server starts just fine and deployes my EAR project without errors at the moment. JSF 1.2 und Seam 2 seam to start properly.

However - as soon as I try to access the first page (i.e. context/login.seam) the browser loads the source of my jsp instead of the rendered content. So far I've no idea where to go on. Have web.xml, faces-config.xml or any related setup files changed for using this environment?


Briefly summarized I've made the following updates to my project so far:

Some lines from web.xml in WAR

<context-param>
    <param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>
    <param-value>Mojarra-1.2</param-value>
</context-param>

<listener>
    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<filter>
    <filter-name>Seam Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>Seam Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <servlet-class>
        org.jboss.seam.servlet.SeamResourceServlet
    </servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.seam</url-pattern>
</servlet-mapping>

jboss-deployment-structure.xml in EAR

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
    <deployment>
        <exclusions>
            <module name="javax.faces.api" slot="main" />
            <module name="com.sun.jsf-impl" slot="main" />
        </exclusions>
        <dependencies>

            <!-- Wir brauchen in jedem Fall Java Server Faces v1.2... nicht das aktuelle v2.0! -->
            <module name="javax.faces.api" slot="1.2" export="true" />
            <module name="com.sun.jsf-impl" slot="1.2" export="true" />

            <!-- Seam braucht einige Libraries, die der JBoss teilweise schon mitbringt... -->
            <module name="org.apache.commons.beanutils" export="true" />
            <module name="org.apache.commons.collections" export="true" />
            <module name="org.apache.commons.lang" export="true" />
            <module name="org.dom4j" export="true" />
            <module name="org.hibernate.validator" export="true" />

        </dependencies>
    </deployment>
</jboss-deployment-structure>

I've also stripped all JARs from the EAR that already come with JBoss v7.1 as modules and modified MANIFEST.MF files.

And I've replaced Log4J with JBoss-Logging, fixed some outdated FacesMessages code and disabled @Service und @Management classes for now.

Also my Oracle datasource has been added to standalone.xml (using ojdbc6.jar) and initializes successfully.


PS: It's currently no option to replace Seam2 with Seam3 for this project. I've not yet tried to use the Seam2-JSF2-Branch (https://github.com/heyoulin/seam2jsf2) - I want to understand my current problems before evaluating alternatives.

Was it helpful?

Solution

We've spent more and more time without real progress on this one. So I've decided to go the another way and dump Seam in favor of CDI and EJB v3.1! Most of the things we used from Seam v2 are obsolete now. This is a huge migration – but I think it will pay off in the end. It should reduce overall memory usage and improve performance. Looks like Seam v2 and JBoss v7 is not that good of an idea...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top