Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] eclipselink.target-server value for SAP Netweaver

Title: [eclipselink-users] eclipselink.target-server value for SAP Netweaver

Hi,

this is in reply to the thread "eclipselink.target-server value for SAP Netweaver".

At the time beeing, there is no built-in ServerPlatform for SAP Netweaver. Nevertheless, you can use EclipseLink with NetWeaver. In order to do so, you have to provide a JTATransaction controler class to EclipseLink:

package org.eclipse.persistence.transaction.sap;

import javax.naming.InitialContext;
import javax.transaction.TransactionManager;

import org.eclipse.persistence.transaction.JTATransactionController;

public class SapTransactionController extends JTATransactionController {
    public static final String JNDI_TRANSACTION_MANAGER_NAME = "TransactionManager";

    @Override
    protected TransactionManager acquireTransactionManager() throws Exception {
        return (TransactionManager)jndiLookup(JNDI_TRANSACTION_MANAGER_NAME);
    }
}

please compile this class against EclipseLink and pack it into the eclipselink.jar.

Then, you must specify this JTATransactionControler in the persistence-unit's properties section of the persistence.xml:

<properties>
  <property name="eclipselink.target-server" value="org.eclipse.persistence.transaction.sap.SapTransactionController"/>
</properties>

I hope this gets you further.


(Also, you might address this issue here: http://forums.sdn.sap.com/forum.jspa?forumID=229&start=0)


Best regards,

Adrian Goerler
SAP AG

Pflichtangaben/Mandatory Disclosure Statements:
http://www.sap.com/company/legal/impressum.epx



I'm deploying my application on SAP Netweaver CE 7.1 and looking at
the docs I don't see a target server value for Netweaver:

http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Extensions_for_Session.2C_Target_Database_and_Target_Application_Server

Has anyone implemented a class which implements
org.eclipse.persistence.platform.ServerPlatform which they are willing
to share?

The exception that I'm currently getting is as follows, it can't find
the TransactionManager.  Any ideas on how to get around this?

Exception Description: Error looking up external Transaction resource
under JNDI name [java:appserver/TransactionManager]
Internal Exception:
com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException:
Path to object does not exist at java:appserver, the whole lookup name
is java:appserver/TransactionManager.
javax.persistence.PersistenceException: Exception [EclipseLink-23004]
(Eclipse Persistence Services - 1.1.2.v20090612-r4475):
org.eclipse.persistence.exceptions.TransactionException
Exception Description: Error obtaining the Transaction Manager
Internal Exception: Exception [EclipseLink-23001] (Eclipse Persistence
Services - 1.1.2.v20090612-r4475):
org.eclipse.persistence.exceptions.TransactionException
Exception Description: Error looking up external Transaction resource
under JNDI name [java:appserver/TransactionManager]
Internal Exception:
com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException:
Path to object does not exist at java:appserver, the whole lookup name
is java:appserver/TransactionManager.
     at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:272)
     at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:111)
     at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:163)


Thanks,
Zarar



Back to the top