java - why won't this richfaces demo project work in myeclipse web project with maven support -


i'm new java , have been working through tutorials familiarize myself of frameworks , technologies jsf, spring, , richfaces. i'm using myeclipse ide , found pretty article on richfaces+jsf2 @ http://www.ibm.com/developerworks/java/library/j-richfaces4/index.html. rest of question centered around richfaces+jsf2 demo project shown in link above.

now, when create new web project in myeclipse using either j2ee spec level 5.0 or 6.0 , import demo project files, can demo project deployed myeclipse tomcat , works fine when visit localhost:8080/[project-name]/index.jsf.

but, if create new web project (either spec level) , add maven support (either standard or myeclipse-style), , import same demo project files in similar fashion, life of me can't web app , running. i'm using same localhost url above (and referencing new project). deployment error output listed below.

what missing?


jul 15, 2013 1:13:31 pm org.apache.catalina.core.aprlifecyclelistener init info: apache tomcat native library allows optimal performance in production environments not found on java.library.path: c:\users\[username]\appdata\local\myeclipse\common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;c:\users\[username]\appdata\local\myeclipse\common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_9.0.0.me201211011550\tomcat\bin jul 15, 2013 1:13:31 pm org.apache.coyote.http11.http11protocol init info: initializing coyote http/1.1 on http-8080 jul 15, 2013 1:13:31 pm org.apache.catalina.startup.catalina load info: initialization processed in 333 ms jul 15, 2013 1:13:31 pm org.apache.catalina.core.standardservice start info: starting service catalina jul 15, 2013 1:13:31 pm org.apache.catalina.core.standardengine start info: starting servlet engine: apache tomcat/6.0.13 jul 15, 2013 1:13:32 pm com.sun.faces.config.configurelistener contextinitialized info: initializing mojarra 2.1.3 (fcs 20110908) context '/rf4jee6stdmvn' jul 15, 2013 1:13:51 pm com.sun.faces.config.configurelistener contextinitialized severe: critical error during deployment:  java.lang.nosuchmethoderror: com.google.common.base.platform.precomputecharmatcher(lcom/google/common/base/charmatcher;)lcom/google/common/base/charmatcher;     @ com.google.common.base.charmatcher.precomputed(charmatcher.java:664)     @ com.google.common.base.charmatcher.<clinit>(charmatcher.java:71)     @ com.google.common.base.splitter.on(splitter.java:127)     @ org.richfaces.resource.resourcelibraryfactoryimpl.<clinit>(resourcelibraryfactoryimpl.java:43)     @ org.richfaces.application.defaultmodule.configure(defaultmodule.java:32)     @ org.richfaces.application.servicesfactoryimpl.init(servicesfactoryimpl.java:27)     @ org.richfaces.application.initializationlistener.createfactory(initializationlistener.java:139)     @ org.richfaces.application.initializationlistener.onstart(initializationlistener.java:112)     @ org.richfaces.application.initializationlistener.processevent(initializationlistener.java:157)     @ javax.faces.event.systemevent.processlistener(systemevent.java:106)     @ com.sun.faces.application.applicationimpl.processlisteners(applicationimpl.java:2139)     @ com.sun.faces.application.applicationimpl.invokelistenersfor(applicationimpl.java:2115)     @ com.sun.faces.application.applicationimpl.publishevent(applicationimpl.java:300)     @ com.sun.faces.config.configmanager.publishpostconfigevent(configmanager.java:600)     @ com.sun.faces.config.configmanager.initialize(configmanager.java:369)     @ com.sun.faces.config.configurelistener.contextinitialized(configurelistener.java:225)     @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:3827)     @ org.apache.catalina.core.standardcontext.start(standardcontext.java:4334)     @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:791)     @ org.apache.catalina.core.containerbase.addchild(containerbase.java:771)     @ org.apache.catalina.core.standardhost.addchild(standardhost.java:525)     @ org.apache.catalina.startup.hostconfig.deploydirectory(hostconfig.java:920)     @ org.apache.catalina.startup.hostconfig.deploydirectories(hostconfig.java:883)     @ org.apache.catalina.startup.hostconfig.deployapps(hostconfig.java:492)     @ org.apache.catalina.startup.hostconfig.start(hostconfig.java:1138)     @ org.apache.catalina.startup.hostconfig.lifecycleevent(hostconfig.java:311)     @ org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecyclesupport.java:117)     @ org.apache.catalina.core.containerbase.start(containerbase.java:1053)     @ org.apache.catalina.core.standardhost.start(standardhost.java:719)     @ org.apache.catalina.core.containerbase.start(containerbase.java:1045)     @ org.apache.catalina.core.standardengine.start(standardengine.java:443)     @ org.apache.catalina.core.standardservice.start(standardservice.java:516)     @ org.apache.catalina.core.standardserver.start(standardserver.java:710)     @ org.apache.catalina.startup.catalina.start(catalina.java:566)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25)     @ java.lang.reflect.method.invoke(method.java:597)     @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:288)     @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:413) jul 15, 2013 1:13:51 pm org.apache.catalina.core.standardcontext listenerstart severe: exception sending context initialized event listener instance of class com.sun.faces.config.configurelistener java.lang.runtimeexception: java.lang.nosuchmethoderror: com.google.common.base.platform.precomputecharmatcher(lcom/google/common/base/charmatcher;)lcom/google/common/base/charmatcher;     @ com.sun.faces.config.configurelistener.contextinitialized(configurelistener.java:292)     @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:3827)     @ org.apache.catalina.core.standardcontext.start(standardcontext.java:4334)     @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:791)     @ org.apache.catalina.core.containerbase.addchild(containerbase.java:771)     @ org.apache.catalina.core.standardhost.addchild(standardhost.java:525)     @ org.apache.catalina.startup.hostconfig.deploydirectory(hostconfig.java:920)     @ org.apache.catalina.startup.hostconfig.deploydirectories(hostconfig.java:883)     @ org.apache.catalina.startup.hostconfig.deployapps(hostconfig.java:492)     @ org.apache.catalina.startup.hostconfig.start(hostconfig.java:1138)     @ org.apache.catalina.startup.hostconfig.lifecycleevent(hostconfig.java:311)     @ org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecyclesupport.java:117)     @ org.apache.catalina.core.containerbase.start(containerbase.java:1053)     @ org.apache.catalina.core.standardhost.start(standardhost.java:719)     @ org.apache.catalina.core.containerbase.start(containerbase.java:1045)     @ org.apache.catalina.core.standardengine.start(standardengine.java:443)     @ org.apache.catalina.core.standardservice.start(standardservice.java:516)     @ org.apache.catalina.core.standardserver.start(standardserver.java:710)     @ org.apache.catalina.startup.catalina.start(catalina.java:566)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25)     @ java.lang.reflect.method.invoke(method.java:597)     @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:288)     @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:413) caused by: java.lang.nosuchmethoderror: com.google.common.base.platform.precomputecharmatcher(lcom/google/common/base/charmatcher;)lcom/google/common/base/charmatcher;     @ com.google.common.base.charmatcher.precomputed(charmatcher.java:664)     @ com.google.common.base.charmatcher.<clinit>(charmatcher.java:71)     @ com.google.common.base.splitter.on(splitter.java:127)     @ org.richfaces.resource.resourcelibraryfactoryimpl.<clinit>(resourcelibraryfactoryimpl.java:43)     @ org.richfaces.application.defaultmodule.configure(defaultmodule.java:32)     @ org.richfaces.application.servicesfactoryimpl.init(servicesfactoryimpl.java:27)     @ org.richfaces.application.initializationlistener.createfactory(initializationlistener.java:139)     @ org.richfaces.application.initializationlistener.onstart(initializationlistener.java:112)     @ org.richfaces.application.initializationlistener.processevent(initializationlistener.java:157)     @ javax.faces.event.systemevent.processlistener(systemevent.java:106)     @ com.sun.faces.application.applicationimpl.processlisteners(applicationimpl.java:2139)     @ com.sun.faces.application.applicationimpl.invokelistenersfor(applicationimpl.java:2115)     @ com.sun.faces.application.applicationimpl.publishevent(applicationimpl.java:300)     @ com.sun.faces.config.configmanager.publishpostconfigevent(configmanager.java:600)     @ com.sun.faces.config.configmanager.initialize(configmanager.java:369)     @ com.sun.faces.config.configurelistener.contextinitialized(configurelistener.java:225)     ... 24 more jul 15, 2013 1:13:51 pm org.apache.catalina.core.standardcontext start severe: error listenerstart jul 15, 2013 1:13:51 pm org.apache.catalina.core.standardcontext start severe: context [/rf4jee6stdmvn] startup failed due previous errors jul 15, 2013 1:13:51 pm com.sun.faces.lifecycle.elresolverinitphaselistener populatefaceselresolverforjsp info: jsf1027: [null] elresolvers jsf not registered jsp container. jul 15, 2013 1:13:51 pm com.sun.faces.config.configurelistener contextdestroyed severe: unexpected exception when attempting tear down mojarra runtime java.lang.nullpointerexception     @ org.richfaces.application.cacheprovider.release(cacheprovider.java:96)     @ org.richfaces.application.servicesfactoryimpl.release(servicesfactoryimpl.java:18)     @ org.richfaces.application.servicetracker.release(servicetracker.java:132)     @ org.richfaces.application.initializationlistener.onstop(initializationlistener.java:147)     @ org.richfaces.application.initializationlistener.processevent(initializationlistener.java:159)     @ javax.faces.event.systemevent.processlistener(systemevent.java:106)     @ com.sun.faces.application.applicationimpl.processlisteners(applicationimpl.java:2139)     @ com.sun.faces.application.applicationimpl.invokelistenersfor(applicationimpl.java:2115)     @ com.sun.faces.application.applicationimpl.publishevent(applicationimpl.java:300)     @ com.sun.faces.config.configurelistener.contextdestroyed(configurelistener.java:332)     @ org.apache.catalina.core.standardcontext.listenerstop(standardcontext.java:3866)     @ org.apache.catalina.core.standardcontext.stop(standardcontext.java:4500)     @ org.apache.catalina.core.standardcontext.start(standardcontext.java:4364)     @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:791)     @ org.apache.catalina.core.containerbase.addchild(containerbase.java:771)     @ org.apache.catalina.core.standardhost.addchild(standardhost.java:525)     @ org.apache.catalina.startup.hostconfig.deploydirectory(hostconfig.java:920)     @ org.apache.catalina.startup.hostconfig.deploydirectories(hostconfig.java:883)     @ org.apache.catalina.startup.hostconfig.deployapps(hostconfig.java:492)     @ org.apache.catalina.startup.hostconfig.start(hostconfig.java:1138)     @ org.apache.catalina.startup.hostconfig.lifecycleevent(hostconfig.java:311)     @ org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecyclesupport.java:117)     @ org.apache.catalina.core.containerbase.start(containerbase.java:1053)     @ org.apache.catalina.core.standardhost.start(standardhost.java:719)     @ org.apache.catalina.core.containerbase.start(containerbase.java:1045)     @ org.apache.catalina.core.standardengine.start(standardengine.java:443)     @ org.apache.catalina.core.standardservice.start(standardservice.java:516)     @ org.apache.catalina.core.standardserver.start(standardserver.java:710)     @ org.apache.catalina.startup.catalina.start(catalina.java:566)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25)     @ java.lang.reflect.method.invoke(method.java:597)     @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:288)     @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:413) jul 15, 2013 1:13:52 pm org.apache.coyote.http11.http11protocol start info: starting coyote http/1.1 on http-8080 jul 15, 2013 1:13:52 pm org.apache.jk.common.channelsocket init info: jk: ajp13 listening on /0.0.0.0:8009 jul 15, 2013 1:13:52 pm org.apache.jk.server.jkmain start info: jk running id=0 time=0/15  config=null jul 15, 2013 1:13:52 pm org.apache.catalina.startup.catalina start info: server startup in 20428 ms 

