Stand-alone EJB3 Client

My EJB is located on a remote located java application server (v9).
The access code is:.
System.setProperty("org.omg.CORBA.ORBInitialHost","abc.selfip.com");
InitialContext ctx = new InitialContext();
SessionUpdaterBean br = (SessionUpdaterBean) ctx.lookup("SessionUpdaterBean");...
I try the same on the localhost, it works. The libraries are included. But accessing the remote server throws exception. A good help source is the glassfish faq (https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB)
but doesnt helps.
could you give me a hint.
Exception snipped:
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: abc.selfip.com; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2348)
.....

Try adding the following property
props.setProperty("org.omg.CORBA.ORBInitialPort", <port>)
Probably you are running into Issue: https://glassfish.dev.java.net/issues/show_bug.cgi?id=1526

Similar Messages

  • NameNotFoundException in JNDI lookup in for stand alone App client in EJB3

    I created an ejb module in netbeans 5.5 added a session facade (SavingsaccountFacade) and downloaded it to SunAppServer 9 (java EE 5). When I try and access the JNDI name in a stand alone java application client using the following code
    Context initial = new InitialContext();
    Object objref = initial.lookup("ejb/SavingsaccountFacade");
    I get the following errors:
    javax.naming.NameNotFoundException: SavingsaccountFacade not found
    at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:203)
    I have added j2ee.jar, appserv-rt.jar, and the dist/SavingsAccount.jar to the library. When I do a similar thing in J2EE1.4 it worked fine.
    Can somebody help please.
    Thanks

    Hi Dave,
    Here's our EJB FAQ entry that explains how EJB Global JNDI names are set in the
    Java EE 5 SDK and Glassfish. The most likely explanation is that the name used
    in the client does not match the one assigned to your EJB in sun-ejb-jar.xml.
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#SessionBeanGlobalJNDINameAssignment
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Consuming dataservice as a stand alone java client, givng an exception com

    when i am trying to access data service from a stand alone java application ,it giving an exception .
    The dataservice is in remote machine.
    Exception:
    com.bea.dsp.dsmediator.client.exception.SDOMediatorException: weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.io.EOFException
         at com.bea.dsp.dsmediator.client.XmlDataServiceBase.invokeFunction(XmlDataServiceBase.java:322)
         at empldetappdataservices.EmployeeDetails.getEmployeesByid(EmployeeDetails.java:84)
         at com.patni.tsg.poc.DataServiceClient.DataServiceClient.main(DataServiceClient.java:42)
    Caused by: weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.io.EOFException
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:290)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:248)
         at com.bea.ld.Server_ydm4ie_EOImpl_815_WLStub.executeFunction(Unknown Source)
         at com.bea.dsp.dsmediator.client.XmlDataServiceBase.invokeFunction(XmlDataServiceBase.java:312)
         ... 2 more
    Caused by: java.io.EOFException
         at weblogic.rjvm.t3.T3JVMConnection.endOfStream(T3JVMConnection.java:897)
         at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.java:586)
         at weblogic.socket.SocketMuxer.deliverEndOfStream(SocketMuxer.java:536)
         at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:694)
         at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:641)
         at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:282)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    my class path i added all neccessary jars:
    weblogic.jar,xbean.jar,DataServices.jar,ld-server-core.jar,ld-client.jar,wlsdo.jar
    code sample:
    public static InitialContext getInitialContext() throws NamingException {
    Environment env = new Environment();
    env.setProviderUrl("t3://pc-p40892:7001");
    env.setInitialContextFactory("weblogic.jndi.WLInitialContextFactory");
    env.setSecurityPrincipal("weblogic");
    env.setSecurityCredentials("weblogic");
    return new InitialContext(env.getInitialContext().getEnvironment());
    public static void main (String args[]) {
    try {
    EmployeeDetailsDocument.EmployeeDetails edet=null;
    EmployeeDetails ds=EmployeeDetails.getInstance(getInitialContext(),"EmplDetApp");
    //The below statement generating the exception.
    EmployeeDetailsDocument[]doc =ds.getEmployeesByid("1001");
    } catch (Exception e) {
    e.printStackTrace();
    pls help me to solve this problem
    Edited by sandeepc221 at 09/19/2007 2:50 AM

    You didn't post the stack trace from the server, but I'm guessing it's complaining about the QName class. Sun changed the QName class in JDK 1.5 wreaking havoc on JDK 1.5 clients that use JDK 1.4 servers and attempt to pass a QName object from one to the other. If your client uses JDK 1.5, your sever will need to use a QName class which is compatible. The file liquiddata/lib/wls90interop.jar contains a QName class that is compatible with the one in JDK1.5. You can put it first in the classpath of your server.
    If you already have wls90interop.jar first in the classpath of your server, then, for your client, you need to either (1) use the Sun JDK 1.5; or (2) put wls90interop.jar first in the classpath of your client (if you are running JDK 1.4).
    http://e-docs.bea.com/aldsp/docs25/appdev/ejbclt.html#wp1090900
    btw - BEA Customer Support is available 24/7 - they should be able to provide you quick answers to questions like this.

  • BPM 10.3 Studio how to use PAPI from stand alone java client

    Would you help me ...., the search for the relevant information in this forum or documentation has not helped!
    I'm running the BPM process via studio and trying to call it from the standalone java program.(According documentation
    I need ... fuegopapi-client.jar and directory.xml )
    Well, of course I could find somewhere directory.xml but it is not the right one .. What are the values(related to directory Service) which are needed to run this
    java code agains the process started from the studio... ? So what I should do...? to setup and configure in BPM10.3 Studio to be able to run this code agains the
    BPM process ...?
    thanks a lot
    Tomas
    ..otherwise the java code look like this ...
    public static void main(String[] args) {
    /////////////////// API Initialization ///////////////////
    Properties configuration = new Properties();
    configuration.setProperty(ProcessService.DIRECTORY_ID, "default");
    configuration.setProperty(ProcessService.DIRECTORY_PROPERTIES_FILE, "directory.xml");
    configuration.setProperty(ProcessService.WORKING_FOLDER, "c:\tmp");
    try {
    ProcessService processService = ProcessService.create(configuration);
    /////////////////// Establish a session ///////////////////
    ProcessServiceSession session = processService.createSession("test", "test", "localhost");
    /////////////////// Operate with PAPI ///////////////////
    for (String processId : session.processesGetIds()) {
    System.out.println("\n Process: " + processId);
    for (InstanceInfo instance : session.processGetInstances(processId)) {
    System.out.println(" -> " + instance.getId());
    /////////////////// Close the session ///////////////////
    session.close();
    /////////////////// Release API Resources ///////////////////
    processService.close();
    } catch (CommunicationException e) {
    System.out.println("Could not connect to Directory Service");
    e.printStackTrace();
    } catch (OperationException e) {
    System.out.println("Could not perform the requested operation");
    e.printStackTrace();
    }

    Would you help me ...., the search for the relevant information in this forum or documentation has not helped!
    I'm running the BPM process via studio and trying to call it from the standalone java program.(According documentation
    I need ... fuegopapi-client.jar and directory.xml )
    Well, of course I could find somewhere directory.xml but it is not the right one .. What are the values(related to directory Service) which are needed to run this
    java code agains the process started from the studio... ? So what I should do...? to setup and configure in BPM10.3 Studio to be able to run this code agains the
    BPM process ...?
    thanks a lot
    Tomas
    ..otherwise the java code look like this ...
    public static void main(String[] args) {
    /////////////////// API Initialization ///////////////////
    Properties configuration = new Properties();
    configuration.setProperty(ProcessService.DIRECTORY_ID, "default");
    configuration.setProperty(ProcessService.DIRECTORY_PROPERTIES_FILE, "directory.xml");
    configuration.setProperty(ProcessService.WORKING_FOLDER, "c:\tmp");
    try {
    ProcessService processService = ProcessService.create(configuration);
    /////////////////// Establish a session ///////////////////
    ProcessServiceSession session = processService.createSession("test", "test", "localhost");
    /////////////////// Operate with PAPI ///////////////////
    for (String processId : session.processesGetIds()) {
    System.out.println("\n Process: " + processId);
    for (InstanceInfo instance : session.processGetInstances(processId)) {
    System.out.println(" -> " + instance.getId());
    /////////////////// Close the session ///////////////////
    session.close();
    /////////////////// Release API Resources ///////////////////
    processService.close();
    } catch (CommunicationException e) {
    System.out.println("Could not connect to Directory Service");
    e.printStackTrace();
    } catch (OperationException e) {
    System.out.println("Could not perform the requested operation");
    e.printStackTrace();
    }

  • How a stand-alone java client to access EJB?

    I have problems to access a ejb.
    ====================================
    client code:
    Properties prop = new Properties();
    prop.setProperty(Context.INITIAL_CONTEXT_FACTORY,"com.sun.enterprise.naming.SerialInitContextFactory");
              prop.setProperty (Context.PROVIDER_URL,"IIOP://127.0.0.1:1050");
              System.err.println("Attempting to create context...");
              Context init = new InitialContext( prop );
              Object obj = init.lookup("hi_bean");
              hihome home =(hihome)PortableRemoteObject.narrow(obj, hihome.class);
              hi c= home.create();
              System.out.println(c.greeting());
    ====================================================
    in Dos. I have the following command:
    java -Dorg.com.CORBA.ORBInitialHost=127.0.0.1 hiclient
    I already open the EJB application on J2EE server on port 80, but run hiclient
    in dos, it has ClassCastException coming from the code :
    hihome home =(hihome)PortableRemoteObject.narrow(obj, hihome.class);
    dose anyone have any ideas about this?
    Thanks

    Check the JNDI name specified in the xml file.
    Hope this will help
    Ashish Mangla

  • Stand Alone java client for calendar server

    I am using washington calendar client as a desktop client for calendar server.Can anyone help me on how to use it with JES?.
    I have the following questions on it.
    1. Whats the way to edit the calendar client? Eg suppose we want to fix an appointment.,how it can be done on that calendar screen?
    2. How can we share a calendar among different users?
    3.What is the database being used to store the details about the tasks entered on calendar client?.
    4.What are the security features available?.

    "Pierre-Yves Fourmond" <[email protected]> wrote in message news:<3bf38eb0$[email protected]>...
    I have an EJB deployed on WebLogic 6.1 on my NT machine and I try to reach it
    with a Java client program on that same machine.
    Properties prop = new Properties();
    prop.setProperty (Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.enterprise.naming.SerialInitContextFactory");Hi Pierre,
    For a start, you need to use the
    "weblogic.jndi.WLInitialContextFactory" as the naming factory.
    Hope this helps
    Regards
    drit

  • Anyone Have an stand alone email client which works Well?

    I am looking for an email client which work well with my old POP3 email account.........I have looked at Post Box, MailSteward, others........any ideas much appreciated.

    Thunderbird!

  • Stand alone client for remote EJB corba error

    Regarding problem below, I've checked System env variables
    that weblogic server is using for CORBA classes:
    javax.rmi.CORBA.UtilClass=weblogic.iiop.UtilDelegateImpl
    org.omg.CORBA.ORBSingletonClass=weblogic.corba.orb.ORB
    org.omg.CORBA.ORBClass weblogic.corba.orb.ORB
    javax.rmi.CORBA.PortableRemoteObjectClass=weblogic.iiop.PortableRemoteObjectDelegateImpl
    But these are server classes and not found in wlclient.jar and wljmsclient.jar. What classes should be used for client? What needs to be set in order to get successful remote RMI/EJB call to weblogic server?
    Original post:
    I have a stand alone spring client for simple stateless session EJB deployed on weblogic 9.2. I'm using spring (jdk 1.5) to call this remote EJB and the only way I can succeed is to have full weblogic.jar in my bootstrap classpath. Otherwise I get corba error:
    CORBA BAD_PARAM 0 No; nested exception is:
    org.omg.CORBA.BAD_PARAM: vmcid: 0x0 minor code: 0 completed: No
    Interestingly, within same client I have JMS call to weblogic JMS and that fails if weblogic.jar is in boot classpath. Getting rid of weblogic.jar from boot classpath works if I have wlclient.jar and wljmsclient.jar in regular classpath (as per weblogic docs). I would think that for stand alone client all I would need is to weblogic client jars, why should I need to have full weblogic.jar?
    I can't get those work together with same classpath. I wonder if anybody has some pointers and/or advice. I was looking to set system parameters for corba for weblogic client that maybe could help:
    org.omg.CORBA.ORBClass
    org.omg.CORBA.ORBSingletonClass
    javax.rmi.CORBA.UtilClass
    javax.rmi.CORBA.StubClass
    javax.rmi.CORBA.PortableRemoteObjectClass
    But I can't find definitive answer.
    Regards,
    -pp
    Edited by mr.papini at 06/28/2007 9:05 AM

    I'm stuck exactly with the same issue while trying to port my application from weblogic to jboss.
    I tried to specify different ORB implementations (JacORB, OpenORB) for jvm option org.omg.CORBA.ORBClass, but JBoss couldn't get them instantiated. Native Sun implementation which is used in JBoss by default and can be instantiated, apparently is not fully compatible with weblogic security module.
    So did you manage to find out the solution?
    Edited by DigitalDude at 04/09/2008 11:47 PM

  • Stand-alone client - lookup problem

    I have a stand-alone Java client application (ContactClient) that I want to use to access an EJB called Contact. I am using J2EE, deploying with deploytool. The EJB has a JNDI name of "MyContact", and the Client reference is "ejb/TheContact". The relevant code in the app is:
    try
    java.util.Properties props = new java.util.Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.cosnaming.CNCtxFactory");
    props.put(Context.PROVIDER_URL, "iiop://localhost:1050");
    Context initial = new InitialContext(props);
    Object objref = initial.lookup("ejb/TheContact");
    ContactHome home =
    (ContactHome)PortableRemoteObject.narrow(objref,
    ContactHome.class);
    contact = home.create();
    catch (Exception ex)
    System.err.println("Exception: " + ex.getMessage());
    ex.printStackTrace();
    The following exception is thrown by initial.lookup("ejb/TheContact");
    javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    I have tried changing the name to "TheContact", and to "java:comp/env/TheContact" with no success. If I change it to the JNDI name "MyContact", the lookup works, but the following call, PortableRemoteObject.narrow(), throws a java.lang.ClassCastException.
    What am I doing wrong?
    John

    Hi, Thanks for your fast reply, but it still doesn't work.
    With your Code I get a classCastException in this line:
    "SessionHome home = (SessionHome)ctx.lookup("SessionBeanInstance");"
    Here is the code from the whole thing, as it works with the appclient script:
    SessionHome: //RemoteHomeInterface
    package ejb;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.EJBHome;
    public interface SessionHome extends EJBHome {
    Session create() throws RemoteException, CreateException;
    Session //Session RemoteInterface
    package ejb;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface Session extends EJBObject {
    public String getString() throws RemoteException;
    SessionBeanInstance //The SessionBean
    package ejb;
    import javax.ejb.SessionBean;
    import javax.ejb.CreateException;
    import javax.ejb.SessionContext;
    public class SessionBeanInstance implements SessionBean{
    public SessionContext context;
    public String getString(){ return "works"; }
    public SessionBeanInstance() {  }
    public void ejbCreate() throws CreateException { System.out.println("Bean created"); }
    public void ejbActivate() {  }
    public void ejbPassivate() {  }
    public void ejbRemove() {  }
    public void setSessionContext(SessionContext ctx) {  context = ctx;  }
    clientMain //The client class
    package client;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.naming.NamingEnumeration;
    import javax.rmi.PortableRemoteObject;
    import ejb.*;
    import java.util.Hashtable;
    public class clientMain {
    private SessionHome home;
    private Session mySession;
    private Context ctx;
    private Object objref;
    public clientMain() {
    try{
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put(Context.PROVIDER_URL, "iiop://127.0.0.1:3700");
    try{
    Context ctx = new InitialContext(env);
    SessionHome home = (SessionHome)ctx.lookup("SessionBeanInstance");
    Session remote = (Session)home.create();
    String test = remote.getString();
    System.out.println(test);
    catch(Exception e){ e.printStackTrace(); }
    catch (Exception ex) { 
    System.err.println("Caught an exception.");
    ex.printStackTrace();
    The error occurs only if is start with the "java -jar" script. Here is the error:
    lang.ClassCastException: com.sun.corba.se.impl.corba.CORBAObjectImpl
    at client.clientMain.<init>(clientMain.java:27)
    at client.Client.main(Client.java:10)
    I don't know what to do, to get it work...

  • Calling a web service through SSL via a stand alone java class

    HI,
    I am trying to call a web service through SSL via a simple stand alone java client.
    I have imported the SSL certificate in my keystore by using the keytool -import command.
    Basically I want to add a user to a group on the server. Say I add a user user 1 to group group 1 using an admin userid and password. All these values are set in an xml file which I send to the server while calling the server. I pass the web service URL, the soap action name and the xml to post as the command line arguments to the java client.
    My xml file(Add.xml) that is posted looks like :
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope
    xmlns:xsi = "http://www.w3.org/1999/XMLSchema-instance"
    xmlns:SOAP-ENC = "http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd = "http://www.w3.org/1999/XMLSchema"
    SOAP-ENV:encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
    <namesp1:modifyGroupOperation xmlns:namesp1 = "/services/modifyGroup/modifyGroupOp">
    <auth>
    <user>adminUser</user>
    <password>adminPassword</password>
    </auth>
    <operationType>ADD</operationType>
    <groupName>group1</groupName>
    <users>
    <userName>user1</userName>
    </users>
    </namesp1:modifyGroupOperation>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    I call the client as:
    java PostXML https://com.webservice.com/services/modifyGroup "/services/modifyGroup/modifyGroupOp" Add.xml
    I my client, I have set the following:
    System.setProperty("javax.net.ssl.keyStore", "C:\\Program Files\\Java\\jre1.5.0_12\\lib\\security\\cacerts");
    System.setProperty("javax.net.ssl.keyStorePassword", "password");
    System.setProperty("javax.net.ssl.trustStore", "C:\\Program Files\\Java\\jre1.5.0_12\\lib\\security\\cacerts");
    System.setProperty("javax.net.ssl.trustStorePassword", "password");
    But when I try to execute the java client, I get the following error:
    setting up default SSLSocketFactory
    use default SunJSSE impl class: com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl
    class com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl is loaded
    keyStore is : C:\Program Files\Java\jre1.5.0_12\lib\security\cacerts
    keyStore type is : jks
    keyStore provider is :
    init keystore
    init keymanager of type SunX509
    trustStore is: C:\Program Files\Java\jre1.5.0_12\lib\security\cacerts
    trustStore type is : jks
    trustStore provider is :
    init truststore
    adding as trusted cert:
    init context
    trigger seeding of SecureRandom
    done seeding SecureRandom
    instantiated an instance of class com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl
    main, setSoTimeout(0) called
    main, setSoTimeout(0) called
    %% No cached client session
    *** ClientHello, TLSv1
    RandomCookie: GMT: .....
    Compression Methods: { 0 }
    [write] MD5 and SHA1 hashes: len = 73
    main, WRITE: TLSv1 Handshake, length = 73
    [write] MD5 and SHA1 hashes: len = 98
    main, WRITE: SSLv2 client hello message, length = 98
    [Raw write]: length = 100
    [Raw read]: length = 5
    [Raw read]: length = 58
    main, READ: TLSv1 Handshake, length = 58
    *** ServerHello, TLSv1
    %% Created: [Session-1, SSL_RSA_WITH_RC4_128_MD5]
    ** SSL_RSA_WITH_RC4_128_MD5
    [read] MD5 and SHA1 hashes: len = 58
    [Raw read]: length = 5
    [Raw read]: length = 5530
    main, READ: TLSv1 Handshake, length = 5530
    *** Certificate chain
    chain [0] = ...
    chain [1] = ...
    chain [2] = ...
    chain [3] = ...
    main, SEND TLSv1 ALERT: fatal, description = certificate_unknown
    main, WRITE: TLSv1 Alert, length = 2
    [Raw write]: length = 7
    0000: 15 03 01 00 02 02 2E .......
    main, called closeSocket()
    main, handling exception: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    main, called close()
    main, called closeInternal(true)
    main, called close()
    main, called closeInternal(true)
    main, called close()
    main, called closeInternal(true)
    Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.c
    ertpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
    at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
    at java.io.BufferedOutputStream.flush(Unknown Source)
    at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:506)
    at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2110)
    at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1088)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    at PostXML.main(PostXML.java:111)
    Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find v
    alid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
    at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
    at sun.security.validator.Validator.validate(Unknown Source)
    at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
    at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown Source)
    ... 18 more
    Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
    at java.security.cert.CertPathBuilder.build(Unknown Source)
    ... 23 more
    I do not know where I have gone wrong. Could someone point out my mistake.
    Thanks In advance!

    Hi jazz123,
    There's an example in the [*Java Web Services Tutorial*|http://java.sun.com/webservices/docs/2.0/tutorial/doc/] : see Chapter 1: Building Web Services with JAX-WS - A Simple JAX-WS Client.

  • XMLSignatureFactory fails in servlet, but works in a stand-alone program.

    Hi all,
    I am trying to write a servlet which will do XML signature et al. For the same, I am using JWSDP 2.0 (Java WebServices Developers Pack) on JRE 1.4.2_5. The servlet is hosted on SAP Netweaver 7 platform on Windows.
    I am getting an exception:
    javax.xml.crypto.NoSuchMechanismException: Cannot find DOM mechanism type
    in the "XMLSignatureFactory.getInstance" line. I looked up in the documentation of XMLSignatureFactory and it says that the DOM mechanism should be provided by the provider argument -  org.jcp.xml.dsig.internal.dom.XMLDSigRI in this case.
    import javax.xml.crypto.dsig.XMLSignatureFactory;
    XMLSignatureFactory sigFactory =
    XMLSignatureFactory.getInstance("DOM", new org.jcp.xml.dsig.internal.dom.XMLDSigRI());
    I tried the above 2 lines in a stand-alone Java client and they work without any issues.
    I also used JWSDP 1.5 and the result was same.
    This means that the servlet API or container for SAP is creating some issues to make this fail.
    I tried to add the "org.jcp.xml.dsig.internal.dom.XMLDSigRI" in the jre/lib/security/java.security, but then the server0 does not start-up.
    Any hints/pointers to resolve this issue?
    Thanks in advance.

    This problem is solved. I am putting the reply here so that others who stumble upon this error can benefit.
    Add the following line to explicitly include the provider before the getInstance
    Security.addProvider(new org.jcp.xml.dsig.internal.dom.XMLDSigRI());
    XMLSignatureFactory sigFactory =
    XMLSignatureFactory.getInstance("DOM", new org.jcp.xml.dsig.internal.dom.XMLDSigRI());

  • Exceptions arsing while accessing DataSource   from a stand alone java clie

    Dear all responders,
    can any one help in resolving my problem??the problem description is as follows:
    i am using sun one application server 7.0 to deploy a J2EE Apllication
    so i have created a data source using the admin page with the name
    "nodbsession".now i want to access this datasource using a stand alone java client and want to establish a connection to database.i am using the following code snippet to do so
    **code is as follows**
    Hashtable env=new Hashtable();
                   env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
                   env.put(Context.PROVIDER_URL, "iiop://localhost:3700");
                   System.out.println("creating context");
                   Context ctx =new InitialContext(env);
                                  System.out.println("created successfull");
                   DataSource ds =(DataSource)ctx.lookup("nodbsession");
    /* by using like this also it is not working
    DataSource ds =(DataSource)ctx.lookup("java:comp/env/jdbc/nodbsession");
    i am able to obtain the context succussfully but the exception is thrown for the data source look up
    the following exception is thrown
    javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
    at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:402)
    at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
    at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
    at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at Test.<init>(Test.java:27)
    at Test.main(Test.java:47)
    please help me in resolving the above problem
    advance thanx to all those who intend to reply
    please provide me a proper resolution

    I think the appserver uses com.sun.enterprise.naming.SerialInitContextFactory on the server side to register different resources. Anything registered with SerialialInitContextFactory cannot be resolved with a CNCtxFactory.
    Can you try using SerialInitContextFactory on the client side.

  • Stand-Alone JMS SAF Client

    Im interested in using a WL Stand-Alone JMS SAF Client to send messages to a server-side JMS destination,
              regardless of the servers availability.
              This is for a J2SE Swing Application. There currently is no app server interaction.
              I found the doc http://e-docs.bea.com/wls/docs92/client/saf_client.html
              It describes almost everything except for what the actual client will look like.
              Im stuck after "Modify Your JMS Client Applications.." section.
              Questions:
              A) Suggestions for other docs?
              B) Is anyone using a Stand-Alone JMS SAF Client?
              C) Does anyone know of any code examples?
              The odd thing is that a search on the net for "JMS SAF Client" or variants of yields nothing other than the WL docs...
              Thanks!

    I could not make stand-alone jms saf client work. Followed the doc, created ClientSAF.xml, made the change for intial-context factory. Tried using with provider_url and without it.
              I am not using default queue and connection factory. The client code is working fine when I don't use saf, i.e. "weblogic.jndi.WLInitialContextFactory" and provider_url.
              Getting following error:
              javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassCastException: weblogic.security.service.SubjectManagerImpl]
                   at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
                   at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
                   at javax.naming.InitialContext.init(Unknown Source)
                   at javax.naming.InitialContext.<init>(Unknown Source)
                   at weblogic.jms.safclient.agent.internal.ClientEnvironmentImpl.getContext(ClientEnvironmentImpl.java:76)
                   at weblogic.jms.forwarder.Forwarder.getInitialContext(Forwarder.java:334)
                   at weblogic.jms.forwarder.Forwarder.reconnect(Forwarder.java:210)
                   at weblogic.jms.forwarder.Forwarder.timerExpired(Forwarder.java:265)
                   at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:259)
                   at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
              Caused by: java.lang.ClassCastException: weblogic.security.service.SubjectManagerImpl
                   at weblogic.corba.client.ClientORBInitializer.initialize(ClientORBInitializer.java:106)
                   at weblogic.jndi.WLInitialContextFactory.<init>(WLInitialContextFactory.java:29)
                   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
                   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
                   at java.lang.reflect.Constructor.newInstance(Unknown Source)
                   at java.lang.Class.newInstance0(Unknown Source)
                   at java.lang.Class.newInstance(Unknown Source)
                   ... 12 more
              java.lang.ClassCastException: weblogic.security.service.SubjectManagerImpl
                   at weblogic.corba.client.ClientORBInitializer.initialize(ClientORBInitializer.java:106)
                   at weblogic.jndi.WLInitialContextFactory.<init>(WLInitialContextFactory.java:29)
                   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)Stack level 1
                   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
                   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
                   at java.lang.reflect.Constructor.newInstance(Unknown Source)
                   at java.lang.Class.newInstance0(Unknown Source)
                   at java.lang.Class.newInstance(Unknown Source)
                   at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
                   at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
                   at javax.naming.InitialContext.init(Unknown Source)
                   at javax.naming.InitialContext.<init>(Unknown Source)
                   at weblogic.jms.safclient.agent.internal.ClientEnvironmentImpl.getContext(ClientEnvironmentImpl.java:76)
                   at weblogic.jms.forwarder.Forwarder.getInitialContext(Forwarder.java:334)
                   at weblogic.jms.forwarder.Forwarder.reconnect(Forwarder.java:210)
                   at weblogic.jms.forwarder.Forwarder.timerExpired(Forwarder.java:265)
                   at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:259)
                   at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
              disconnect stack trace finished
              QUEUE NAME: jmssysmodule-ois!oisQueue

  • Stand-Alone Client to Access JMS Resource without ACC

    I'am having trouble to run the JMS SimpleProducer example from the JMS tutorial as a Stand-Alone application.
    Although its works as suggested when run inside an ACC. (The tutorial I refer to: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JMS5.html#wp79822 )
    The JMS provider I use is Sun Java System Application Server Platform Edition 8.2 (build b06-fcs).
    Its documentation states that one could run a client outside the ACC and still access JMS:
    http://docs.sun.com/source/819-0217-10/dgacc.html#wp1022252
    Following those instructions throws an exeption when invoking
    Context jndiContext = new InitialContext();
    jndiContext.lookup("jms/ConnectionFactory");Of course I did add the three required libraries (appserv-rt.jar, j2ee.jar, imqjmsra.jar) and added the VM arguments to point the client's orb to the JSAS. Also, the JMS administed object exist, admin console shows them and example in ACC worked fine.
    The last step of the tutorial says: "� As long as the client environment is set appropriately and the JVM is compatible, you merely need to run the main class." Is there anything I miss? Btw. I run the example on Mac OS X 10.4.6 and Java 1.5.0_06.
    Why does the exception refer to org/netbeans/modules/schema2beans/BaseBeanThat is the exception thrown:
    Destination name is jms/Queue
    04.04.2006 16:25:12 com.sun.corba.ee.spi.logging.LogWrapperBase doLog
    INFO: "IOP00710299: (INTERNAL) Successfully created IIOP listener on the specified host/port: all interfaces/49648"
    Exception in thread "main" java.lang.NoClassDefFoundError: org/netbeans/modules/schema2beans/BaseBean
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            at com.sun.enterprise.connectors.ConnectorAdminServicesFactory.getService(ConnectorAdminServicesFactory.java:35)
            at com.sun.enterprise.connectors.ConnectorRuntime.createServices(ConnectorRuntime.java:109)
            at com.sun.enterprise.connectors.ConnectorRuntime.getRuntime(ConnectorRuntime.java:71)
            at com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:55)
            at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:293)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at SimpleProducer.main(SimpleProducer.java:66)
    Java Result: 1

    Adding a fourth jar from the JSAS to the standalone application resolves the problem: appserv-admin.jar - available at install_dir/lib/appserv-admin.jar
    Does the tutorial miss this or is there anything I missunderstood?

  • Problems in accessing EJB from stand-alone client

    Hi,
    I am trying to access a EJB deployed in RI from a stand-alone client. When I run it, I got this exception:
    Exception in thread "main" java.rmi.AccessException: CORBA NO_PERMISSION 9998 Ma
    ybe; nested exception is:
    org.omg.CORBA.NO_PERMISSION: minor code: 9998 completed: Maybe
    org.omg.CORBA.NO_PERMISSION: minor code: 9998 completed: Maybe
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Unknown Source)
    at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
    eption(ReplyMessage_1_2.java:93)
    at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
    ClientResponseImpl.java:108)
    at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
    entSC.java:136)
    at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
    at TheBeanRemoteStub.test(Unknown Source)
    at Client.main(Client.java:19)
    The following is the code of the client:
    System.setProperty(Context.SECURITY_PRINCIPAL, "achong");
    System.setProperty(Context.SECURITY_CREDENTIALS, "achong");
    Context context = new InitialContext(System.getProperties());
    Object object = PortableRemoteObject.narrow(context.lookup("MyBean"), TheBeanHome.class);
    TheBeanHome home = (TheBeanHome) object;
    I have set "support client choice" while deploying the bean, and set which roles can access which methods. Any idea? Is my code is incorrect?

    I have the same problem like you.
    If you solve it, please give me a hint.
    Thank you very much!
    [email protected]

Maybe you are looking for

  • Lync 2013 Client takes a long time to "restore" from taskbar

    On many Windows 8 & 8.1 systems in our environment the Lync client will take anywhere from 2-10 seconds to pop up when clicked on in the taskbar.  The application is running, logged in, and active.  This is very frustrating to our userbase as they wi

  • Ipod was corrupted i restored it now windows and itunes does not recognize

    one day i plugged my 80g classic in to charge and sync. itunes diagnosed my ipod as corrupted and said please click restore,so i did now my windows computer and itunes does not recognize it at all i have a new 1g shuffle and it works fine. wat do i d

  • Import from internal table

    Dear Experts, I need a solution for importing from an internal table. Two variables I_EXP01 and I_EXP02 containing an xml stream have been exported to the database using the following syntax and depending on the size of I_EXP01 and I_EXP02 two or mor

  • VZ In-Home Agent says I'm not connected to internet, but I am

    I tried to setup Outlook 2007 to use my verizon.net email.  Anyway I couldn't get it to work manually.  So I downloaded VZ - In-Home Agent.  Everytime I use it, it checks everything (network, wireless, router), when it gets to the point where it trie

  • Why does only arrow move on desktop?

    Why does only the arrow move on desktop but it doesn't do anything?