Skip to Content
avatar image
Former Member

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Sep 26, 2005 at 03:43 PM

    Check this:

    /message/604269#604269 [original link is broken]

    Regards

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 .

      ( I have tried out same as given SDN forums-Java Proxy Problem )

      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)

      InvokeProxy.java file:

      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);

      queryOutRemote.vendorOut(reqtype);

      Message = Message + "Message Send ";

      } catch (Exception ex) {

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

      }

      return Message ;

      }

      } //end of class