-->
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.  [ 9 posts ] 
Author Message
 Post subject: IllegalArgumentException with joined subclasses in 2.1 final
PostPosted: Mon Dec 15, 2003 11:24 am 
Beginner
Beginner

Joined: Fri Aug 29, 2003 4:26 am
Posts: 26
Location: Germany, Dortmund
Hi,
I have created a structure like: User extends Actor, Group Extends User.
Actors can have Permissions (See below the hbm.xml).
While adding a permission to a user or group I get the IllegalArgumentException during commit().
In BasicPropertyAccessor.java[96] I can see, that Hibernate tries to execute getId() on the target Permission but methods contains the clazz Actor?!
In 2.0.2 this code was running.


Code:
<hibernate-mapping>
  <class name="com.ssn.acx.api.persistence.collections.Actor" table="TestJActor" dynamic-update="true">
    <id name="id" column="id" type="long">
      <generator class="native">
        <param name="sequence">TestJActorSEQ</param>
      </generator>
    </id>
    <property name="name" type="string" not-null="true" unique="true"/>
    <set name="permissions" table="act_perm">
      <key column="permission_id"/>
      <many-to-many column="actor_id" class="com.ssn.acx.api.persistence.collections.Actor"/>
    </set>
    <joined-subclass name="com.ssn.acx.api.persistence.collections.User" table="TestUser" dynamic-update="true">
      <key column="actor_id"/>
      <property name="firstname" type="string" not-null="true"/>
      <set name="groups" lazy="true" table="user_groups">
           <key column="user_id"/>
           <many-to-many column="group_id" class="com.ssn.acx.api.persistence.collections.Group"/>
      </set>
    </joined-subclass>
    <joined-subclass name="com.ssn.acx.api.persistence.collections.Group" table="TestGroup" dynamic-update="true">
      <key column="actor_id"/>
      <property name="description" type="string"/>
      <set name="users" table="user_groups">
        <key column="group_id"/>
        <many-to-many column="user_id" class="com.ssn.acx.api.persistence.collections.User"/>
      </set>
    </joined-subclass>
  </class>
  <!--    Permission mappings  -->
  <class name="com.ssn.acx.api.persistence.collections.Permission" table="TestJPermission">
    <id name="id" column="id" type="long">
      <generator class="native">
        <param name="sequence">PermissionSEQ</param>
      </generator>
    </id>
    <property name="name" type="string" not-null="true" unique="true"/>
    <property name="description" type="string"/>
  </class>
</hibernate-mapping>

_________________
Bye
Kai


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2003 11:27 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is a FAQ

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2003 12:01 pm 
Beginner
Beginner

Joined: Fri Aug 29, 2003 4:26 am
Posts: 26
Location: Germany, Dortmund
Sorry if I haver overlooked it, but I have found in the FAQ and forum two issues about IllegalAccessError one during configuration Hibernate and one with Tomcat.
I am working without Tomcat and the configuration is fine.
Do you mean one of these or another which I have not found.

_________________
Bye
Kai


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2003 12:41 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
http://www.hibernate.org/74.html#A3
http://www.hibernate.org/74.html#A4

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2003 8:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I'm not sure that this is the thing mentioned in the FAQ. If you are truly certain that you have something that worked in 2.0.2 and it doesn't work in 2.1, then please submit a very simple main() method to JIRA so that I can reproduce the problem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2003 8:55 am 
Beginner
Beginner

Joined: Fri Aug 29, 2003 4:26 am
Posts: 26
Location: Germany, Dortmund
I have done some tests with this problem. It seems to be a problem with Hibernate and the log4j XML configuration.
I have added the Jira issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-557

_________________
Bye
Kai


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2003 9:15 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Code:
    <set name="permissions" table="act_perm">
      <key column="permission_id"/>
      <many-to-many column="actor_id" class="com.ssn.acx.api.persistence.collections.Actor"/>
    </set>



Should be a collection of Permission. Please be more careful.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2003 1:13 pm 
Beginner
Beginner

Joined: Fri Aug 29, 2003 4:26 am
Posts: 26
Location: Germany, Dortmund
Sorry but I do not catch you or yor comment???


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2003 1:20 pm 
Beginner
Beginner

Joined: Fri Aug 29, 2003 4:26 am
Posts: 26
Location: Germany, Dortmund
Sorry after your comment in Jira it is clear.
Im a little bit confused because of the dependency with logging.
Sorry and thanx!


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