4 Replies Latest reply: Apr 29, 2011 10:36 AM by Chris Harris RSS

Need help creating richfaces-impl-jsf2 w/ manually building RichFaces 3.3.3 Final

Chris Harris Newbie

Specs:

JSF2

RichFaces 3.3.3 Final

Facelets 1.1.16

WAS 6.1

MyFaces 2.0.2

Tomahawk and Tomahawk Sandbox 1.1.10

java version 1.5

 

Hi.

 

I needed to manually build RichFaces 3.3.3 Final using Maven 2, because I needed to make some minor changes.  I was successful in accomplishing that task by following:

http://community.jboss.org/wiki/HowToBuildRichFacesSnapshotsManually33x

 

The problem I'm faced with is that I'm having trouble building the JSF2 version of RichFaces 3.3.3 Final.  I currently use the JSF2 version of RichFaces 3.3.3 Final in a Production app.  So, I need to create richfaces-impl-jsf2.jar.

 

I've come across this link (I'll call this link A):

http://community.jboss.org/wiki/HowtoaddRichFaces33xtomavenbasedproject

 

and this link (I'll call this link B):

http://community.jboss.org/wiki/RichFaces333andJSF20

 

Link A mentions pasting:

<dependency>
      <groupId>org.richfaces.ui</groupId>
      <artifactId>richfaces-ui</artifactId>
      <version>${richfaces.version}</version>
    </dependency>

and

<dependency>
      <groupId>org.richfaces.framework</groupId>
      <artifactId>richfaces-impl-jsf2</artifactId>
      <version>3.3.3.Final</version>
    </dependency>

within the <dependencies> tags according to "3.3.3 version comes with two richfaces-impl jars in order to provide  jsf2 compatible version. So additionally to ui dependency from above you  have to add richfaces-impl of needed version"

 

Well, I've tried putting those in pom.xml at C:\richfaces-ui-3.3.3.Final-src\richfaces-ui-3.3.3.Final    (root)

That resulted in an error message:

C:\richfaces-ui-3.3.3.Final-src\richfaces-ui-3.3.3.Final>mvn clean install

[INFO] Scanning for projects...

[INFO] ------------------------------------------------------------------------

[ERROR] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='org.richfaces.ui:richfaces-ui

'}' and 'Vertex{label='org.richfaces.framework:richfaces-api'}' introduces to cycle in the graph org.richfaces.framework

:richfaces-api --> org.richfaces.ui:richfaces-ui --> org.richfaces.framework:richfaces-api

[INFO] ------------------------------------------------------------------------

[INFO] For more information, run Maven with the -e switch

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 2 seconds

[INFO] Finished at: Wed Dec 08 00:00:42 CST 2010

[INFO] Final Memory: 5M/9M

[INFO] ------------------------------------------------------------------------

 

So, I tried removing

<dependency>
      <groupId>org.richfaces.ui</groupId>
      <artifactId>richfaces-ui</artifactId>
      <version>${richfaces.version}</version>
    </dependency>

and left the 1 richfaces-impl-jsf2 dependency mentioned earlier.

 

That didn't work either.  Here's the error message:

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

 

Please refer to C:\richfaces-ui-3.3.3.Final-src\richfaces-ui-3.3.3.Final\framework\jsf-test\target\surefire-reports for
the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 minutes 54 seconds
[INFO] Finished at: Wed Dec 08 00:08:05 CST 2010
[INFO] Final Memory: 62M/111M
[INFO] ------------------------------------------------------------------------
C:\richfaces-ui-3.3.3.Final-src\richfaces-ui-3.3.3.Final>

Please refer to C:\richfaces-ui-3.3.3.Final-src\richfaces-ui-3.3.3.Final\framework\jsf-test\target\surefire-reports for
the individual test results.

 

 

So, I noticed that link B mentioned:

NOTE - if you had no richfaces-ui dependency  in your project ( assuming api and impl transitively added), but had  all three dependencies listed (ui, api and impl) - you should replace richfaces-impl with richfaces-impl-jsf2 mentioned above.

 

I don't see anything named richfaces-ui.  That means that I'd have to replace richfaces-impl with richfaces-impl-jsf2, but root's pom.xml has no dependencies listed.  I see ui as a module in the root pom.xml.

 

Am I altering the wrong pom.xml file?  I tried adding that dependency within pom.xml in C:\richfaces-ui-3.3.3.Final-src\richfaces-ui-3.3.3.Final\ui

ui's pom.xml has

<dependency>
            <groupId>org.richfaces.framework</groupId>
            <artifactId>richfaces-api</artifactId>
            <version>3.3.3.Final</version>
        </dependency>

as a dependency, but I don't see richfaces-impl listed as a dependency.  If I place

<dependency>
      <groupId>org.richfaces.framework</groupId>
      <artifactId>richfaces-impl-jsf2</artifactId>
      <version>3.3.3.Final</version>
    </dependency>

in there, I get this error message:

 

[FATAL ERROR] Container realm = plexus.core

urls[0] = file:/C:/Program Files/Apache/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar

urls[1] = file:/C:/Documents and Settings/harrisc7/.m2/repository/postgresql/postgresql/8.2-504.jdbc3/postgresql-8.2-504

.jdbc3.jar

urls[2] = file:/C:/Documents and Settings/harrisc7/.m2/repository/org/apache/maven/archetype/archetype-packaging/2.0-alp

ha-4/archetype-packaging-2.0-alpha-4.jar

urls[3] = file:/C:/Documents and Settings/harrisc7/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.

jar

[INFO] ------------------------------------------------------------------------

[ERROR] FATAL ERROR

[INFO] ------------------------------------------------------------------------

[INFO] javax/faces/component/visit/VisitContext

[INFO] ------------------------------------------------------------------------

[INFO] Trace

java.lang.NoClassDefFoundError: javax/faces/component/visit/VisitContext

        at java.lang.Class.getDeclaredMethods0(Native Method)

        at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)

        at java.lang.Class.getDeclaredMethods(Class.java:1763)

        at java.beans.Introspector$1.run(Introspector.java:1280)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1278)

        at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1144)

        at java.beans.Introspector.getBeanInfo(Introspector.java:402)

        at java.beans.Introspector.getBeanInfo(Introspector.java:166)

        at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptors(PropertyUtils.java:949)

        at org.ajax4jsf.builder.config.ComponentBaseBean.checkPropertiesForClass(ComponentBaseBean.java:232)

        at org.ajax4jsf.builder.config.ComponentBaseBean.access$000(ComponentBaseBean.java:38)

        at org.ajax4jsf.builder.config.ComponentBaseBean$1.visit(ComponentBaseBean.java:170)

        at org.ajax4jsf.builder.config.ClassWalkingLogic.walkClass(ClassWalkingLogic.java:51)

        at org.ajax4jsf.builder.config.ClassWalkingLogic.walkClass(ClassWalkingLogic.java:49)

        at org.ajax4jsf.builder.config.ClassWalkingLogic.walkClass(ClassWalkingLogic.java:49)

        at org.ajax4jsf.builder.config.ClassWalkingLogic.walk(ClassWalkingLogic.java:37)

        at org.ajax4jsf.builder.config.ComponentBaseBean.checkProperties(ComponentBaseBean.java:167)

        at org.ajax4jsf.builder.config.ComponentBean.checkProperties(ComponentBean.java:132)

        at org.ajax4jsf.builder.config.BuilderConfig.checkComponentProperties(BuilderConfig.java:489)

        at org.ajax4jsf.builder.mojo.GenerateMojo.createConfig(GenerateMojo.java:293)

        at org.ajax4jsf.builder.mojo.GenerateMojo.execute(GenerateMojo.java:99)

        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)

        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)

        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:55

