我必须在我最初没有开发的应用程序中引入一些更改。
它使用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>
如果您需要更多配置或来源告诉我。
答案 0 :(得分:0)
错误日志在这种情况下很明显,
org.hibernate.HibernateException: Errors in named queries: dameTipoRelacion,.....
因此,请解决此错误,深入查看所有已命名的查询,并验证所有named queries
是否合适。