class retunring nullPointerException??

E

elh.maayan

hi..
we have a homegrown Web Framework, which lives in jboss, each time we
update our code application coe via ant script ,the framework stops
and starts jboss, anong the procedures to start jboss is a loading up
hbm files with hibernate spring orm, problem is, when start the server
the second time, we get a nullPointerException when attempting to map
one of the classes. we traced it down to hibernate mapping a class
which was meant to store OracleBlob, in one of it's code hibernate
uses:

EnumeratedType.class.isAssignbleFrom(..)

however the class property returns nullPointerException!!, hos is that
possible ? (EnumeratedType is an interface).
 
T

Thomas Fritsch

EnumeratedType.class.isAssignbleFrom(..)

however the class property returns nullPointerException!!,
You mean "*throws* NullPointerException", don't you?
hos is that possible ? (EnumeratedType is an interface).
Carefully read the API doc of Class#isAssignableFrom
<http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html#isAssignableFrom(java.lang.Class)>

There you'll find, that the method-call isAssignableFrom(cls) throws a
NullPointerException, if cls is null.
 
E

elh.maayan

i'm sorry i meant throws null..

what you said makes sense, BUT i didn't say isAssignableFrom throws
it, i said that doing in eclipse a watch expression
'PersistentEnum.class',
THAT throws an exception.

look at the stack trace, the isAssignableFrom is in line 168, i had
brake point there, and tried the watch expression.

java.lang.NullPointerException
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:
143)
at
org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoade
at
org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.j
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at net.sf.hibernate.type.TypeFactory.class$(TypeFactory.java:
71)
at
net.sf.hibernate.type.TypeFactory.heuristicType(TypeFactory.java:168)
 
T

Thomas Fritsch

i'm sorry i meant throws null..

what you said makes sense, BUT i didn't say isAssignableFrom throws
it, i said that doing in eclipse a watch expression
'PersistentEnum.class',
THAT throws an exception.

look at the stack trace, the isAssignableFrom is in line 168, i had
brake point there, and tried the watch expression.

java.lang.NullPointerException
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:143)
at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoade
at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.j
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at net.sf.hibernate.type.TypeFactory.class$(TypeFactory.java:71)
at net.sf.hibernate.type.TypeFactory.heuristicType(TypeFactory.java:168)
Looking at your stack trace (especially its top lines) it seems the
NullPointerException is caused by a bug in JBoss's classloader.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top