Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0'

<>

This question already has an answer here:

Answers


The error states,

"Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation."

so, you either need to use the Spring Java agent to start your JVM, or need to disable the InstrumentationLoadTimeWeaver.

See, How to configure EclipseLink 2.0 and Spring 3.0.5 and Tomcat 6?

For JPA weaving with EclipseLink, you can also use the static weaver, then no agent or instrumentation is required.


To help others with this issue,

I have he same problem after including some of the APIS thst uses later Spring (3.x.) versions to the existing project.

My application was started up successfully in one machine but failed on another machine. After investigating carefully we found this,

On the machine it was failing, the PersistenceExceptionTranslationPostProcessor was loaded from spring-dao-2.0.8.jar [Loaded org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor from file:/lib/spring-dao-2.0.8.jar]

Where as on the other machine it was loaded from spring-tx-3.1.1.RELEASE.jar [Loaded org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor from file:/lib/spring-tx-3.1.1.RELEASE.jar]

Then I tried removing the spring-dao-2.0.8.jar from the class-path and tried, it worked. spring-dao-2.0.8.jar was an unnecessary dependency.

Regards Lyju


Need Your Help

Add and populate a 'property' to tracked Mixpanel (mixpanel.com) events

python analytics mixpanel

Is there a Mixpanel-API to add and populate a 'property' to all the 'events' of a particular type. This, I want to do every day, via a cronjob, for all the matching events for the previous day.

delphi component with a collection of TPictures

delphi vcl

I'm trying to create a VCL component like TImage, that lets me add a variable amount of different sized TPictures.