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

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 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

  • 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

  • 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

  • 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

  • Accessing the Session in Toplink Essentials

    I try access session by this way:
    http://ontoplink.blogspot.com/2007/01/accessing-session-in-toplink-essentials.html
    and get exception:
    (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: Could not find the session with the name [my_name] in the session.xml file []
    Is session.xml needed for this ? I hope not, because it requires project.xml and it maybe require some another... All what I need is:
    session.getEventManager().addListener(myEventListener);
    to force toplink switch database schema in listener preLogin method. In Hibernate, it can be done by one line in config file.
    Lumir

    OK, I tried obtain session BEFORE creating EntityManagerFactory and EntityManager.
    Now when obtaining it AFTER creating EMF and EM, it works.
    But this not solve problem with change db schema, because AFTER create EMF and EM, session is logged in and EventListener preLogin isn't called.
    Can anyone point me, how to change db schema ? I know it for connection defined using toplink.jdbc.* properties, but not for JNDI:
    public class ToplinkSessionCustomizer implements SessionCustomizer
    public void customize(Session session) throws Exception
              if(jdbcUrl == null)
                   // JDBC URL is not set, assume JNDI lookup
                   JNDIConnector connector = (JNDIConnector) session.getLogin().getConnector();
                   connector.setLookupType(JNDIConnector.STRING_LOOKUP);
                   // 1. Not works, cause NPE
                   // at oracle.toplink.essentials.descriptors.ClassDescriptor.verifyTableQualifiers(ClassDescriptor.java:3518)
                   session.getDatasourcePlatform().setTableQualifier(schema);
                   SessionEventAdapter preLoginEventListener = new SessionEventAdapter()
                   // Listen for preLogin events
                        public void preLogin(SessionEvent event)
                        event.getSession().getLogin().setTableQualifier("myschema");
                   // 2. Not works, eventManager is null, cause NPE !
                   session.getEventManager().addListener(preLoginEventListener);
              else
    // This works OK
                   DatabaseLogin login = session.getLogin();
                   login.useOracleThinJDBCDriver();
                   login.setDatabaseURL(jdbcUrl);
                   login.setUserName(userName);
                   login.setPassword(password);
                   login.setTableQualifier(schema);
         }

  • 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.

  • 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

  • Toplink Essentials how to use scope_identity w/ sqlserver

    I created a class that extends SQLServerPlatform and overrode the method buildSelectForNativeSequence with:
    public ValueReadQuery buildSelectQueryForNativeSequence() {
    return new ValueReadQuery("select scope_identity() AS 'identity' ");
    When I run a test I get and error.
    I can see from the log that toplink is now using scope_identity instead of @@Identity. What is the problem?
    I cannot use @@Identity because triggers are firing on the insert table which is causing the wrong identity to be returned.
    Please help!!!!
    [TopLink Fine]: 2007.04.02 12:06:33.281--ClientSession(14384648)--Connection(3803825)--Thread(Thread[AWT-EventQueue-0,6,main])--INSERT INTO Personnel (AssignedBy, AssignmentType, CaseId, LastEditedBy, DateAssigned, _version, LastEditedOn, TimeAssigned, cruiser, OfficerId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    bind => [0000, 1, 8, greg, 2007-04-05 12:06:18.859, 1, 2007-04-02 12:06:33.109, 12:06, null, 0087]
    [TopLink Finest]: 2007.04.02 12:06:33.281--ClientSession(14384648)--Thread(Thread[AWT-EventQueue-0,6,main])--Execute query ValueReadQuery()
    [TopLink Fine]: 2007.04.02 12:06:33.281--ClientSession(14384648)--Connection(3803825)--Thread(Thread[AWT-EventQueue-0,6,main])--select scope_identity() AS 'identity'
    [TopLink Warning]: 2007.04.02 12:06:33.296--UnitOfWork(22481956)--Thread(Thread[AWT-EventQueue-0,6,main])--Local Exception Stack:
    Exception [TOPLINK-4011] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Exception Description: Error preallocating sequence numbers. The sequence table information is not complete.
    at oracle.toplink.essentials.exceptions.DatabaseException.errorPreallocatingSequenceNumbers(DatabaseException.java:137)

    The error seems to indicate that null is being returned. Verify that scope_identity is returning the correct value. Switching to using a sequence table would workaround the issue and improve your performance through allowing sequence pre-allocation.

  • 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..

  • Oracle.toplink errors, but no toplink installed? (10G, SRDemo)

    Hello, I installed the Chapter 4 SRDemo on my machine, and I am receiving an error. (at bottom)
    However, I am able to connect to the database without any problems, have been using the same database connection for over a month, but wanted to trying doing the EJBs and following the SRDemo tutorial.
    This locks my account, so it is using the correct account name (Which is not the same as the default from the demo)
    What is really confusing me is the references to TopLink everwhere. I do not have TopLink installed. When I try to debug when I step into the line where the error is thrown it tells me "Unable to find source file for package oracle.toplink.essentials.exceptions, filename TopLinkException.java.
    Here is the error I receive on running the ServiceRequestFacadeClientEmbed.java in the SRDemo:
    Mar 16, 2009 12:05:14 PM oracle.toplink.essentials.session.file:/C:/TEMP/oratemp/SRDEMO/Model/classes/-Model
    INFO: TopLink, version: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))
    Mar 16, 2009 12:05:14 PM oracle.toplink.essentials.session.file:/C:/TEMP/oratemp/SRDEMO/Model/classes/-Model
    INFO: Server: unknown
    Mar 16, 2009 12:05:16 PM com.evermind.server.ejb.logging.EJBMessages logException
    SEVERE: [ServiceRequestFacade:public org.srdemo.persistence.Products org.srdemo.business.ServiceRequestFacadeBean.findProductById(java.lang.Long)] exception occurred during method invocation: oracle.oc4j.rmi.OracleRemoteException: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    Error Code: 1017; nested exception is:
         Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    ....

    OK... so I started with a new try. (Same machine) Edit --- installed Oracle and JDev on a new machine, got the exact same results.
    Downloaded JDeveloper 10G
    Extracted to new directory.
    New application - accepted all defaults.
    New Business Tier->EJB->Entities from Tables
    Substep - New Database Connection Accepted defaults, entered user name and password, entered hostname (not on localhost) and sid. Tested connection (Success!)
    Selected only Address Table and accept all defaults.
    project1.Addresses.java is created.
    New Session Bean -> accepted all defaults
    SessionEJBBean.java is created
    New Sample Java Client -> accepted all defaults
    SessionEJBClient.java is created
    Ran SessionEJBBean.java
    [Starting OC4J using the following ports: HTTP=8989, RMI=23891, JMS=9227.]
    C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\config>
    C:\Jdev10-2\jdk\bin\javaw.exe -client -classpath C:\Jdev10-2\j2ee\home\oc4j.jar;C:\Jdev10-2\jdev\lib\jdev-oc4j-embedded.jar -Xverify:none -XX:MaxPermSize=256m -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\config\server.xml
    [waiting for the server to complete its initialization...]
    Mar 17, 2009 10:54:42 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Auto-unpacking C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\dms.war...
    Mar 17, 2009 10:54:42 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Unjar C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\dms.war in C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\dms
    Mar 17, 2009 10:54:42 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Finished auto-unpacking C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\dms.war
    Mar 17, 2009 10:54:42 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Auto-unpacking C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\connectors\datasources\datasources.rar...
    Mar 17, 2009 10:54:42 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Unjar C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\connectors\datasources\datasources.rar in C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\connectors\datasources\datasources
    Mar 17, 2009 10:54:42 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Finished auto-unpacking C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\connectors\datasources\datasources.rar
    Mar 17, 2009 10:54:42 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Auto-unpacking C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\datatags.ear...
    Mar 17, 2009 10:54:42 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Unjar C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\datatags.ear in C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\datatags
    Mar 17, 2009 10:54:43 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Finished auto-unpacking C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\datatags.ear
    Mar 17, 2009 10:54:43 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Auto-unpacking C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\datatags\webapp.war...
    Mar 17, 2009 10:54:43 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Unjar C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\datatags\webapp.war in C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\datatags\webapp
    Mar 17, 2009 10:54:46 AM oracle.oc4j.util.FileUtils autoUnpack
    INFO: Finished auto-unpacking C:\Jdev10-2\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\applications\datatags\webapp.war
    Mar 17, 2009 10:54:46 AM com.evermind.server.XMLApplicationServerConfig randomizeJtaAdminPassword
    INFO: Updating JtaAdmin account
    Ready message received from Oc4jNotifier.
    Embedded OC4J startup time: 31654 ms.
    09/03/17 10:54:51 Oracle Containers for J2EE 10g (10.1.3.4.0)  initializedRun SessionEJBClient.java
    Mar 17, 2009 10:55:30 AM oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
    WARNING: Exception returned by remote server: {0}
    javax.ejb.EJBException: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    Error Code: 1017; nested exception is:
         Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    Error Code: 1017; nested exception is: oracle.oc4j.rmi.OracleRemoteException: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    Error Code: 1017; nested exception is:
         Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    Error Code: 1017
    oracle.oc4j.rmi.OracleRemoteException: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    Error Code: 1017
         at com.evermind.server.ejb.EJBUtils.getUserException(EJBUtils.java:346)
         at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:75)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at SessionEJB_RemoteProxy_11o700f.queryAddressesFindAll(Unknown Source)
         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.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
         Nested exception is:
    .....So I would really appreciate any help, I have no good idea where to go next. I'm going to go try wiping a machine in the next cube and installing Oracle from scratch too.
    Thanks,
    Jeff
    Edited by: jeffles on Mar 17, 2009 9:49 AM

  • 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

  • Problem with standalone Toplink Essentials (Spring/JPA)

    I'm using the Glassfish/Toplink JPA implementation in combination with the new JPA code in 2.0M5. Works great when I run my web app from within Maven using the jetty6 maven plugin.
    But, when I deploy my app as a WAR to an application server I get the following exception:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: URI scheme is not "file"
    Caused by: java.lang.IllegalArgumentException: URI scheme is not "file"
    at java.io.File.<init>(File.java:338)
    at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.getPersistentClassNamesFromURL(PersistenceUnitProcessor.java:556)
    at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.buildPersistentClassSet(PersistenceUnitProcessor.java:401)
    at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.buildEntityList(EntityManagerSetupImpl.java:159)
    at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:492)
    at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:154)
    at org.springframework.orm.jpa.ContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(ContainerEntityManagerFactoryBean.java:181)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:232)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:901)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:870)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:393)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:256)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:167)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:332)
    at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4236)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4760)
    at com.sun.enterprise.web.WebModule.start(WebModule.java:292)
    This happens with both Glassfish and plain Tomcat.
    I don't really understand the problem. It looks like some classpath issue, but it is not clear what Toplink is looking for.
    S.

    Hello,
    Does this work if you set the <exclude-unlisted-classes> tag to true and list your classes in the persistence.xml as described in:
    http://www.oracle.com/technology/products/ias/toplink/jpa/howto/java-se-usage.html
    If it works, the problem might be with searching the persistence context for entities using a non-url classloader.
    Best Regards,
    Chris

Maybe you are looking for