-->
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.  [ 11 posts ] 
Author Message
 Post subject: Very strange error: Could not find class
PostPosted: Thu Nov 25, 2004 5:56 pm 
Beginner
Beginner

Joined: Thu Jul 29, 2004 7:14 pm
Posts: 41
Hibernate version: 2.1.4

Mapping documents:

WebFlexForm.hbm.xml :
================

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class
name="com.pendylum.main.model.WebFlexForm"
table="WFFORM"
>

<id
name="formId"
type="java.lang.Integer"
column="form_id"
>
<generator class="assigned" />
</id>

<property
name="formName"
type="java.lang.String"
column="form_name"
not-null="true"
length="50"
/>
<property
name="formDescription"
type="java.lang.String"
column="description"
length="255"
/>

<!-- Associations -->
<!-- bi-directional many-to-many association to WebFlexFormControl -->
<set
name="webFlexFormControls"
lazy="true"
cascade="none"
table="ASS_WFFORM_WFFORMCONTROL"
>
<key>
<column name="form_id" />
</key>
<many-to-many
class="com.pendylum.main.model.WebFlexFormControl"
>
<column name="control_id" />
</many-to-many>
</set>

</class>

</hibernate-mapping>


WebFlexFormControl.hbm.xml :
====================

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class
name="com.pendylum.main.model.WebFlexFormControl"
table="WFFORMCONTROL"
>

<id
name="controlId"
type="java.lang.Integer"
column="control_id"
>
<generator class="assigned" />
</id>

<property
name="controlName"
type="java.lang.String"
column="control_name"
not-null="true"
length="50"
/>
<property
name="controlDescription"
type="java.lang.String"
column="description"
length="255"
/>
<property
name="controlType"
type="java.lang.Integer"
column="control_type"
/>
<property
name="controlLabel"
type="java.lang.String"
column="control_label"
length="50"
/>
<property
name="controlSize"
type="java.lang.Integer"
column="control_size"
/>

<!-- Associations -->

<!-- bi-directional many-to-one association to CDFormControlType -->
<many-to-one
name="cdFormControlType"
class="com.pendulym.main.model.CDFormControlType"
not-null="true"
>
<!-- this column is defined in this class's table -->
<column name="control_type" />
</many-to-one>

<!-- bi-directional many-to-many association to WebFlexForm -->
<set
name="webFlexForms"
lazy="true"
cascade="none"
table="ASS_WFFORM_WFFORMCONTROL"
>
<key>
<column name="control_id" />
</key>
<many-to-many
class="com.pendylum.main.model.WebFlexForm"
>
<column name="form_id" />
</many-to-many>
</set>

</class>

</hibernate-mapping>


CDFormControlType.hbm.xml :
====================

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class
name="com.pendylum.main.model.CDFormControlType"
table="CD_FORMCONTROLTYPE"
>

<id
name="formControlTypeId"
type="java.lang.Integer"
column="formcontroltype_id"
>
<generator class="assigned" />
</id>

<property
name="formControlTypeName"
type="java.lang.String"
column="formcontroltype_name"
not-null="true"
length="10"
/>
<property
name="formControlTypeDescription"
type="java.lang.String"
column="formcontroltype_description"
length="50"
/>

<!-- Associations -->
<!-- bi-directional one-to-many association to WebFlexFormControl -->
<set
name="webFlexFormControls"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<!-- this column is defined in WebFlexFormControl class's table -->
<column name="control_type" />
</key>
<one-to-many
class="com.pendulym.main.model.WebFlexFormControl"
/>
</set>


</class>

</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

try {
Session session1 = HibernateSession.getSession();

} catch ( InfrastructureException ie) {
System.out.println( "1.jsp: failed = " + ie.getMessage() );
ie.printStackTrace();
} finally {
HibernateSession.closeSession();
}


Full stack trace of any exception that occurs:

