[Resolvido] Aplicação FJ28 não roda! Primeiro Exemplo de como usar vRaptor!

4 respostas
GabrielCardelli

LOG:

16/01/2010 15:51:00 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:goodbuycaelum' did not find a matching property.
16/01/2010 15:51:00 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\XEClient\bin;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\jEdit;C:\AppServ\Apache2.2\bin;C:\AppServ\php6
16/01/2010 15:51:00 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
16/01/2010 15:51:00 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 679 ms
16/01/2010 15:51:00 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
16/01/2010 15:51:00 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
log4j:WARN No appenders could be found for logger (br.com.caelum.vraptor.ioc.spring.VRaptorApplicationContext).
log4j:WARN Please initialize the log4j system properly.
16/01/2010 15:51:04 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
16/01/2010 15:51:04 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
16/01/2010 15:51:04 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/53  config=null
16/01/2010 15:51:04 org.apache.catalina.startup.Catalina start
INFO: Server startup in 3417 ms

http://localhost:8080/goodbuycaelum/ --> OK ABRE A PAGINA!!
Quando eu utilizo
http://localhost:8080/goodbuycaelum/mundo/boasvindas --> 404 OK mais sem escrever nada no console!!

Classe Mundo:

package br.com.caelum.goodbuy;

import br.com.caelum.vraptor.Resource;

@Resource
public class Mundo {
	
	public void boasVindas(){
		
		System.out.println("olá mundo");
		
	}

}

Web.XML

<?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>goodbuycaelum</display-name>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>
	
	<!-- configura o controlador do VRaptor -->
	<filter>
		<filter-name>vraptor</filter-name>
		<filter-class>br.com.caelum.vraptor.VRaptor</filter-class>
	</filter>
	
	<filter-mapping>
		<filter-name>vraptor</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
	</filter-mapping>
	
	<jsp-config>
		<jsp-property-group>
			<description>goodbuycaelum</description>
			<display-name>Good Buy Caelum</display-name>
			<url-pattern>*.jsp</url-pattern>
			<include-prelude>/header.jspf</include-prelude>
			<include-coda>/footer.jspf</include-coda>
		</jsp-property-group>
	</jsp-config>
</web-app>

Caso alguem puder ajudar... agradeço...

4 Respostas

Paulo_Silveira

Ola Gabriel

Pra descobrir o erro, a gente precisa ler a saida do log, mas parece que seu log4j.xml nao esta configurado:
log4j:WARN No appenders could be found for logger (br.com.caelum.vraptor.ioc.spring.VRaptorApplicationContext).

O Vraptor-blank-project já vem com um log4j.xml, que deveria estar dentro de src, que será copiado para WEB-INF/classes. Verifique e poste a saida do log!

abracos

GabrielCardelli

Obrigado Paulo, vou baixar o blank e configurar o log
Abraço

GabrielCardelli

Isso?

16/01/2010 15:51:00 org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:goodbuycaelum' did not find a matching property. 16/01/2010 15:51:00 org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\XEClient\bin;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\jEdit;C:\AppServ\Apache2.2\bin;C:\AppServ\php6 16/01/2010 15:51:00 org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 16/01/2010 15:51:00 org.apache.catalina.startup.Catalina load INFO: Initialization processed in 679 ms 16/01/2010 15:51:00 org.apache.catalina.core.StandardService start INFO: Starting service Catalina 16/01/2010 15:51:00 org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.20 log4j:WARN No appenders could be found for logger (br.com.caelum.vraptor.ioc.spring.VRaptorApplicationContext). log4j:WARN Please initialize the log4j system properly. 16/01/2010 15:51:04 org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 16/01/2010 15:51:04 org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 16/01/2010 15:51:04 org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/53 config=null 16/01/2010 15:51:04 org.apache.catalina.startup.Catalina start INFO: Server startup in 3417 ms 16/01/2010 17:12:07 org.apache.catalina.core.StandardContext reload INFO: Reloading this Context has started log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository. 17:12:09,261 INFO [VRaptorApplicationContext] Refreshing Root WebApplicationContext: startup date [Sat Jan 16 17:12:09 BRST 2010]; root of context hierarchy 17:12:09,835 INFO [VRaptorApplicationContext] Scanning WEB-INF/classes: C:\Users\gabrielcardelli\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\goodbuycaelum\WEB-INF\classes 17:12:09,995 INFO [DefaultListableBeanFactory] Overriding bean definition for bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor': replacing [Root bean: class [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Root bean: class [br.com.caelum.vraptor.ioc.spring.InjectionBeanPostProcessor]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] 17:12:10,474 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@643edd: defining beans [XStreamXMLDeserializer,defaultMethodNotAllowedHandler,defaultMultipartConfig,emptyElementsRemoval,defaultInterceptorRegistry,defaultTypeNameExtractor,pathAnnotationRoutesParser,objenesisProxifier,asmBasedTypeCreator,defaultConverters,paranamerNameProvider,defaultRoutes,encodingHandlerFactory,noRoutesConfiguration,defaultDeserializers,defaultAcceptHeaderToFormat,defaultResourceNotFoundHandler,defaultTypeFinder,defaultResourceTranslator,defaultRouter,stereotypeHandler,converterHandler,interceptorStereotypeHandler,deserializesHandler,stereotypedBeansRegistrar,defaultSpringLocator,defaultFormatResolver,instantiateInterceptor,interceptorListPriorToExecutionExtractor,resourceLookupInterceptor,defaultValidator,outjectResult,deserializingInterceptor,XStreamJSONSerialization,defaultPathResolver,defaultLogicResult,multipartInterceptor,defaultValidationViewsFactory,defaultRefererResult,jstlLocalization,defaultStatus,emptyResult,XStreamXMLSerialization,parametersInstantiatorInterceptor,defaultHttpResult,defaultPageResult,forwardToDefaultViewInterceptor,defaultRepresentationResult,defaultResult,applicationConfiguration,executeMethodInterceptor,flashInterceptor,downloadInterceptor,defaultMethodInfo,ognlParametersProvider,defaultOutjector,bigDecimalConverter,bigIntegerConverter,booleanConverter,byteConverter,characterConverter,doubleConverter,enumConverter,floatConverter,integerConverter,localeBasedCalendarConverter,localeBasedDateConverter,longConverter,primitiveBooleanConverter,primitiveByteConverter,primitiveCharConverter,primitiveDoubleConverter,primitiveFloatConverter,primitiveIntConverter,primitiveLongConverter,primitiveShortConverter,shortConverter,uploadedFileConverter,VRaptorRequestProvider,httpServletRequestProvider,httpServletResponseProvider,httpSessionProvider,defaultInterceptorStack,defaultRequestExecution,mundo,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,cacheBasedTypeCreator]; root of factory hierarchy 17:12:10,683 INFO [DefaultConverters ] Registering bundled converters 17:12:10,782 INFO [RouteBuilder ] /mundo/boasVindas --> public void br.com.caelum.goodbuy.Mundo.boasVindas() 17:12:10,784 INFO [VRaptor ] VRaptor 3 successfuly initialized

GabrielCardelli

opa , fechei o eclipse e abri e rodou oO

Criado 16 de janeiro de 2010
Ultima resposta 16 de jan. de 2010
Respostas 4
Participantes 2