Skip to Content
0
Former Member
Aug 10, 2005 at 04:34 PM

Java Proxy Problem

19 Views

Hello,

My Java Proxy don't work.

I have imported the generated jar file to DEVST.

Than i create a new Java Class in the same project.

InvokeProxy. This Class i call from a JSP.

My Problem is to call from the InvokeProxy class my Java Bean.

[code]

public class InvokeProxy {

public String sendData(String tcode, String tid) {

String role = "";

BOPITD001OUT_PortTypeLocalHome queryOutLocalHome = null;

BOPITD001OUT_PortTypeLocal queryOutLocal = null;

try {

Context ctx = null;

Object ref = null;

Properties p = new Properties();

p.put(

Context.INITIAL_CONTEXT_FACTORY,

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

p.put(Context.PROVIDER_URL, "server:port");

p.put(Context.SECURITY_PRINCIPAL, "Administrator");

p.put(Context.SECURITY_CREDENTIALS, "pass");

ctx = new InitialContext();

queryOutLocalHome =

(BOPITD001OUT_PortTypeLocalHome) ctx.lookup(

"java:comp/env/ejb/BOPITD001OUT_PortTypeBean");

queryOutLocal = queryOutLocalHome.create();

MessageSpecifier msg = queryOutLocal.$messageSpecifier();

msg.setSenderService("XD1Java");

queryOutLocal.$messageSpecifier(msg);

TD001_Type reqtype = new TD001_Type();

reqtype.setTRANSCODE(tcode);

reqtype.setTRANSID(tid);

queryOutLocal.bOPITD001OUT(reqtype);

role="Message Send";

}

catch (Exception ex) {

System.out.println(ex.getMessage());

role = ex.getMessage();

}

return role;

}

}

[/code]

I get the Error: "Path to object does not exist at java:comp, the whole lookup name is java:comp/env/ejb/BOPITD001OUT_PortTypeBean."

When i use following url i get no error, but i got "null"

as exception value and no error message.

"sap.com/ProxySenderEAR/BOPITD001OUT_PortTypeBean"

Any Idea what i'm doing wrong?

Regards,

Robin