Spring Roo生成的JSF项目为生成的〜.web.util.ViewExpiredExceptionExceptionHandlerFactory生成java.lang.ClassNotFoundException

时间:2014-06-21 20:10:09

标签: java spring jsf spring-roo

当运行Spring Roo在STS中的VMWare服务器上生成一个实体的JSF项目时,我得到了生成的〜.web.util.ViewExpiredExceptionExceptionHandlerFactory类的java.lang.ClassNotFoundException。

我使用仪表板中的选项创建了一个Spring Roo项目。然后我使用Roo Shell输入以下命令:

jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY

entity jpa --class~.domain.Subject --testAutomatically

然后我在Subject.java中添加了几个带有原始类型的字段

然后我使用Roo Shell中的以下命令选择了JSF:

web jsf setup

web jsf all --package~.web

我将persistence.xml属性hibernate.hbm2ddl.auto更改为" create-drop"

我使用Run As Maven Clean编译它 - 没有错误。然后我选择了Run As和On Server。

完整的痕迹是:

Jun 21, 2014 6:50:18 PM com.springsource.tcserver.security.PropertyDecoder <init>
INFO: tc Runtime property decoder using memory-based key
Jun 21, 2014 6:50:18 PM com.springsource.tcserver.security.PropertyDecoder <init>
INFO: tcServer Runtime property decoder has been initialized in 190 ms
Jun 21, 2014 6:50:19 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 21, 2014 6:50:19 PM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init
INFO: Started up JMX registry on 127.0.0.1:6969 in 89 ms
Jun 21, 2014 6:50:19 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 670 ms
Jun 21, 2014 6:50:19 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 21, 2014 6:50:19 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: VMware vFabric tc Runtime 2.8.2.RELEASE/7.0.35.B.RELEASE
Jun 21, 2014 6:50:19 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Program Files\springsource\vfabric-  
tc-server-developer-2.8.2.RELEASE\base-instance\conf\Catalina\localhost\Test.xml
Jun 21, 2014 6:50:19 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to    
'org.eclipse.jst.jee.server:Test' did not find a matching property.
Jun 21, 2014 6:50:20 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
Jun 21, 2014 6:50:20 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jun 21, 2014 6:50:21 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jun 21, 2014 6:50:22 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.1.2 (FCS 20110610) for context '/Test'
Jun 21, 2014 6:50:23 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods    marked with these annotations will have said annotations processed.
Jun 21, 2014 6:50:23 PM com.sun.faces.config.ConfigureListener contextInitialized 

SEVERE: Critical error during deployment:  
com.sun.faces.config.ConfigurationException:  
    Factory 'javax.faces.context.ExceptionHandlerFactory' was not configured properly.
at
com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:360)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.faces.FacesException:   
com.roseberry.test.web.util.ViewExpiredExceptionExceptionHandlerFactory
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:603)
at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:482)
at javax.faces.FactoryFinder.access$400(FactoryFinder.java:138)
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:943)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303)
... 17 more
Caused by: java.lang.ClassNotFoundException:     com.roseberry.test.web.util.ViewExpiredExceptionExceptionHandlerFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:591)
... 22 more

Jun 21, 2014 6:50:23 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class          com.sun.faces.config.ConfigureListener

java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 
'javax.faces.context.ExceptionHandlerFactory' was not configured properly.
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.sun.faces.config.ConfigurationException: Factory   
'javax.faces.context.ExceptionHandlerFactory' was not configured properly.
at    
com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist
(FactoryConfigProcessor.java:305)
at com.sun.faces.config.processor.FactoryConfigProcessor.process
       (FactoryConfigProcessor.java:219)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:360)
at com.sun.faces.config.ConfigureListener.contextInitialized
       (ConfigureListener.java:225)
... 14 more
Caused by: javax.faces.FacesException:   
com.roseberry.test.web.util.ViewExpiredExceptionExceptionHandlerFactory
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:603)
    at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:482)
    at javax.faces.FactoryFinder.access$400(FactoryFinder.java:138)
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:943)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303)
... 17 more
Caused by: java.lang.ClassNotFoundException:   
com.roseberry.test.web.util.ViewExpiredExceptionExceptionHandlerFactory
at    
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at   
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:591)
... 22 more

Jun 21, 2014 6:50:23 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Jun 21, 2014 6:50:23 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Test] startup failed due to previous errors
Jun 21, 2014 6:50:23 PM com.sun.faces.config.ConfigureListener contextDestroyed
SEVERE: Unexpected exception when attempting to tear down the Mojarra runtime
java.lang.IllegalStateException: Application was not properly initialized at startup,  could not find Factory: javax.faces.application.ApplicationFactory
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:951)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316)
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:112)
at  
com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:325)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4837)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5484)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run
        (HostConfig.java:1637)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

Jun 21, 2014 6:50:23 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Jun 21, 2014 6:50:23 PM org.apache.catalina.loader.WebappClassLoader   
                        clearReferencesJdbc
SEVERE: The web application [/Test] registered the JDBC driver    
[org.hsqldb.jdbc.JDBCDriver] but failed to unregister it when the web application was 
stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jun 21, 2014 6:50:23 PM org.apache.catalina.loader.WebappClassLoader 
                         checkThreadLocalMapForLeaks 
SEVERE: The web application [/Test] created a ThreadLocal with key of type  
[javax.faces.context.FacesContext$1] (value        
                       [javax.faces.context.FacesContext$1@56540233]) 
 and a value of type [com.sun.faces.config.InitFacesContext] (value   
[com.sun.faces.config.InitFacesContext@255c8e8c]) but failed to remove it when the web 
application was stopped. Threads are going to be renewed over time to try and avoid a  
probable memory leak.
Jun 21, 2014 6:50:23 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\springsource\vfabric- 
tc-server-developer-2.8.2.RELEASE\base-instance\webapps\manager
Jun 21, 2014 6:50:23 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\springsource\vfabric- 
tc-server-developer-2.8.2.RELEASE\base-instance\webapps\ROOT
Jun 21, 2014 6:50:23 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 21, 2014 6:50:23 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4192 ms

类Web.util.ViewExpiredExceptionExceptionHandlerFactory实际上是由Spring Roo生成的,所以我认为它会正确配置它。

任何帮助解决这个问题都将受到赞赏。

0 个答案:

没有答案