-
1. 1 datasource, 1 persistence unit, 2 war's
wdfink Apr 13, 2011 9:00 AM (in response to carek)Two persistenceunits and one mysql-ds.xml should be ok.
Could you attach the configuration files and the server.log?
-
2. Re: 1 datasource, 1 persistence unit, 2 war's
carek Apr 13, 2011 10:46 AM (in response to wdfink)sure.
Here they are:
persistences:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="console" transaction-type="JTA"> <jta-data-source>java:/DefaultDS</jta-data-source> <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class> <class>org.drools.persistence.info.SessionInfo</class> <class>org.drools.persistence.info.WorkItemInfo</class> </persistence-unit> </persistence>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="pl.edu.agh.iosr.agent" transaction-type="JTA"> <jta-data-source>java:/DefaultDS</jta-data-source> <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class> <class>org.drools.persistence.info.SessionInfo</class> <class>org.drools.persistence.info.WorkItemInfo</class> <properties> <property name="jboss.entity.manager.factory.jndi.name" value="java:/EntityManagerFactory"/> </properties> </persistence-unit> </persistence>
hibernate:
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.username">root</property> <property name="connection.password"></property> <property name="connection.pool_size">1</property> <property name="current_session_context_class">thread</property> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> <property name="hibernate.hbm2ddl.auto">update</property> <property name="hibernate.show_sql">true</property> </session-factory> </hibernate-configuration>
datasource:
<?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>DefaultDS</jndi-name> <connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>root</user-name> <password></password> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> </datasources>
I am afraid that there's third persistence.xml or rather I woud say lack of it... After searching through code of jbpm console I saw a line:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa);
but I can't see any persistence.xml inside it's war... In addition processes are read from hardcoded path on disk... well I guess the only thing I can do is to modify jbpm console source code and recompile it
-
server.log.zip 11.9 KB
-
-
3. 1 datasource, 1 persistence unit, 2 war's
wdfink Apr 13, 2011 10:24 AM (in response to carek)You should not deploy a hibernate configuration if you use persistence.xml (I've never done in that way)
-
4. Re: 1 datasource, 1 persistence unit, 2 war's
carek Apr 13, 2011 10:30 AM (in response to wdfink)ok. Thanks for the advice
-
5. 1 datasource, 1 persistence unit, 2 war's
wdfink Apr 13, 2011 10:38 AM (in response to carek)Oooh,
please, please edit your post and attach the log as file,
the thread and the log is mor or less unreadable.