File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate using weblogic 10.3 Datasource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate using weblogic 10.3 Datasource" Watch "Hibernate using weblogic 10.3 Datasource" New topic
Author

Hibernate using weblogic 10.3 Datasource

Srinivas Kaza
Greenhorn

Joined: Jul 17, 2012
Posts: 1
HI,
When I use direct jdbc connection my code is working with Hibernate. I am trying to use Weblogic datasource then I am getting error. Your helps is highly appreciated. thanks.

I have configured datasource in weblogic 10.3 server. the DataSource JNDI Identifier is jdbc/MyDB
I have added this in weblogic.xml & web.xml

WEBLOGIC.xml


web.xml


Now in hibernate.cfg.xml I configured like below



When I use this setup I am getting the following error:
org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [java:/comp/env/jdbc/MyDB]
at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68)
at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:116)
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89)
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:71)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2277)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2273)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1742)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1782)
at com.dataresources.daoimpl.DepartmentDAOImpl.addDepartment(DepartmentDAOImpl.java:15)
at com.mycompany.businessdelegate.BusinessDelegate.SaveDepartement(BusinessDelegate.java:12)
at com.mycompany.controller.SpringController.saveDepartment(SpringController.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate using weblogic 10.3 Datasource