Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with Asyncronous Java Proxy

Hi Friends,

My scenario is JAVA>XI>JDBC (Asyncronous Message).

I have imported the generated jar file and Created new Java Class (Invoke Proxy) in same project.Iam getting an error when I call this class from JSP .

When I use :

Object ref = ctx.lookup("java:comp/env/ejb/VendorOut_PortTypeBean");

queryOutHome = (VendorOut_PortTypeHome) PortableRemoteObject.narrow(ref, VendorOut_PortTypeHome.class);

queryOutRemote = queryOutHome.create();

I am getting an error: NULL

(After Lookup In Catch :null)

<u>InvokeProxy.java file:</u>

public class InvokeProxy {

public String SendVendor(String VendorNumber, String LastName,String SearchTerm,String Currency,String Street,String City,String Zip,String Country )

{

String Message = "";

VendorOut_PortTypeLocalHome queryOutLocalHome = null;

VendorOut_PortTypeLocal queryOutLocal = null;

VendorOut_PortTypeHome queryOutHome = null;

VendorOut_PortTypeRemote queryOutRemote = null;

try {

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, "password");

InitialContext ctx = new InitialContext();

Message = "before Lookup";

Object ref = ctx.lookup("java:comp/env/ejb/VendorOut_PortTypeBean");

Message = "After Lookup";

queryOutHome = (VendorOut_PortTypeHome) PortableRemoteObject.narrow(ref, VendorOut_PortTypeHome.class);

Message = Message + "After Lookup";

queryOutRemote = queryOutHome.create();

Message = Message + "After Lookup create";

MessageSpecifier msg = queryOutRemote.$messageSpecifier();

msg.setSenderService("TBIT_PROXY_BS");

queryOutRemote.$messageSpecifier(msg);

VendorDT_Type reqtype = new VendorDT_Type();

AddressDT_Type reqtype1 = new AddressDT_Type();

reqtype1.setStreet(Street);

reqtype1.setCity(City);

reqtype1.setCountry(Country);

reqtype1.setZip(Zip);

reqtype.setVendorNumber(VendorNumber);

reqtype.setLastName(LastName);

reqtype.setSearchTerm(SearchTerm);

reqtype.setCurrency(Currency);

reqtype.setAddress(reqtype1);

queryOutLocal.vendorOut(reqtype);

Message = Message + "Message Send ";

} catch (Exception ex) {

Message = Message + "In Catch"+ ex.getMessage();

}

return Message ;

}

} //end of class

Former Member
Not what you were looking for? View more on this topic or Ask a question