所以我在使用Spring JPA和Hibernate来确保我的项目的依赖关系时遇到了这个问题,我的依赖关系看起来是:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
<version>1.0.2.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.5.0-Final</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jpa</artifactId>
<version>2.0.8</version>
</dependency>
我得到的最终错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor#0': 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)#14': 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 ServletContext resource [/WEB-INF/hibernate-context.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 ServletContext resource [/WEB-INF/hibernate-context.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609) ~[spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925) ~[spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472) ~[spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) ~[spring-web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) ~[spring-web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) [catalina.jar:7.0.30.A]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) [catalina.jar:7.0.30.A]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.30.A]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.30.A]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.30.A]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) [catalina.jar:7.0.30.A]
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:650) [catalina.jar:7.0.30.A]
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1582) [catalina.jar:7.0.30.A]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_09]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_09]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_09]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_09]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_09]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09]
我已经找到了所有关于消除Spring- jpa
依赖关系的解决方案,但是这样的操作导致与无法加载有关的错误persistence_1_0.xsd
。任何线索,我该如何解决?
添加对hibernateJPA2的依赖关系:
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
问题内容: 我正在为spring数据编写示例。这是我的spring.xml 这些是我pom.xml中的依赖项 我还没有使用过persistence.xml 。我正在关注异常 引起原因:java.lang.NoSuchMethodError:javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax / persistenc
问题内容: 我正在升级jpa,hibernate,spring和jdk,以启用JPA 2.1中的新功能。但是我收到以下错误: 我已经阅读了有关此内容的其他帖子,但是它们无法解决我的计算机上的错误。例如,SJuan76对此帖子的回答建议升级到jpa2.1,但是我已将eclipse jpa项目方面设置为2.1版,并且我也将其包含在pom.xml中。单击此链接,您可以在完整的pom.xml中阅读各种库的
问题内容: 我有一个Play Framework应用程序,并且正在使用Hibernate 4.2.5.Final(可通过Maven依赖管理器检索)。我决定升级到Hibernate 4.3.0.Final,成功重新编译我的应用程序,然后运行它。 我在下面有一个例外,但无法弄清楚原因。我降级到4.2.5,并且没有发生此问题。然后,我尝试在4.2.5之后的每个最终版本中升级Hibernate。也就是说,
问题内容: 我使用npm install命令反复收到npm对等依赖项错误。这是我的package.json,我对React和Webpack的对等依赖未得到满足 问题答案: 好吧,首先,这些不是错误,它们是警告。它们实际上并不会阻止您的代码运行,只是在您的依赖项有问题的情况下提醒您。 实际上,软件包是一种指定方式,“使用我,您还应该安装 y 软件包的 x 版本”。就您而言,有两个问题: __ 该版本
我正试图用Maven构建一个Java项目。我的pom。xml主要包括依赖项,其中一些依赖项有自己的可传递依赖项。 当我运行'mvn compile'时,大多数依赖项加载良好,但没有找到一些传递性依赖项,给出警告“[警告]artifact_name的POM丢失,没有可用的依赖项信息”。这导致Maven编译失败。 日志显示,已从Maven和Jboss公共存储库中搜索了依赖项。 > 在这种情况下,当没有
[错误]无法解析插件org.apache.cxf:cxf-java2ws-plugin:2.4.3-fuse-01-02或其依赖项之一:未能读取org.apache.cxf:cxf-java2ws-plugin:jar:2.4.3-fuse-01-02:无法在central(http://repo.maven.apache.org/maven2)中找到org.apache.cxf:cxf-java