-->
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.  [ 10 posts ] 
Author Message
 Post subject: no connection properties specified
PostPosted: Sat Jul 30, 2005 1:15 pm 
Newbie

Joined: Wed Jul 27, 2005 8:07 pm
Posts: 9
Hello

I am using jboss 4.0.3, and deployed a small hibernate app. when I started to use the app, I have the following problem:

10:05:41,312 WARN [UserSuppliedConnectionProvider] No connection properties specified - the user must supply JDBC connections

However, I do have the connection specified in the hibernate.cfg.xml, and the datasource is defined in oracle-ds.xml in the jboss deploy directory.

<hibernate-configuration>
<session-factory name="java:/hibernate/HibernateFactory">
<property name="show_sql">true</property>
<property name="connection.datasource">java:/comp/env/jdbc/TimeTracker</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
</session-factory>
</hibernate-configuration>


By printing out the connection properties, I confirm that the properties are set


[STDOUT] hibernate.session_factory_name=java:/hibernate/HibernateFactory
[STDOUT] hibernate.cglib.use_reflection_optimizer=true
[STDOUT] hibernate.connection.datasource=java:/comp/env/jdbc/TimeTracker
[STDOUT] hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
[STDOUT] hibernate.show_sql=true

Can anybody help me to figure this out?

thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 31, 2005 12:42 pm 
Senior
Senior

Joined: Wed Jul 13, 2005 4:31 pm
Posts: 142
Location: Seattle, WA
Are you using EJB 3.0 beta?
or,
are you using hibernate directly?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 31, 2005 12:45 pm 
Newbie

Joined: Wed Jul 27, 2005 8:07 pm
Posts: 9
No, I am not using any EJB. I use hibernate directly


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 31, 2005 1:08 pm 
Senior
Senior

Joined: Wed Jul 13, 2005 4:31 pm
Posts: 142
Location: Seattle, WA
Hm...
So, it's not EJB 3.0 configuration...

Post your oracle-ds.xml. Another possibility is oracle datasource config doesn't match the hibernate datasource.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 31, 2005 3:40 pm 
Newbie

Joined: Wed Jul 27, 2005 8:07 pm
Posts: 9
Here is the oracle-ds.xml:

<datasources>
<local-tx-datasource>
<jndi-name>TimeTracker</jndi-name>
<connection-url>jdbc:oracle:thin:@127.0.0.1:1521:test</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>timetracker</user-name>
<password>test</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
</local-tx-datasource>
</datasources>

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 31, 2005 6:53 pm 
Senior
Senior

Joined: Wed Jul 13, 2005 4:31 pm
Posts: 142
Location: Seattle, WA
I am using jboss 4.0.1, and my datasource name is MySqlDS. My hibernate config is set to have connection.datasource=java:/MySqlDS. It works.

So, try the jndi name of java:/TimeTracker for your datasource.
<property name="connection.datasource">java:/TimeTracker</property>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 1:34 pm 
Newbie

Joined: Wed Jul 27, 2005 8:07 pm
Posts: 9
I tried :
<property name="connection.datasource">java:/TimeTracker</property>
and it did not make any difference.

I read somewhere that the hibernate application needs to be deployed as .har, not .war. jboss 4.0.1 can read from the expanded directory structure, but jboss 4.0.2 has a bug to read from the expanded deployment dir.

Do you mind to post your deployment structure for your working hibernate app?

thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 2:28 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
jingc3 wrote:
I tried :
<property name="connection.datasource">java:/TimeTracker</property>
and it did not make any difference.

I read somewhere that the hibernate application needs to be deployed as .har, not .war. jboss 4.0.1 can read from the expanded directory structure, but jboss 4.0.2 has a bug to read from the expanded deployment dir.

Do you mind to post your deployment structure for your working hibernate app?

thanks in advance


I successfully deploy our application as a war file in both JBoss 3.2.6 and 4.0.2.

mssql-ds.xml
Code:
<datasources>
  <local-tx-datasource>
    <jndi-name>SQLDS</jndi-name>
...


hibernate.cfg.xml
Code:
       
<property name="connection.datasource">java:/SQLDS</property>


When we deploy to Weblogic 8.1, we drop the "java:/" from the datasource property.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 5:03 pm 
Newbie

Joined: Wed Jul 27, 2005 8:07 pm
Posts: 9
I tried on different versions of jboss, tried expanded deployment and compact .ear or .war deployment, and modified the connection.datasource to various format, the results yield the same to me:

the deployment was successful. When I load the jsp page, the log indicates that the configuration file has been located and read, but it always failed by complaining the no connection properties specified.

can anyone point out what is wrong here?

thx


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 5:18 pm 
Newbie

Joined: Wed Jul 27, 2005 8:07 pm
Posts: 9
The problem was resolved by explicitly set the connection properties in the application code by this:

System.setProperty("hibernate.connection.datasource", "java:/TimeTracker");
cfg.setProperties(System.getProperties());

I don't think this is the right way to do it even though it makes the app working.


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