[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Jboss JPA Config

mattias@hexabit.se do-not-reply at jboss.com
Wed Apr 16 18:12:55 EDT 2008


Hi,

Do anyone have time to sort this out once and for all? I know this has been discussed several times, but different websites and forums have different answers. I'm getting the following error when deploying a small ejb3 project:


  | --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
  | ObjectName: persistence.units:unitName=tinyphotoalbum
  |   State: NOTYETINSTALLED
  |   Depends On Me:
  |     jboss.j2ee:jar=ImageServices.jar,name=ImageDetailManagementBean,service=EJB3
  | 

The jarfile/META-INF/persistance.xml looks like:
<?xml version="1.0" encoding="UTF-8" ?>
  | <persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |              xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
  |              version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
  | 
  |   <persistence-unit name="tinyphotoalbum">
  |   	<jta-data-source>java:/MySqlDS</jta-data-source>
  |     <class>se.hexabit.tinyphotoalbum.beans.ImageDetails</class>
  |     <properties>
  | 		<property name="hibernate.archive.autodetection" value="class, hbm"/>
  | 		<property name="hibernate.show_sql" value="true"/>
  | 		<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
  | 		<property name="hibernate.connection.password" value="tinyphotoalbum"/>
  | 		<property name="hibernate.connection.url" value="jdbc:mysql://192.168.0.138:3306/TinyPhotoAlbum"/>
  | 		<property name="hibernate.connection.username" value="tinyphotoalbum"/>
  | 		<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
  | 	</properties>
  |   </persistence-unit>
  | </persistence>
  | 

And the JBOSS_HOME\server\default\deploy\mysql-ds.xml:

  | <?xml version="1.0" encoding="UTF-8"?>
  | <datasources>
  |   <local-tx-datasource>
  |     <jndi-name>MySqlDS</jndi-name>
  |     <connection-url>jdbc:mysql://192.168.0.138:3306/TinyPhotoAlbum</connection-url>
  |     <driver-class>com.mysql.jdbc.Driver</driver-class>
  |     <user-name>tinyphotoalbum</user-name>
  |     <password>tinyphotoalbum</password>
  |     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
  |     <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
  |     <metadata>
  |        <type-mapping>mySQL</type-mapping>
  |     </metadata>
  |   </local-tx-datasource>
  | </datasources>
  | 

Finnally i placed the driver in the lib-dir as:
JBOSS_HOME\server\default\lib\mysql-connector-java-5.1.6-bin.jar

Is there any more configuration that needs to be done?

BR,
Mattias

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

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



More information about the jboss-user mailing list