Problem in accessing the Web Service using standalone Java Client

Dear Friends,
Hi,
I have an active web service and I have tested the same with XML Spy and Apache Axis and is giving me the output perfectly. For the same, I have developed a standalone Java client but getting problem in fetching the output.
The Exception is :
<Jan 4, 2006 5:54:16 PM GMT+05:30> <Info> <WebService> <BEA-220025> <Handler weblogic.webservice.core.handler.ClientHandler threw
an exception from its handleResponse method.
The exception was:
javax.xml.rpc.JAXRPCException: java.io.IOException: Received a response from url: http://10.20.15.59:18004/amountToWords which did
not have a valid SOAP content-type: text/html;charset=ISO-8859-1. .>
SOAP Fault **************** Exception during processing: java.io.IOException: Received a response from url: http://10.20.15.59:18
004/amountToWords which did not have a valid SOAP content-type: text/html;charset=ISO-8859-1.
(see Fault Detail for stacktrace)
javax.xml.rpc.soap.SOAPFaultException: Exception during processing: java.io.IOException: Received a response from url: http://10.2
0.15.59:18004/amountToWords which did not have a valid SOAP content-type: text/html;charset=ISO-8859-1.
(see Fault Detail for sta
cktrace)
at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:313)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:566)
at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:419)
at HelloClient.main(HelloClient.java:100)
I have tried some ways to set the content type explicitly but the results are same(throwing an exception).
I appreciate you all for helping me out of this.
Thanks
VR

Hi Amit
We also have this issue with weblogic webservices. Did you get any resolution for this issue.
When the service is executed for lesser number of hits, all the responses are processed properly. But as load (Number of hits for the same service) increases, few responses are failed to be parsed in the web service client. We could confirm that the producer responds with proper content type (text/xml)
Any help or pointers will be greatly appreciated.
Thanks,
Finny

