Pelo que entendi então tá td no esquema.
Persistence.xml dentro de Webcontent/META-INF/:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="default">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost/imobiliaria" />
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
<property name="hibernate.connection.password" value="dimeola" />
<property name="hibernate.connection.username" value="postgres" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>
Classes anotadas com @Entity (import javax.persistence.Entity;).
No print que postei aparece o log4j.xml na /src, então beleza.
O erro que dá referente ao log4j.xml é este:
log4j:WARN No appenders could be found for logger (br.com.bronx.vraptor.restrictrex.startup.PageHandler).
log4j:WARN Please initialize the log4j system properly.
Injetei no web.xml:
<context-param>
<param-name>br.com.caelum.vraptor.provider</param-name>
<param-value>br.com.caelum.vraptor.util.jpa.JPACustomProvider</param-value>
</context-param>
A saida completa do console é esta:
NFO: Initializing Coyote HTTP/1.1 on http-8080
17/04/2010 14:42:31 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 979 ms
17/04/2010 14:42:31 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
17/04/2010 14:42:31 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.26
14:42:31,954 INFO [VRaptorApplicationContext] Refreshing Root WebApplicationContext: startup date [Sat Apr 17 14:42:31 BRT 2010]; root of context hierarchy
14:42:32,278 INFO [VRaptorApplicationContext] Scanning WEB-INF/classes: /home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp2/wtpwebapps/Imobiliaria/WEB-INF/classes
14:42:32,497 INFO [VRaptorApplicationContext] Scanning packages from WEB-INF/classes and jars: [br.com.bronx.vraptor.restrictrex]
14:42:32,550 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]
14:42:32,932 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@778255: defining beans [defaultRoutes,XStreamXMLDeserializer,defaultDeserializers,defaultMultipartConfig,encodingHandlerFactory,defaultMethodNotAllowedHandler,defaultResourceTranslator,defaultTypeNameExtractor,paranamerNameProvider,defaultInterceptorRegistry,defaultRouter,asmBasedTypeCreator,defaultTypeFinder,pathAnnotationRoutesParser,defaultResourceNotFoundHandler,objenesisProxifier,emptyElementsRemoval,defaultConverters,defaultAcceptHeaderToFormat,noRoutesConfiguration,stereotypeHandler,converterHandler,interceptorStereotypeHandler,deserializesHandler,stereotypedBeansRegistrar,defaultSpringLocator,outjectResult,defaultPathResolver,jstlLocalization,resourceLookupInterceptor,defaultRepresentationResult,defaultStatus,replicatorOutjector,applicationConfiguration,defaultMethodInfo,defaultLogicResult,defaultResult,defaultPageResult,flashInterceptor,XStreamJSONSerialization,defaultRefererResult,downloadInterceptor,multipartInterceptor,defaultValidationViewsFactory,ognlParametersProvider,parametersInstantiatorInterceptor,interceptorListPriorToExecutionExtractor,XStreamXMLSerialization,emptyResult,forwardToDefaultViewInterceptor,executeMethodInterceptor,defaultHttpResult,deserializingInterceptor,defaultFormatResolver,defaultValidator,instantiateInterceptor,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,defaultRequestExecution,defaultInterceptorStack,entityManagerCreator,entityManagerFactoryCreator,JPATransactionInterceptor,usuarioDAO,imovelDAO,loginController,indexController,imagemController,homeController,imovelController,accesControllerInterceptor,imagens,usuarioLogado,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,restrictionChecker,pageHandler,org.springframework.aop.config.internalAutoProxyCreator,cacheBasedTypeCreator]; root of factory hierarchy
14:42:33,146 INFO [DefaultConverters ] Registering bundled converters
14:42:33,319 INFO [RouteBuilder ] /login -> LoginController.login()
14:42:33,326 INFO [RouteBuilder ] /login/adiciona -> LoginController.adiciona(Usuario)
14:42:33,327 INFO [RouteBuilder ] /login/autentica -> LoginController.autentica(Usuario)
14:42:33,328 INFO [RouteBuilder ] /login/logout -> LoginController.logout()
log4j:WARN No appenders could be found for logger (br.com.bronx.vraptor.restrictrex.startup.PageHandler).
log4j:WARN Please initialize the log4j system properly.
14:42:33,370 INFO [RouteBuilder ] /index/lista -> IndexController.lista()
14:42:33,371 INFO [RouteBuilder ] /index -> IndexController.index()
14:42:33,376 INFO [RouteBuilder ] /filme/{filme.id}/imagem -> ImagemController.upload(Imovel, UploadedFile)
14:42:33,383 INFO [RouteBuilder ] /filme/{filme.id}/imagem -> ImagemController.download(Imovel)
14:42:33,384 INFO [RouteBuilder ] /home -> HomeController.home()
14:42:33,385 INFO [RouteBuilder ] /imovel/adiciona -> ImovelController.adiciona(Imovel)
14:42:33,386 INFO [RouteBuilder ] /imovel/lista -> ImovelController.lista()
14:42:33,386 INFO [RouteBuilder ] /imovel/edita -> ImovelController.edita(Long)
14:42:33,387 INFO [RouteBuilder ] /imovel -> ImovelController.formulario()
14:42:33,388 INFO [RouteBuilder ] /imovel/altera -> ImovelController.altera(Imovel)
14:42:33,395 INFO [RouteBuilder ] /imovel/remove -> ImovelController.remove(Long)
14:42:33,398 INFO [VRaptor ] VRaptor 3.1.1 successfuly initialized
14:42:33,832 INFO [VRaptorApplicationContext] Refreshing Root WebApplicationContext: startup date [Sat Apr 17 14:42:33 BRT 2010]; root of context hierarchy
14:42:34,089 INFO [VRaptorApplicationContext] Scanning WEB-INF/classes: /home/bruno/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp2/wtpwebapps/JMovie/WEB-INF/classes
14:42:34,315 INFO [VRaptorApplicationContext] Scanning packages from WEB-INF/classes and jars: [br.com.bronx.vraptor.restrictrex]
14:42:34,366 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]
14:42:34,740 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@16b321b: defining beans [defaultMultipartConfig,defaultDeserializers,asmBasedTypeCreator,defaultConverters,paranamerNameProvider,pathAnnotationRoutesParser,encodingHandlerFactory,noRoutesConfiguration,objenesisProxifier,defaultTypeNameExtractor,defaultResourceNotFoundHandler,defaultMethodNotAllowedHandler,emptyElementsRemoval,defaultAcceptHeaderToFormat,defaultRouter,XStreamXMLDeserializer,defaultInterceptorRegistry,defaultRoutes,defaultTypeFinder,defaultResourceTranslator,stereotypeHandler,converterHandler,interceptorStereotypeHandler,deserializesHandler,stereotypedBeansRegistrar,defaultSpringLocator,multipartInterceptor,forwardToDefaultViewInterceptor,instantiateInterceptor,defaultStatus,executeMethodInterceptor,defaultValidator,defaultPathResolver,jstlLocalization,ognlParametersProvider,defaultPageResult,flashInterceptor,parametersInstantiatorInterceptor,defaultValidationViewsFactory,downloadInterceptor,interceptorListPriorToExecutionExtractor,deserializingInterceptor,XStreamJSONSerialization,defaultLogicResult,defaultHttpResult,XStreamXMLSerialization,applicationConfiguration,defaultResult,defaultRefererResult,outjectResult,defaultMethodInfo,resourceLookupInterceptor,defaultOutjector,emptyResult,defaultRepresentationResult,defaultFormatResolver,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,defaultRequestExecution,defaultInterceptorStack,generoDAO,usuarioDAO,filmeDAO,imagemDAO,loginController,filmeController,generoController,indexController,imagemController,homeController,accesControllerInterceptor,filmeLogic,imagens,usuarioLogado,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,restrictionChecker,pageHandler,org.springframework.aop.config.internalAutoProxyCreator,cacheBasedTypeCreator]; root of factory hierarchy
14:42:35,054 INFO [DefaultConverters ] Registering bundled converters
14:42:35,180 INFO [RouteBuilder ] /login/adiciona --> public void br.com.bruno.jmovie.controller.LoginController.adiciona(br.com.bruno.jmovie.model.Usuario)
14:42:35,181 INFO [RouteBuilder ] /login/autentica --> public void br.com.bruno.jmovie.controller.LoginController.autentica(br.com.bruno.jmovie.model.Usuario)
14:42:35,182 INFO [RouteBuilder ] /login/logout --> public void br.com.bruno.jmovie.controller.LoginController.logout()
14:42:35,187 INFO [RouteBuilder ] /login --> public void br.com.bruno.jmovie.controller.LoginController.loginUsuario()
14:42:35,187 INFO [RouteBuilder ] /usuario --> public void br.com.bruno.jmovie.controller.LoginController.novo()
log4j:WARN No appenders could be found for logger (br.com.bronx.vraptor.restrictrex.startup.PageHandler).
log4j:WARN Please initialize the log4j system properly.
14:42:35,244 INFO [RouteBuilder ] /filme/adiciona --> public void br.com.bruno.jmovie.controller.FilmeController.adiciona(br.com.bruno.jmovie.model.Filme)
14:42:35,244 INFO [RouteBuilder ] /filme/lista --> public void br.com.bruno.jmovie.controller.FilmeController.lista()
14:42:35,247 INFO [RouteBuilder ] /filme/edita --> public void br.com.bruno.jmovie.controller.FilmeController.edita(java.lang.Integer)
14:42:35,247 INFO [RouteBuilder ] /filme --> public void br.com.bruno.jmovie.controller.FilmeController.formulario()
14:42:35,248 INFO [RouteBuilder ] /filme/altera --> public void br.com.bruno.jmovie.controller.FilmeController.altera(br.com.bruno.jmovie.model.Filme)
14:42:35,249 INFO [RouteBuilder ] /filme/remove --> public void br.com.bruno.jmovie.controller.FilmeController.remove(java.lang.Integer)
14:42:35,251 INFO [RouteBuilder ] /genero/adiciona --> public void br.com.bruno.jmovie.controller.GeneroController.adiciona(br.com.bruno.jmovie.model.Genero)
14:42:35,252 INFO [RouteBuilder ] /genero/lista --> public java.util.List br.com.bruno.jmovie.controller.GeneroController.lista()
14:42:35,252 INFO [RouteBuilder ] /genero --> public void br.com.bruno.jmovie.controller.GeneroController.formulario()
14:42:35,253 INFO [RouteBuilder ] /genero/remove --> public void br.com.bruno.jmovie.controller.GeneroController.remove(java.lang.Long)
14:42:35,254 INFO [RouteBuilder ] /index/lista --> public void br.com.bruno.jmovie.controller.IndexController.lista()
14:42:35,255 INFO [RouteBuilder ] /index --> public void br.com.bruno.jmovie.controller.IndexController.index()
14:42:35,301 INFO [RouteBuilder ] /filme/{filme.id}/imagem --> public void br.com.bruno.jmovie.controller.ImagemController.upload(br.com.bruno.jmovie.model.Filme,br.com.caelum.vraptor.interceptor.multipart.UploadedFile)
14:42:35,305 INFO [RouteBuilder ] /filme/{filme.id}/imagem --> public java.io.File br.com.bruno.jmovie.controller.ImagemController.download(br.com.bruno.jmovie.model.Filme)
14:42:35,309 INFO [RouteBuilder ] /home --> public void br.com.bruno.jmovie.controller.HomeController.home()
14:42:35,318 INFO [VRaptor ] VRaptor 3 successfuly initialized
17/04/2010 14:42:35 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
17/04/2010 14:42:35 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
17/04/2010 14:42:35 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/68 config=null
17/04/2010 14:42:35 org.apache.catalina.startup.Catalina start
INFO: Server startup in 4593 ms
Pelo que li no site da Caelum, esse provider já existe, basta apenas injetar o contexto dele no web.xml, foi feito.
Iniciei o server mas não criou nada. Olhei dentro de WEB-INF/classes e não têm nada. =/
O persistence.xml fica dentro ou fora da /src?