-->
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.  [ 2 posts ] 
Author Message
 Post subject: JNDI lookup of SessionFactory fails in Websphere cluster
PostPosted: Sat Oct 22, 2016 4:33 am 
Newbie

Joined: Sat Oct 22, 2016 4:18 am
Posts: 1
Hi,
I sometimes get a ClassCastException when looking up a SessionFactory from JNDI in a Websphere cluster. It seems the Reference object is obtained from another node in the cluster and the UUID instance does not match with any SessionFactory in the current JVM.

Going through the SessionFactoryImpl, the getReference method is implemented as:
Code:
   public Reference getReference() {
      // from javax.naming.Referenceable
      LOG.debug( "Returning a Reference to the SessionFactory" );
      return new Reference(
            SessionFactoryImpl.class.getName(),
            new StringRefAddr("uuid", getUuid()),
            SessionFactoryRegistry.ObjectFactoryImpl.class.getName(),
            null
      );
   }


The SessionFactory name is not used in this Reference.

On Websphere I get the error:
Code:
NMSV0609W: A Reference object looked up from the context "<cluster name>" with the name "<session factory name>" was sent to the JNDI Naming Manager and was returned unprocessed. Reference data follows:
Reference Factory Class Name: org.hibernate.internal.SessionFactoryRegistry$ObjectFactoryImpl
Reference Factory Class Location URLs: <null>
Reference Class Name: org.hibernate.internal.SessionFactoryImpl
Type: uuid
Content: 95378527-0b22-4bd2-a143-69b8560a9b36


The InitialContext.lookup() call returns the Reference causing a ClassCastException when casting to a SessionFactory.

I use 4.2.7 in production, but this code is also present in the latest code from GitHub.

Is there anyone who has faced this issue and resolved it? As I mentioned before, this error is intermittent.

Thanks,
Deepu


Top
 Profile  
 
 Post subject: Re: JNDI lookup of SessionFactory fails in Websphere cluster
PostPosted: Sat Oct 22, 2016 2:15 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
This seems like an issue in WebSphere. Have you tried asking this question on StackOverflow or WebSphere forum as well?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.