Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!

David Ratliff

Greenhorn
+ Follow
since Jul 09, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by David Ratliff

Hello,

I am working on migrating an older project to use Spring 3 and Hibernate 4. We did use the HibernateTemplate to access the database.
Since HibernateTemplate is deprecated, I using the Session Factory directly and Hibernate Transaction Manager.
I have gone through numerous examples and everything looks good to me. But I keep getting and error when I call my method that get's the current session.

Here is the error, I don't have an stack trace that relates to this error but I can provide what it does dump.

org.hibernate.HibernateException: No Session found for current thread






My applicationConfiguration.xml



my Controller:




my DAO:



I have commented out the @Transactional because when I leave it in, c3p0 fails and my service won't even start. I know it is some configuration that I am missing or have understood incorrectly.

Please let me know if you need more information. Any help is greatly appreciated.

Thank you,

Dave
8 years ago
Thank you Mark. I have been reading about that. I am refactoring my code to use the session factory.

9 years ago
Thank you Bill. That worked. Now on to another problem. Believe it or not, this was working with an older version of Spring. I have moved it to the latest version of Spring, Hibernate and Spring-ws.

The error I am getting (research appears that it might be a Spring/hibernate conflict, I have set my version information in the pom.xml)




Error:



Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class is the problem I believe.


applicationConfiguration.xml/test-applicationConfiguration.xml






SearchDAOImpl.java





Again, thank you everyone for the help and patience. I know it is probably a configuration issue but I am just not seeing it.

Dave
9 years ago
Here are the code snippets....

applicationContext.xml



test-applicationContext.xml



NameSearchEnpoint Class



NameSearchEnpoint Test Class



Please let me know if I should post more.

Thank you,

Dave
9 years ago
Hello Everyone,

I am have been working on a project and have converted it from Spring Services 1.5.6 to 2.0. I am using JAXB to generate types from NIEM Schemas. I am getting an error when I test. If I don't have any test classes it generates the WSDL with no problems and appears to work.

Has anyone seen this problem and what am I missing?

Here is the error message.



My confusion is from this in the error: org.companyname.jailroster.ws.NameSearchEndpoint.jailRosterImpl. Why does it nest it under my endpoint?
It should be org.companyname.jailroster.business.JailRosterImpl

To add another level of complication I have a statement in my POM.xml to force the NIEM schemas to generate classes in a specific location.



Any help or insight would be greatly appreciated.

Thank you,

Dave
9 years ago
Hello Everyone,

I am working on my first Hibernate project and I am having some problems that I just cannot figure out.

I have a simple DAO that calls a hibernate template. I have 2 classes that I use a join to link. I have made similar tests work using MS-SQL.
I would like to know if anyone has any experience working with Sybase ASE 15.0 and the JTDS driver or the jConnect Driver.

Is it my code? My understanding (am I missing something)? Or is this just a problem?

Edit: Helps when you add the error message

Error Message:

2010-07-01 08:09:42,011 [tomcat-http--2] ERROR org.hennepinsheriff.jailroster.dao.SearchDAOImpl.nameSearch(SearchDAOImpl.java:311) - Error Logging: org.springframework.orm.hibernate3.HibernateQueryException: Book.bookInfo is not mapped [ from org.hennepinsheriff.jailroster.business.Book, Book.bookInfo as i where Book.booknum = i.booknum and i.bookDate >= ?]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Book.bookInfo is not mapped [ from org.hennepinsheriff.jailroster.business.Book, Book.bookInfo as i where Book.booknum = i.booknum and i.bookDate >= ?]


DAO snippet:



Book Class



Book Info Class


Any help is greatly appreciated.

Thank you

Dave
Welcome Jeff.
11 years ago