Programación General > Java
Problema de inicio de .war con Tomcat bajo Spring
(1/1)
madtyn:
Hola, soy nuevo en este foro y como andaba buscando solución a mi problema y no la encuentro, ví un caso parecido al mío en este foro y pensé que igual aquí sí había gente que pudiera ayudarme.
He posteado aquí en el subforo Java porque dicho otro caso tambien estaba aquí, espero no haberme equivocado.
La cuestión es que he desarrollado una aplicación web con Maven2, Java, Hibernate, Spring y Tapestry (SO Ubuntu). Sucede que corriendo con maven2 y Jetty todo funciona de perlas, pero a la hora de empaquetar el .war y correrlo en Tomcat (6.0.20)...
El tomcat de repositorio no dejaba correr el manager, así que bajé el de la web y eso bien. Pero al iniciar la aplicación da los errores que os adjunto más abajo.
Como estoy siguiendo un ejemplo de un profesor, no sé bien donde está el fallo, aunque todo apunta a que hay un problema con un nombre JNDI. Así que estoy en un punto que no sé si el problema es de Spring por definir mal el datasource, de Tomcat por tener algo mal configurado o incluso de Hibernate (aunque me parecería un poco más raro) por que los datos salen proporcionados por Hibernate.
Os adjunto mis ficheros de configuracion de Spring (tampoco sé si el fichero de spring del test no estará interfiriendo), de Hibernate y el pom.xml de Maven2.La parte del test no la meto porque creo, quiero y espero que no tenga nada que ver. Los logs de Tomcat (que he intentado acortar y poner un poco más legibles) los he puesto en este post.
PD: Tambien sale un mensaje al principio de amd64 porque mi portatil es de 64 bits, ¿podría tener que ver?
catalina.out:
--- Código: Text --- 17-sep-2009 16:56:24 org.apache.catalina.core.AprLifecycleListener initINFO: La biblioteca nativa de Apache Tomcat basada en ARP que permite un rendimiento óptimo en entornos de desarrollo no ha sido hallada en java.library.path: /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.10/jre/../lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib17-sep-2009 16:56:24 org.apache.coyote.http11.Http11Protocol initINFO: Inicializando Coyote HTTP/1.1 en puerto http-808017-sep-2009 16:56:24 org.apache.catalina.startup.Catalina loadINFO: Initialization processed in 1393 ms17-sep-2009 16:56:24 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener createMBeansGRAVE: Exception processing Global JNDI Resourcesjavax.naming.NamingException: Cannot create resource instance at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:143) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) at org.apache.naming.NamingContext.lookup(NamingContext.java:793) [Os ahorro el largo stacktrace] 17-sep-2009 16:56:24 org.apache.catalina.core.StandardService startINFO: Arrancando servicio Catalina17-sep-2009 16:56:24 org.apache.catalina.core.StandardEngine startINFO: Starting Servlet Engine: Apache Tomcat/6.0.2017-sep-2009 16:56:25 org.apache.catalina.startup.HostConfig deployWARINFO: Despliegue del archivo pojo-minibank.war de la aplicación web17-sep-2009 16:56:27 org.apache.catalina.core.StandardContext startGRAVE: Error listenerStart17-sep-2009 16:56:27 org.apache.catalina.core.StandardContext startGRAVE: Falló en arranque del Contexto [/pojo-minibank] debido a errores previos17-sep-2009 16:56:27 org.apache.catalina.startup.HostConfig deployWARINFO: Despliegue del archivo pfc-gimnasio.war de la aplicación web17-sep-2009 16:56:29 org.apache.catalina.core.StandardContext startGRAVE: Error listenerStart17-sep-2009 16:56:29 org.apache.catalina.core.StandardContext startGRAVE: Falló en arranque del Contexto [/pfc-gimnasio] debido a errores previos17-sep-2009 16:56:30 org.apache.coyote.http11.Http11Protocol startINFO: Arrancando Coyote HTTP/1.1 en puerto http-808017-sep-2009 16:56:30 org.apache.jk.common.ChannelSocket initINFO: JK: ajp13 listening on /0.0.0.0:800917-sep-2009 16:56:30 org.apache.jk.server.JkMain startINFO: Jk running ID=0 time=0/93 config=null17-sep-2009 16:56:30 org.apache.catalina.startup.Catalina startINFO: Server startup in 5468 ms
localhost.2009-09-17:
--- Código: Text --- 17-sep-2009 16:56:26 org.apache.catalina.core.ApplicationContext logINFO: Initializing Spring root WebApplicationContext17-sep-2009 16:56:27 org.apache.catalina.core.StandardContext listenerStartGRAVE: Excepción enviando evento inicializado de contexto a instancia de escuchador de clase org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Cannot create resource instance at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) [Otro laaargo stacktrace] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Cannot create resource instance Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Cannot create resource instance Caused by: javax.naming.NamingException: Cannot create resource instance 17-sep-2009 16:56:27 org.apache.catalina.core.ApplicationContext logINFO: Closing Spring root WebApplicationContext17-sep-2009 16:56:27 org.apache.catalina.core.ApplicationContext logINFO: Initializing Spring root WebApplicationContext17-sep-2009 16:56:29 org.apache.catalina.core.StandardContext listenerStartGRAVE: Excepción enviando evento inicializado de contexto a instancia de escuchador de clase org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Cannot create resource instance Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Cannot create resource instance Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-config.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Cannot create resource instance Caused by: javax.naming.NamingException: Cannot create resource instance 17-sep-2009 16:56:29 org.apache.catalina.core.ApplicationContext logINFO: Closing Spring root WebApplicationContext17-sep-2009 16:56:30 org.apache.catalina.core.ApplicationContext logINFO: ContextListener: contextInitialized()17-sep-2009 16:56:30 org.apache.catalina.core.ApplicationContext logINFO: SessionListener: contextInitialized()
Navegación
Ir a la versión completa