You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Matthieu Riou <ma...@gmail.com> on 2007/04/30 18:05:11 UTC

Deployment on JBoss

Hi guys,

One of our users in ODE is trying to deploy on JBoss. There seems to be some
configuration problems, most probably related to the presence of Hibernate
in the server. He's having the following stacktrace (I trimmed the non
relevant bits):

13:15:29,343 INFO  [STDOUT] ERROR - ODEServer.initDAO(413) | Error
instantiating
 DAO Connection Factory class org.apache.ode.dao.jpa.BPELDAO
ConnectionFactoryImp
l.
javax.persistence.PersistenceException: Provider error. Provider:
org.hibernate.
ejb.HibernatePersistence
       at javax.persistence.Persistence.createFactory(Persistence.java:175)
       at javax.persistence.Persistence.createEntityManagerFactory
(Persistence.
java:111)
       at org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl.init
(BPELDAOConne
ctionFactoryImpl.java:108)
       at org.apache.ode.il.dbutil.Database.createDaoCF(Database.java:267)
       at org.apache.ode.axis2.ODEServer.initDAO(ODEServer.java:410)
       at org.apache.ode.axis2.ODEServer.init(ODEServer.java:144)
       ....
13:15:31,078 INFO  [STDOUT] ERROR - StandardContext.loadOnStartup(4073) |
Servle
t /ode threw load() exception
java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
       at javax.persistence.Persistence.createFactory(Persistence.java:169)
       at javax.persistence.Persistence.createEntityManagerFactory
(Persistence.
java:111)
       at org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl.init
(BPELDAOConne
ctionFactoryImpl.java:108)
       at org.apache.ode.il.dbutil.Database.createDaoCF(Database.java:267)
       at org.apache.ode.axis2.ODEServer.initDAO(ODEServer.java:410)
       at org.apache.ode.axis2.ODEServer.init(ODEServer.java:144)

As you can see there's a ClassCastException in
javax.persistence.Persistence.createFactory which is a bit weird. Note that
we instantiate the factory using a specific name:

_emf = Persistence.createEntityManagerFactory("ode-dao", propMap);

And that our persistence.xml *only* references the OpenJPA persistence
factory. I've looked at the sources of Persistence.java in Glassfish but
couldn't find the right version that seems to be used here (the
createFactory method doesn't seem to exist anymore).

I'm running out of ideas and thought the knowledgeable people would probably
know more about the JBoss environment. Any idea?

Thanks!
Matthieu

RE: Deployment on JBoss

