-->
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.  [ 2 posts ] 
Author Message
 Post subject: Fail connect database with JNDI connection in App Server
PostPosted: Tue Jul 18, 2006 12:23 am 
Newbie

Joined: Tue Jul 18, 2006 12:12 am
Posts: 1
I build an application with
Java 1.5.
Framework: Hibernate 3.2 cr2
OS: Window XP
Testing Database: Oracle 8,9,10 and MySQL 4,5

The Application run ok with all Tomcat 5.5 version.
But when i try to deploy to Java Application Server 9 / JBoss 4.0.4.
(Included all the hibernate required library file to WEB_INF\lib already..)
(Note: configured JNDI connection in application. If configure using JDBC in application. it will be ok. but i need JNDI)

It showed me error on the following..
do i miss any configuration in Java system Application server 9 / JBoss 4.0.4?

exception
javax.servlet.ServletException: Filter execution threw an exception

root cause
java.lang.NoClassDefFoundError
my.com.snt.cis.filter.HibernateFilter.doFilter(HibernateFilter.java:31)

From the log file:
[#|2006-07-18T09:43:32.406+0800|INFO|sun-appserver-pe9.0|javax.enterprise.syste m.stream.out|_ThreadID=16;_ThreadName=httpWorkerThread-8090-0;|[httpWorkerThread -8090-0] ERROR CIS Building SessionFactory failed.
org.hibernate.HibernateException: Could not find datasource
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConne ctionProvider.java:56)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(Connec tionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(Connec tionProviderFactory.java:56)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java :385)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:61)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at my.com.snt.util.HibernateUtil.<clinit>(HibernateUtil.java:33)
at my.com.snt.cis.filter.HibernateFilter.doFilter(HibernateFilter.java:21)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:216)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:184)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 276)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java: 120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:13 7)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorT ask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(Proces sorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask .java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: javax.naming.NameNotFoundException: No object bound to name java:/comp/env/jdbc/cis
at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:751)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:190)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:307)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConne ctionProvider.java:52)
... 33 more
|#]

[#|2006-07-18T09:43:32.406+0800|INFO|sun-appserver-pe9.0|javax.enterprise.syste m.stream.out|_ThreadID=16;_ThreadName=httpWorkerThread-8090-0;|HibernateUtil.jav a : org.hibernate.HibernateException: Could not find datasource|#]

[#|2006-07-18T09:43:32.406+0800|SEVERE|sun-appserver-pe9.0|javax.enterprise.sys tem.container.web|_ThreadID=16;_ThreadName=httpWorkerThread-8090-0;_RequestID=5b 873953-bff7-443e-8293-a0885d134cc1;|StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NoClassDefFoundError
at my.com.snt.cis.filter.HibernateFilter.doFilter(HibernateFilter.java:31)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:216)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:184)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 276)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java: 120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:13 7)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorT ask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(Proces sorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask .java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 18, 2006 5:53 am 
Beginner
Beginner

Joined: Wed Aug 10, 2005 12:09 am
Posts: 30
does the jndi name of your data source defined on the appserver match the data source definition in your hibernate configuration? I assume you can lookup the data source from the filter yourself, but hibernate can't find it. Is that correct?


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