Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Object Relational Mapping and the fly likes Issue in hibernate version Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Issue in hibernate version" Watch "Issue in hibernate version" New topic

Issue in hibernate version

manjunath jonna

Joined: Dec 08, 2009
Posts: 1
I am using spring 2.5.5 and JPA (with hibernate) in my application. I am using 3.3.2 version of hibernate-entitymanager, which has dependency on hibernate 3.2.6. I want to call a stored procedure and return an output value from a stored procedure. There is a method called session.connection() in Session class which can be used to invoke stored procedure. However that method got deprecated.

As an alternative, they have provided a method Session.doWork(), but it is not available in hibernate 3.2.6. So I have updated the hibernate entity manager to 3.4.0, doWork() method is available in this version, but while running the application, I am getting the following error.

>>> 2009-12-07 16:24:24,473+0530 0 main ERROR context.TestContextManager: Caught exception while allowing TestExecutionListener [org.springframework.t] to prepare test instance [null(]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.TestContext.getApplicationContext(
at org.springframework.test.context.TestContextManager.prepareTestInstance(
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(
at org.junit.internal.runners.JUnit4ClassRunner$
at org.junit.internal.runners.ClassRoadie.runUnprotected(
at org.junit.internal.runners.ClassRoadie.runProtected(
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(
at org.apache.maven.surefire.booter.SurefireBooter.main(
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bulkController': Autowiring of fields failed; neste
d exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected
vice; nested exception is org.springframework.beans.factory.BeanCreationExcep
tion: Error creating bean with name 'orderServiceImpl': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreatio
nException: Could not autowire field: private
sistenceManager; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceManager': Inje
ction of persistence methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entit
yManagerFactory' defined in URL [file:src/main/webapp/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang
.NoClassDefFoundError: Could not initialize class org.hibernate.ejb.Ejb3Configuration

It is giving an error "Could not initialize class org.hibernate.ejb.Ejb3Configuration".

Any help would be very much appreciated.
It is sorta covered in the JavaRanch Style Guide.
subject: Issue in hibernate version
It's not a secret anymore!