-->
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.  [ 1 post ] 
Author Message
 Post subject: use of Hibernate in JBoss without JNDI datasource
PostPosted: Mon Apr 18, 2005 3:42 pm 
Newbie

Joined: Mon Apr 18, 2005 3:20 pm
Posts: 1
Hibernate version: 2.1.8
JBoss version: 4.0.0

Hi,


I'm trying, in a web application, to programmatically configure the Hibernate properties, so that I can determine the database URL according to the host I'm running on.
The association is performed through a properties file present in the .war file.

The goal is to have the same configuration code working in J2EE and J2SE environments.

My problem is the following: if, in the JBoss environment, I only add the jdbc driver (for Oracle 9.2.0.6) to the war file, I get an exception raised on the first call to Session.beginTransaction() saying that no suitable driver can be found.
I could remote debug JBoss, so I know that the configuration properties are set the way I want them.
I also tried the following: added the Oracle driver jar into the <jboss>/server/default/lib folder, and the problem went away.
My analysis is that the hibernate classes are loaded in a separate class loader (probably a parent of the web app classloader), so the content of the war file is not visible to them. Do you confirm that?

However there is a catch in my situation (actually 2 catches):
- I am not allowed to deploy the jdbc driver jar in JBoss in the QA and production environment
- we need to have those jars in our war file since we use the Oracle OCI jdbc driver, which requires the Oracle client to be installed on the same machine, and of course jdbc drivers for different versions of the client are not compatible.

I would rather avoid having to configure several dastasources in JBoss, which would be wasteful since I'd only use one per instance.

Do you have any alternative approach that you think I might try?
Thank you very much for your time,

-Laurent


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

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.