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