Remove related entity, oracle.toplink.essentials.indirection.IndirectList

I have two entities autogenerated by the jdev 10.1.3.1 JPA wizard, Proveedor(codprov varchar2 PK) having n Lineas(codprov varchar2 PK, Codline varchar2 PK) related as:
in entity Proveedor:
private List<Linea> lineas;
@OneToMany(mappedBy="proveedor")
public List<Linea> getLineas() {
return lineas;
public Linea removeLinea(Linea linea) {
System.out.println(" is at:" + getLineas().indexOf(linea));
getLineas().remove(linea);
linea.setProveedor(null);
return linea;
in Linea:
@Id
@ManyToOne
@JoinColumn(name="CODPROV", referencedColumnName="CODPROV")
public Proveedor getProveedor() {
return proveedor;
the delete method on the service bean is :
public void delLinea( String codprov,String codline){
EntityManager em = jpaResourceBean.getEntityManager();
try{
em.getTransaction().begin();
Linea linea = em.find(Linea.class, new LineaPK(codprov, codline));
em.remove(linea);
em.getTransaction().commit();
linea.getProveedor().removeLinea(linea);
finally {
em.close();
when i try to remove the entity linea calling delLinea on the service bean
the List (oracle.toplink.essentials.indirection.IndirectList) is NOT removing the entity linea, the system output show that is not there:
     06/08/30 16:59:23 is at:-1
the relationship is not lost, as linea.getProveedor().removeLinea(linea); works so it's being held ok (at least from Linea to Proveedor)
what i'm doing wrong, is IndirectList is mantaining copies of the related entities ??

thank you, after reading your reply i tried this:
public void delLinea( String codprov,String codline){
EntityManager em = jpaResourceBean.getEntityManager();
try{
em.getTransaction().begin();
Linea linea = em.find(Linea.class, new LineaPK(codprov, codline));
linea.getProveedor().removeLinea(linea);
em.remove(linea);
em.getTransaction().commit();
finally {
em.close();
As you advised, I'm reading the Proveedor in the transaction and clearing the relation before removing the entity Linea, but em.getTransaction().commit() throws:
GRAVE: #{ProveedorBean.linea_Del}: javax.faces.el.EvaluationException: javax.persistence.RollbackException: java.lang.NullPointerException
javax.faces.FacesException: #{ProveedorBean.linea_Del}: javax.faces.el.EvaluationException: javax.persistence.RollbackException: java.lang.NullPointerException
     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:98)
     at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)
     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:105)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
     at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
     at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
     at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
     at java.lang.Thread.run(Thread.java:595)
Caused by: javax.faces.el.EvaluationException: javax.persistence.RollbackException: java.lang.NullPointerException
     at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150)
     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
     ... 25 more
Caused by: javax.persistence.RollbackException: java.lang.NullPointerException
     at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:109)
     at oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:45)
     at services.inventario.impl.InventarioServiceBean.delLinea(InventarioServiceBean.java:473)
     at ui.ProveedorBean.linea_Del(ProveedorBean.java:152)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
     ... 26 more
Caused by: java.lang.NullPointerException
     at oracle.toplink.essentials.internal.identitymaps.CacheKey.computeHash(CacheKey.java:183)
     at oracle.toplink.essentials.internal.identitymaps.CacheKey.setKey(CacheKey.java:366)
     at oracle.toplink.essentials.internal.identitymaps.IdentityMap.getCacheKey(IdentityMap.java:277)
     at oracle.toplink.essentials.internal.identitymaps.IdentityMap.remove(IdentityMap.java:399)
     at oracle.toplink.essentials.internal.identitymaps.IdentityMapManager.removeFromIdentityMap(IdentityMapManager.java:1036)
     at oracle.toplink.essentials.internal.sessions.IdentityMapAccessor.removeFromIdentityMap(IdentityMapAccessor.java:801)
     at oracle.toplink.essentials.internal.sessions.IdentityMapAccessor.removeFromIdentityMap(IdentityMapAccessor.java:793)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.postMergeChanges(UnitOfWorkImpl.java:2834)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.mergeChangesIntoParent(UnitOfWorkImpl.java:2556)
     at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:93)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:842)
     at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:90)
     ... 34 more
