This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error caused by persistence.xml

 
Chih-Wei Lee
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Chih-Wei Lee
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 823
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 823
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 823
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And also.... weblogic is a smart choice
 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic