Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

class retunring nullPointerException??

Thread view: 
elh.maayan@gmail.com - 20 Apr 2007 09:55 GMT
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).
Thomas Fritsch - 20 Apr 2007 12:08 GMT
[...]
> 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(ja
va.lang.Class
)>

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

Signature

Thomas

elh.maayan@gmail.com - 20 Apr 2007 16:40 GMT
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)
Thomas Fritsch - 20 Apr 2007 18:14 GMT
> i'm sorry i meant throws null..
>
[quoted text clipped - 16 lines]
>   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.

Signature

Thomas

elh.maayan@gmail.com - 21 Apr 2007 22:41 GMT
anyway to fix this?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.