Well, that one was easy, thanks to this post:
https://www.manning-sandbox.com/message.jspa?messageID=56075
I just added the configuration to my persistence.xml file:
<persistence>
| <persistence-unit name="crunch">
| <jta-data-source>java:/CrunchDS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
| <property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLDialect"/>
| <property name="hibernate.connection.driver_class"
value="com.mysql.jdbc.Driver"/>
| <property name="hibernate.connection.url"
value="jdbc:mysql://localhost/crunch"/>
| <property name="hibernate.connection.username"
value="blah"/>
| </properties>
| </persistence-unit>
| </persistence>
The EAR is now deployed, albeit with a huge number of exceptions. I think the problem now
is that the location of the mysql-connector jar file (mysql-connector-java-5.0.5-bin.jar)
needs to be changed. I used to put it in server/default/lib but I get these errors on the
deploy:
| 11:38:11,319 INFO [ConnectionFactoryBindingService] Bound ConnectionManager
'jboss.jca:service=DataSourceBinding,name=CrunchDS' to JNDI name
'java:CrunchDS'
| 11:38:11,339 INFO [EARDeployer] Init J2EE application:
file:/home/mjhammel/src/cei/jboss-4.2.2.GA-cei/server/default/deploy/Crunch.ear
| 11:38:11,422 INFO [JmxKernelAbstraction] creating wrapper delegate for:
org.jboss.ejb3.entity.PersistenceUnitDeployment
| 11:38:11,423 INFO [JmxKernelAbstraction] installing MBean:
persistence.units:ear=Crunch.ear,unitName=crunch with dependencies:
| 11:38:11,423 INFO [JmxKernelAbstraction]
jboss.jca:name=CrunchDS,service=DataSourceBinding
| 11:38:11,425 INFO [PersistenceUnitDeployment] Starting persistence unit
persistence.units:ear=Crunch.ear,unitName=crunch
| 11:38:11,436 INFO [Configuration] Reading mappings from resource : META-INF/orm.xml
| 11:38:11,437 INFO [Ejb3Configuration] [PersistenceUnit: crunch] no META-INF/orm.xml
found
| 11:38:11,443 INFO [ConnectionProviderFactory] Initializing connection provider:
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
| 11:38:11,444 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
| 11:38:11,447 WARN [JBossManagedConnectionPool] Throwable while attempting to get a
new connection: null
| org.jboss.resource.JBossResourceException: Could not create connection; - nested
throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for:
com.mysql.jdbc.Driver; - nested throwable: (java.lang.ClassNotFoundException: No
ClassLoaders found for: com.mysql.jdbc.Driver))
The HSQL jar files all seem to be in server/default/lib, so my gut feeling is that the
mysql-connector jar file is also supposed to go here. If so, then this problem is not
about the connector.
More googling....
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115768#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...