Hi all, first I am new using hibernte so maybe you may excuse my stupid guestion...
I try to use a one-to-many collection between the following classes:
ScaleGroups.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="com.hoellehuettner.persistence.ScaleGroups"
table="T_SCALEGROUPS"
>
<id
name="IDScaleGroup"
column="IDSCALEGROUP"
type="integer"
>
<generator class="native">
</generator>
</id>
<set name="Scales" lazy="true">
<key column="IDSCALEGROUP" />
<one-to-many class="com.hoellehuettner.persistence.Scales" />
</set>
</class>
</hibernate-mapping>
Scales.hbm.xmlCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.hoellehuettner.persistence.Scales" table="T_SCALES">
<id name="IDScale" column="IDSCALE" type="integer">
<generator class="native">
</generator>
</id>
<property name="IDScaleGroup" type="integer">
<column name="IDSCALEGROUP" not-null="true" unique="false"/>
</property>
<property name="name" type="string">
<column name="SC_NAME" not-null="true" unique="true"/>
</property>
</class>
</hibernate-mapping>
hibernate.cfg.xmlCode:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/HSP</property>
<property name="show_sql">true</property>
<property name="use_outer_join">false</property>
<property name="jta.UserTransaction">java:comp/UserTransaction/</property>
<property name="dialect">net.sf.hibernate.dialect.SybaseDialect</property>
<!-- Mapping files -->
<mapping resource="com/hoellehuettner/persistence/Scales.hbm.xml"/>
<mapping resource="com/hoellehuettner/persistence/ScaleGroups.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Apache MessageQuote:
INFO: Jk running ID=0 time=0/16 config=E:\java\server\jakarta-tomcat-4.1.27\conf\jk2.properties
2004-06-13 11:09:55,343 INFO hibernate.cfg.Environment -> Hibernate 2.0 beta 5
2004-06-13 11:09:55,343 INFO hibernate.cfg.Environment -> loaded properties from resource hibernate.properties: {hibernate.cglib.use_refle
ction_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.SybaseDialect, hibernate.show_sql=true, hibernate.use_outer_join=true, hibe
rnate.jdbc.use_scrollable_resultset=false, hibernate.connection.datasource=java:/comp/env/jdbc/HSP}
2004-06-13 11:09:55,359 INFO hibernate.cfg.Environment -> using CGLIB reflection optimizer
2004-06-13 11:09:55,359 INFO hibernate.cfg.Environment -> JVM proxy support: true
2004-06-13 11:09:55,359 INFO hibernate.cfg.Configuration -> Configuration resource: /hibernate.cfg.xml
2004-06-13 11:09:55,421 INFO hibernate.cfg.Configuration -> Mapping resource: com/hoellehuettner/persistence/Scales.hbm.xml
2004-06-13 11:09:55,468 INFO hibernate.mapping.Collection -> Mapping class: com.hoellehuettner.persistence.Scales -> T_SCALES
2004-06-13 11:09:55,531 INFO hibernate.cfg.Configuration -> Mapping resource: com/hoellehuettner/persistence/ScaleGroups.hbm.xml
2004-06-13 11:09:55,546 INFO hibernate.mapping.Collection -> Mapping class: com.hoellehuettner.persistence.ScaleGroups -> T_SCALEGROUPS
Servlet ExceptionCode:
javax.servlet.ServletException: Invoker service() exception
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:524)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
...
Should look like a simple sample but invoking the servlet on my apache I get a servlet exception. This only occurs while using the one-to-many relation from ScaleGroup 2 Scales. Normal field mapping or one-to-one mapping seems fine.
Thx in advance for your help.