On Sun, 2006-01-15 at 17:39 -0800, Dave wrote:
> Lastest build:
>
> java.lang.NoClassDefFoundError:
> org/apache/commons/collections/map/ReferenceMap
> org.apache.myfaces.application.jsp.JspStateManagerImpl
> $SerializedViewCollection.getOldSerializedViewsMap(JspStateManagerImpl.java:647)
> org.apache.myfaces.application.jsp.JspStateManagerImpl
> $SerializedViewCollection.get(JspStateManagerImpl.java:658)
> org.apache.myfaces.application.jsp.JspStateManagerImpl.getSerializedViewFromServletSession(JspStateManagerImpl.java:451)
> org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreTreeStructure(JspStateManagerImpl.java:212)
> org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:237)
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:255)
> org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:143)
>
> I looked into commons-collections-2.1.jar. Its package name was
> changed:
>
> org/apache/commons/collections/ReferenceMap.class
>
> any workaround? But when I built faces, there was no compilation
> errors. Where are the libs used to build MyFaces? all the common jar
> files are under examples.
>
> I copied all the jars from example WEB-INF/lib.
>
> jar tvf commons-collections-2.1.jar | find "ReferenceMap.class"
> org/apache/commons/collections/ReferenceMap.class
If you look at ${myfaces.home.dir}/api/api/pom.xml you can see that
myfaces-api.jar depends on commons-collections-3.1.jar.
There does seem to be something odd here; I think that dependency should
be in the impl/pom.xml and NOT in the api/api/pom.xml file. However
that's not your problem: you need commons-collections-3.1.jar in your
classpath.
When maven runs, it downloads all jars that a project declares a
dependency on and puts them in your $HOME/.m2 directory. If you're a
windows user then you'll need to figure out what the equivalent is for
that OS.
Regards,
Simon