my dog learned polymorphism*
The moose likes BEA/Weblogic and the fly likes Error caused by persistence.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Error caused by persistence.xml" Watch "Error caused by persistence.xml" New topic
Author

Error caused by persistence.xml

Chih-Wei Lee
Ranch Hand

Joined: Feb 20, 2008
Posts: 129
Hi:
I am trying to deploy my web application to WebLogic 11gR1.
I use JPA1.0 + Hibernate 3.3.
When I deploy my web app via WebLogic console.
I ran into this error

id "-1" from server "CarbeionServer-0". Exception is: "java.lang.ClassNotFoundException: org.hibernate.HibernateException: This error c
ould indicate that a component was deployed on a cluster member but not other m
embers of that cluster. Make sure that any component deployed on a server that i
s part of a cluster is also deployed on all other members of that cluster

The error caused by the persistence.xml

<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">

<persistence-unit name="carbeionPU">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.format_sql" value="true"/>
</properties>
</persistence-unit>

</persistence>

Once I define a persistence provider in persistence.xml, I got this error. If I delete it then it works fine.
I have put all hibernate related jar in WEB-INF/lib and set pre-load the classes in WEB-INF-lib in weblogic.xml
Weblogic should be able to load those jar to deal with persistence.xml

Does anyone know how to solve this problem?

Thanks,

Chris


SCEA, SCJD, SCDJWS, SCWCD, SCJP
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 818

Try putting your related jar files under domain/lib of the domain you are working on in the WLS .

Let's see if that works.


Regards, Sud.
SCJP 5 ScjpFAQ JLS
Chih-Wei Lee
Ranch Hand

Joined: Feb 20, 2008
Posts: 129
Thanks sudipto, it works.
However, when I try to add Spring configuration file, applicationContext.xml.
It said

"HibernateEntityManagerFactory violate class loading constraint"

So far, I have ran into too many problems making Hibernate work with WebLogic.
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 818

Did you try finding about this? I mean, do you know cause of this error ?

Chih-Wei Lee wrote:

"HibernateEntityManagerFactory violate class loading constraint"



Chih-Wei Lee
Ranch Hand

Joined: Feb 20, 2008
Posts: 129
Hi sudipto:
Unfortunately I don't know what causes this error. I think it might be my Spring configuration,
but the same configuration works on Tomcat.
I think the configuration is quite simple and don't know why it just doesn't work on WebLogic.
I have been trying to move a web app from Tomcat to Weblogic during this weekend.
It just doesn't work on WebLogic and so many errors during the deployment. Sometimes, WebLogic just hang there and doesn't tell me what the error is.
I just feel frustrated and decide to stick with Tomcat.
Although it's not a complete application server like WebLogic, but it did gave me the most flexibility to integrate with other frameworks or functions.
If you know the answer, I still appreciate you can tell me. Maybe I will still try it on WebLogic.

Thanks,
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 818

Could I have a look at the error log....

After a small research I found out this, go through this and see if this could help..... link

Till then let me see if I could find out anything else.....
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 818

And also.... weblogic is a smart choice
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 818

After a research I found out that this is a known issue that comes while deploying/ redeploying an application with hibernate.
And this needs to be fixed by the vendor of the framework provider.

Keep looking if Oracle releases a patch to fix this.

Hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error caused by persistence.xml
 
Similar Threads
A question about "persistence.xml" by Weblogic
EJB3 2 client apps and 2 different databases
deploy jar with jpa Entites to Glassfish
No Persistence provider for EntityManager named...
Can <jar-file> inside persistence.xml be used in .war apps?