[jboss-user] [JBoss Tools (users)] - Re: How to configure Hibernate Console in a Maven project ?

chawax do-not-reply at jboss.com
Thu Apr 3 11:08:16 EDT 2008


Thanks Max. I finally could make the configuration node work and now I can see all my EJB3 entity classes when expanding the configuration node, so no more problem with mapping file. The problem is that I don't exactly now how I solved this problem !  I Just made a maven clean then a maven install and it was OK. I will report it if I reproduce the problem, but I think it was my fault, not a problem with JBoss Tools ;)

Anyway I have another problem when opening Session Factory and Database nodes in Hibernate Configurations view. I think it deals with the way I configured the datasource since it can't find it.

The stack trace is following :

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.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)
  | 	... 11 more

My persistence.xml files refers to a JNDI datasource, so there might be something special to do in hibernate.properties to make it work. Is there an example for this ?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141391#4141391

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4141391



More information about the jboss-user mailing list