2004-11-25 16:25:43,984 DEBUG [org.apache.tomcat.util.threads.ThreadPool] Getting new thread data
2004-11-25 16:27:12,000 INFO [net.sf.hibernate.cfg.Environment] Hibernate 2.1.4
2004-11-25 16:27:12,015 INFO [net.sf.hibernate.cfg.Environment] hibernate.properties not found
2004-11-25 16:27:12,015 INFO [net.sf.hibernate.cfg.Environment] using CGLIB reflection optimizer
2004-11-25 16:27:12,031 INFO [net.sf.hibernate.cfg.Configuration] configuring from resource: /hibernate.cfg.xml
2004-11-25 16:27:12,031 INFO [net.sf.hibernate.cfg.Configuration] Configuration resource: /hibernate.cfg.xml
2004-11-25 16:27:12,156 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath under net/sf/hibernate/
2004-11-25 16:27:12,156 DEBUG [net.sf.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath
2004-11-25 16:27:12,218 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.connection.datasource=java:/SchedulerDB
2004-11-25 16:27:12,218 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory
2004-11-25 16:27:12,218 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup
2004-11-25 16:27:12,218 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.dialect=net.sf.hibernate.dialect.SQLServerDialect
2004-11-25 16:27:12,218 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.connection.provider_class=com.opensourceconnections.msjdbcproxy.HibernateProvider
2004-11-25 16:27:12,218 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N'
2004-11-25 16:27:12,234 DEBUG [net.sf.hibernate.cfg.Configuration] java:/hibernate/HibernateFactory<-org.dom4j.tree.DefaultAttribute@177ab84 [Attribute: name resource value "com\pendylum\main\model\WebFlexForm.hbm.xml"]
2004-11-25 16:27:12,234 INFO [net.sf.hibernate.cfg.Configuration] Mapping resource: com\pendylum\main\model\WebFlexForm.hbm.xml
2004-11-25 16:27:12,234 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
2004-11-25 16:27:12,234 DEBUG [net.sf.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
2004-11-25 16:27:12,421 INFO [net.sf.hibernate.cfg.Binder] Mapping class: com.pendylum.main.model.WebFlexForm -> WFFORM
2004-11-25 16:27:12,578 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: formId -> form_id, type: integer
2004-11-25 16:27:12,609 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: formName -> form_name, type: string
2004-11-25 16:27:12,609 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: formDescription -> description, type: string
2004-11-25 16:27:12,609 INFO [net.sf.hibernate.cfg.Binder] Mapping collection: com.pendylum.main.model.WebFlexForm.webFlexFormControls -> ASS_WFFORM_WFFORMCONTROL
2004-11-25 16:27:12,625 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: webFlexFormControls, type: java.util.Set
2004-11-25 16:27:12,640 DEBUG [net.sf.hibernate.cfg.Configuration] java:/hibernate/HibernateFactory<-org.dom4j.tree.DefaultAttribute@1b5eba4 [Attribute: name resource value "com\pendylum\main\model\WebFlexFormControl.hbm.xml"]
2004-11-25 16:27:12,640 INFO [net.sf.hibernate.cfg.Configuration] Mapping resource: com\pendylum\main\model\WebFlexFormControl.hbm.xml
2004-11-25 16:27:12,640 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
2004-11-25 16:27:12,640 DEBUG [net.sf.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
2004-11-25 16:27:12,703 INFO [net.sf.hibernate.cfg.Binder] Mapping class: com.pendylum.main.model.WebFlexFormControl -> WFFORMCONTROL
2004-11-25 16:27:12,703 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: controlId -> control_id, type: integer
2004-11-25 16:27:12,703 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: controlName -> control_name, type: string
2004-11-25 16:27:12,703 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: controlDescription -> description, type: string
2004-11-25 16:27:12,718 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: controlType -> control_type, type: integer
2004-11-25 16:27:12,718 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: controlLabel -> control_label, type: string
2004-11-25 16:27:12,718 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: controlSize -> control_size, type: integer
2004-11-25 16:27:12,718 ERROR [net.sf.hibernate.cfg.Configuration] Could not compile the mapping document
net.sf.hibernate.MappingException: Could not find class: com.pendulym.main.model.CDFormControlType
at net.sf.hibernate.cfg.Binder.bindManyToOne(Binder.java:624)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1023)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:361)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:333)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)
at com.pendylum.main.session.HibernateSession.<clinit>(HibernateSession.java:35)
at org.apache.jsp._1_jsp._jspService(_1_jsp.java:66)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
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)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)
2004-11-25 16:27:12,734 INFO [STDOUT] HibernateSession: Static Initializer Block failed.
2004-11-25 16:27:12,796 INFO [STDOUT] net.sf.hibernate.MappingException: Error reading resource: com\pendylum\main\model\WebFlexFormControl.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)
at com.pendylum.main.session.HibernateSession.<clinit>(HibernateSession.java:35)
at org.apache.jsp._1_jsp._jspService(_1_jsp.java:66)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
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)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)
Caused by: net.sf.hibernate.MappingException: Could not find class: com.pendulym.main.model.CDFormControlType
at net.sf.hibernate.cfg.Binder.bindManyToOne(Binder.java:624)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1023)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:361)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:333)
... 51 more
2004-11-25 16:27:12,921 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
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)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)
2004-11-25 16:27:13,046 ERROR [org.jboss.web.localhost.Engine] ----- Root Cause -----
javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
at org.apache.jsp._1_jsp._jspService(_1_jsp.java:121)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
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)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)


