cancel
Showing results for 
Search instead for 
Did you mean: 

Java Proxy Problem

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Hi Robin,

the libs have to be declared in the application-j2ee-engine.xml, but they are not allowed to be in the EAR file itself. Check, if they are inside, if so delete them (with WinZip).

Can you call your Java Proxy by a stand alone application (directly from your IDE)?

Maybe there are problems with the messagSpecifier. Could you check, if the stuff runs, when you delete the code lines referring to this?

Stefan

Answers (0)