-->
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: CLassNotFoundException:WebsphereTransactionManagerLookup
PostPosted: Sat Dec 20, 2003 5:26 am 
Hi,
I am trying to deploy an ear file ( developed on JBoss) on Websphere 5.1
appserver. I have to use this latest version of 5.1 since the application
uses jdk1.4.1 apis.
The application uses hibernate for data access. I have successfully deployed
the appication on Weblogic 8.1 appserver. Currently when I try deploying on
Websphere appserver, I am getting some problems. I have given below the
details, pls go through and suggest me some solutions. This error has become
ShowStopper, the application server shuts down whenever it encounters this
error.


I wanted to create hibernate session. For creating session, since I need an
instance of hibernate Session Factory, I am using the below code for
creating the instance of SessionFactory. I am getting an error while
creating the instance of Session Factory itself.

net.sf.hibernate.cfg.Configuration config= new
net.sf.hibernate.cfg.Configuration();
config.setProperty("hibernate.transaction.manager_lookup_class","net.sf.hibe
rnate.transaction.WebsphereTransactionManagerLookup");
config.setProperty("hibernate.connection.provider_class","net.sf.hibernate.c
onnection.DatasourceConnectionProvider");
config.setProperty("hibernate.connection.datasource","jdbc/DataSourceName")
config.setProperty("hibernate.show_sql","false");
config.setProperty("hibernate.dialect","net.sf.hibernate.dialect.MicrosoftSQ
LServerDialect");

After this I am adding some of my user defined classes (actually java beans)
using config.addClass() method.

net.sf.hibernate.Session session =
config.buildSessionFactory().openSession(new ClassY())
//this classY implements net.sf.hibernate.Interceptor.


I am getting an ClassNotFoundException error. I am getting this error
inspite of adding hibernate2.jar in the classpath(I did copy the same jar
file under appserver/lib folder also). I did modify the ws.ext.dirs
classpath to include the jar file.

I have pasted the error below . Please let me know what could be the
problem. If possible, please suggest some alternate approach to fix this
problem. Also, if you know any examples of Hibernate implementation for
latest websphere appserver, please let me know. When I deploy the same
code on Weblogic by using WeblogicTransactionManagerLookup instead of
WebsphereTransactionManagerLookup, I did not get any error.

Internally, Hibernate Api (inside ReflectHelper of net.sf.hibernate.util
package) uses the below code for getting an instance of
WebsphereTransactionManagerLookup.
Class cls= Thread.currentThread().getContextClassLoader().loadClass(name);
name is string variable of value
"net.sf.hibernate.transaction.WebsphereTransactionManagerLookup";

I am not sure whether this is the problem with the class loader. Let me
whether any explicit settings need to be done for this.

[12/19/03 22:17:18:088 IST] 2aa310e4 TransactionMa I
net.sf.hibernate.transaction.TransactionManagerLookupFactory instantiating
TransactionManagerLookup:
net.sf.hibernate.transaction.WebsphereTransactionManagerLookup
[12/19/03 22:17:18:108 IST] 2aa310e4 TransactionMa E
net.sf.hibernate.transaction.TransactionManagerLookupFactory Could not
instantiate TransactionManagerLookup
[12/19/03 22:17:18:158 IST] 2aa310e4 TransactionMa E
net.sf.hibernate.transaction.TransactionManagerLookupFactory TRAS0014I: The
following exception was logged java.lang.ClassNotFoundException:
net.sf.hibernate.transaction.WebsphereTransactionManagerLookup
at java.net.URLClassLoader.findClass(URLClassLoader.java(Compiled
Code))
at
com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java(Compiled
Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java(Compiled Code))
at
net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:73)
at
net.sf.hibernate.transaction.TransactionManagerLookupFactory.getTransactionM
anagerLookup(TransactionManagerLookupFactory.java:41)
at
net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:66)
at
net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1023)
at
net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:71
6)


Top
  
 
 Post subject:
PostPosted: Sun Dec 21, 2003 9:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Its looks like a spelling mistake to me. The class is:
net.sf.hibernate.transaction.WebSphereTransactionManagerLookup

Note: the capital S in Sphere.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 23, 2003 3:36 am 
david wrote:
Its looks like a spelling mistake to me. The class is:
net.sf.hibernate.transaction.WebSphereTransactionManagerLookup

Note: the capital S in Sphere.


thanks, that was the problem


Top
  
 
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.