由于启动错误,无法部署Spring,Struts 2和Hibernate webapp

时间:2011-11-24 16:43:37

标签: hibernate spring struts2

我必须在我最初没有开发的应用程序中引入一些更改。

它使用Maven。当我在执行mvn install后尝试部署时,出现以下错误:

Error creating bean with name 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor': 
Cannot create inner bean '(inner bean)' of type [org.springframework.transaction.interceptor.TransactionInterceptor] 
while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'transactionManager' 
while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'transactionManager' defined in class path resource [applicationContext.xml]: 
Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' 
defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException:
org.hibernate.HibernateException: Errors in named queries: 
dameTipoRelacion, consultaPerfil, consultaOrganizacionPorPadre, obtenerDepartamentos, consultaOrganizacionPorPadreYNivel, 
consultaOrganizacionNivel, consultaGruposRelacion, consultaRelaciones, obtenerDepartamentosSC, dameGrupo, dameDepartamento

我的persistence.xml是:

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0">
    <persistence-unit name="punit">
    </persistence-unit>
</persistence>

如果您需要更多配置或来源告诉我。

1 个答案:

答案 0 :(得分:0)

错误日志在这种情况下很明显,

org.hibernate.HibernateException: Errors in named queries: dameTipoRelacion,.....

因此,请解决此错误,深入查看所有已命名的查询,并验证所有named queries是否合适。