Search code examples
jsf-2glassfish-3mojarra

Upgrading to latest mojarra in glassfish 3.1.2.2


So I got tired of some problems that might be related to the bundled mojarra 2.1.6.

So decided to give 2.1.17 a shot.

Deleted

C:\glassfish3\glassfish\domains\domain1\osgi-cache

and replaced

C:\glassfish3\glassfish\modules\javax.faces.jar 

with the one found here

No matter how i restart the server, do clean deploys from eclipse etc (add remove both the server and the app via eclipse)

I see the following in the server log :(

[#|2013-02-03T13:22:42.172+0100|INFO|glassfish3.1.2|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=1;_ThreadName=Thread-2;|Initializing Mojarra 2.1.6 (SNAPSHOT 20111206) for context '/MyApp'|#]

Not giving up so easily I followed this article for bundling it into my web-app instead

Updates to glassfish-web.xml

<class-loader delegate="false" />
<property name="useBundledJsf" value="true"/>

Updates to pom.xml

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.faces</artifactId>
    <version>2.1.17</version>
</dependency>
<dependency>
    <groupId>org.glassfish.web</groupId>
    <artifactId>weld-integration</artifactId>
    <version>3.2-b06</version>
    <exclusions>
        <exclusion>
            <artifactId>*</artifactId>
            <groupId>*</groupId>
        </exclusion>
    </exclusions>
</dependency>

This sort of works:

INFO: Initializing Mojarra 2.1.17 ( 20130107-1935 https://svn.java.net/svn/mojarra~svn/tags/2.1.17@11335) for context '/MyApp'

but im not able to inject EJBs in my JSF managed beans. Question is, how can i get latest mojarra to play with glassfish 3.1.2.2 and my webapp that also contains ejbs?


Solution

  • Okay, so the answer to my initial problem (replacement of javax.faces.jar not taking effect) is bit embarrassing.

    Apparently I had my eclipse glassfish plugin configured for the domain

    c:/glassfish3/glassfish/domains/domain1 
    

    but the server path was set to

    C:/eclipseee3/plugins/oracle.eclipse.runtime.glassfish.build3122_1.0.0/glassfish3/glassfish