Hi any body have any idea about this problem
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0
Mapping documents:
hibernate-service.xml:
<mbean code="org.jboss.hibernate.jmx.Hibernate"
name="jboss.har:service=Hibernate">
<attribute name="DatasourceName">java:/hibernatePool</attribute>
<attribute name="Dialect">org.hibernate.dialect.OracleDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
<attribute name="Hbm2ddlAuto">create</attribute>
<!--
GIVE YUR CACHEPROVIDER CLASS.
<attribute name="CacheProviderClass">net.sf.hibernate.cache.HashtableCacheProvider</attribute>
-->
</mbean>
myApplication.xml
<application>
<display-name>My Application</display-name>
<module>
<web>
<web-uri>myapp.war</web-uri>
<context-root>myapp</context-root>
</web>
</module>
</application>
jboss-app.xml :
<jboss-app>
<module>
<har>myapp.har</har>
</module>
</jboss-app>
Code between sessionFactory.openSession() and session.close():
private static final SessionFactory sessionFactory;
static {
try {
// Create the SessionFactory
Context ctx = new InitialContext();
sessionFactory = (SessionFactory) ctx.lookup("java:/hibernatePool");
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
}
}
Full stack trace of any exception that occurs:
C:\Documents and Settings\vasan>cd\
C:\>cd jboss-4.0.2
C:\jboss-4.0.2>cd bin
C:\jboss-4.0.2\bin>run
===============================================================================
.
JBoss Bootstrap Environment
.
JBOSS_HOME: C:\jboss-4.0.2\bin\\..
.
JAVA: C:\jdk142_04\bin\java
.
JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m
.
CLASSPATH: C:\jdk142_04\lib\tools.jar;C:\jboss-4.0.2\bin\\run.jar
.
===============================================================================
.
19:25:20,115 INFO [Server] Starting JBoss (MX MicroKernel)...
19:25:20,115 INFO [Server] Release ID: JBoss [Zion] 4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)
19:25:20,115 INFO [Server] Home Dir: C:\jboss-4.0.2
19:25:20,115 INFO [Server] Home URL: file:/C:/jboss-4.0.2/
19:25:20,115 INFO [Server] Library URL: file:/C:/jboss-4.0.2/lib/
19:25:20,115 INFO [Server] Patch URL: null
19:25:20,115 INFO [Server] Server Name: default
19:25:20,115 INFO [Server] Server Home Dir: C:\jboss-4.0.2\server\default
19:25:20,115 INFO [Server] Server Home URL: file:/C:/jboss-4.0.2/server/default/
19:25:20,115 INFO [Server] Server Data Dir: C:\jboss-4.0.2\server\default\data
19:25:20,115 INFO [Server] Server Temp Dir: C:\jboss-4.0.2\server\default\tmp
19:25:20,131 INFO [Server] Server Config URL: file:/C:/jboss-4.0.2/server/default/conf/
19:25:20,131 INFO [Server] Server Library URL: file:/C:/jboss-4.0.2/server/default/lib/
19:25:20,131 INFO [Server] Root Deployment Filename: jboss-service.xml
19:25:20,131 INFO [Server] Starting General Purpose Architecture (GPA)...
19:25:20,506 INFO [ServerInfo] Java version: 1.4.2_04,Sun Microsystems Inc.
19:25:20,506 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.4.2_04-b05,Sun Microsystems Inc.
19:25:20,506 INFO [ServerInfo] OS-System: Windows 2000 5.0,x86
19:25:20,928 INFO [Server] Core system initialized
19:25:22,787 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
19:25:22,865 INFO [WebService] Using RMI server codebase:
http://client-50:8083/
19:25:22,990 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
19:25:27,381 INFO [Embedded] Catalina naming disabled
19:25:27,756 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
19:25:27,756 INFO [Catalina] Initialization processed in 312 ms
19:25:27,772 INFO [StandardService] Starting service jboss.web
19:25:27,772 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.5.9
19:25:27,819 INFO [StandardHost] XML validation disabled
19:25:27,834 INFO [Catalina] Server startup in 62 ms
19:25:27,959 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=file:/C:/jboss-4.0.2/server/default/deploy/http-invoker.sar/invoker.war/
19:25:28,241 INFO [WebappLoader] Dual registration of jndi stream handler: factory already defined
19:25:28,834 INFO [TomcatDeployer] deploy, ctxPath=/ws4ee, warUrl=file:/C:/jboss-4.0.2/server/default/tmp/deploy/tmp35319jboss-ws4ee-exp.war/
19:25:28,944 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=file:/C:/jboss-4.0.2/server/default/deploy/jbossweb-tomcat55.sar/ROOT.war/
19:25:29,116 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=file:/C:/jboss-4.0.2/server/default/deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
19:25:30,881 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=file:/C:/jboss-4.0.2/server/default/deploy/management/console-mgr.sar/web-console.war/
19:25:31,475 INFO [MailService] Mail Service bound to java:/Mail
19:25:32,038 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/default/deploy/jboss-ha-local-jdbc.rar
19:25:32,241 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/default/deploy/jboss-ha-xa-jdbc.rar
19:25:32,397 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/default/deploy/jboss-local-jdbc.rar
19:25:32,506 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/default/deploy/jboss-xa-jdbc.rar
19:25:32,725 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/default/deploy/jms/jms-ra.rar
19:25:32,803 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.2/server/default/deploy/mail-ra.rar
19:25:33,975 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=DefaultDS,service=DataSourceBinding to JNDI name 'java:DefaultDS'
19:25:34,303 INFO [A] Bound to JNDI name: queue/A
19:25:34,319 INFO
Bound to JNDI name: queue/B
19:25:34,319 INFO [C] Bound to JNDI name: queue/C
19:25:34,319 INFO [D] Bound to JNDI name: queue/D
19:25:34,319 INFO [ex] Bound to JNDI name: queue/ex
19:25:34,350 INFO [testTopic] Bound to JNDI name: topic/testTopic
19:25:34,350 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
19:25:34,350 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
19:25:34,350 INFO [testQueue] Bound to JNDI name: queue/testQueue
19:25:34,413 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
19:25:34,475 INFO [DLQ] Bound to JNDI name: queue/DLQ
19:25:34,647 INFO [ConnectionFactoryBindingService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=JmsXA,service=ConnectionFactoryBinding to JNDI name 'java:JmsXA'
19:25:34,850 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=loggerPool,service=DataSourceBinding to JNDI name 'java:loggerPool'
19:25:34,897 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=samplepool,service=DataSourceBinding to JNDI name 'java:samplepool'
19:25:34,928 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=hibernatePool,service=DataSourceBinding to JNDI name 'java:hibernatePool'
19:25:34,959 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C:/jboss-4.0.2/server/default/deploy/jmx-console.war/
19:25:35,100 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.2/server/default/deploy/myapp.ear/
19:25:35,366 INFO [Environment] Hibernate 3.0rc1
19:25:35,366 INFO [Environment] hibernate.properties not found
19:25:35,397 INFO [Environment] using CGLIB reflection optimizer
19:25:35,397 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
19:25:35,397 INFO [Hibernate] Using JDBC batch size : null
19:25:35,428 INFO [Configuration] Searching for mapping documents in jar: myapp.har
19:25:35,428 INFO [Configuration] Found mapping documents in jar: com/mportal/hibernate/model/Template.hbm.xml
19:25:35,553 INFO [HbmBinder] Mapping class: com.mportal.hibernate.model.TempletSubscriber -> GLOBAL_TEMPLATE_SUBSCRIBERS
19:25:35,600 INFO [Configuration] processing extends queue
19:25:35,600 INFO [Configuration] processing collection mappings
19:25:35,600 INFO [Configuration] processing association property references
19:25:35,600 INFO [Configuration] processing foreign key constraints
19:25:35,756 INFO [Dialect] Using dialect: org.hibernate.dialect.OracleDialect
19:25:35,772 INFO [SettingsFactory] Default batch fetch size: 1
19:25:35,772 INFO [SettingsFactory] Generate SQL with comments: disabled
19:25:35,772 INFO [SettingsFactory] Order SQL updates by primary key: disabled
19:25:35,772 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
19:25:35,788 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
19:25:35,788 INFO [SettingsFactory] Query language substitutions: {}
19:25:35,788 INFO [NamingHelper] JNDI InitialContext properties:{}
19:25:35,788 INFO [DatasourceConnectionProvider] Using datasource: java:/hibernatePool
19:25:36,178 INFO [SettingsFactory] JDBC batch size: 15
19:25:36,178 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
19:25:36,178 INFO [SettingsFactory] Scrollable result sets: enabled
19:25:36,178 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
19:25:36,194 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.JTATransactionFactory
19:25:36,194 INFO [NamingHelper] JNDI InitialContext properties:{}
19:25:36,194 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
19:25:36,194 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
19:25:36,194 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
19:25:36,194 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
19:25:36,194 INFO [SettingsFactory] Automatic flush during beforeCompletion(): enabled
19:25:36,194 INFO [SettingsFactory] Automatic session close at end of transaction: enabled
19:25:36,194 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
19:25:36,194 INFO [SettingsFactory] Second-level cache: enabled
19:25:36,194 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
19:25:36,194 INFO [SettingsFactory] Structured second-level cache entries: enabled
19:25:36,194 INFO [SettingsFactory] Query cache: disabled
19:25:36,194 INFO [SettingsFactory] Statistics: disabled
19:25:36,194 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
19:25:36,194 INFO [SettingsFactory] Default entity-mode: pojo
19:25:36,835 INFO [SessionFactoryImpl] building session factory
19:25:37,272 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
19:25:37,288 INFO [Dialect] Using dialect: org.hibernate.dialect.OracleDialect
19:25:37,288 INFO [Configuration] processing extends queue
19:25:37,288 INFO [Configuration] processing collection mappings
19:25:37,288 INFO [Configuration] processing association property references
19:25:37,288 INFO [Configuration] processing foreign key constraints
19:25:37,288 INFO [Configuration] processing extends queue
19:25:37,288 INFO [Configuration] processing collection mappings
19:25:37,288 INFO [Configuration] processing association property references
19:25:37,288 INFO [Configuration] processing foreign key constraints
19:25:37,288 INFO [SchemaExport] Running hbm2ddl schema export
19:25:37,288 INFO [SchemaExport] exporting generated schema to database
19:25:37,288 INFO [NamingHelper] JNDI InitialContext properties:{}
19:25:37,288 INFO [DatasourceConnectionProvider] Using datasource: java:/hibernatePool
19:25:37,366 INFO [SchemaExport] schema export complete
19:25:37,381 INFO [NamingHelper] JNDI InitialContext properties:{}
19:25:37,381 INFO [SessionFactoryImpl] Checking 0 named queries
19:25:37,381 INFO [Hibernate] SessionFactory successfully built and bound into JNDI [java:/hibernate/SessionFactory]
19:25:37,381 INFO [TomcatDeployer] deploy, ctxPath=/myapp, warUrl=file:/C:/jboss-4.0.2/server/default/deploy/myapp.ear/myapp.war/
19:25:37,444 INFO [WebappClassLoader] validateJarFile(C:\jboss-4.0.2\server\default\.\deploy\myapp.ear\myapp.war\WEB-INF\lib\weblogic.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
19:25:37,522 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.2/server/default/deploy/myapp.ear/
19:25:37,631 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
19:25:37,694 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
19:25:37,694 INFO [JkMain] Jk running ID=0 time=0/16 config=null
19:25:37,710 INFO [Server] JBoss (MX MicroKernel) [4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 17s:579ms
19:26:17,226 INFO [STDOUT] reqType ::GetGT
19:26:17,226 INFO [STDOUT] inside processTemplateRequest ::::
19:26:17,258 INFO [STDOUT] looking for session factory
19:26:17,258 INFO [STDOUT] :::::::::::::org.jboss.resource.adapter.jdbc.WrapperDataSource
19:26:17,258 INFO [STDOUT] java.lang.ClassCastException
19:26:17,258 INFO [STDOUT] at com.mportal.hibernate.dao.HibernateUtil.<clinit>(HibernateUtil.java:41)
19:26:17,258 INFO [STDOUT] at com.mportal.hibernate.dao.DAO.getAllTemplet(DAO.java:36)
19:26:17,258 INFO [STDOUT] at com.mportal.hibernate.middletier.HibernateOperationsManagerImpl.getAllTemplet(HibernateOperationsManagerImpl.java:15)
19:26:17,258 INFO [STDOUT] at com.mportal.hibernate.gui.controller.TempletActionController.findTemplet(TempletActionController.java:24)
19:26:17,258 INFO [STDOUT] at com.mportal.hibernate.gui.controller.WebRequestHandler.processTemplateRequest(WebRequestHandler.java:106)
19:26:17,258 INFO [STDOUT] at com.mportal.hibernate.gui.controller.WebRequestHandler.handleRequest(WebRequestHandler.java:75)
19:26:17,258 INFO [STDOUT] at com.mportal.hibernate.gui.controller.WebRequestHandler.doPost(WebRequestHandler.java:128)
19:26:17,258 INFO [STDOUT] at com.mportal.hibernate.gui.controller.WebRequestHandler.doGet(WebRequestHandler.java:138)
19:26:17,273 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
19:26:17,273 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
19:26:17,273 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
19:26:17,273 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
19:26:17,273 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
19:26:17,273 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
19:26:17,273 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
19:26:17,273 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
19:26:17,273 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
19:26:17,273 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
19:26:17,273 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
19:26:17,273 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
19:26:17,273 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
19:26:17,273 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
19:26:17,273 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
19:26:17,273 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
19:26:17,273 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
19:26:17,273 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
19:26:17,273 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
19:26:17,273 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
19:26:17,273 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
19:26:17,273 INFO [STDOUT] :::::::::::::null
19:26:17,273 INFO [STDOUT] Initial SessionFactory creation failed.java.lang.ClassCastException
19:26:17,273 ERROR [[WebRequestHandler]] Servlet.service() for servlet WebRequestHandler threw exception
java.lang.ExceptionInInitializerError
at com.mportal.hibernate.dao.HibernateUtil.<clinit>(HibernateUtil.java:52)
at com.mportal.hibernate.dao.DAO.getAllTemplet(DAO.java:36)
at com.mportal.hibernate.middletier.HibernateOperationsManagerImpl.getAllTemplet(HibernateOperationsManagerImpl.java:15)
at com.mportal.hibernate.gui.controller.TempletActionController.findTemplet(TempletActionController.java:24)
at com.mportal.hibernate.gui.controller.WebRequestHandler.processTemplateRequest(WebRequestHandler.java:106)
at com.mportal.hibernate.gui.controller.WebRequestHandler.handleRequest(WebRequestHandler.java:75)
at com.mportal.hibernate.gui.controller.WebRequestHandler.doPost(WebRequestHandler.java:128)
at com.mportal.hibernate.gui.controller.WebRequestHandler.doGet(WebRequestHandler.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassCastException
at com.mportal.hibernate.dao.HibernateUtil.<clinit>(HibernateUtil.java:41)
... 28 more
[b]Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html