-->
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.  [ 4 posts ] 
Author Message
 Post subject: HAR deployment problems
PostPosted: Mon Feb 13, 2006 8:57 am 
Newbie

Joined: Tue Mar 15, 2005 7:37 am
Posts: 16
I have a question regarding HAR deployment on jboss.

I have classes in 'some.package' mapped by a hbm.xml file in the same dir.
I also have classes in 'someother.package' that are not mapped by any hbm.xml.

Methods in the mapped classes have references to classes that are not mapped. When deploying I get Exceptions like this:

Code:
java.lang.NoClassDefFoundError: someother/package/Test
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
        at java.lang.Class.getDeclaredMethods(Class.java:1763)
        at org.hibernate.property.BasicPropertyAccessor.getterMethod(BasicPropertyAccessor.java:248)
        at org.hibernate.property.BasicPropertyAccessor.getGetterOrNull(BasicPropertyAccessor.java:228)



The 'Test' class is only used by helper methods and are never used in any getter/setter that are mapped by the hbm.xml file.

Must all classes in the HAR by mapped? Or could it be anything else that I do wrong?

Thanks,
/Magnus


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 13, 2006 8:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Not all classes have to be mapped but if you refer to a class from a mapping, such as a relationship, then it would need to be mapped also.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 14, 2006 4:37 am 
Newbie

Joined: Tue Mar 15, 2005 7:37 am
Posts: 16
The problem here is that the second class is used by a class that is mapped but not in any relationship that is mapped. Something like this:

Code:
public OtherClass getOtherClass() { ... } // This is not a hibernate property 

public int getProperty() { ... } // This is a mapped property


but when the class is scanned by the HAR-deployer it seems like the 'getOtherClass()' is picked up (even if shouldn't be) and I get the exception above even though the OtherClass is in the har-file.

Should this work or fail?

/Magnus


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 14, 2006 7:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I don't know what version (Hibermate/JBoss) you are using but I don't have this problem. The deployer should scan for hbm.xml files and use them to setup the SessionFactory. If the class in question is in the har archive then it should be a non-issue.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.