db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keeney, Thomas" <Keen...@SEC.GOV>
Subject RE: Two EAR and two Torque.properties
Date Tue, 13 Jan 2004 15:13:28 GMT
If you're running a version of Torque that has codebase similar to version
3.0, I may know the issue.  In Torque version 3.0, Line 240 retrieves the
iterator for "mapBuilders", a STATIC Map.  Then Line 246 sets "mapBuilders"
to <code>null</code>.  I believe the problem is with JBoss's
UnifiedClassLoader (unified class repository).  If I am correct the scenario
would run like this:

1)  You access App1.ear, so JBoss loads Torque.class into the unified class
repository.  Torque.class initializes just fine (Line 240 retrieves the
iterator for "mapBuilders" and Line 246 sets "mapBuilders" to
<code>null</code>.
2)  You then access App2.ear.  JBoss uses Torque.class that is already in
the unified class repository, so it uses the Class instance from step #1 to
initialize Torque.  "mapBuilders" has already been set to <code>null</code>,
so when JBoss reaches line 240, a NullPointerException is thrown.

I found a problem that is similar to your's:
http://www.mail-archive.com/jboss-development@lists.sourceforge.net/msg38686
.html


Try using scoped classloaders with your EAR's JBoss deployment descriptors
to isolate each Torque instance.  Hope this helps.

Best Regards,

Tom 

-----Original Message-----
From: Mujahid Malaysia [mailto:harimaumalaya@fastmail.fm]
Sent: Monday, January 12, 2004 10:57 PM
To: torque-user@db.apache.org
Subject: Two EAR and two Torque.properties


Hi all,

I have two different J2EE applications in two .EAR in a single JBoss.
Each application is going to connect to its' own database through Torque.
So, each application has its' own Torque.properties etc.

Let's name these two applications with App1.ear and App2.ear. Now, if I
connect to App1.ear first, the db connection in App2.ear can't be
initialized. So does vice-versa.

Does that means I can't have two Torques running in two separate
applications? 

Thanks.

=============================

The error message is as follows

[LogInterceptor] TransactionRolledbackLocalException, causedBy:
java.lang.NullPointerException
        at org.apache.torque.Torque.initialize(Torque.java:240)
        at org.apache.torque.Torque.init(Torque.java:406)
        at
        com.xcompany.api.dao.DAOFactory.getInstance(DAOFactory.java:55)
        at
 
com.xcompany.security.xdoclet.security.bean.UserMapSBean.searchUserMap(Unkno
wn
        Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)

-----------------------------
Mujahid Malaysia
"Kembalikan Keagungan Islam"

-- 
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/docs/quotes.html

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message