-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate + Websphere 7 strange problem
PostPosted: Sun Sep 04, 2011 10:33 am 
Newbie

Joined: Sun Sep 04, 2011 10:26 am
Posts: 4
Hello, I am using Hibernate 3.6.5 and I'm facing a very strange problem, with IBM Websphere.

The server I'm using is Websphere 7.0.0.13 with JPA 2 feature-pack version 1.0.0.3, and I configured the server to use parent-last class loader as the IBM JPA 2.0 documentation stated. The DB server is MS SQL-Server 2008. Entities mapped by annotations.

Deployment goes fine, and here is the tricky part: On one Websphere I get an exception: QuerySyntaxException: Entity is not mapped [SELECT a FROM Entity a WHERE a.Id = :Id]

On another Websphere, with exactly the same specs, exactly the same installation process, exactly same computer model, exactly the same ear file.. all goes well - no exception and persistence is working great.

I compared the drivers (SQLJDBC4), all the paths, the data-sources settings, even tried the same DB - nothing. I also deployed it on another application server (Glassfish 3.1), and it works just fine.

I have no clue...

Please help.

Best regards.


Top
 Profile  
 
 Post subject: Re: Hibernate + Websphere 7 strange problem
PostPosted: Sun Sep 04, 2011 5:48 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
looks like a classloading issue: a possible difference between the two cases is the order in which the applications where initialized, an so from where the classes where loaded. If that's the case, then it's an application server misconfiguration or bug.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate + Websphere 7 strange problem
PostPosted: Mon Sep 05, 2011 1:29 am 
Newbie

Joined: Sun Sep 04, 2011 10:26 am
Posts: 4
I'm completely positive that it is a Websphere bug - as I mentioned, it works fine on another Websphere and on Glassfish app server. I was hopping maybe someone here would know how to fix it.

IBM protocol for configuring third-party JPA 2.0 vendors does include a class-loading change, and I set it to "Parent-last", exactly as they specified.

I found that if I list all my entities in my persistence.xml file like this:<class>com.package.Entitiy</class>
it works well and everything is mapped, but I think all my entities should be mapped even without the persistence <class> tag, automatically through deployment.

Do you have an idea?

Thank you all.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.