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
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