Name and version of the database you are using: MS SQLServer 2000

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


This is my hibernate.cfg.xml :

<?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">

<!-- configuration in a managed environment -->
<hibernate-configuration>

<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory name="java:/hibernate/HibernateFactory">

<!-- properties -->
<property name="hibernate.connection.datasource">java:/SchedulerDB</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property>
<property name="hibernate.dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.connection.provider_class">com.opensourceconnections.msjdbcproxy.HibernateProvider</property>
<property name="hibernate.query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>

<!-- mapping files -->
<mapping resource="com\pendylum\main\model\WebFlexForm.hbm.xml"/>
<mapping resource="com\pendylum\main\model\WebFlexFormControl.hbm.xml"/>
<mapping resource="com\pendylum\main\model\CDFormControlType.hbm.xml"/>
<mapping resource="com\pendylum\scheduler\model\SchTest.hbm.xml"/>

</session-factory>

</hibernate-configuration>


This is my HibernateSession.java :

/*
* Created on Nov 17, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package com.pendylum.main.session;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.pendylum.main.exception.InfrastructureException;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Session;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.Transaction;
import net.sf.hibernate.cfg.Configuration;

/**
* @author hussains
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class HibernateSession {
private static final ThreadLocal threadSession = new ThreadLocal();
private static final ThreadLocal threadTransaction = new ThreadLocal();

// static initializer block; executed when the classloader loads the class
static {
try {
// when using JNDI --> SessionFactory is now in JNDI, see hibernate.cfg.xml
Configuration cfg = new Configuration().configure();
System.out.println( "HibernateSession: Configuration created." );
cfg.buildSessionFactory();
System.out.println( "HibernateSession: SessionFactory created." );
//new Configuration().configure().buildSessionFactory();
} catch ( Throwable th ) {
System.out.println( "HibernateSession: Static Initializer Block failed." );
th.printStackTrace( System.out );
throw new ExceptionInInitializerError( th );
}
}

public static SessionFactory getSessionFactory() throws InfrastructureException {
SessionFactory sessions = null;
try {
Context ctx = new InitialContext();
String jndiName = "java:/hibernate/HibernateFactory";
sessions = (SessionFactory)ctx.lookup( jndiName );
System.out.println( "HibernateSession: getSessionFactory() successfully executed." );
} catch ( NamingException nex ) {
System.out.println( "HibernateSession: getSessionFactory() failed." );
throw new InfrastructureException( "HibernateSession: Lookup failed", nex);
}
return sessions;
}

public static Session getSession() throws InfrastructureException {
Session s = (Session)threadSession.get();
// Open a new Session, if this thread has none yet
try {
if (s == null) {
System.out.println( "HibernateSession: Opening new Session for this thread." );
s = getSessionFactory().openSession();
threadSession.set(s);
System.out.println( "HibernateSession: getSession() successfully executed." );
}
} catch ( HibernateException hex ) {
System.out.println( "HibernateSession: getSession() failed." );
throw new InfrastructureException( "Opening new Session for this thread failed.", hex );
}
return s;
}

public static void closeSession() {
try {
Session s = (Session)threadSession.get();
threadSession.set( null );
if ( s != null && s.isOpen() ) {
System.out.println( "HibernateSession: Closing Session of this thread." );
s.close();
System.out.println( "HibernateSession: closeSession() successfully executed." );
}
} catch ( HibernateException hex ) {
System.out.println( "HibernateSession: closeSession() failed." );
hex.printStackTrace();
}
}

public static void beginTransaction() throws InfrastructureException {
Transaction tx = (Transaction)threadTransaction.get();
try {
if ( tx == null ) {
System.out.println( "Starting new database transaction in this thread." );
tx = getSession().beginTransaction();
threadTransaction.set( tx );
System.out.println( "HibernateSession: beginTransaction() successfully executed." );
}
} catch ( HibernateException hex ) {
System.out.println( "HibernateSession: beginTransaction() failed." );
throw new InfrastructureException( "Starting new database transaction in this thread failed.", hex );
}
}

public static void rollbackTransaction() {
Transaction tx = (Transaction)threadTransaction.get();
try {
threadTransaction.set( null );
if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ) {
System.out.println( "Trying to rollback database transaction of this thread." );
tx.rollback();
System.out.println( "HibernateSession: rollbackTransaction() successfully executed." );
}
} catch ( HibernateException hex ) {
System.out.println( "Trying to rollback database transaction of this thread failed." );
hex.printStackTrace();
} finally {
closeSession();
}
}

public static void commitTransaction() {
Transaction tx = (Transaction)threadTransaction.get();
try {
System.out.println( "commitTransaction(): Committing database transaction of this thread (starting)" );
if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() )
System.out.println( "commitTransaction(): Committing database transaction of this thread." );
tx.commit();
threadTransaction.set(null);
System.out.println( "HibernateSession: commitTransaction() successfully executed." );
} catch ( HibernateException hex ) {
System.out.println( "commitTransaction(): Committing database transaction of this thread failed." );
rollbackTransaction();
hex.printStackTrace();
}
}

}


The system was working perfect. Then I add WebFlexForm.java, WebFlexFormControl.java and CDFormControlType.java I use MiddleGen to generate mappings and classes but now I am getting this error message. The funny thing is that com.pendulym.main.model.CDFormControlType class is present and I can see it.
It appears to me that it maps WebFlexForm first successfully then it tries to maps WebFlexFormControl and when reaches at CDFormControlType reference it expects that this class has already been mapped. It is not so it gives an error message.

What do you guys think? TIA


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 26, 2004 12:48 pm 
Beginner
Beginner

Joined: Thu Jul 29, 2004 7:14 pm
Posts: 41
To test my theory, I change the mapping order in my hibernate.cfg.xml to

<!-- mapping files -->
<mapping resource="com\pendylum\main\model\CDFormControlType.hbm.xml"/>
<mapping resource="com\pendylum\main\model\WebFlexForm.hbm.xml"/>
<mapping resource="com\pendylum\main\model\WebFlexFormControl.hbm.xml"/>
<mapping resource="com\pendylum\scheduler\model\SchTest.hbm.xml"/>


Now I am getting a different error message :


2004-11-26 11:29:20,078 DEBUG [org.apache.tomcat.util.threads.ThreadPool] Getting new thread data
2004-11-26 11:37:08,468 INFO [net.sf.hibernate.cfg.Environment] Hibernate 2.1.4
2004-11-26 11:37:08,609 INFO [net.sf.hibernate.cfg.Environment] hibernate.properties not found
2004-11-26 11:37:08,625 INFO [net.sf.hibernate.cfg.Environment] using CGLIB reflection optimizer
2004-11-26 11:37:08,718 INFO [net.sf.hibernate.cfg.Configuration] configuring from resource: /hibernate.cfg.xml
2004-11-26 11:37:08,718 INFO [net.sf.hibernate.cfg.Configuration] Configuration resource: /hibernate.cfg.xml
2004-11-26 11:37:08,968 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath under net/sf/hibernate/
2004-11-26 11:37:08,968 DEBUG [net.sf.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath
2004-11-26 11:37:09,078 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.connection.datasource=java:/SchedulerDB
2004-11-26 11:37:09,078 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory
2004-11-26 11:37:09,078 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup
2004-11-26 11:37:09,078 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.dialect=net.sf.hibernate.dialect.SQLServerDialect
2004-11-26 11:37:09,078 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.connection.provider_class=com.opensourceconnections.msjdbcproxy.HibernateProvider
2004-11-26 11:37:09,078 DEBUG [net.sf.hibernate.cfg.Configuration] hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N'
2004-11-26 11:37:09,078 DEBUG [net.sf.hibernate.cfg.Configuration] java:/hibernate/HibernateFactory<-org.dom4j.tree.DefaultAttribute@1635aad [Attribute: name resource value "com\pendylum\main\model\CDFormControlType.hbm.xml"]
2004-11-26 11:37:09,078 INFO [net.sf.hibernate.cfg.Configuration] Mapping resource: com\pendylum\main\model\CDFormControlType.hbm.xml
2004-11-26 11:37:09,093 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
2004-11-26 11:37:09,125 DEBUG [net.sf.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
2004-11-26 11:37:09,375 INFO [net.sf.hibernate.cfg.Binder] Mapping class: com.pendylum.main.model.CDFormControlType -> CD_FORMCONTROLTYPE
2004-11-26 11:37:09,515 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: formControlTypeId -> formcontroltype_id, type: integer
2004-11-26 11:37:09,562 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: formControlTypeName -> formcontroltype_name, type: string
2004-11-26 11:37:09,562 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: formControlTypeDescription -> formcontroltype_description, type: string
2004-11-26 11:37:09,593 ERROR [net.sf.hibernate.cfg.Configuration] Could not compile the mapping document
net.sf.hibernate.MappingException: Associated class not found
at net.sf.hibernate.cfg.Binder.bindOneToMany(Binder.java:708)
at net.sf.hibernate.cfg.Binder.bindCollection(Binder.java:541)
at net.sf.hibernate.cfg.Binder$2.create(Binder.java:1421)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1017)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:361)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:333)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)
at com.pendylum.main.session.HibernateSession.<clinit>(HibernateSession.java:35)
at org.apache.jsp._1_jsp._jspService(_1_jsp.java:65)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
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)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.pendulym.main.model.WebFlexFormControl
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:161)
at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:169)
at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
at net.sf.hibernate.cfg.Binder.bindOneToMany(Binder.java:703)
... 59 more
2004-11-26 11:37:09,609 INFO [STDOUT] HibernateSession: Static Initializer Block failed.
2004-11-26 11:37:09,609 INFO [STDOUT] net.sf.hibernate.MappingException: Error reading resource: com\pendylum\main\model\CDFormControlType.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)
at com.pendylum.main.session.HibernateSession.<clinit>(HibernateSession.java:35)
at org.apache.jsp._1_jsp._jspService(_1_jsp.java:65)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
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)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)
Caused by: net.sf.hibernate.MappingException: Associated class not found
at net.sf.hibernate.cfg.Binder.bindOneToMany(Binder.java:708)
at net.sf.hibernate.cfg.Binder.bindCollection(Binder.java:541)
at net.sf.hibernate.cfg.Binder$2.create(Binder.java:1421)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1017)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:361)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:333)
... 51 more
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.pendulym.main.model.WebFlexFormControl
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:161)
at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:169)
at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
at net.sf.hibernate.cfg.Binder.bindOneToMany(Binder.java:703)
... 59 more
2004-11-26 11:37:09,875 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
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)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)
2004-11-26 11:37:10,031 ERROR [org.jboss.web.localhost.Engine] ----- Root Cause -----
javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
at org.apache.jsp._1_jsp._jspService(_1_jsp.java:80)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
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)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)


Looks like the associations are not being interpreted properly by Hibernate. Please response.


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 26, 2004 4:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it simply says it cannot find the class CDFormControlType

So go check your class path etc for its existence - and check if the packagename is corrrect.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 11:02 am 
Beginner
Beginner

Joined: Thu Jul 29, 2004 7:14 pm
Posts: 41
Sorry. My bad. I misspell the package name in the mapping file. It should be com.pendylum.main not com.pendulym.main When I fix it the error went away although I got another error message :

2004-11-29 09:52:30,178 INFO [STDOUT] net.sf.hibernate.MappingException: Repeated column in mapping for class com.pendylum.main.model.WebFlexFormControl should be mapped with insert="false" update="false": control_type
at

As I can see that control_type column is being referred twice in my mapping file WebFlexFormControl (one as a property and one as a part of association). When I add insert="false" update="false" in the association portion, the error went away. My concern is what it is going to effect ? and should I have made this change in the property section instead of association?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 11:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you need to tell which column mapping that is the "master" - which property/association should be the one hibernate listens too ?

Maybe you don't need that column mapped twice at all ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 11:09 am 
Beginner
Beginner

Joined: Tue Oct 26, 2004 12:45 pm
Posts: 43
Location: Israel
I think it means that if you won't put value in the property, but only in the association, it won't enter the DB.

Can't you use only the Association, and remove the property?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 11:18 am 
Beginner
Beginner

Joined: Thu Jul 29, 2004 7:14 pm
Posts: 41
max wrote:
you need to tell which column mapping that is the "master" - which property/association should be the one hibernate listens too ?

Maybe you don't need that column mapped twice at all ?


Hibernate should listen to the association one. I think I dont need this column twice but the Middlegen generated this file for me.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 11:42 am 
Beginner
Beginner

Joined: Thu Jul 29, 2004 7:14 pm
Posts: 41
ok I tried a test by removing the property section and instead using the association section only for control_type column. Now in the database I have :

in WFFROM table
===========
form_id form_name
--------------------------
1 schtestSum
2 schtestDet

in WFFORMCONTROL table
=================
control_id control_name control_type
-----------------------------------------------------
1 testid 1
2 testname 1

in CD_FORMCONTROLTYPE
==================
formcontroltype_id form_controltype_name
---------------------------------------------------
1 text
2 select

in ASS_WFFORM_WFFORMCONTROL
========================
form_id control_id
------------------------
1 1
1 2
2 2


Then I wrote this code to test it:

WebFlexForm aWebFlexForm = aWebFlexFormDAO.retrieveWebFlexForm( new Integer(1) );
out.println( "Form Id : " + aWebFlexForm.getFormId() );
out.println( "Form Name : " + aWebFlexForm.getFormName() );
Set aSet = aWebFlexForm.getWebFlexFormControls();
Iterator iter = aSet.iterator();
while ( iter != null && iter.hasNext() ) {
WebFlexFormControl aWebFlexFormControl = (WebFlexFormControl)iter.next();
out.println( "Control Information : " );
out.println( aWebFlexFormControl.getControlId() );
out.println( aWebFlexFormControl.getControlName() );
out.println( aWebFlexFormControl.getControlType() );
}


aWebFlexFormControl.getControlType() is printing null instead of 1. Any reason?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 11:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
have you removed your attempt with insert/update true/false ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 11:52 am 
Beginner
Beginner

Joined: Thu Jul 29, 2004 7:14 pm
Posts: 41
yes. this is my mapping file now :

WebFlexFormControl.hbm.xml
====================

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class
name="com.pendylum.main.model.WebFlexFormControl"
table="WFFORMCONTROL"
>

<id
name="controlId"
type="java.lang.Integer"
column="control_id"
>
<generator class="assigned" />
</id>

<property
name="controlName"
type="java.lang.String"
column="control_name"
not-null="true"
length="50"
/>
<property
name="controlDescription"
type="java.lang.String"
column="description"
length="255"
/>
<property
name="controlLabel"
type="java.lang.String"
column="control_label"
length="50"
/>
<property
name="controlSize"
type="java.lang.Integer"
column="control_size"
/>


<!-- Associations -->

<!-- bi-directional many-to-one association to CDFormControlType -->
<many-to-one
name="cdFormControlType"
class="com.pendylum.main.model.CDFormControlType"
not-null="true"
>
<!-- this column is defined in this class's table -->
<column name="control_type" />
</many-to-one>

<!-- bi-directional many-to-many association to WebFlexForm -->
<set
name="webFlexForms"
lazy="true"
cascade="none"
table="ASS_WFFORM_WFFORMCONTROL"
>
<key>
<column name="control_id" />
</key>
<many-to-many
class="com.pendylum.main.model.WebFlexForm"
>
<column name="form_id" />
</many-to-many>
</set>

</class>

</hibernate-mapping>


CDFormControlType.hbm.xml
===================
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class
name="com.pendylum.main.model.CDFormControlType"
table="CD_FORMCONTROLTYPE"
>

<id
name="formControlTypeId"
type="java.lang.Integer"
column="formcontroltype_id"
>
<generator class="assigned" />
</id>

<property
name="formControlTypeName"
type="java.lang.String"
column="formcontroltype_name"
not-null="true"
length="10"
/>
<property
name="formControlTypeDescription"
type="java.lang.String"
column="formcontroltype_description"
length="50"
/>


<!-- Associations -->

<!-- bi-directional one-to-many association to WebFlexFormControl -->
<set
name="webFlexFormControls"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<!-- this column is defined in WebFlexFormControl class's table -->
<column name="control_type" />
</key>
<one-to-many
class="com.pendylum.main.model.WebFlexFormControl"
/>
</set>


</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2004 4:58 pm 
Beginner
Beginner

Joined: Thu Jul 29, 2004 7:14 pm
Posts: 41
It works only if i use like this

CDFormControlType aCDFormControlType = aWebFlexFormControl.getCdFormControlType();
out.println( aCDFormControlType.getFormControlTypeId() );

so aWebFlexFormControl.getControlType() does not work but aWebFlexFormControl.getCdFormControlType() does work.


Testing Update
==========

I then tried to update the WFFORMCONTROL by writing this code :

WebFlexFormControl aWebFlexFormControl = new WebFlexFormControl();
aWebFlexFormControl.setControlId( new Integer(10) );
aWebFlexFormControl.setControlName( "control 10" );
aWebFlexFormControl.setControlType( new Integer(2) );
aWebFlexFormControl.setControlLabel( "control 10" );

aWebFlexFormControlDAO.create( aWebFlexFormControl );

I get this error message :

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'control_type', table 'Sched.dbo.WFFORMCONTROL'; column does not allow nulls. INSERT fails.

but when I change the code to use CDFormControlType, it works :

WebFlexFormControl aWebFlexFormControl = new WebFlexFormControl();
aWebFlexFormControl.setControlId( new Integer(10) );
aWebFlexFormControl.setControlName( "control 10" );
//aWebFlexFormControl.setControlType( new Integer(2) );
aWebFlexFormControl.setControlLabel( "control 10" );

CDFormControlType aCDFormControlType = aCDFormControlTypeDAO.retrieve( new Integer(2) );
aWebFlexFormControl.setCdFormControlType( aCDFormControlType );

aWebFlexFormControlDAO.create( aWebFlexFormControl );


I like to use set and get on controlType as it is easier to write such code; but right now i cant. Any input?

Thanks


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