-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate Tools and JNDI Datasource
PostPosted: Mon Feb 18, 2008 10:29 am 
Beginner
Beginner

Joined: Mon Dec 05, 2005 4:15 am
Posts: 36
Hi!

I try to use the Hibernate Tools plugin for Eclipse for a JBoss Project with JPA support. In my persistence.xml, I have:

Code:
<persistence-unit name="myPersUnit">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/MyDataSource</jta-data-source>
...


If I try to create a Hibernate Console Configuration, I get an error:
Code:
org.hibernate.HibernateException: Could not find datasource
   at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
   at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
   at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2005)
   at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$2.execute(LazyDatabaseSchemaWorkbenchAdapter.java:99)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
   at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:96)
   at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:58)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:103)
   at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: javax.naming.NameNotFoundException: MyDataSource not bound
   at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
   at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
   at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
   at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
   at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
   at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
   at javax.naming.InitialContext.lookup(InitialContext.java:392)
   at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
   ... 11 more


But my MyDataSource is bound, I can check it from the JNDIView of JMXConsole. Maybe it caused through the missed JNDI proberties, because I don't set they in the Hibernate Console Configuration. But I couldn't found how I can set they. Has anybody an idea how to configure Hibernate Tools with a JNDI Data Source?

HibernateTools 3.2.0GA, JBoss Tools 2.0.0GA


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.