integrate Primaface+spring+mybatis, can't add all themes

UI Components for JSF
Post Reply
dwt
Posts: 4
Joined: 06 Jul 2012, 05:10

06 Jul 2012, 05:23

integrate Primaface+spring+mybatis, then I can't add all themes

I build a project include Primaface 3.3.1 and spring 3.1.0 and mybatis 3.1.1 and Tomcat 7.
The I can't add all themes jar into my project, for example:
afterdark 1.5 and 1.6 are work
afternoon 1.5 is work, 1.6 is not work
afterwork 1.5 is work, 1.6 is not work
dark-hive1.5 and 1.6 are not work

I got below error during startup the server:

Serious: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.IllegalStateException: The application is not properly initialized at startup, can not find the factory: javax.faces.application.ApplicationFactory
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:800)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:302)
at org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:159)
at org.apache.myfaces.context.servlet.FacesContextImplBase.getELContext(FacesContextImplBase.java:210)
at javax.faces.component.UIViewRoot.setLocale(UIViewRoot.java:1450)
at org.apache.myfaces.webapp.AbstractFacesInitializer._createFacesContext(AbstractFacesInitializer.java:462)
at org.apache.myfaces.webapp.AbstractFacesInitializer.initStartupFacesContext(AbstractFacesInitializer.java:434)
at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:113)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
2012-7-6 10:02:50 org.apache.catalina.core.StandardContext startInternal
Serious: Error listenerStart
2012-7-6 10:02:50 org.apache.catalina.core.StandardContext startInternal
Serious: Context [/PrimeFaces] startup failed due to previous errors
2012-7-6 10:02:50 org.apache.catalina.core.StandardContext listenerStop
Serious: Exception sending context destroyed event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.IllegalStateException: The application is not properly initialized at startup, can not find the factory: javax.faces.application.ApplicationFactory
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:800)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:302)
at org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:159)
at org.apache.myfaces.context.servlet.FacesContextImplBase.getELContext(FacesContextImplBase.java:210)
at javax.faces.component.UIViewRoot.setLocale(UIViewRoot.java:1450)
at org.apache.myfaces.webapp.AbstractFacesInitializer._createFacesContext(AbstractFacesInitializer.java:462)
at org.apache.myfaces.webapp.AbstractFacesInitializer.initShutdownFacesContext(AbstractFacesInitializer.java:444)
at org.apache.myfaces.webapp.StartupServletContextListener.contextDestroyed(StartupServletContextListener.java:155)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4819)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5466)
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:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
2012-7-6 10:02:50 org.apache.catalina.core.ApplicationContext log
Info: Closing Spring root WebApplicationContext
2012-7-6 10:02:50 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
Serious: The web application [/PrimeFaces] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2012-7-6 10:02:50 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Serious: The web application [/PrimeFaces] created a ThreadLocal with key of type [javax.faces.context.FacesContext$1] (value [javax.faces.context.FacesContext$1@17368db]) and a value of type [org.apache.myfaces.context.servlet.StartupFacesContextImpl] (value [org.apache.myfaces.context.servlet.StartupFacesContextImpl@3fe9029b]) 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.
2012-7-6 10:02:50 org.apache.coyote.AbstractProtocol start
Info: Starting ProtocolHandler ["http-bio-8080"]
2012-7-6 10:02:50 org.apache.coyote.AbstractProtocol start
Info: Starting ProtocolHandler ["ajp-bio-8009"]
2012-7-6 10:02:50 org.apache.catalina.startup.Catalina start
Info: Server startup in 13005 ms

dwt
Posts: 4
Joined: 06 Jul 2012, 05:10

06 Jul 2012, 13:19

My web.xml is below

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name></display-name>
<welcome-file-list>
<welcome-file>index.faces</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:config/spring/applicationContext-*.xml</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/resources/myfaces-config/view-config.xml,/resources/myfaces-config/resources-config.xml,/resources/myfaces-config/flow-config.xml,/resources/myfaces-config/system-config.xml,/resources/myfaces-config/commons-config.xml</param-value>
</context-param>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>#{themeBean.theme}</param-value>
</context-param>
</web-app>

Lyrionus
Posts: 60
Joined: 31 Aug 2011, 09:09

06 Jul 2012, 14:04

Have you tried cleaning your project, and tomcat? Because it looks like you tried doing something and tomcat choked... and kept the wrong info somewhere.
JSF 2.0
Primefaces 3.2
Tomcat 7.0

dwt
Posts: 4
Joined: 06 Jul 2012, 05:10

09 Jul 2012, 02:33

I guessI have known the reason, I'm using the MyEclipse, which include the JSF jar by default. (jsf-api.jar and jsf-impl.jar)
I think it is conflict with the JSF jar in MyFaces, so I try to delete the JSF jar in MyEclipse, only keep the JSF Jar in Myfaces.
But after startup, when I try to login the web page, I got below error message:

2012-7-9 8:23:02 org.apache.myfaces.util.ExternalSpecifications isUnifiedELAvailable
Info: MyFaces Unified EL support enabled

dwt
Posts: 4
Joined: 06 Jul 2012, 05:10

14 Jul 2012, 08:53

Hi All

This issue has been resloved, I miss a '\' in configuration file.

adamdog
Posts: 1
Joined: 17 Jul 2012, 03:33

17 Jul 2012, 03:38

I encountered same issue, how did you resolve? miss a "\" ? where?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 28 guests