Hi,
I am getting this when running HIbernate objects under JBoss as a MBean:
java.lang.ClassCastException: cannot assign instance of net.sf.hibernate.proxy.SerializableProxy to field com.db.device.NetPortalSubnetwork.network of type com.db.device.NetPortalNetwork in instance of com.db.device.NetPortalSubnetwork
If I run the same code outside of JBoss everything works fine !
pls help,
TIA,
--steve p.
(mappings)
Code:
<class name="com.db.device.NetPortalSubnetwork" table="subnet" mutable="true" polymorphism="implicit" dynamic-update="false" dynamic-insert="false" proxy="com.db.device.NetPortalSubnetwork">
<id name="id" type="long" unsaved-value="0">
<generator class="native">
</generator>
</id>
<property name="name" column="name" type="string"/>
<property name="description" column="description" type="string"/>
<many-to-one name="network" class="com.db.device.NetPortalNetwork" column="net_subnet_id"/>
<set name="mgmtInfo" table="ne_subnet" inverse="true" lazy="false">
<key column="subnet_id"/>
<many-to-many class="com.db.device.NEMgmtInfo" column="ne_subnet"/>
</set>
<set name="ems" table="subnet_ems" inverse="true" lazy="false">
<key column="ems_id"/>
<many-to-many class="com.db.device.Ems" column="ne_subnet"/>
</set>
<property name="netPortalControlled" type="boolean"/>
<property name="layerNumber" type="int"/>
<property name="topologyType" type="com.db.device.TopologyEnum"/>
<property name="technologyType" type="com.db.qos.DomainType"/>
<many-to-one name="moHistory" class="com.db.device.MOHistory" cascade="all"/>
</class>
and
Code:
<class name="com.db.device.NetPortalNetwork" table="network" mutable="true" polymorphism="implicit" dynamic-update="false" dynamic-insert="false" proxy="com.db.device.NetPortalNetwork">
<id name="id" type="long" unsaved-value="0">
<generator class="native">
</generator>
</id>
<!--property name="name" column="name" type="string"/-->
<many-to-one name="netName" class="com.db.device.NEName" column="net_name" cascade="all"/>
<property name="description" column="description" type="string"/>
<set name="subnet" cascade="all-delete-orphan" inverse="true" lazy="true">
<key column="net_subnet_id"/>
<one-to-many class="com.db.device.NetPortalSubnetwork"/>
</set>
<set name="sites" cascade="all-delete-orphan" inverse="true" lazy="true">
<key column="net_site_id"/>
<one-to-many class="com.db.device.NetPortalSite"/>
</set>
<set name="pools" cascade="all-delete-orphan" lazy="true">
<key column="pool_info_id"/>
<one-to-many class="com.db.device.NetPortalPoolInfo"/>
</set>
<set name="ems" cascade="all-delete-orphan" lazy="true">
<key column="net_ems_id"/>
<one-to-many class="com.db.device.Ems"/>
</set>
<set name="networkElements" inverse="false" lazy="true">
<key column="network_ne_id"/>
<one-to-many class="com.db.device.NEMgmtInfo"/>
</set>
<many-to-one name="moHistory" class="com.db.device.MOHistory" cascade="all"/>
</class>