Skip to Content
author's profile photo
Former Member

Problem in Accessing the EJB

I want to access remote EJB from my Portal Service.

the EJB and the portal Service run on a separated machines.

here is what i wrote:

Properties properties = new Properties();

properties.put(Context.INITIAL_CONTEXT_FACTORY,

"com.sap.engine.services.jndi.InitialContextFactoryImpl");

properties.put(Context.PROVIDER_URL, "p030633:50004");

InitialContext context = new InitialContext(properties);

String name = "sap.com/GDS/GtinManager";

GtinManagerHome home = (GtinManagerHome)

javax.rmi.PortableRemoteObject.narrow.narrow(

context.lookup(name), GtinManagerHome.class);

gm = (GtinManager)home.create();

i run this code from java application and it works.

but in portal i get this error:

"com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at GDS, the whole lookup name is sap.com/GDS/GtinManager."

Thanks

Raja

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • author's profile photo
    Former Member
    Posted on Jan 20, 2005 at 09:51 AM

    Hello,

    if you NW 04 SP7 or higher, please look this document

    https://www.sdn.sap.com/sdn/index.sdn?contenttype=url&content=/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how to access an ejb from a portal component.mht

    else in EP6 SP2, it is more difficult to access to an EJB because the portal have an other classloader sysem and other JNDI context

    Best Regards,

    Fabrice

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Jan 25, 2005 at 09:32 AM

    this tutorial help u in accessing local EJB and not remote EJB

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Jan 27, 2005 at 12:08 PM

    He,

    maybe it's just this line missing:

    properties.put(“force_remote”, “true”);

    Regards,

    Armin

    Add comment
    10|10000 characters needed characters exceeded