-->
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: 3.2beta9a: Could not find datasource
PostPosted: Wed Jan 17, 2007 11:19 am 
Regular
Regular

Joined: Tue May 24, 2005 9:06 am
Posts: 64
I tried to use the new version 3.2beta9a for an EJB3 project for JBoss 4.0.5. The project developed with Eclipse 3.2.1 and WTP 1.5.2. However, I get the error message: "Could not find datasource".

Please find below persistence.xml and the stack trace when opening a session factory. I guess that hibernate tools have troubles in resolving the datasource resp. JNDI name which is otherwise resolved by JBoss. Any hint is appreciated!

Code:
<persistence-unit name="hskaPersistence">
   <provider>org.hibernate.ejb.HibernatePersistence</provider>
   <jta-data-source>java:/hskaDS</jta-data-source>
   <jar-file>hskaEJB-client.jar</jar-file>
   <properties>


The stacktrace looks as follows:
Code:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
   at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
   at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
   at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
   at javax.naming.InitialContext.lookup(InitialContext.java:351)
   at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
   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:1933)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1216)
   at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:317)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
   at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:312)
   at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
   at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 17, 2007 1:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes this is an "annoying" problem that currently requires you to have a setup that have the hibernate.connection properties in the persistence.xml and comment out the datasource.

In the next version i hope to resolve this by allowing users to specify additional connection properties that will override the (in this context) useless datasource setup (optimally would probably be to also allow you to point to a DTP connection or something similar)

_________________
Max
Don't forget to rate


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.