Similar Messages

  • How to Authenticate the Web Service from my Java Client?

    Hi All,
    I am a newbie. I am working in Microsoft Technology. But due to a critical requirement, I am suppose to write a Java Web Service Client application. I some how managed to create the Client Application. The application works fine if the Authentication is turned off in the web service level itself. I am unable to or unaware of authentication in Java World. I have written a .NET Client application where I am able to set the Credentials but in Java world no property or method allows me to set it.
    Anybody knows how to solve this problem?
    My configuration is,
    JDK - JDK 1.5.0.16
    IDE - Netbeans 6.1
    Web Server - Tomcat 6.0
    SOAP - Native C++ SOAP
    How do I did?
    - Created a Java Web Service Client Application.
    - Added the Web Reference to the SOAP WSDL url.
    - Initialized the class object using the WSDL generated SOAP classes (Reference classes)
    My code look like,
    String result = "";
                try {
                    QName name = new QName("http://eaglesuite20/eaglesoap.wsdl", "eaglesoap");
                    eaglesuite20.eaglesoap.Eaglesoap service = new eaglesuite20.eaglesoap.Eaglesoap(new URL("http://phobos:1011/?wsdl"), name);
                    eaglesuite20.eaglesoap.EaglesoapPortType port = service.getEaglesoap();               
                    // TODO initialize WS operation arguments here
                    eagle.Request submitRequest = new eagle.Request();
                    submitRequest.setRequestType(eagle.RequestType.E_B_SCHEDULE_DEF);
                    submitRequest.setOperation(eagle.Operation.READ);
                    eagle.FilterDefinition filter = new eagle.FilterDefinition();
                    filter.setField(new JAXBElement<String>(new QName("urn:eagle", "Field"), String.class, "SHOW_SCHEDULED"));
                    filter.setValue(new JAXBElement<String>(new QName("urn:eagle", "Value"), String.class, "SHOW_SCHEDULED"));
                    filter.setOperator(eagle.EOperators.EQUAL);
                    eagle.FilterDefinitions filDefs = new eagle.FilterDefinitions();
                    filDefs.getFilterDefinition().add(filter);
                    submitRequest.setFilterDefinitions(new JAXBElement<eagle.FilterDefinitions>(new QName("urn:eagle", "FilterDefinitions"), eagle.FilterDefinitions.class, filDefs));
                    // TODO process result here
                    result = port.submitData(submitRequest);
                //out.println("Result = " + result);
                } catch (Exception ex) {
                    // TODO handle custom exceptions here
                    out.println(ex.getMessage());
                }Thanks in Advance.

    Hi
    Did you get your problem solved? Can you please help as I am getting null pointer exception when I invoke a call to web service which is secured/
    Please help!!!!!!!!! this is urgent.

  • Not able to receive the web service response to java client - jax-rpc

    HI,
    Have a wsdl and created the java client using wscompile and got the set of files (Port, Binding, ServiceLocator, Service and all related java files).
    My java client sends the valid java request to the webserver and i could see the correct response coming back to my machine as the reply from the webserver.
    But i couldnt get the response printed using System.out.println in my java client when i invoke call.invoke() method with needed input parameters.
    Do i need to set any encoding or how do i get the response in the my java client which is returned from the webserver?

    The whole PL/SQL which fails in case it helps to solve the issue
    declare
    peticion VARCHAR2(32767);
    env VARCHAR2(32767);
    url varchar2(1000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    begin
    url:='http://<HOST>:7778';
    -- soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    -- <auth:BasicChallenge
    -- xmlns:auth="http://www.soap-authentication.org/2002/01/">
    -- <Realm>Oracle Calendar Web Services</Realm>
    -- </auth:BasicChallenge>
    peticion:='
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
    <auth:BasicAuth xmlns:auth="http://soap-authentication.org/2002/01/">
    <Name>sysadmin</Name>
    <Password>sysadmin1</Password>
    </auth:BasicAuth>
    </soap:Header>
    <soap:Body>
    <cwsl:Create xmlns:cwsl="http://www.oracle.com/WebServices/Calendaring/1.0/">
    <CmdId>Testoraptor Command 31</CmdId>
    <iCalendar>
    <vcalendar prodid="-//Oracle//Calendaring//Calendarlet//EN" version="2.0">
    <vevent>
    <class>PUBLIC</class>
    <description>a long description</description>
    <dtstart>20061003T090909</dtstart>
    <duration>60M</duration >
    <location>my location</location>
    <priority>2</priority>
    <summary>a title</summary>
    <uid>4567</uid>
    <x-oracle-eventtype>APPOINTMENT</x-oracle-eventtype>
    </vevent>
    </vcalendar>
    </iCalendar>
    </cwsl:Create>
    </soap:Body>
    </soap:Envelope>';
    http_req := utl_http.begin_request(url||'/ocws-bin/ocas.fcgi', 'POST','HTTP/1.0');
    utl_http.set_header(http_req, 'Content-Type', 'text/xml');
    utl_http.set_header(http_req, 'Content-Length', length(peticion));
    utl_http.set_header(http_req, 'SOAPAction', '"http://www.oracle.com/WebServices/Calendaring/1.0/Create"');
    utl_http.write_text(http_req, peticion);
    dbms_output.put_line (length(peticion));
    http_resp := utl_http.get_response(http_req);
    utl_http.read_text(http_resp, env);
    utl_http.end_response(http_resp);
    end;
    We have tried many different XML structures but we are not able to create an appointment.

  • Problem in accessing a web service from a desktop client

    hello,
    i have deployed a webservice on JSAS 9.1 and i test it, its working fine.
    then i create a client by using netbeans IDE6.0. the client is a simple java class and i make it webservice client. then after compling i run the client it works fine.
    but when i try to run the .jar that the IDE has made after compling the client application, the program close on the statement where i made the Object of the service (i.e. CircleService service = new CircleService();)
    try{
    CircleService service = new CircleService();
    Circle port = service.getCirclePort();
    double r = 10.0;
    double arearesult = port.area(r);
    The webservice is properly deployed as i have tested it from the JSAS admin console.
    Can anybody tell me whats the problem? Is there any security issue or someother issue.
    null

    i have tried the stack trace in the catch but as i said on the statement where i made the object for the service the program just exits. it didn't return any exception or any output.
    thanx for refering me any answer.......

  • How to access the Web Service Browser

    Hi,
    I need to access the Web Service Browser to generate a Web Service Description.
    How can I do it?
    I use the follow url:
    http://<host_name>:<port_number>/sap/bc/bsp/sap/WebServiceBrowser/search.html?sap-client=<relevant_client>
    but I can't say how to determine values for the three placeholders.
    Help me please.
    THANKS

    Hi Andrea,
    you can access the web services in sap transaction SICF. Then right click on the
    service and choose "test". The hostname is the host on where the sap system
    runs.
    The port ´number can be seen in transaction SMICM -> shift + F1. Here you can see
    the portnumer assigned to the HTTP protocol.
    And the client is the sap client (standard client) for which the service is configured.
    Hope this helps.
    KR,
    Andreas

  • Problem with accessing a web service from outside world

    Hello SAP experts
    I have a custom BAPI for which I have created a webservice.
    If I login as an admin to the BOX where I have installed this SAP server and open an internet explorer window and give the URL, I can access the web service without any problem. This is just a simple BAPI that searches for some data from a table based.
    However, when I give the same URL from a different PC, it can open the web service and in the fields if I give the data and click on send button, it fails with an error '500 Internal Server Error '.
    I looked for the details of this error on internet and it says that this is some general error and solutions that it suggested doesn't help my scenario.
    Has anyone seen this problem before? Any help will be highly appreciated.
    Tks
    Ram

    i have tried the stack trace in the catch but as i said on the statement where i made the object for the service the program just exits. it didn't return any exception or any output.
    thanx for refering me any answer.......

  • How to call web-service using only java code

    Hello, how to call web-service using only java code. I can call it from BPM process or Web Dynpro Java Application, but if I need to call it from ejb component?

    I'm found answer:
    Java and SAP Portal blog: How to call web service from java code example

  • How to access .asmx Web Service using JAVA? Newbie

    Hello Experts,
    Currently, I have a project where in I have to access a ,NET web service. It is made of C#. I just want to ask how will I start the accessing process? I made this simple equation on how my project is.
    Java Project + C#.Net Web Service = Integration
    1. Do i need to create a Web Service too for the Java Project? If yes, What are the necessary tools needed for the creation of this Java Web Service?
    2. The .NET Web Service is available online. (It is made by other people).
    3. Based on the equation, what is the equivalent technology for the + sign?
    4. Can you site a concrete example for accessing a web service?
    5. I'm new here. Totally I have no idea where to start.
    6. Thank you experts.
    Edited by: Benedict.Aluan on 05 30, 08 1:38 PM
    Edited by: Benedict.Aluan on 05 30, 08 1:39 PM

    Hello
    Thanks a lot for your help ...
    I am developing simple J2EE based web service client using IBM WSAD 5.1. I have used the following code to call .asmx web service in Java
    String url = "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl";
         String namespace = "http://tempuri.org/";
         name = request.getParameter("txtName");
         try
              System.out.println("In Internet Service");
              ServiceFactory factory = ServiceFactory.newInstance();
              Service serv = factory.createService(new URL(url),new QName(namespace,"TempConvert"));
              System.out.println("Got Service......");
              Call obj = (Call)serv.createCall();
              System.out.println("Got Call......");
              obj.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,"");
              obj.setProperty(Call.OPERATION_STYLE_PROPERTY,"wrapped");
              obj.setTargetEndpointAddress(url);
              obj.setPortTypeName(new QName(namespace,"TempConvertSoap"));
              obj.setOperationName(new QName(namespace,"FahrenheitToCelsius"));
              obj.addParameter("param1",XMLType.XSD_STRING,String.class,ParameterMode.IN);
              obj.setReturnType(XMLType.XSD_STRING);
              System.out.println("Parameters Set.....");
              Object[] params = new Object[]{name};
              k = (String)obj.invoke(params);
              System.out.println("Result: "+k);
         catch(Exception e)
            System.out.println("Exception is : "+e);
        }But this code is throwing exception that
    Invalid Address "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl"I have also tried this URL with Java Proxy. But it showing the same error.
    Plz can u tell me how to access .asmx web service ?
    Waiting 4 reply.

  • Calling a web-service using JAX-WS client on the browser

    Hi,
    I created a basic web-service using netbeans/glassfish, which can be successfully called from a JavaFX application running stand-alone.
    But when I try to run the same JavaFX application on a browser, the web-service call does not work, and it is hard to get any information on where it is failing.
    I can see the error is a Throwable (not an Exception), but the message is null.
    What are the restrictions on being able to call a webservice using the JAX-WS libraries? Are there security issues? I am not using the javafx HTTP libraries.
    Also, if Java1.6u10 is available on the machine running the browser, do I still need to package all the JAX-WS libraries for the client?
    Any help is appreciated, even if it is just about how to track down the problem.

    Thank you very much for responding.
    There was no error due to WebService. Actually, I was using xmlbeans and I did not put those xmlbeans jar files into appropriate place. That is what caused the problem. I have solved it now and it is working fine.
    I put those xmlbeans jar files into my war file. It is working. Earlier, I had put them in tomcat 5.5's shared/lib directory. It was not working.
    Thank you once again for replying.
    Sasi.

  • Exception while accessing a web service using adaptive web service

    Hi All,
    I have accessed a web service from backend ( ABAP) and when i deploy the model i get an exception :
         Exception on execution of web service on destination 'DEFAULT_WS_EXECUTION_DEST' for operation 'ZGetWorkpackages' in interface '_-CAG_-Z_GET_WORKPACKAGES'
    can any one help?
    Regards
    Deepa

    hi
    After you have integrated  webservice ,  have you created the destinations in the visual admin tool .
    during calling the webservice  you might  selected the option of using logical destinations and used the
    default destinations as it is , and  are these destinations configured in the visula admin .
    if so please check the parameters you have provided ,  this would solve yourproblem
    Thanks

  • Problem in testing a Web service using SOAPUI

    Hi Experts,
    I have developed a web service in our ECC 6.0 and download the WSDL file generated from SE80. When i downloaded the file, it saved as only XML file.  As I dont have JAVA stack in the ECC 6.0, i was testing using SOAPUI. But when i try to upload the file, it always says "Found nothing to import <URL>".
    Can anyone help me why it is giving this error? I still doubt there is some problem with the WSDL file which is generated for the service.
    Please guide me how to check the WSDL file generated is correct or not?
    Cheers,
    Madhu

    Thanks for the blog Salil.
    What ever it is mentioned is already done in SOAMANAGER. Endpoints are available for the service.
    Below is the Overview of the service:
    Object Status:               Services: 1 / Endpoints: 1 
    Porttype Namespace:   urn:sap-com:document:sap:soap:functions:mc-style
    Porttype Name:             YMTEST_WS
    Internal Name:               YMTEST_WS
    SOAP Applikation:         URN:SAP-COM:SOAP:RUNTIME:APPLICATION:RFC:710
    Package Name:             $TMP
    Ok, i have developed 2 web services. One web service in ECC 6.0, where Java stack not available so i provided CRM system Java stack address in the global setting and executed my ECC 6.0 web service which says "No endpoints are found for the Web service"
    Following is the URL:  http://tuasd06db.tuasw2k.tuaspower.com.sg:8000/sap/bc/srt/wsdl/sdef_YMTEST_WS/wsdl11/ws_policy/document?sap-client=220
    The one web service which created in CRM 2007, i can test in the navigator, no problem with that. 
    Following is the URL: 
    http://tuasd06db.tuasw2k.tuaspower.com.sg:8002/sap/bc/srt/wsdl/bndg_DE7DA5BA0B3A93F1AF60001A64258BFC/wsdl11/allinone/standard/document?sap-client=220
    You can find the URL difference btw the URL's. Do i need to publish the service in the service registry? I thought for testing it is not required.
    Now all i have problem with the ECC 6.0 web service.
    Cheers,
    Madhu

  • Problem while opening the Web Service Homepage

    Hi All,
    I have created a Web Service and in Tcode WSADMIN , I am trying to open the Web Service Homepage (Ctrl+F8) and getting an error message "Could not determine WSDL Address(ICF Error)".
    Please suggest...
    Regards
    Pravesh

    Hi,
    In transaction SICF
    <b>/sap/bc/bsp/sap/learning_map</b>
    Choose Activate Service from the context menu.
    Also refer this thread.
    Solution Manager Learning Map http error 403
    Regards,
    Sarvesh

  • Accessing XI web service from portal as client

    Hi all
    I need to access a web service which has been created on XI    
    server. I want to acess it from enterprise portal as a web service client. please provide related links to achieve this.
    thanks in advance
    vaishali

    Vaishali,
    never did this before, but some general ideas:
    Do you have an WSDL for that web service? Then simply use your NWDS and select New --> Portal Service --> From WSDL (or similar). What I mean is the following: NWDS can read WSDL files and will automatically generate a proxy for you that actually generates an ordinary portal service. This portal service then can be called by standard means in SAP EP.
    Regards,
    Dominik

  • HELP!!! Problem of Calling external Web Service from a Java Stored Procedur

    1.I read the topic on http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html about Calling external Web Service from a Java Stored Procedur.
    2.After I import .jar to Oracle what is required by the topic,som error occued.
    Like: ORA-29521: javax/activation/ActivationDataFlavor class not found,
    ORA-29545: badly formed class.
    3.These is not enough .jar required on the topic? What can I do for ORA-29545: badly formed class?
    Thany you!

    Try this
    Re: HELP! Loading Java Classes into Oracle ERROR

  • How to use standalone java client with an enterprise bean in J2EE 1.4

    Hi All,
    I am have deployed a stateless session bean in Sun's J2EE 1.4 Application Server. i am trying to call the bean using a standalone java client. but the client cannot access the bean.
    The error coming is:
    Jan 21, 2004 7:48:27 PM com.sun.corba.ee.impl.legacy.connection.SocketFactoryCo
    nectionImpl <init>
    WARNING: ORBUTIL.connectFailure
    org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(
    RBUtilSystemException.java:1739)
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(
    RBUtilSystemException.java:1757)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.
    init>(SocketFactoryConnectionImpl.java:74)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryContactInfoImpl
    createConnection(SocketFactoryContactInfoImpl.java:88)
    at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.begi
    Request(CorbaClientRequestDispatcherImpl.java:146)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(Corba
    lientDelegateImpl.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaCli
    ntDelegateImpl.java:212)
    at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
    at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.jav
    :69)
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.ja
    a:58)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:12
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at StatelessSessionClient.main(StatelessSessionClient.java:17)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection re
    used: connect
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSoc
    etFactory.java:390)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.
    init>(SocketFactoryConnectionImpl.java:58)
    ... 10 more
    Caused by: java.net.ConnectException: Connection refused: connect
    at sun.nio.ch.Net.connect(Native Method)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:457)
    at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSoc
    etFactory.java:381)
    ... 11 more
    javax.naming.CommunicationException: Can't find SerialContextProvider
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.ja
    a:66)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:12
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at StatelessSessionClient.main(StatelessSessionClient.java:17)
    Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed
    No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(
    RBUtilSystemException.java:1739)
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(
    RBUtilSystemException.java:1757)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.
    init>(SocketFactoryConnectionImpl.java:74)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryContactInfoImpl
    createConnection(SocketFactoryContactInfoImpl.java:88)
    at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.begi
    Request(CorbaClientRequestDispatcherImpl.java:146)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(Corba
    lientDelegateImpl.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaCli
    ntDelegateImpl.java:212)
    at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
    at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.jav
    :69)
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.ja
    a:58)
    ... 3 more
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection re
    used: connect
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSoc
    etFactory.java:390)
    at com.sun.corba.ee.impl.legacy.connection.SocketFactoryConnectionImpl.
    init>(SocketFactoryConnectionImpl.java:58)
    ... 10 more
    Caused by: java.net.ConnectException: Connection refused: connect
    at sun.nio.ch.Net.connect(Native Method)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:457)
    at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSoc
    etFactory.java:381)
    ... 11 more
    My java client uses the following code to access the bean:
    Hashtable props = new Hashtable();
    String URL="iiop://localhost:3700";
    props.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
    props.put("java.naming.provider.url", URL) ;
    InitialContext ctx = new InitialContext();
    Object ref = ctx.lookup("ejb/StatelessSessionHome");
    StatelessSessionHome home = (StatelessSessionHome)PortableRemoteObject.narrow(ref,StatelessSessionHome.class);
    StatelessSessionRemote statelessSession = home.create();
    plz help me to locate the error.
    Regards,
    Mohit

    Hi Amol,
    thanks for your suggestion.
    i have deployed the converter application in J2EE1.4 tutorial in Sun AppServer J2EE1.4. the deployment process works smoothly. but accessing the deployed converter bean using standalone client as given in the tutorial gives the following error.
    Caught an unexpected exception!
    javax.naming.NoInitialContextException: Need to specify class name in environmen
    t or system property, or as an applet parameter, or in an application resource f
    ile: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    40)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:280)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at ConverterClient.main(ConverterClient.java:14)
    I have set the InitialHost and InitialPort as suggested by you in the client code. the client gets successfully compiled but gives error when executed.
    The client code is:
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import java.math.BigDecimal;
    public class ConverterClient {
    public static void main(String[] args) {
    System.setProperty("org.omg.CORBA.ORBInitialHost","localhost");
    System.setProperty("org.omg.CORBA.ORBInitialPort","3700");          
    try {
    Context initial = new InitialContext();
    Object objref = initial.lookup
    ("java:comp/env/ejb/SimpleConverter");
    ConverterHome home =
    (ConverterHome)PortableRemoteObject.narrow(objref,
    ConverterHome.class);
    Converter currencyConverter = home.create();
    BigDecimal param = new BigDecimal ("100.00");
    BigDecimal amount =
    currencyConverter.dollarToYen(param);
    System.out.println(amount);
    amount = currencyConverter.yenToEuro(param);
    System.out.println(amount);
    System.exit(0);
    } catch (Exception ex) {
    System.err.println("Caught an unexpected exception!");
    ex.printStackTrace();
    Please suggest so that i can run the standalone client successfully.
    Regards,
    Mohit Kapoor

Maybe you are looking for