update

thanks answer below, this one, figured out going on.

one of maven dependencies of myeclipse web projects maven support causing issue. created exclusion specific jar.

<dependency>     <groupid>org.jboss.weld</groupid>     <artifactid>weld-osgi-bundle</artifactid>     <version>1.0.1-sp3</version>     <exclusions>         <exclusion>             <artifactid>google-collections</artifactid>             <groupid>com.google.collections</groupid>         </exclusion>     </exclusions> </dependency> 

the reason works because richfaces demo project includes guava, according comment below this answer, newer version of google-collections.

also, after making changes project dependencies, simple reload/refresh of web app not enough push out changes. had stop server, remove web app, restart server, , re-deploy application. perhaps standard practice java or myeclipse or specific changes making, not expecting have that.

what pain! has been learning experience.

that's dependency conflict google's library, guava or google collection. fix it, need have dependency tree. you're using myeclipse, open pom.xml file , in tabs below select dependency hierarchy view. search dependencies told you. there can different problems:

  • you're excluding dependency artifact needs it.
  • maven resolving conflict new google's dependency, method in old 1 , third-party library using makes use of it. in case should try update third party library or downgrade version of 1 you're using own.
  • for artifact, included version of api dependency , other version of implementation. in case, execution expects find method it's not available in implementation.

take this related question.


Comments