-->
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: JBoss and serializable datatype - classloader problems?!
PostPosted: Mon Jan 12, 2004 10:26 am 
Newbie

Joined: Tue Oct 07, 2003 3:58 pm
Posts: 16
Location: Netherlands
Hello everyone,

I tried to find something alike my problem here but failed.


The problem:
There is a class which is managed by Hibernate
And there is another class which is property of managed class. I'd like to store it as BLOB field and did the following mapping.

<class
name="OperatorSessionState"
table="OPERATOR_SESSION_STATE"
dynamic-update="false"
dynamic-insert="false"
>

<id
name="id"
column="id"
type="java.lang.String"
>
<generator class="assigned">
</generator>
</id>

<property
name="mission"
type="serializable"
update="true"
insert="true"
column="mission"
length="1000000"
/>

</class>

I deploy this thing in JBoss
Once deployed it works just fine - stores and retrieves complex 'mission' object.

BUT!

Once re-deployed, it gives me the following exception:

net.sf.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of eg.Mission>
at net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:68)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:205)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2213)
at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:216)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:111)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:663)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:678)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:57)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:49)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:429)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2122)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2000)
at net.sf.hibernate.impl.SessionImpl.internalLoadOneToOne(SessionImpl.java:1951)
at net.sf.hibernate.type.OneToOneType.resolveIdentifier(OneToOneType.java:77)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2208)
at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:216)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:111)
at net.sf.hibernate.loader.Loader.find(Loader.java:731)
at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:972)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1483)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1462)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1458)
Caused by:
java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:38)

When I restart JBoss - everything is OK again till next redeployment.

An attempt to use exact class name instead of serializable type caused the very same behavior, except that instead of java.lang.IllegalArgumentException there was ClassCastException, with that very class name.

hibernate.jar and all her libs are there in server/default/lib

Seems like there is a classloader(s) who is caching version of that class on first run and then just keeps till JBoss' death.

What shall I do to not restart Jboss on every run? Put hibernate.jar and all that she needs into my .ear?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2004 12:13 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Check out http://forum.hibernate.org/viewtopic.php?t=925534&highlight=redeploy for an answer.


Sherman


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2004 12:26 pm 
Newbie

Joined: Tue Oct 07, 2003 3:58 pm
Posts: 16
Location: Netherlands
This is not what exactly I've experienced.
I'm not using hibernate as MBean/JBoss service.

But anyway, I've solved this by putting hibernate2.jar, cglib2.jar, odmg.jar and ehcache.jar into EAR archive.

Sorry for noise I've made, but maybe someone could have this googled and would have spent an hour or two less... :)


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