6)

        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)

        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav

a:387)

        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)

        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)

        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:592)

        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)

        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)

        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 2 minutes 32 seconds

[INFO] Finished at: Wed Dec 08 00:25:04 CST 2010

[INFO] Final Memory: 66M/131M

[INFO] ------------------------------------------------------------------------

C:\richfaces-ui-3.3.3.Final-src\richfaces-ui-3.3.3.Final>

 

To be thorough in verifying that it was time to do a face palm, I then pasted:

<dependency>
      <groupId>org.richfaces.ui</groupId>
      <artifactId>richfaces-ui</artifactId>
      <version>${richfaces.version}</version>
    </dependency>

in ui's pom.xml along with the richfaces-impl-jsf2 dependency.

 

Sure enough, back to this error:


C:\richfaces-ui-3.3.3.Final-src\richfaces-ui-3.3.3.Final>mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='org.richfaces.ui:richfaces-ui
'}' and 'Vertex{label='org.richfaces.ui:richfaces-ui'}' introduces to cycle in the graph org.richfaces.ui:richfaces-ui -
-> org.richfaces.ui:richfaces-ui
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Wed Dec 08 00:35:33 CST 2010
[INFO] Final Memory: 5M/9M
[INFO] ------------------------------------------------------------------------

 

What exactly am I doing wrong?

 

I'm about to upgrade my face palm to a head desk.  Also, do I have to run "mvn install" from root every time and wait ~ 32 minutes?  My work laptop is slow if that amount of time seems absurd.

 

- Chris