0

So I've set up a datasource in JBoss 6.2GA, called "java:/jdbc/iconDS"

Then I linked to it in persistence.xml, calling the entity manager factory "java:jboss/persistence/icon"

My web.xml loads a context reference to the persistent unit I set up, and also loads infrastructure.xml, which tries to look up my two JNDI names.

It says "Starting Persistence Unit Service 'iconRules.war#primary", but then "hibernate.properties not found", and regardless of whether I put in a hibernate.cfg.xml or not, it just hangs on :

HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider  
IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: Could not create connection

Which indicates that it's just not working.


Edit: solved. Thanks Pascal for the help

djb
  • 1,635
  • 3
  • 26
  • 49
  • Did you specify the connection url in the standalone.xml config of jboss? with the tag? – Pascal Rodriguez Feb 26 '14 at 16:00
  • Hi Pascal, yes, it says "Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0)" and "JBAS010400: Bound data source [java:/jdbc/iconDS]" in the startup, so I think it's configured correctly. – djb Feb 27 '14 at 07:42
  • Hmm, when it fails though, it does say "Unable to get managed connection for java:/jdbc/iconDS" – djb Feb 27 '14 at 08:11
  • I've tried connecting with straight JDBC now, and it opens a connection, creates a statement from the connection, but then hangs on statement.execute(QueryString); indefinitely. – djb Feb 27 '14 at 12:26

1 Answers1

0

I tried with straight JDBC, and it still didn't work. Eventually I found it was a bug with my Java 1.6 version! ARGH

Driver.getConnection hangs using SQLServer driver and Java 1.6.0_29

Community
  • 1
  • 1
djb
  • 1,635
  • 3
  • 26
  • 49