[jboss-user] [Persistence] - moving JPA application using Hibernate to JBOSS 5.01

2009-11-21 Thread waltc
Hi,
I apologize for this as I am sure it is a frequent question but I have not 
found an answer. I have a JPA servlet that was running fine under Tomcat 6 with 
the persistence.xml under WEB-INF/classes/META-INF.

This file pointed to the db, specified the dialect, etc etc

When I moved the war file over to JBoss 5.0.1 I first discovered I needed to 
add the non-jta-provider element. Originally I pointed to defaultDS as the 
examples I did find depicted. I then received an error that indicating I could 
not have the hibernate jars under the web-inf/lib for the web service webapp 
(javax.persistence class casting). I removed all the hibernate jars from the 
local web-inf/lib. I next received an error indicating the dialect 
(MySQLDialect) could not be cast to Dialect. As it happens I also have a Seam 
application that uses the same logical database So I thought perhaps it was 
related to the datasource specification. I next changed that specification 
 to point to the same ds that the seam app uses. I still 
have the same error about the dialect. Below is the specified persistence.xml. 
Would someone be kind enough to either paste a reference to a quick how-to move 
a j2se based jpa web app to jboss 5.0.1 or explain what it is that is w!
 rong with the below file.

Thanks,

Walt

Here is the error:

DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "persistence.unit:unitName=#CU3JPAPU" is missing the following 
dependencies:
Dependency "jboss.jca:name=UpdaterDatasource 
transaction-type="RESOURCE_LOCAL",service=DataSourceBinding" (should be in 
state "Create", but is actually in state "** NOT FOUND Depends on 
'jboss.jca:name=UpdaterDatasource 
transaction-type="RESOURCE_LOCAL",service=DataSourceBinding' **")

DEPLOYMENTS IN ERROR:
Deployment "jboss.jca:name=UpdaterDatasource 
transaction-type="RESOURCE_LOCAL",service=DataSourceBinding" is in error due to 
the following reason(s): ** NOT FOUND Depends on 
'jboss.jca:name=UpdaterDatasource 
transaction-type="RESOURCE_LOCAL",service=DataSourceBinding' **

Here is the persistence.xml


http://java.sun.com/xml/ns/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/ ... ce_1_0.xsd">

org.hibernate.ejb.HibernatePersistence
java:/UpdaterDatasource 
transaction-type="RESOURCE_LOCAL"















This works fine in tomcat using effectively the same persistence.xml.
The non-jta-data-source element was added as I worked through all sorts of 
deployment issues ending here. Isn't there a simple way to do this. The 
application is resource-local as it bootstraps its own EntityManagerFactory 
from the static under Persistence. I did find a jira indicating it should work 
and was fixed but it doesn't appear to be to me.

Thanks,

Walt

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

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

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Persistence] - moving JPA application using Hibernate to JBOSS 5.01

2009-11-21 Thread waltc
Hi,
I apologize for this as I am sure it is a frequent question but I have not 
found an answer. I have a JPA servlet that was running fine under Tomcat 6 with 
the persistence.xml under WEB-INF/classes/META-INF.

This file pointed to the db, specified the dialect, etc etc

When I moved the war file over to JBoss 5.0.1 I first discovered I needed to 
add the non-jta-provider element. Originally I pointed to defaultDS as the 
examples I did find depicted. I then received an error that indicating I could 
not have the hibernate jars under the web-inf/lib for the web service webapp 
(javax.persistence class casting). I removed all the hibernate jars from the 
local web-inf/lib. I next received an error indicating the dialect 
(MySQLDialect) could not be cast to Dialect. As it happens I also have a Seam 
application that uses the same logical database So I thought perhaps it was 
related to the datasource specification. I next changed that specification 
 to point to the same ds that the seam app uses. I still 
have the same error about the dialect. Below is the specified persistence.xml. 
Would someone be kind enough to either paste a reference to a quick how-to move 
a j2se based jpa web app to jboss 5.0.1 or explain what it is that is w!
 rong with the below file.

Thanks,

Walt

Here is the error:

DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "persistence.unit:unitName=#CU3JPAPU" is missing the following 
dependencies:
Dependency "jboss.jca:name=UpdaterDatasource 
transaction-type="RESOURCE_LOCAL",service=DataSourceBinding" (should be in 
state "Create", but is actually in state "** NOT FOUND Depends on 
'jboss.jca:name=UpdaterDatasource 
transaction-type="RESOURCE_LOCAL",service=DataSourceBinding' **")

DEPLOYMENTS IN ERROR:
Deployment "jboss.jca:name=UpdaterDatasource 
transaction-type="RESOURCE_LOCAL",service=DataSourceBinding" is in error due to 
the following reason(s): ** NOT FOUND Depends on 
'jboss.jca:name=UpdaterDatasource 
transaction-type="RESOURCE_LOCAL",service=DataSourceBinding' **

Here is the persistence.xml


  | http://java.sun.com/xml/ns/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/ ... ce_1_0.xsd">
  | 
  | org.hibernate.ejb.HibernatePersistence
  | java:/UpdaterDatasource 
transaction-type="RESOURCE_LOCAL"
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 

This works fine in tomcat using effectively the same persistence.xml.
The non-jta-data-source element was added as I worked through all sorts of 
deployment issues ending here. Isn't there a simple way to do this. The 
application is resource-local as it bootstraps its own EntityManagerFactory 
from the static under Persistence. I did find a jira indicating it should work 
and was fixed but it doesn't appear to be to me.

Thanks,

Walt

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

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

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Persistence] - Re: moving JPA application using Hibernate to JBOSS 5.01

2009-11-21 Thread waltc
After much trial and error and false starts I discovered my problem.

It is important that the web-inf/lib contain NO hibernate jar files or 
javassist.jar. The original error, which was, the MySQLDialect could not be 
cast to Dialect was due to the mismatched hibernate jars. So be careful here.



The final persistence.xml is:

  | I believe I could live better without the class elements as this version of 
hibernate will discover them.
  | The c3p0 properties, even though commented out, I left in as the 
non-jta-data-source should have connection and statement pooling in it not here.
  | 
  | http://java.sun.com/xml/ns/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";>
  |   
  | org.hibernate.ejb.HibernatePersistence
  | java:/LuceneResumeDatasource
  | 
  |   
  |   
  |   
  |   
  |  
  |   
  | 
  | 
  |   
  | 

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266906
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user