Richfaces junto com glassfish não aceita os jars

5 respostas
adimir

Ola all, estou com um grande problema q não consigo resolver a um tempo,
tenho q usar o glassfish, como server app; Estou querendo utilisar richfaces, mas muitos me disseram para copiar os jars baixados do richfaces,
richfaces-api-3.1.4.GA.jar
richfaces-ui-3.1.4.GA.jar
richfaces-impl-3.1.4.GA.jar
e copialos para o web-inf/lib meu web.xml esta assim :

<?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_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>web</display-name>
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>

	<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>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>
</web-app>

ok funfa ate colocar os jars no lib, depois disto acabou nada mais funfa.
da erro .

5 Respostas

G

Já apanhei um pouquinho para configurar tbm, deve estar faltando alguma lib adicional.

Poste o erro que está dando no console, pra gente te ajudar.

adimir

Opas [e foi maus esqueci de pegar o erro

[#|2008-05-26T23:49:40.296-0300|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=10;_ThreadName=main;/web;|Initializing Sun’s JavaServer Faces implementation (1.2_04-b20-p03) for context ‘/web’|#]

[#|2008-05-26T23:49:40.718-0300|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;_RequestID=dad37be6-8c5f-4384-bf58-342241368d33;|WebModule[/web]PWC1275: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

at org.ajax4jsf.application.DebugLifecycleFactory.(DebugLifecycleFactory.java:39)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:549)

at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:448)

at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:249)

at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:805)

at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:486)

at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:381)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4515)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:5176)

at com.sun.enterprise.web.WebModule.start(WebModule.java:327)

at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:58)

at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:296)

at com.sun.appserv.management.util.misc.RunnableBase._submit(RunnableBase.java:168)

at com.sun.appserv.management.util.misc.RunnableBase.submit(RunnableBase.java:184)

at com.sun.enterprise.web.VirtualServer.startChildren(VirtualServer.java:1672)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1231)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:955)

at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:58)

at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:296)

at com.sun.appserv.management.util.misc.RunnableBase._submit(RunnableBase.java:168)

at com.sun.appserv.management.util.misc.RunnableBase.submit(RunnableBase.java:184)

at com.sun.enterprise.web.EmbeddedWebContainer$WebEngine.startChildren(EmbeddedWebContainer.java:453)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1231)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:533)

at org.apache.catalina.startup.Embedded.start(Embedded.java:936)

at com.sun.enterprise.web.WebContainer.start(WebContainer.java:873)

at com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:790)

at com.sun.enterprise.web.PEWebContainerLifecycle.onStartup(PEWebContainerLifecycle.java:84)

at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:442)

at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:120)

at com.sun.enterprise.server.PEMain.run(PEMain.java:411)

at com.sun.enterprise.server.PEMain.main(PEMain.java:338)

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:597)

at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)

|#]

[#|2008-05-26T23:49:40.718-0300|SEVERE|sun-appserver9.1|org.apache.catalina.core.StandardContext|_ThreadID=10;_ThreadName=main;_RequestID=dad37be6-8c5f-4384-bf58-342241368d33;|PWC1306: Startup of context /web failed due to previous errors|#]

[#|2008-05-26T23:49:40.937-0300|INFO|sun-appserver9.1|javax.enterprise.system.core.selfmanagement|_ThreadID=10;_ThreadName=main;|SMGT0007: Self Management Rules service is enabled|#]

[#|2008-05-26T23:49:40.984-0300|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Application server startup complete.|#]

[#|2008-05-26T23:49:41.171-0300|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;;|Initializing Sun’s JavaServer Faces implementation (1.2_04-b20-p03) for context ‘’|#]

G

Veja bem

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

Falta o Jar do commons-logging

O RichFaces exige vários Jar Commons, são eles:
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-discovery-0.4.jar
commons-logging-1.1.jar

adimir

Muito obrigado, realmente era isso mesmo, estavam faltando estes jars,
alterei o web.xml para

<?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_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>web</display-name>

	<context-param>
		<param-name>org.richfaces.SKIN</param-name>
		<param-value>classic</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
		<param-value>server</param-value>
	</context-param>

	<filter>
		<display-name>RichFaces Filter</display-name>
		<filter-name>richfaces</filter-name>
		<filter-class>org.ajax4jsf.Filter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>richfaces</filter-name>
		<servlet-name>Faces Servlet</servlet-name>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
	</filter-mapping>

	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>

	<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>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>
</web-app>

bem simples sem muita complicacao no web.xml
estava usando o richfaces 3.1.4, ai apenas copiei os jars de do pacote do MyFaces q tem todos estes, pois estou usando o Jsf do glassfish, mapeado no eclipse, e tcharam funfou tudo, gracas a grande ajuda do nosso amigo.
Valeu muito obrigado

felipearimateia

adimir:
Muito obrigado, realmente era isso mesmo, estavam faltando estes jars,
alterei o web.xml para

<?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_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>web</display-name>

	<context-param>
		<param-name>org.richfaces.SKIN</param-name>
		<param-value>classic</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
		<param-value>server</param-value>
	</context-param>

	<filter>
		<display-name>RichFaces Filter</display-name>
		<filter-name>richfaces</filter-name>
		<filter-class>org.ajax4jsf.Filter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>richfaces</filter-name>
		<servlet-name>Faces Servlet</servlet-name>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
	</filter-mapping>

	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>

	<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>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>
</web-app>

bem simples sem muita complicacao no web.xml
estava usando o richfaces 3.1.4, ai apenas copiei os jars de do pacote do MyFaces q tem todos estes, pois estou usando o Jsf do glassfish, mapeado no eclipse, e tcharam funfou tudo, gracas a grande ajuda do nosso amigo.
Valeu muito obrigado

em qual pasta vc colocou esses jars…
to apanhado pra configurar richfaces no glassfish v2, IDE Netbenas 6.5

Criado 26 de maio de 2008
Ultima resposta 7 de mai. de 2009
Respostas 5
Participantes 3