NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Giving up on Hibernate (for now), trying EclipseLink...

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
JavaMan55



Joined: 27 Dec 2010
Posts: 18

PostPosted: Mon Jan 10, 2011 8:25 pm    Post subject: Giving up on Hibernate (for now), trying EclipseLink... Reply with quote

Still no joy...

I get the following error:

WARNING [org.netbeans.ProxyClassLoader]: Will not load class javax.persistence.Persistence arbitrarily from one of ModuleCL@1f488f1[org.netbeans.modules.hibernatelib] and ModuleCL@5db5ae[org.ksh.eclipselink] starting from ModuleCL@6cef4[org.ksh.kslogbase]; see http://wiki.netbeans.org/DevFaqModuleCCE

Now, all I've done is follow the tutorial (mentioned elsewhere) using my own DB, and put the code, verbatim, into my TopComponent (well, except for changing the table names, and the persistence unit name to my versions of them) ...

First, I don't understand why it's trying to load anything from hibernatelib, and secondly, I actually did the program in the tutorial and could get it to work ... with the sample db, but not with mine! ARGH!

Just in case it matters, my persistence.xml looks like this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="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">
  <persistence-unit name="KSLogDataLayerPU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>kslog.Qsotable</class>
    <class>kslog.States</class>
    <properties>
      <property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/kslog"/>
      <property name="javax.persistence.jdbc.password" value="*****"/>
      <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
      <property name="javax.persistence.jdbc.user" value="kslog"/>
    </properties>
  </persistence-unit>
</persistence>


I make all the wrappers, like the tutorial says and create all the dependencies. Can you say, "Frustration"? Surprised
Back to top
obrienmi



Joined: 17 Jan 2011
Posts: 2
Location: Ottawa

PostPosted: Mon Jan 17, 2011 5:55 pm    Post subject: JPA 2.0 using EclipseLink as the Persistence Provider Reply with quote

JavaMan55,
Try the following tutorial for WebLogic or almost any other server.
http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial
http://wiki.eclipse.org/EclipseLink/Examples/JPA#Application_Server_Tutorials

The latest release of Oracle WebLogic Server has been available on OTN at the following location since 20110115.
http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html

This release provides support for JSR-317 JPA 2.0 container managed applications using the QWG8 patch or a manual prepending classpath change.

In 10.3.3.0 you were required to use the FilteringClassLoader via the *<wls:prefer-application-packages>* addition to your application managed persistence unit - this workaround as well as the persistence.xml renaming one is now fully deprecated and not required in 10.3.4.0 for both application and container managed persistence contexts.
As of 20110115 the 5 outstanding issues below look to be fixed by applying the http://download.oracle.com/docs/cd/E17904_01/web.1111/e13720/using_toplink.htm#EJBAD1309 patch for QWG8 or manually prepending to the WebLogic 10.3.4.0 server classpath.
%BEA_HOME%\modules\javax.persistence_1.0.0.0_2-0-0.jar;%BEA_HOME%\modules\com.oracle.jpa2support_1.0.0.0_2-0.jar

>A JPA 2.0 EE application using EclipseLink as the JPA2 persistence provider on WebLogic is detailed in the analysis section below
1) JPA 2.0 XSD parsing - verified
2) New JPA 2.0 schema elements like <shared-cache-mode>NONE</shared-cache-mode> - verified
3) JPA 2.0 runtime API like a entityManager.getMetamodel(); call on the Servlet or Stateless session bean - verified
4) JPA 2.0 weaving/instrumentation - this will require a more detailed lazy model and more debugging to fully verify
5) Dependency Injection of a container managed JPA 2.0 entityManager on a EJB component like a stateless session bean - verified
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#Enabling_JPA2_support

>OTN download
http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html
>Patching
http://download.oracle.com/docs/cd/E18476_01/doc.220/e18480/weblogicchap.htm
>Documentation
http://download.oracle.com/docs/cd/E17904_01/web.1111/e13852/toc.htm
>Supported Oracle WebLogic Server Versions
http://download.oracle.com/docs/cd/E15315_06/help/oracle.eclipse.tools.weblogic.doc/html/SupportedServerVersions.html
>TopLink JPA 2.0 Specific documentation/patching
http://download.oracle.com/docs/cd/E17904_01/web.1111/e13720/using_toplink.htm#EJBAD1309
>EclipseLink Wiki: JPA 2.0 using EclipseLink on WebLogic analysis (XSD, Weaving, DI of @PersistenceContext)
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#Enabling_JPA2_support

thank you
/Michael O'Brien
http://www.eclipselink.org
Back to top
darrensy



Joined: 13 Jun 2012
Posts: 2

PostPosted: Wed Jun 13, 2012 9:43 am    Post subject: Reply with quote

Do you still have an issue with that? I wanna know what method you used to fix.


__________________
flow assurance
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo