Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Sep 26, 2005 at 03:43 PM

    Check this:

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

    Regards

    Stefan

    Add a 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.