Posted by Patrick Linskey <pl...@bea.com>.
I was suggesting to put it into the xml file, not to remove it. At the
time, I had only read the very beginning of your email. It's early still
in my time zone.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Matthieu Riou [mailto:matthieu.riou@gmail.com] 
> Sent: Monday, April 30, 2007 9:15 AM
> To: Patrick Linskey
> Cc: open-jpa-dev@incubator.apache.org
> Subject: Re: Deployment on JBoss
> 
> It's hard for me to test as this is reported by one of our 
> users but I can ask him to try that. But wouldn't that result 
> in selecting the Hibernate implementation instead OpenJPA 
> (which we don't want)?
> 
> Thanks,
> Matthieu
> 
> 
> On 4/30/07, Patrick Linskey <pl...@bea.com> wrote:
> 
> 	What happens if you toss
> 	
> '<provider>org.apache.openjpa.persistence.PersistenceProviderI
> mpl</provi
> 	der>' into your persistence.xml file?
> 	
> 	-Patrick
> 	
> 	--
> 	Patrick Linskey
> 	BEA Systems, Inc. 
> 	
> ______________________________________________________________
> _________
> 	Notice:  This email message, together with any 
> attachments, may contain
> 	information  of  BEA Systems,  Inc.,  its subsidiaries  
> and  affiliated 
> 	entities,  that may be confidential,  proprietary,  
> copyrighted  and/or
> 	legally privileged, and is intended solely for the use 
> of the individual
> 	or entity named in this message. If you are not the 
> intended recipient, 
> 	and have received this message in error, please 
> immediately return this
> 	by email and then delete it.
> 	
> 	> -----Original Message-----
> 	> From: Matthieu Riou [mailto: matthieu.riou@gmail.com 
> <ma...@gmail.com> ]
> 	> Sent: Monday, April 30, 2007 9:05 AM
> 	> To: open-jpa-dev@incubator.apache.org
> 	> Subject: Deployment on JBoss
> 	>
> 	> Hi guys,
> 	>
> 	> One of our users in ODE is trying to deploy on JBoss. There
> 	> seems to be some configuration problems, most probably
> 	> related to the presence of Hibernate in the server. He's 
> 	> having the following stacktrace (I trimmed the non 
> relevant bits):
> 	>
> 	> 13:15:29,343 INFO  [STDOUT] ERROR - ODEServer.initDAO(413) |
> 	> Error instantiating  DAO Connection Factory class
> 	> org.apache.ode.dao.jpa.BPELDAO ConnectionFactoryImp l.
> 	> javax.persistence.PersistenceException: Provider 
> error. Provider:
> 	> org.hibernate.
> 	> ejb.HibernatePersistence
> 	>        at
> 	> javax.persistence.Persistence.createFactory 
> (Persistence.java:175)
> 	>        at 
> javax.persistence.Persistence.createEntityManagerFactory
> 	> (Persistence.
> 	> java:111)
> 	>        at 
> org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl.init
> 	> (BPELDAOConne 
> 	> ctionFactoryImpl.java:108)
> 	>        at
> 	> 
> org.apache.ode.il.dbutil.Database.createDaoCF(Database.java:267)
> 	>        at 
> org.apache.ode.axis2.ODEServer.initDAO(ODEServer.java:410)
> 	>        at 
> org.apache.ode.axis2.ODEServer.init(ODEServer.java:144)
> 	>        ....
> 	> 13:15:31,078 INFO  [STDOUT] ERROR -
> 	> StandardContext.loadOnStartup(4073) | Servle t /ode threw
> 	> load() exception
> 	> java.lang.ClassCastException : 
> org.hibernate.ejb.HibernatePersistence
> 	>        at
> 	> 
> javax.persistence.Persistence.createFactory(Persistence.java:169)
> 	>        at 
> javax.persistence.Persistence.createEntityManagerFactory
> 	> (Persistence. 
> 	> java:111)
> 	>        at 
> org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl.init
> 	> (BPELDAOConne
> 	> ctionFactoryImpl.java:108)
> 	>        at
> 	> org.apache.ode.il.dbutil.Database.createDaoCF 
> (Database.java:267)
> 	>        at 
> org.apache.ode.axis2.ODEServer.initDAO(ODEServer.java:410)
> 	>        at 
> org.apache.ode.axis2.ODEServer.init(ODEServer.java:144)
> 	>
> 	> As you can see there's a ClassCastException in 
> 	> javax.persistence.Persistence.createFactory which is a bit
> 	> weird. Note that we instantiate the factory using a 
> specific name:
> 	>
> 	> _emf = 
> Persistence.createEntityManagerFactory("ode-dao", propMap); 
> 	>
> 	> And that our persistence.xml *only* references the OpenJPA
> 	> persistence factory. I've looked at the sources of
> 	> Persistence.java in Glassfish but couldn't find the right
> 	> version that seems to be used here (the createFactory method 
> 	> doesn't seem to exist anymore).
> 	>
> 	> I'm running out of ideas and thought the knowledgeable people
> 	> would probably know more about the JBoss environment. 
> Any idea?
> 	>
> 	> Thanks! 
> 	> Matthieu
> 	>
> 	
> 	Notice:  This email message, together with any 
> attachments, may contain information  of  BEA Systems,  Inc., 
>  its subsidiaries  and  affiliated entities,  that may be 
> confidential,  proprietary,  copyrighted  and/or legally 
> privileged, and is intended solely for the use of the 
> individual or entity named in this message. If you are not 
> the intended recipient, and have received this message in 
> error, please immediately return this by email and then delete it. 
> 	
> 
> 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

Re: Deployment on JBoss

Posted by Matthieu Riou <ma...@gmail.com>.
It's hard for me to test as this is reported by one of our users but I can
ask him to try that. But wouldn't that result in selecting the Hibernate
implementation instead OpenJPA (which we don't want)?

Thanks,
Matthieu

On 4/30/07, Patrick Linskey <pl...@bea.com> wrote:
>
> What happens if you toss
> '<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provi
> der>' into your persistence.xml file?
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
> _______________________________________________________________________
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it.
>
> > -----Original Message-----
> > From: Matthieu Riou [mailto:matthieu.riou@gmail.com]
> > Sent: Monday, April 30, 2007 9:05 AM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: Deployment on JBoss
> >
> > Hi guys,
> >
> > One of our users in ODE is trying to deploy on JBoss. There
> > seems to be some configuration problems, most probably
> > related to the presence of Hibernate in the server. He's
> > having the following stacktrace (I trimmed the non relevant bits):
> >
> > 13:15:29,343 INFO  [STDOUT] ERROR - ODEServer.initDAO(413) |
> > Error instantiating  DAO Connection Factory class
> > org.apache.ode.dao.jpa.BPELDAO ConnectionFactoryImp l.
> > javax.persistence.PersistenceException: Provider error. Provider:
> > org.hibernate.
> > ejb.HibernatePersistence
> >        at
> > javax.persistence.Persistence.createFactory(Persistence.java:175)
> >        at javax.persistence.Persistence.createEntityManagerFactory
> > (Persistence.
> > java:111)
> >        at org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl.init
> > (BPELDAOConne
> > ctionFactoryImpl.java:108)
> >        at
> > org.apache.ode.il.dbutil.Database.createDaoCF(Database.java:267)
> >        at org.apache.ode.axis2.ODEServer.initDAO(ODEServer.java:410)
> >        at org.apache.ode.axis2.ODEServer.init(ODEServer.java:144)
> >        ....
> > 13:15:31,078 INFO  [STDOUT] ERROR -
> > StandardContext.loadOnStartup(4073) | Servle t /ode threw
> > load() exception
> > java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
> >        at
> > javax.persistence.Persistence.createFactory(Persistence.java:169)
> >        at javax.persistence.Persistence.createEntityManagerFactory
> > (Persistence.
> > java:111)
> >        at org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl.init
> > (BPELDAOConne
> > ctionFactoryImpl.java:108)
> >        at
> > org.apache.ode.il.dbutil.Database.createDaoCF(Database.java:267)
> >        at org.apache.ode.axis2.ODEServer.initDAO(ODEServer.java:410)
> >        at org.apache.ode.axis2.ODEServer.init(ODEServer.java:144)
> >
> > As you can see there's a ClassCastException in
> > javax.persistence.Persistence.createFactory which is a bit
> > weird. Note that we instantiate the factory using a specific name:
> >
> > _emf = Persistence.createEntityManagerFactory("ode-dao", propMap);
> >
> > And that our persistence.xml *only* references the OpenJPA
> > persistence factory. I've looked at the sources of
> > Persistence.java in Glassfish but couldn't find the right
> > version that seems to be used here (the createFactory method
> > doesn't seem to exist anymore).
> >
> > I'm running out of ideas and thought the knowledgeable people
> > would probably know more about the JBoss environment. Any idea?
> >
> > Thanks!
> > Matthieu
> >
>
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual or
> entity named in this message. If you are not the intended recipient, and
> have received this message in error, please immediately return this by email
> and then delete it.
>

RE: Deployment on JBoss

Posted by Patrick Linskey <pl...@bea.com>.
What happens if you toss
'<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provi
der>' into your persistence.xml file?

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Matthieu Riou [mailto:matthieu.riou@gmail.com] 
> Sent: Monday, April 30, 2007 9:05 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: Deployment on JBoss
> 
> Hi guys,
> 
> One of our users in ODE is trying to deploy on JBoss. There 
> seems to be some configuration problems, most probably 
> related to the presence of Hibernate in the server. He's 
> having the following stacktrace (I trimmed the non relevant bits):
> 
> 13:15:29,343 INFO  [STDOUT] ERROR - ODEServer.initDAO(413) | 
> Error instantiating  DAO Connection Factory class 
> org.apache.ode.dao.jpa.BPELDAO ConnectionFactoryImp l.
> javax.persistence.PersistenceException: Provider error. Provider:
> org.hibernate.
> ejb.HibernatePersistence
>        at 
> javax.persistence.Persistence.createFactory(Persistence.java:175)
>        at javax.persistence.Persistence.createEntityManagerFactory
> (Persistence.
> java:111)
>        at org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl.init
> (BPELDAOConne
> ctionFactoryImpl.java:108)
>        at 
> org.apache.ode.il.dbutil.Database.createDaoCF(Database.java:267)
>        at org.apache.ode.axis2.ODEServer.initDAO(ODEServer.java:410)
>        at org.apache.ode.axis2.ODEServer.init(ODEServer.java:144)
>        ....
> 13:15:31,078 INFO  [STDOUT] ERROR - 
> StandardContext.loadOnStartup(4073) | Servle t /ode threw 
> load() exception
> java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
>        at 
> javax.persistence.Persistence.createFactory(Persistence.java:169)
>        at javax.persistence.Persistence.createEntityManagerFactory
> (Persistence.
> java:111)
>        at org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl.init
> (BPELDAOConne
> ctionFactoryImpl.java:108)
>        at 
> org.apache.ode.il.dbutil.Database.createDaoCF(Database.java:267)
>        at org.apache.ode.axis2.ODEServer.initDAO(ODEServer.java:410)
>        at org.apache.ode.axis2.ODEServer.init(ODEServer.java:144)
> 
> As you can see there's a ClassCastException in 
> javax.persistence.Persistence.createFactory which is a bit 
> weird. Note that we instantiate the factory using a specific name:
> 
> _emf = Persistence.createEntityManagerFactory("ode-dao", propMap);
> 
> And that our persistence.xml *only* references the OpenJPA 
> persistence factory. I've looked at the sources of 
> Persistence.java in Glassfish but couldn't find the right 
> version that seems to be used here (the createFactory method 
> doesn't seem to exist anymore).
> 
> I'm running out of ideas and thought the knowledgeable people 
> would probably know more about the JBoss environment. Any idea?
> 
> Thanks!
> Matthieu
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

RE: Deployment on JBoss

Posted by Patrick Linskey <pl...@bea.com>.
> As you can see there's a ClassCastException in 
> javax.persistence.Persistence.createFactory which is a bit 
> weird. Note that we instantiate the factory using a specific name:

Aah, you had more content in your email. Of course.

> And that our persistence.xml *only* references the OpenJPA 
> persistence factory. I've looked at the sources of 

Sounds like you've already got the OpenJPA persistence provider listed.

> persistence factory. I've looked at the sources of 
> Persistence.java in Glassfish but couldn't find the right 
> version that seems to be used here (the createFactory method 
> doesn't seem to exist anymore).

What do you mean -- in what sense does that method not exist anymore?

> I'm running out of ideas and thought the knowledgeable people 
> would probably know more about the JBoss environment. Any idea?

IIRC, the JBoss folks were talking about using a Persistence class other
than the one from the RI, so they may have other behavior in their impl.
Certainly, if this is the case, it doesn't sound like their impl is
compliant with the spec, although I don't know what the status of the
CTS is wrt. loading other JPA impls. Also, I don't know what JBoss's
Java EE 5 status is.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Matthieu Riou [mailto:matthieu.riou@gmail.com] 
> Sent: Monday, April 30, 2007 9:05 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: Deployment on JBoss
> 
> Hi guys,
> 
> One of our users in ODE is trying to deploy on JBoss. There 
> seems to be some configuration problems, most probably 
> related to the presence of Hibernate in the server. He's 
> having the following stacktrace (I trimmed the non relevant bits):
> 
> 13:15:29,343 INFO  [STDOUT] ERROR - ODEServer.initDAO(413) | 
> Error instantiating  DAO Connection Factory class 
> org.apache.ode.dao.jpa.BPELDAO ConnectionFactoryImp l.
> javax.persistence.PersistenceException: Provider error. Provider:
> org.hibernate.
> ejb.HibernatePersistence
>        at 
> javax.persistence.Persistence.createFactory(Persistence.java:175)
>        at javax.persistence.Persistence.createEntityManagerFactory
> (Persistence.
> java:111)
>        at org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl.init
> (BPELDAOConne
> ctionFactoryImpl.java:108)
>        at 
> org.apache.ode.il.dbutil.Database.createDaoCF(Database.java:267)
>        at org.apache.ode.axis2.ODEServer.initDAO(ODEServer.java:410)
>        at org.apache.ode.axis2.ODEServer.init(ODEServer.java:144)
>        ....
> 13:15:31,078 INFO  [STDOUT] ERROR - 
> StandardContext.loadOnStartup(4073) | Servle t /ode threw 
> load() exception
> java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
>        at 
> javax.persistence.Persistence.createFactory(Persistence.java:169)
>        at javax.persistence.Persistence.createEntityManagerFactory
> (Persistence.
> java:111)
>        at org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl.init
> (BPELDAOConne
> ctionFactoryImpl.java:108)
>        at 
> org.apache.ode.il.dbutil.Database.createDaoCF(Database.java:267)
>        at org.apache.ode.axis2.ODEServer.initDAO(ODEServer.java:410)
>        at org.apache.ode.axis2.ODEServer.init(ODEServer.java:144)
> 
> As you can see there's a ClassCastException in 
> javax.persistence.Persistence.createFactory which is a bit 
> weird. Note that we instantiate the factory using a specific name:
> 
> _emf = Persistence.createEntityManagerFactory("ode-dao", propMap);
> 
> And that our persistence.xml *only* references the OpenJPA 
> persistence factory. I've looked at the sources of 
> Persistence.java in Glassfish but couldn't find the right 
> version that seems to be used here (the createFactory method 
> doesn't seem to exist anymore).
> 
> I'm running out of ideas and thought the knowledgeable people 
> would probably know more about the JBoss environment. Any idea?
> 
> Thanks!
> Matthieu
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.