The following variation throws the same exception:
public void delLinea( String codprov,String codline){
EntityManager em = jpaResourceBean.getEntityManager();
try{
em.getTransaction().begin();
Proveedor prov = em.find(Proveedor.class, codprov);
Linea linea = em.find(Linea.class, new LineaPK(codprov, codline));
prov.removeLinea(linea);
em.remove(linea);
em.getTransaction().commit();
finally {
em.close();
the following variation:
public void delLinea( String codprov,String codline){
EntityManager em = jpaResourceBean.getEntityManager();
try{
em.getTransaction().begin();
Proveedor prov = em.find(Proveedor.class, codprov);
Linea linea = em.find(Linea.class, new LineaPK(codprov, codline));
prov.removeLinea(linea);
em.getTransaction().commit();
em.getTransaction().begin();
linea = em.find(Linea.class, new LineaPK(codprov, codline));
em.remove(linea);
em.getTransaction().commit();
finally {
em.close();
after the second commit(); throws the same:
Caused by: javax.persistence.RollbackException: java.lang.NullPointerException
     at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:109)
     at oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:45)
     at services.inventario.impl.InventarioServiceBean.delLinea(InventarioServiceBean.java:477)
     at ui.ProveedorBean.linea_Del(ProveedorBean.java:152)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
     ... 23 more
Caused by: java.lang.NullPointerException
     at oracle.toplink.essentials.internal.identitymaps.CacheKey.computeHash(CacheKey.java:183)
     at oracle.toplink.essentials.internal.identitymaps.CacheKey.setKey(CacheKey.java:366)
     at oracle.toplink.essentials.internal.identitymaps.IdentityMap.getCacheKey(IdentityMap.java:277)
     at oracle.toplink.essentials.internal.identitymaps.IdentityMap.remove(IdentityMap.java:399)
     at oracle.toplink.essentials.internal.identitymaps.IdentityMapManager.removeFromIdentityMap(IdentityMapManager.java:1036)
     at oracle.toplink.essentials.internal.sessions.IdentityMapAccessor.removeFromIdentityMap(IdentityMapAccessor.java:801)
     at oracle.toplink.essentials.internal.sessions.IdentityMapAccessor.removeFromIdentityMap(IdentityMapAccessor.java:793)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.postMergeChanges(UnitOfWorkImpl.java:2834)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.mergeChangesIntoParent(UnitOfWorkImpl.java:2556)
     at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:93)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:842)
     at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:90)
     ... 31 more

Similar Messages

  • Help with: oracle.toplink.essentials.exceptions.ValidationException

    hi guys,
    I really need ur help with this.
    I have a remote session bean that retrieves a list of books from the database using entity class and I call the session bean from a web service. The problem is that when i display the books in a jsp directly from the session bean everything works ok but the problem comes when I call the session bean via the web service than it throws this:
    Exception Description: An attempt was made to traverse a relationship using indirection that had a null Session. This often occurs when an entity with an uninstantiated LAZY relationship is serialized and that lazy relationship is traversed after serialization. To avoid this issue, instantiate the LAZY relationship prior to serialization.
    at oracle.toplink.essentials.exceptions.ValidationException.instantiatingValueholderWithNullSession(ValidationException.java:887)
    at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:233)
    at oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:105)
    at oracle.toplink.essentials.indirection.IndirectList.buildDelegate(IndirectList.java:208)
    at oracle.toplink.essentials.indirection.IndirectList.getDelegate(IndirectList.java:330)
    at oracle.toplink.essentials.indirection.IndirectList$1.<init>(IndirectList.java:425)
    at oracle.toplink.essentials.indirection.IndirectList.iterator(IndirectList.java:424)
    at com.sun.xml.bind.v2.runtime.reflect.Lister$CollectionLister.iterator(Lister.java:278)
    at com.sun.xml.bind.v2.runtime.reflect.Lister$CollectionLister.iterator(Lister.java:265)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:129)
    at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
    at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
    at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:277)
    at com.sun.xml.bind.v2.runtime.BridgeImpl.marshal(BridgeImpl.java:100)
    at com.sun.xml.bind.api.Bridge.marshal(Bridge.java:141)
    at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:315)
    at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:142)
    at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:108)
    at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:258)
    at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:320)
    at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:93)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:454)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:176)
    ... 29 more
    This happens when I test the web service using netbeans 6.5.
    here's my code:
    session bean:
    ArrayList bookList = null;
    public ArrayList retrieveBooks()
    try
    List list = em.createNamedQuery("Book.findAll").getResultList();
    bookList = new ArrayList(list);
    catch (Exception e)
    e.getCause();
    return bookList;
    web service:
    @WebMethod(operationName = "retrieveBooks")
    public Book[] retrieveBooks()
    ArrayList list = ejbUB.retrieveBooks();
    int size = list.size();
    Book[] bookList = new Book[size];
    Iterator it = list.iterator();
    int i = 0;
    while (it.hasNext())
    Book book = (Book) it.next();
    bookList[i] = book;
    i++;
    return bookList;
    Please help guys, it's very urgent

    Yes i have a relationship but i didnt want it to be directly. Maybe this is a design problem but in my case I dont expect any criminals to be involved in lawsuit. My tables are like that:
    CREATE TABLE IF NOT EXISTS Criminal(
         criminal_id INTEGER NOT NULL AUTO_INCREMENT,
         gender varchar(1),
         name varchar(25) NOT NULL,
         last_address varchar(100),
         birth_date date,
         hair_color varchar(10),
         eye_color varchar(10),
         weight INTEGER,
         height INTEGER,
         PRIMARY KEY (criminal_id)
    ENGINE=INNODB;
    CREATE TABLE IF NOT EXISTS Lawsuit(
         lawsuit_id INTEGER NOT NULL AUTO_INCREMENT,
         courtName varchar(25),
         PRIMARY KEY (lawsuit_id),
         FOREIGN KEY (courtName) REFERENCES Court_of_Law(courtName) ON DELETE NO ACTION
    ENGINE=INNODB;
    CREATE TABLE IF NOT EXISTS Rstands_trial(
         criminal_id INTEGER,
         lawsuit_id INTEGER,
         PRIMARY KEY (criminal_id, lawsuit_id),
         FOREIGN KEY (criminal_id) REFERENCES Criminal(criminal_id) ON DELETE NO ACTION,
         FOREIGN KEY (lawsuit_id) REFERENCES Lawsuit(lawsuit_id) ON DELETE CASCADE
    ENGINE=INNODB;So I couldnt get it.

  • Oracle.toplink.essentials.exceptions.ValidationException

    Hi,
    In my EJB 3 application we added a Schema entity to our already existing Student entity.
    I added the followning code in the student entity:
    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(
              nullable = true,
              name = "SCHEMA_ID"
    private Schema schema;
    After adding the Schema enity I tried to compile and run the tests. I got the following toplink error message (roughly):
    nternal Exception: Exception [TOPLINK-7250] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: [class se.myapp.subsytem.alpha.Student] uses a non-entity [class se.myapp.subsytem.domain.Schema] as target entity in the relationship attribute [private e.myapp.subsytem.domain.Schema].
    I found out that I had to change the persistence.xml but not why?
    I would be very happy if someone could shed some light in this matter since I have no clue why I must put it in the persistence.xml
    cheers,
    //mike

    You must either annotate every Entity with the @Entity annotation, or map it through the ORM.xml. All Entities must also define an @Id annotation.
    -- James : http://www.eclipselink.org

  • Oracle TopLink Essentials and CommunicationsException

    Hi ,
    I have server application , using MySql and Oracle TopLink Essentials - 2.0 working fine .
    But in the next day am getting always error :
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failureAfter searching get some info , that there is a default connection time for MySql (8h), and after that conection is closing.
    I found some solution which should after 7h restart the connection, so it never will close :
    <property name="idle-timeout-in-seconds" value="25200"/>I add it to the persistence.xml, unfortunately this is not working :(
    Have any one the Idea how to solve this problem ?
    This is Exception stack :
    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    Last packet sent to the server was 0 ms ago.
    Error Code: 0
    Call: SELECT ID, EMAIL, PASSWORD, USERNAME, CREATIONDATE, DESCRIPTION FROM ADMIN WHERE (EMAIL = ?)
         bind => [and]
    Query: ReportQuery(***.*******.*****.models.Admin)
         *** ****.*******.core.LgAdmin.login(LgAdmin.java:149)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:616)
         at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:406)
         at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
         at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1417)
         at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:878)
         at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
         at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
         at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:49)
         at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
         at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
         at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274)
         at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:377)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
         at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
         at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
         at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
         at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
         at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
         at java.lang.Thread.run(Thread.java:636)
    Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failureThank you for any Help !!

    Hallo ForumKid2.
    Ok, at first , I am really beginner with J2EE :(
    Yes , I open connection as private attribute , with out closing it....
    private final EntityManagerFactory emf = Persistence.createEntityManagerFactory("TestModel", new java.util.HashMap<String, String>());I had an Idea to do it with own factory (Singleton class) to open and close the connection .
    I don't know how to do this via connection pool.. it mean to use some property in persistence.xml?
    But it will not fix the connection error ...or ?
    Anyone has Idea how to solve this problem ???
    Thank you !
    greetings
    andrzej

  • Log oracle.toplink.essentials messages to log4j

    Env: Netbeans 6.7, Java desktop app
    I am looking for sample code showing how to log toplink messages to log4j
    Thanks
    Dave

    There is a option to redirect the log to a file and that can be configured in Session.xml .Add the below xml element to Session.xml and based on the log level you can log the sql statements.
    <?xml version="1.0" encoding="Cp1252" ?>
    <sessions version="1.1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <session xsi:type="server-session">
    <name>default</name>
    <server-platform xsi:type="weblogic-10-platform"/>
    <logging xsi:type="eclipselink-log">
    <log-level>finer</log-level>
    <file-name>C:\Toplinklog\Pojo\QLS.log</file-name>
    </logging>
    <primary-project xsi:type="xml">META-INF/tlMap.xml</primary-project>
    </session>
    </sessions>
    Or
    If you want to implement your own logging mechanism using log4j then below is the appraoch.
    Create a SessionEventAdapter and hook session log in its preLogin() method.
    Create SessionEventAdapter
    public class MySessionEventAdapter extends SessionEventAdapter {
    public void preLogin(SessionEvent event) {
    event.getSession().setSessionLog(new MyTopLinkSessionLog());
    Declare SessionEventAdapter in sessions.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <toplink-sessions version="10g Release 3 (10.1.3.1.0)" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <session xsi:type="server-session">
    <name>ORCL_MYAPP</name>
    <server-platform xsi:type="websphere-60-platform"></server-platform>
    <event-listener-classes>
    <event-listener-class>com.myapp.MySessionEventAdapter</event-listener-class>
    </event-listener-classes>
    <logging xsi:type="toplink-log">
    <log-level>fine</log-level>
    <logging-options>
    <log-exception-stacktrace>true</log-exception-stacktrace>
    <print-thread>true</print-thread>
    <print-session>true</print-session>
    <print-connection>true</print-connection>
    <print-date>true</print-date>
    </logging-options>
    </logging>
    <primary-project xsi:type="xml">myToplinkProject.xml</primary-project>
    <login xsi:type="database-login">
    <platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</platform-class>
    <external-connection-pooling>true</external-connection-pooling>
    <external-transaction-controller>true</external-transaction-controller>
    <sequencing>
    <default-sequence xsi:type="native-sequence">
    <name>Native</name>
    <preallocation-size>1</preallocation-size>
    </default-sequence>
    </sequencing>
    <datasource lookup="string">jdbc/myDatasource</datasource>
    </login>
    <connection-policy></connection-policy>
    </session>
    </toplink-sessions>
    The session log class
    // I tried session log which extended oracle.toplink.logging.DefaultSessionLog; however it didn't work.
    public class MyTopLinkSessionLog extends AbstractSessionLog {
    public synchronized void log(SessionLogEntry sle) {
    if (sle.hasException()) {
    Throwable e = sle.getException();
    MyLogWriter.error(e.getClass().getName() + " : " + e.getMessage(), sle.getException());
    } else if (sle.getConnection() != null) {
    MyLogWriter.debug(sle.getMessage());
    Hoipe this helps.
    Regards,
    P.Vinay Kumar

  • How to Create and Remove CMP Entity with Toplink in same transaction??

    Hi, i have a problem to create and delete cmp intances with toplink.
    I create a entity bean and remove the same entity bean in the same transaction.
    ie. my method have this code:
    bean a = homeBean.create(pk);
    a.remove();
    bean a = homeBean.create(pk);
    this code throws a javax.ejb.DuplicateKeyException
    Toplink not remove CMP, execute the two calls of create first.
    What configure toplink to support this case ??
    Is this possible ??
    I Can't controling the transaction manualy i'm using CMP entity beans with CMT.
    tanks.
    Message was edited by:
    Carlos Lacerda

    BM,
    If you want to import the utils package into your code, then the location of the utils package has to be in your CLASSPATH. JDeveloper uses libraries to define a project's CLASSPATH.
    I'm not sure exactly what's going on here, but you might want to read the information about packages and class libraries in the online documentation. It's under:
    User Guides
    -> Working with JDeveloper
    -> Packages and Class Libraries
    Blaise

  • Remove related entity records

    Hi All,
    I have one mother  entity    'BTHeaderPartnerSet',  which contains the relation ship enties those are having the data .
    One of the relation ship entity is '  BTPartnerOpportunity' , which contains the all partners data those are existing in opportunity .  According to my requirement I need to remove or delete some records from above entity '   'BTPartnerOpportunity'  by chekcing the partner function . Please help me in this .
        IF lr_entity IS BOUND.
        lr_partnerset = lr_entity->get_related_entity( iv_relation_name = 'BTHeaderPartnerSet' ).
        IF lr_partnerset IS BOUND.
          lr_partneropp = lr_partnerset->get_related_entities( iv_relation_name = 'BTPartnerOpportunity' ).
          IF lr_partneropp IS BOUND.
            lr_iterator = lr_partneropp->get_iterator( ).
            lr_iterator->filter_by_property( iv_attr_name = 'PARTNER_FCT'
                                             iv_value     = 'Z000003' ).
    even though I have used filter by property it is not working .
    Regards,
    Ram

    Hi Dharama,
    I wrote the below code, still it is not deleting the entities from Relationship child entity .
    DATA:
       lr_current     TYPE REF TO if_bol_bo_property_access,
       lr_partnerset  TYPE REF TO cl_crm_bol_entity,
       lr_entity      TYPE REF TO cl_crm_bol_entity.
       lr_current ?= me->collection_wrapper->get_current( ).
       lr_entity ?= focus_bo.
       IF lr_entity IS BOUND.
         lr_partnerset = lr_entity->get_related_entity( iv_relation_name = 'BTHeaderPartnerSet' ).
       ENDIF.
       DATA: lr_bo TYPE REF TO if_bol_bo_property_access,
                 lr_iterator TYPE REF TO if_bol_bo_col_iterator,
                lr_entity1 TYPE REF TO cl_crm_bol_entity,
                 lr_col TYPE REF TO if_bol_bo_col.
       lr_partneropp = lr_partnerset->get_related_entities( iv_relation_name = 'BTPartnerOpportunity' ).
       lr_iterator = lr_partneropp->get_iterator( ).
    *  lr_entity1 = lt_iterator->find_by_property( iv_attr_name = 'PARTNER_FCT' iv_value = '0000021' ).
        lr_entity1 ?= lr_iterator->get_first( ).
        WHILE lr_entity1 is BOUND.
          lr_partneropp->remove( lr_entity1 ).
          lr_entity1 ?= lr_iterator->get_next( ).
          ENDWHILE.
       lr_current->set_property( iv_attr_name = 'PARTNER_SET ' iv_value = lr_partnerset ).
    regards,
    ram

  • Problems with Toplink Essentials on OracleAS 10.1.3.1 / OC4J 10.1.3.2

    Hi, all.
    I successfully installed OracleAS 10.1.3.0 and applied patch 5906151 to update do OAS 10.1.3.1 and OC4J 10.1.3.2, running on both Windows and AIX.
    I deployed a j2ee app (ejb-jar and ear/war separatelly) on both. My application runs very well on Windows platform, but fails on AIX.
    In order to get my app running with EJB 3.0, JPA and Toplink, I had to copy toplink-essentials.jar to $ORACLE_HOME/j2ee/home/applib/ directory.
    On AIX I was getting the following error:
    exception occurred during method invocation: javax.ejb.EJBException:
       java.lang.RuntimeException: javax.ejb.EJBException: oracle.toplink.essentials.exceptions.ValidationException
              Exception Description: Error encountered when building the @NamedQuery [MyClass.findAll]
                 from entity class [class oracle.toplink.essentials.internal.ejb.cmp3.metadata.queries.MetadataNamedQuery].
             Internal Exception: java.lang.IllegalStateException: ClassLoader "myApp.root:0.0.1"
               (from  in /oracle/product/10.1.3.0/j2ee/OC4J_1/applications/myApp/):
      This loader has been closed and should not be in use.;
    But I found a known issue on Metalink [Note:427650.1] (bug 5928776) - https://metalink.oracle.com/metalink/plsql/f?p=130:14:11405609768040641618::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,427650.1,1,1,1,helvetica
    I replaced the toplink-essentials.jar and toplink-essentials-agent.jar as stated on the metalink for the version build 41, and tested. And later for the latest build 58.
    But I am getting another error message:
    Exception [TOPLINK-46] (Oracle TopLink Essentials - 2.0 (Build b58-rc1 (08/05/2007))): oracle.toplink.essentials.exceptions.DescriptorException
    Exception Description: There should be one non-read-only mapping defined for the primary key field [MY_TABLE.MY_FIELD].
    Descriptor: RelationalDescriptor(xyz.MyClass --> [DatabaseTable(MY_TABLE)])
    Runtime Exceptions:
    ; nested exception is: javax.persistence.PersistenceException: Exception [TOPLINK-0] (Oracle TopLink Essentials - 2.0 (Build b58-rc1 (08/05/2007))): oracle.toplink.essentials.exceptions.IntegrityException
    Descriptor Exceptions:
    ---------------------------------------------------------Does anyone have any idea about this issue?

    Seems to be a bug. That was the response from Oracle support (Metalink)
    Response:
    Your issue seems to be related to bug 5594702 - Abstract: EJB30 ENTITY BEAN WITH @ID AND @COLUMN ANNOTATION FAILS TO DEPLOY ON AIX.
    There is an issue with the IBM JDK/JRE 1.5's processing of annotations.
    Links:
    http://www.theserverside.com/discussions/thread.tss?thread_id=37764
    http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?forum=367&thread=112543&cat=10
    When processing annotations it returns boolean values as false.
    Work-around:
    Fully specify the @Column annotation's boolean values. If insertable and updatable are set to false (which will happen due to this bug) then TopLink sets the PK
    mapping to read-only and the exception seen is expected.
    Note: nullable attribute of the @Colmun is not used in the EJB3/JPA preview of 10.1.3.0 If the customer MUST override the default column name then they should use:
    @Column(name="column-name", insertable=true, updatable=true)
    If they do not wish to override the default column name then simply do not use an @Column annotation.
    It can be deleted or commented out in the JDev generated code.
    There are two reported annotation processing issues with the AIX JVM. One was fixed in SR1 and the other is fixed
    in SR3 (due out Oc 11 - today). Upgrading to these more recent JVM releases may also address this issue.
    RECOMMENDED SOLUTIONS:
    1. Upgrade the IBM AIX JVM to SR3.
    OR
    2. Fix all generated @Column annotations as described above

  • How to verify OC4J uses Oracle Toplink 10.x and not Toplink Essentials

    Hi,
    We dont want to use the default JPA provider "Toplink *Essentials*" that comes with OC4J. Rather we want to use Oracle Toplink 10.x
    I downloaded [Oracle Toplink 10.x|http://www.oracle.com/technology/software/products/ias/htdocs/1013topsoft.html] and followed the installation instructions:- http://www.oracle.com/technology/products/ias/toplink/doc/10131/install/install.html#CHDBBIFB
    When i deploy my EJB 3.0 appliation and invoke a JPA Entity, i can see the server log:- NOTIFICATION TopLink, version: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))
    Do i have to do any other configuration/setting to ensure that i use Oracle Toplink and not Toplink Essentials in OC4J?
    Thanks in Advance,
    Prashant Tejura
    Edited by: user1186295 on May 26, 2009 10:33 AM

    rashant,
    Hi, there are currently the following providers to choose from - you may want to consult your rep for any details on moving from 10.1.3.4 to 10.1.3.5.
    1) TopLink or EclipseLink using EclipseLink JPA - the RI for JPA for WebLogic, OC4J and GlassFish
    - EclipseLink JPA is focus of all current JPA development as part of EclipseLink and TopLink
    2) Another open-source JPA implementation like OpenJPA or Hibernate
    Deprecated:
    3) TopLink using TopLink JPA - replaced by (1) TopLink using EclipseLink JPA
    4) TopLink using TopLink Essentials JPA - replaced by (1) TopLink using EclipseLink JPA
    Changes to server.xml as follows:
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/OC4J_Web_Tutorial#Modify_server.xml
    <shared-library name="oracle.persistence" version="1.0" library-compatible="true">
              <code-source path="../../../eclipselink/eclipselink.jar"/>
              <code-source path="../../../eclipselink/javax.persistence_*.jar"/>
              <import-shared-library name="oracle.jdbc"/>
         </shared-library>
    Changes to persistence.xml as follows: (container-managed JTA datasource)
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/OC4J_Web_Tutorial#Persistence.xml
    <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="example" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>jdbc/OracleDS</jta-data-source>
    <class>org.eclipse.persistence.example.jpa.server.business.Cell</class>
    <properties>
    <property name="eclipselink.target-server" value="OC4J"/>
    <property name="eclipselink.logging.level" value="FINEST"/>
    </properties>
    </persistence-unit>
    </persistence>
    You should see output similar to the following in your server log:
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/OC4J_Web_Tutorial#Console_Output
    [EL Finest]: 2009-02-26 14:04:34.464--ServerSession(8634980)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--Begin deploying Persistence Unit example; state Predeployed; factoryCount 1
    [EL Info]: 2009-02-26 14:04:34.542--ServerSession(8634980)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--EclipseLink, version: Eclipse Persistence Services - ***
    [EL Fine]: 2009-02-26 14:04:35.213--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--Detected Vendor platform: org.eclipse.persistence.platform.database.oracle.Oracle10Platform
    [EL Config]: 2009-02-26 14:04:35.26--ServerSession(8634980)--Connection(5230779)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--Connected: jdbc:oracle:thin:@//1y.yyy.yy.yy:1521/ORCL
         User: SCOTT
         Database: Oracle Version: Oracle Database 11g Release 11.1.0.0.0 - Production
         Driver: Oracle JDBC driver Version: 10.1.0.5.0
    [EL Finest]: 2009-02-26 14:04:35.385--UnitOfWork(5746770)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--PERSIST operation called on: org.eclipse.persistence.example.jpa.server.business.Cell@9107088( id: null state: null left: null right: null parent: null references: null).
    [EL Fine]: 2009-02-26 14:04:35.807--ClientSession(5748500)--Connection(6653899)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--INSERT INTO EL_CELL (ID, STATE, TSEQ, RIGHT_ID) VALUES (?, ?, ?, ?)
         bind => [551, null, null, null]
    thank you
    /michael
    www.eclipselink.org

  • Strange classloader experience with toplink-essentials on Oc4j-10.1.3.3.0

    Hi,
    I am teaching classes at the Eotvos University/Budapest on a topic where OC4J has been used for 2 years. Students use jdeveloper (regularly updated) to create webapps with EJB3.0+toplink backends. They test their projects first with the JDeveloper embedded OC4J, but after that they deploy it on a central server running standalone OC4J.
    Students make quite an intensive and versatile use of the OC4J server, a noteworthy stress-test you may find interesting! The server is a Ubuntu Linux with JDK_1.5.0_14.
    1. The first known issue is that after about 10 projects are deployed (small class projects 3-4 EJBs, 3-4 JSP-s each), oc4j regularl goes into a "runaway" mode, i.e. the CPU utilization of the JVM process goes up to 99-100%. Static web content is still available, but all applications stop responding. I can state pretty safely that the applications deployed are fairly harmless and it is not even necessary to run them to make this happen. I.e. after 10-15 apps are depoyed it is enough to start the admin-client.jar or the admin console to experience this problem. (The applications have no problem individually: last year after these issues occurred, we installed them individually for grading and nothing like this happened).
    Let me point out that SO FAR this happened with Oc4j-10.1.3.1 and Oc4j-10.1.3.2 only, and this was the main reason we swithed to Oc4j-10.1.3.3.0
    2. Another issue that exists both with the earlier versions and 10.1.3.3.0 is that applications need to include the toplink-essentials.jar explicitely if they use EJB3.0 entities. It appears to me that this should not be neessary as there are default definitions for that in config/server.xml (a shared-library definition for toplink-essentials), and in config/system-application.xml (a corresponding import-shared-library tag), but still their applications cannot be deployed because of the follwing error:
    Deploy error: Deploy error: Operation failed with error:
    Hiányzó osztály: oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
    FĂĽggĹ' osztály: com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl
    BetöltĹ': oc4j:10.1.3
    Kódforrás: /opt/oc4j_101330/j2ee/home/lib/oc4j-internal.jar
    (On our machines, JDK displays some errors in Hungarian: HiányzĂł osztály=Missing class; FĂĽggĹ' osztály=Dependent class; BetöltĹ'=Loader; KĂłdforrás=Code source.)
    To fix this issue, we used a workaround, i.e. their orion-application.xml is regularly extended with something like:
    <library path="/opt/oc4j/toplink/jlib/toplink-essentials.jar"/>
    And this solved the problem. Can you explain this?
    3. Now, with 10.1.3.3.0 this did not help much either. Although the toplink-essentials.jar was found, another nasty exception happened in the server still during deployment:
    Caused by: java.lang.NoSuchMethodException: oracle.toplink.essentials.platform.server.oc4j.Oc4jPlatform.<init>(oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl)
    at java.lang.Class.getConstructor0(Class.java:2678)
    at java.lang.Class.getConstructor(Class.java:1629)
    at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.updateServerPlatform(EntityManagerSetupImpl.java:309)
    Apparently a class in toplink-essentials.jar (version 2, build 41, i.e. the one that comes with oc4j) cannot properly invoke a the constructor of another class IN THE SAME JAR.
    I checked everything, even unzipped and checked the class signatures, and also made sure that there is no other toplink-essentials.jar in the classpath. Still the error remained.
    FInally, I tried to add the above libary tag to $OC4J_HOME/config/apllication.xml instead of the applications local orion-application.xml, and - voila!!! - it WORKS now!
    Can you explain all this to me? From the documentation the location of the <library> tag in the descriptor files should not amke any difference, but still it seems to do.
    Regards: Arpad Bakay

    Seems to be a bug. That was the response from Oracle support (Metalink)
    Response:
    Your issue seems to be related to bug 5594702 - Abstract: EJB30 ENTITY BEAN WITH @ID AND @COLUMN ANNOTATION FAILS TO DEPLOY ON AIX.
    There is an issue with the IBM JDK/JRE 1.5's processing of annotations.
    Links:
    http://www.theserverside.com/discussions/thread.tss?thread_id=37764
    http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?forum=367&thread=112543&cat=10
    When processing annotations it returns boolean values as false.
    Work-around:
    Fully specify the @Column annotation's boolean values. If insertable and updatable are set to false (which will happen due to this bug) then TopLink sets the PK
    mapping to read-only and the exception seen is expected.
    Note: nullable attribute of the @Colmun is not used in the EJB3/JPA preview of 10.1.3.0 If the customer MUST override the default column name then they should use:
    @Column(name="column-name", insertable=true, updatable=true)
    If they do not wish to override the default column name then simply do not use an @Column annotation.
    It can be deleted or commented out in the JDev generated code.
    There are two reported annotation processing issues with the AIX JVM. One was fixed in SR1 and the other is fixed
    in SR3 (due out Oc 11 - today). Upgrading to these more recent JVM releases may also address this issue.
    RECOMMENDED SOLUTIONS:
    1. Upgrade the IBM AIX JVM to SR3.
    OR
    2. Fix all generated @Column annotations as described above

  • Toplink Essentials JPA doesn't use GenerationType.IDENTITY

    Based on EJB 3 and JPA I want to store some entities (@Entity) in a database. For some of those entites the database auto increments the primary key. In these cases I defined a @TableGenerator and a @GeneratedValue using GenerationType.IDENTITY as strategy in order to get the primary key (@Id) updated after the entity has been persisted.
    Short example:
    @Entity
    @Table(name = "orders")
    public class POrder implements PEntity {
         @TableGenerator(name = "orderIdGenerator", initialValue = 0, allocationSize = 1)
         @Id
         @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "orderIdGenerator")
         @Column(name = "orderNumber", nullable = false)
         private Integer orderNumber;
    ...I am running the application on GlassFish. I added a corresponding JDBC resource to the server configuration, using the specific MySql driver interfaces.
    Persisting entities which doesn't use a TableGenerator works, but as soon as I try to persist an entity which should use a TableGenerator I am running in the following exception:
    beergame.server.exception.BeergameServerException: nested exception is: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.1 (Build b55-fcs (10/10/2008))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'beergame3.sequence' doesn't exist
    Error Code: 1146
    Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
         bind => [1, roleIdGenerator]
    Query: DataModifyQuery()
    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.1 (Build b55-fcs (10/10/2008))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'beergame3.sequence' doesn't exist
    Error Code: 1146
    Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
         bind => [1, roleIdGenerator]
    Query: DataModifyQuery()
         at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:311)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:654)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:703)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:492)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:452)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeCall(AbstractSession.java:690)
         at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
         at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:214)
         at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:257)
         at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelect(DatasourceCallQueryMechanism.java:237)
         at oracle.toplink.essentials.queryframework.DataModifyQuery.executeDatabaseQuery(DataModifyQuery.java:86)
         at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:628)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:1845)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:924)
         at oracle.toplink.essentials.sequencing.QuerySequence.update(QuerySequence.java:344)
         at oracle.toplink.essentials.sequencing.QuerySequence.updateAndSelectSequence(QuerySequence.java:283)
         at oracle.toplink.essentials.sequencing.StandardSequence.getGeneratedVector(StandardSequence.java:96)
         at oracle.toplink.essentials.sequencing.Sequence.getGeneratedVector(Sequence.java:281)
         at oracle.toplink.essentials.internal.sequencing.SequencingManager$Preallocation_Transaction_NoAccessor_State.getNextValue(SequencingManager.java:420)
         at oracle.toplink.essentials.internal.sequencing.SequencingManager.getNextValue(SequencingManager.java:846)
         at oracle.toplink.essentials.internal.sequencing.ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:110)
         at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:240)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.assignSequenceNumber(UnitOfWorkImpl.java:355)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:3266)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:432)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:3226)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.persist(EntityManagerImpl.java:221)
         at com.sun.enterprise.util.EntityManagerWrapper.persist(EntityManagerWrapper.java:440)
         at beergame.server.model.trans.impl.TExtensionOfPEntityImpl.persist(TExtensionOfPEntityImpl.java:130)
         at beergame.server.model.trans.impl.TRoleImpl.<init>(TRoleImpl.java:61)
         at beergame.server.logic.trans.impl.GameLogicImpl.assignUserToValueChainLevel(GameLogicImpl.java:81)
         at beergame.server.logic.remote.impl.UserSessionBean.createGame(UserSessionBean.java:65)
    I wonder why a sequence table has to be update whereas IDENTITY is defined as strategy. I tried also AUTO as strategy but it doesn' matter, the result is the same.
    I read several posts in forums, but couldn't find a solution. So I still have no idea how to get IDENTITY used as strategy. Any one of you does?
    My configuration:
    IDE: Eclipse 3.4.0
    Server: GlassFish V2 Java EE 5
    JPA Implementation: Toplink Essentials v2.1-b55
    JPA driver: oracle.toplink.essentials.PersistenceProvider
    Database: MySQL 5.0.51a
    JDBC driver: mysql-connector-java-5.1.5

    I did it. I must admit, I was a little bit confused by the annotation TableGenerator. It is not responsible for generating ids of a table at all but only in conjunction with a table which should provide ids.
    After I removed @TableGenerator and also the corresponding reference within @GeneratedValue the persistence works as expected. Now the code looks like this:
    @Entity
    @Table(name = "orders")
    public class POrder implements PEntity {
         @Id
         @GeneratedValue(strategy = GenerationType.IDENTITY)
         @Column(name = "orderNumber", nullable = false)
         private Integer orderNumber;
    ...Edited by: TomCat78 on Oct 12, 2008 3:38 PM

  • Predeploy for PersistenceUnit failed - JBOSS with toplink essentials

    I am trying to migrate my project from Tomcat 6 to Jboss-5.1.0-GA
    I am using JPA 1.0 with toplink-essentials 2.0 for database process.
    In tomcat it is working perfectly.
    But when i am trying in JBOSS, it showing the below error..
    19:38:27,983 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#Entity state=Create
    javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
    Exception Description: predeploy for PersistenceUnit [Entity] failed.
    Internal Exception: java.lang.NullPointerException
    at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:615)
    at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:178)
    at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
    at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
    at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
    at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
    at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
    at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
    at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
    at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
    at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
    at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
    at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
    at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
    at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
    at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
    at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
    at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
    at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
    at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
    at org.jboss.Main.boot(Main.java:221)
    at org.jboss.Main$1.run(Main.java:556)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
    Exception Description: predeploy for PersistenceUnit [Entity] failed.
    Internal Exception: java.lang.NullPointerException
    at oracle.toplink.essentials.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:212)
    ... 62 more
    Caused by: java.lang.NullPointerException
    at oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLHelper.parseDocument(XMLHelper.java:623)
    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.readStandardMappingFiles(MetadataProcessor.java:369)
    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.readMappingFiles(MetadataProcessor.java:339)
    at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:344)
    at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:584)
    ... 61 more
    15:37:39,014 WARN [HDScanner] Failed to process changes
    org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
    DEPLOYMENTS IN ERROR:
    Deployment persistence.unit:unitName=#Entity is in error due to the following reason(s): java.lang.NullPointerException
    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
    at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)and my persistence.xml file is here like below...
    <persistence 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" version="1.0">
    <persistence-unit name="Entity" transaction-type="JTA">
    <provider>oracle.toplink.essentials.PersistenceProvider</provider>
    <jta-data-source>java:/iport</jta-data-source>
    <mapping-file>orm.xml</mapping-file>
    <class>env.model.authorization.IptUsersRoles</class>
    <class>env.model.defaults.IptConveyourMaster</class>
    <class>env.model.defaults.IptAccessroles</class>
    <class>env.model.defaults.IptAccesstype</class>
    <class>env.model.defaults.IptAccounttype</class>
    <class>env.model.defaults.IptCompanylicensejoin</class>
    <class>env.model.defaults.IptCompagentjoin</class>
    <class>env.model.defaults.IptState</class>
    <class>env.model.defaults.IptStockyardCargotype</class>
    <class>env.model.defaults.IptTaxcategory</class>
    <class>env.model.defaults.IptTaxparameter</class>
    <class>env.model.defaults.IptTaxtype</class>
    <class>env.model.defaults.IptTerminaltype</class>
    <class>env.model.defaults.IptTugtype</class>
    <class>env.model.defaults.IptGldetailsmaster</class>
    <class>env.model.defaults.IptBagmaster</class>
    <class>env.model.defaults.IptTax</class>
    <class>env.model.defaults.IptBranch</class>
    <class>env.model.defaults.IptTransactionType</class>
    <class>env.model.masters.IptAgentmaster</class>
    <class>env.model.operations.IptCommunicationTemplate</class>
    <class>env.model.operations.IptCommtemplateLines</class>
    <class>env.model.workflow.IptApprovedDocstatus</class>
    <class>env.model.masters.IptVesselPerformanceMaster</class>
    <class>env.model.defaults.IptEquipmentType</class>
    <class>env.model.defaults.IptCity</class>
    <class>env.model.transactions.IptLabreportFunction</class>
    <class>env.model.defaults.IptAttachmentConfiguration</class>
    <class>env.model.defaults.IptAttachmentConfigurationLines</class>
    <class>env.model.defaults.IptExchangeratelines</class>
    <class>env.model.masters.IptNotifications</class>
    <class>env.model.masters.IptNotificationslines</class>
    <class>env.model.defaults.IptLogSheet</class>
    <properties>
    <property name="toplink.jdbc.driver"
    value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
    <property name="toplink.jdbc.url"
    value="jdbc:sqlserver://x.x.x.x;databaseName=IPORTMAN_GPL" />
    <property name="toplink.jdbc.user" value="xx" />
    <property name="toplink.jdbc.password" value="xx" />
    </properties>
    </persistence-unit>
    </persistence>I also have the /META-INF/orm.xml file... where the code is like below...
    <?xml version="1.0" encoding="UTF-8"?>
    <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
    version="1.0">
    <persistence-unit-metadata>
    <persistence-unit-defaults>
    <schema>IPORTMAN</schema>
    <catalog>IPORTMAN_GPL</catalog>
    </persistence-unit-defaults>
    </persistence-unit-metadata>
    </entity-mappings>I can understand one thing, that there is some thing wrong in persistence.xml and it's data.
    After so much googled, i had found some solutions.... like....
    1) Remove the "private static final long serialVersionUID = 1L;" from all pojos.
    2) There should not be white space in persistence.xml inside <class> tag.
    3) Change the JTA datasource from NON-JTA datasoucre.
    I had changed all things as per the above mentioned points.
    But still i am getting the same error.
    Please verify the problem and suggest me a possible solution.
    Please help me.. Please..
    Edited by: sree4j on May 1, 2013 12:55 AM
    Edited by: sree4j on May 1, 2013 12:56 AM
    Edited by: sree4j on May 1, 2013 12:57 AM

    Hai jsutherl, Thank you for reply..
    Right now cannot upgrade my project from toplink to eclipselink.
    Because my project was an huge application. where i am using nearly 250 actionclasses and dao.
    I already tried to migrate, but the package structures are completely different. so, i am unable to figure out this packages path.
    So, as per your suggestion, i had renamed my orm.xml to mapping.xml file.
    But when i am running the application then the below error was throwing....
    19:03:30,149 INFO [STDOUT] [TopLink Warning]: 2013.05.01 07:03:30.119--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class env.model.masters.IptNotifications. The class is ignored.[here IptNotifications is a database pojo refrence class where the db table name is IPT_NOTIFICATIONS]
    The above same kind of error was throwing to all my pojos [i.e. Database table refrence classes]
    Please help me.
    I have to migrate my project to jboss.
    All my work are getting stopped due to this issues.
    Please help me..

  • TopLink on WebLogic or oracle.toplink.PersistenceProvider

    Hy.
    I have applied patch 5KXF to add toplink 11g on WebLogic 10.3.
    Now, in BEA_HOME\patch_wls1030\patch_jars\ there is toplink.jar.
    But how can I use it?
    Inside toplink.jar there is file META-INF\services\META-INF\services\javax.persistence.spi.PersistenceProvider.
    I assume that content of this file is the name of the implementation class.
    It is "oracle.toplink.PersistenceProvider".
    But when I put this name in persistence.xml and try to deploy my EAR, this message appears
    =====================================================================================================
    weblogic.deployment.EnvironmentException: Error processing persitence unit toplink of module toplink.jar: Error instantiating the Persistenc
    e Provider class oracle.toplink.essentials.PersistenceProvider of the PersistenceUnit toplink: java.lang.ClassNotFoundException: oracle.topl
    ink.essentials.PersistenceProvider
    at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:322)
    at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:123)
    at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:331)
    at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptor(AbstractPersistenceUnitRegistry.java:245)
    at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:63)
    =====================================================================================================
    The persistence.xml file looks like
    =====================================================================================================
    <persistence-unit name="toplink">
    <provider>
    oracle.toplink.essentials.PersistenceProvider
    </provider>
    <jta-data-source>jdbc/miroslav_rehirDS</jta-data-source>
    </persistence-unit>
    =====================================================================================================
    One thing more .... In the filesistem I can't find class oracle.toplink.PersistenceProvider.
    On the other hand it is OK to put
    <provider>
    org.eclipse.persistence.jpa.PersistenceProvider
    </provider>
    Thanks four your replies,
    Miroslav

    Miroslav,
    You may be interested in the latest release of Oracle WebLogic Server.
    See the recent OTN post from 20110115 detailing the latest release of Oracle WebLogic Server and some retesting of the previous issues related to JSR-317 JPA 2.0 support below.
    11g Release 1 Patch Set 3 (WLS 10.3.4)
    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.
    commEnv.cmd: line 67
    @rem Set BEA Home
    set BEA_HOME=C:\opt\wls1034r20110115
    @rem Enable JPA 2.0 functionality on WebLogic Server 10.3.4 with the following patch line for commEnv.cmd:67
    set PRE_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 below1) 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 downloadhttp://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
    Documentationhttp://download.oracle.com/docs/cd/E17904_01/web.1111/e13852/toc.htm
    Supported Oracle WebLogic Server Versionshttp://download.oracle.com/docs/cd/E15315_06/help/oracle.eclipse.tools.weblogic.doc/html/SupportedServerVersions.html
    TopLink JPA 2.0 Specific documentation/patchinghttp://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

  • Toplink Essentials + Composite Primary Key Mapping Error

    Exception [TOPLINK-7150] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: Invalid composite primary key specification. The names of the primary key fields or properties in the primary key class [ar.com.eds.mcd.fawkes.model.PreviousStepEJB3PK] and those of the entity bean class [class ar.com.eds.mcd.fawkes.model.PreviousCurrentStepEJB3] must correspond and their types must be the same. Also, ensure that you have specified id elements for the corresponding attributes in XML and/or an @Id on the corresponding fields or properties of the entity class.
    Is it a Toplink bug?
    I have the following code:
    public class PreviousStepEJB3PK implements Serializable {
    private static final long serialVersionUID = 3024775815042084864L;
    public Long id;
    public Long previousId;
    public PreviousStepEJB3PK() {
    public PreviousStepEJB3PK(Long id, Long previousId) {
    this.id = id;
    this.previousId = previousId;
    public boolean equals(Object other) {
    if (other instanceof PreviousStepEJB3PK) {
    final PreviousStepEJB3PK otherPreviousStepPK = (PreviousStepEJB3PK) other;
    final boolean areEqual = (otherPreviousStepPK.id.equals(id) && otherPreviousStepPK.previousId.equals(previousId));
    return areEqual;
    return false;
    public int hashCode() {
    return super.hashCode();
    @Entity
    @Table(name = "OS_CURRENTSTEP_PREV")
    @NamedQuery(name = "findById",
    query = "select object(o) from PreviousCurrentStepEJB3 o where o.id = ?1")
    @IdClass(PreviousStepEJB3PK.class)
    public class PreviousCurrentStepEJB3 implements Serializable {
    private static final long serialVersionUID = 1717698904412346878L;
    @Id
    @Column(name = "ID", nullable = false)
    private Long id;
    @Id
    @Column(name = "PREVIOUS_ID", nullable = false)
    private Long previousId;
    public PreviousCurrentStepEJB3() {
    I´m using eclipse to deploy my application over an OC4J. When I launch the deploy I have the following error:
    07/07/05 11:42:47 Caused by: Exception [TOPLINK-7150] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: Invalid composite primary key specification. The names of the primary key fields or properties in the primary key class [ar.com.eds.mcd.fawkes.model.PreviousStepEJB3PK] and those of the entity bean class [class ar.com.eds.mcd.fawkes.model.PreviousCurrentStepEJB3] must correspond and their types must be the same. Also, ensure that you have specified id elements for the corresponding attributes in XML and/or an @Id on the corresponding fields or properties of the entity class.
    07/07/05 11:42:47 at oracle.toplink.essentials.exceptions.ValidationException.invalidCompositePKSpecification(ValidationException.java:995)
    07/07/05 11:42:47 at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataValidator.throwInvalidCompositePKSpecification(MetadataValidator.java:119)
    07/07/05 11:42:47 at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.validatePrimaryKey(ClassAccessor.java:1463)
    07/07/05 11:42:47 at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.process(ClassAccessor.java:463)
    07/07/05 11:42:47 at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processAnnotations(MetadataProcessor.java:196)
    07/07/05 11:42:47 at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.processORMetadata(EntityManagerSetupImpl.java:993)
    07/07/05 11:42:47 at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:501)
    07/07/05 11:42:47 at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:152)

    I ran into a similar problem. I was able to work around it by putting the @Id annotations on the accessors for the primary key fields rather than on the fields themselves. This seems like a bug to me.

  • Unable to deploy Web App using JPA TopLink Essentials in Tomcat5.5.17

    Hi All,
    I am trying to deploy a Web App ( used Top Link Essentials ) to Tomcat and i am getting the following Error..
    I am strating tomcat using -javaagent:/Path/To/spring-agaent.jar
    Dec 14, 2006 9:52:46 AM org.apache.catalina.loader.WebappClassLoader loadClass
    INFO: Illegal access: this web application instance has been stopped already.  Could not load oracle.toplink.essentials.internal.weaving.ClassDetails.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
    java.lang.IllegalStateException
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            at oracle.toplink.essentials.internal.weaving.TopLinkWeaver.transform(TopLinkWeaver.java:84)
            at org.springframework.orm.jpa.persistenceunit.ClassFileTransformerAdapter.transform(ClassFileTransformerAdapter.java:56)
            at sun.instrument.TransformerManager.transform(TransformerManager.java:122)
            at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
            at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1812)
            at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:866)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            at java.lang.Class.getDeclaredConstructors0(Native Method)
            at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
            at java.lang.Class.getConstructor0(Class.java:2671)
            at java.lang.Class.newInstance0(Class.java:321)
            at java.lang.Class.newInstance(Class.java:303)
            at org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:396)
            at com.sun.faces.config.ConfigureListener.verifyObjects(ConfigureListener.java:1438)
            at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:509)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
            at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
            at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
            at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
            at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
            at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
            at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
            at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
            at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
            at org.apache.catalina.core.StandardService.start(StandardService.java:450)
            at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
            at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432) Thanks
    Sateesh

    Spring 2.0 provides custom support for TopLink Essentials in Tomcat out-of-the-box. You should follow the instructions here: http://static.springframework.org/spring/docs/2.0.x/reference/orm.html#orm-jpa-setup-lcemfb-tomcat
    Essentially, Spring provides a custom class loader for Tomcat and doesn't use an agent.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Cursor Hover Pop-up Doesn't Say the Right Thing?

    Hello everyone, I'm a fairly new Macbook user and I'm beginning to notice that the the yellow boxed pop-up doesn't always relate to or say the right thing. For ex. if I had about 6 to 7 tabs open, the tabs found further right have no problem giving m

  • SQL Server Memory Usage Peaks to 95% and its not releasing SQL 2012

    We are currently running SQL 2012  64 bit, Lock Pages Enabled, 128 GB. We allocated Max Memory 112000, Min Memory to 0. We have a SQL Maintenace Job which backs up (Full Backup) of our server around 11PM at that time the SQL Server memory peaks to al

  • To See training session for XMP Metadata

    Hi all, Can u plz tell me the link useful in training Session for getting and setting the metadata for image. Thanks Best Regards Dan

  • Screen slides to the right

    Ever since I downloaded and installed Lion the screen at the flick of the mouse will move to the right exposing another desktop with widgets and other stuff.   The only way to get back to my regular desktop is to click on the arrow at the lower right

  • About thumbnails of FF 602 not showing up

    Hi FF Thanks for a great software. It is great but sometimes having troubles as you keep on rolling new updates... One of rather minor issue but still annoying is that suddenly thumbnail of FF from taskbar and desktop (later noticed even actual exe f