Regarding JMS standalone application client

Hi,
I m new to JMS.
I m using NetBeans IDE and would like to know how can i create connection factories and destinations either administratively or through JNDI.
Btw, i m writing a simple stand alone application client which has a queuesender and a queuereceiver.
Regards.

Hi,
I m using Jboss4.2.0GA...plz tell me how to create a connection factory and a destination queue......and then how to look them up via JNDI??
I m writing a simple stand alone application client with a sender and a receiver.
Regards,
Chowdary.

Similar Messages

  • JMS Standalone Application

    I am Developing JMS Standalone Application And Using Sun App Server 8.1 The Following I Have Created
    1. META-INF/application-client.xml
    2. source/jms/SimpleQueueSender.java
    3.source/jms/SimpleQueueReceiver.java
    The Following Is The Code In application-client.xml
    <application-client>
            <display-name>Simple JMS Standalone Application </display-name>
            <resource-ref>
                    <description>Simple Queue SenderReceiver</description>
                    <res-ref-name>jms/MyQCF</res-ref-name>
                    <res-type>javax.jms.QueueConnectionFactory</res-type>
                    <res-auth>Container</res-auth>
            </resource-ref>
            <resource-env-ref>
                    <description>SQR</description>
                    <resource-env-ref-name>jms/MyQueue</resource-env-ref-name>
                    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
            </resource-env-ref>
    </application-client>The Following Is The Code Used In SimpleQueueXXX(Either Sender Or Receiver )
    queueConnectionFactory = (QueueConnectionFactory)
                    jndiContext.lookup("java:comp/env/jms/MyQCF");
                queue = (Queue) jndiContext.lookup("java:comp/env/jms/MyQueue");when i run the the packaged jar file using appclient
    the following error is generated
    WARNING: ACC003: Application threw an exception.
    javax.naming.InvalidNameException: Real JNDI name cannot be empty for jms/MyQCF
    at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:475)
    at com.sun.enterprise.appclient.AppContainer.preInvoke(AppContainer.java:134)
    at com.sun.enterprise.appclient.Main.<init>(Main.java:383)
    at com.sun.enterprise.appclient.Main.main(Main.java:99)
    Mar 9, 2006 7:16:40 PM com.sun.enterprise.appclient.Main <init>
    WARNING: ACC010: Make sure the server port is not disabled and that you are looking up a valid name
    Thanks In Advance , Please Help Me At The Earliest

    Yaa , I Have Resolved It By Writing sun-application-client.xml but now i am getting some another error , can look into this why does this come
    Mar 10, 2006 12:53:26 PM com.sun.enterprise.appclient.Main <init>
    WARNING: ACC003: Application threw an exception.
    java.lang.ClassNotFoundException:
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at com.sun.enterprise.appclient.Main.<init>(Main.java:388)
    at com.sun.enterprise.appclient.Main.main(Main.java:99)
    Thanks In Advance , Please Reply At The Earliest

  • Regarding OC4J Standalone application -- "Out of Memory"

    Hi all,
    am installed the OC4J Standalone Application in windowns platform.......
    I am facing some problem.it's link "Out of Memory". my system RAM size is 2GB.
    we also increase JVM size in Server.xml file and also in command prompt. But again it is showing "Out Of Memory" and also we need to increase the OC4J file.
    Can anybody please help me to resolve this issue.
    Thanks in advance

    Can you post the actual exception you are seeing -- you may be running into the PermGen issue, which is different from the common heapsize issue.
    The JVM heapsize is not set in server.xml -- for standalone, its supplied on the command line where you start OC4J.
    For example:
    $>java -Xmx512m -Xms512m -jar oc4j.jar
    -steve-

  • Application-client.xml - resourceBundle

    Hi..
    I have a problem creating a standalone application client...
    I have crated an application-client.xml file containing ejb-refs to 2 Sessionbeans : Like this ->
    <ejb-ref>
    <ejb-ref-name>bean/AdvisorProxy</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>app.common.proxy.AdvisorProxyHome</home>
    <remote>app.common.proxy.AdvisorProxy</remote>
    </ejb-ref>
    <ejb-ref>
    <ejb-ref-name>bean/AdminProxy</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>app.common.proxy.AdminProxyHome</home>
    <remote>app.common.proxy.AdminProxy</remote>
    </ejb-ref>
    When I try to run my app I get an exception when I try to get my bean through the context :
    java.util.MissingResourceException: Can't find bundle for base name com/evermind/client/assembler/Assembler, locale en_GB
    Is there something else I have to specify anywhere?
    Thanks...
    johan

    This fixed my problem:
    - JNDI initial context factory -
    com.evermind.server.rmi.RMIInitialContextFactory
    - jndi provider url -
    opmn:ormi://servername

  • Classpath for JMS standalone client

    Hi,
    I observed some problem, when I try to start my JMS client application. If in classpath is oc4j.jar it works, but when I replace oc4j.jar with oc4jclient.jar doesn't
    I notice the message:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/evermind/server/jms/EvermindXAConnectionFactory
    at com.evermind.server.jms.ConnectInfo.getPass(ConnectInfo.java:98)
    at com.evermind.server.jms.EvermindTopicConnectionFactory.createTopicCon
    nection(EvermindTopicConnectionFactory.java:83)
    at sapconnector.MaterialMoverClient.main(MaterialMoverClient.java:52)
    the line no. 52 exactly means:
    TopicConnection connection = factory.createTopicConnection();
    What the OC4J client jar (oc4jclient.jar) is not enough for starting JMS standalone client?
    regards
    Krzysztof

    Hi, thanks for the reply.
    Well, I figured out that problem. It was my jar file. One of the jar file, which is imqjmsra.jar wasn't really the right one and that was giving me the problem. Well, at least that is working not, but I am having new problems.
    Right, I have been trying to make this work for about three days now. The truth is that my standalone JMS does work, when it is running on the same machine where the J2EE Server is located, but I am trying to make my JMS standalone client to connect to J2EE server from different location. Now I am getting connection refused error. Well, I guess I will be keep trying util I get this working.

  • Running JMS simple application from java standalone program stucks

    Hi All, i`m new to JMS service, and tried to code a simple application from the J2EE guide. They use standalone j2ee client application there, and i did not
    dound any way to debug it from eclipse .. so i have coded following standalone app (not j2ee client JAR) to produce simple messages
    public class producerMain {
         public static void main(String argv[]) throws NamingException, JMSException
              Properties jndiProp = new Properties();
              jndiProp.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.sun.enterprise.naming.SerialInitContextFactory");
              jndiProp.put(javax.naming.Context.PROVIDER_URL, "localhost:3920");
              InitialContext context =new InitialContext(jndiProp);
              ConnectionFactory factory = (ConnectionFactory)context.lookup("sashaConnectionFactory");
              Queue queue = (Queue)context.lookup("jms/Queue");
              System.out.println("Got here");
              Connection connection = factory.createConnection();
    Session session = connection.createSession(
    false,
    Session.AUTO_ACKNOWLEDGE);
    MessageProducer producer = session.createProducer(queue);
    TextMessage message = session.createTextMessage();
    for (int i = 0; i < 5; i++) {
    message.setText("This is message " + (i + 1));
    System.out.println("Sending message: " + message.getText());
    producer.send(message);
    producer.send(session.createMessage());
    producer.close();
    session.close();
    connection.close();
    factory = null;
         context.close();
         System.out.println("Quiting application");
    application works .. it sends a messages .. but it does not quit .. (dozens of new threads get opened, besides the main thread, which quits, but other threads
    does not quit .. and the application stucks .. )
    Does anyone know, why does it stuck .. what are those threads ? and why does not they finish ?
    Thanks, Regards Sasha.

    Thanks.
    changing to
    exp.append("\n");and flushing the writer stream and closing the stream fixed the problem.
    Why do we have to flush the stream?
    and, why do we have to close the writer before reading? what if I want to continue writting in to the writer?
    thanks again.

  • How to insert message in OC4J JMS from standalone java client.

    Hi,
    I have been following available examples for creating standalone java clients to insert messages in JMS queues.
    I am able to insert using java client when the SOA suite and the standalone java code are on same machine.
    package producerconsumerinjava;
    import javax.jms.*;
    import javax.naming.*;
    import java.util.Hashtable;
    public class QueueProducer
    public static void main(String[] args)
    String queueName = "jms/demoQueue";
    String queueConnectionFactoryName = "jms/QueueConnectionFactory";
    Context jndiContext = null;
    QueueConnectionFactory queueConnectionFactory = null;
    QueueConnection queueConnection = null;
    QueueSession queueSession = null;
    Queue queue = null;
    QueueSender queueSender = null;
    TextMessage message = null;
    int noMessages = 5;
    * Set the environment for a connection to the OC4J instance
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
    env.put(Context.SECURITY_CREDENTIALS, "mypass");
    env.put(Context.PROVIDER_URL,"ormi://myserver.company.com:12402"); //12402 is the rmi port
    * Set the Context Object.
    * Lookup the Queue Connection Factory.
    * Lookup the JMS Destination.
    try
    jndiContext = new InitialContext(env);
    queueConnectionFactory =
    (QueueConnectionFactory) jndiContext.lookup(queueConnectionFactoryName);
    queue = (Queue) jndiContext.lookup(queueName);
    catch (NamingException e)
    System.out.println("JNDI lookup failed: " + e.toString());
    System.exit(1);
    * Create connection.
    * Create session from connection.
    * Create sender.
    * Create text message.
    * Send messages.
    * Send non text message to end text messages.
    * Close connection.
    try
    queueConnection = queueConnectionFactory.createQueueConnection();
    queueSession =
    queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    queueSender = queueSession.createSender(queue);
    message = queueSession.createTextMessage();
    for (int i = 0; i < noMessages; i++)
    message.setText("Message " + (i + 1));
    System.out.println("Producing message: " + message.getText());
    queueSender.send(message);
    queueSender.send(queueSession.createBytesMessage());
    catch (JMSException e)
    System.out.println("Exception occurred: " + e.toString());
    finally
    if (queueConnection != null)
    try
    queueConnection.close();
    catch (JMSException e)
    System.out.println("Closing error: " + e.toString());
    But when the SOA Suite is remote, I am struggling to get the settings correct
    Till now, here is what I have figured out from looking at blogs/tars etc on the Net:
    1. I need to use ApplicationClientInitialContextFactory instead of RMIInitialContextFactory (http://download.oracle.com/docs/cd/E14101_01/doc.1013/e13975/jndi.htm)
    2. The project should have a META-INF/application-client.xml file, which may be dummy (http://www.wever.org/java/space/Oracle/JmsTar1). Question is, my code is there in a single absolutely standalone code..how I can use this application-client.xml and where it has to be placed.
    Errors:
    When trying to run exact same code on local server that tries to enqueue JMS on remotee serverer
    Exception occurred: javax.jms.JMSException: Unable to create a connection to "xxxxxxx.yyyyyy01.dev.com/10.42.456.11:12,602" as user "null".
    Any help is greatly welcome.
    As an exercise, I copied this complete code on the server and then ran locally using a telnet client...it worked. So the problem is coming when accessing the server remotely.
    Rgds,
    Amit

    1. I need to use ApplicationClientInitialContextFactory instead of RMIInitialContextFactoryNot necessarily.
    2. The project should have a META-INF/application-client.xml fileThat's only necessary if going the ApplicationClientInitialContextFactory route.
    There are two types of JMS client applications you can write -- a pure/plain Java app, and an "AppClient". That first is your everyday run-of-the-mill Java application, nothing special. That latter is a special, complicated beast that tries to act as a part of the whole client/server/J2EE architecture which provides you with a semi-managed environment. Either can be made to work, but if all you need is JMS access (using plain OC4J JMS factory/queue names and not JMS Connector names), then the first is easier to get working (and performs a tiny bit better as well due to being a lighter-weight solution).
    I think the problem you are having might be: When you use the plain Java client solution, you do not have any type of management, and that includes user management. With no user management (and if the JMS server is not configured to allow anonymous connections) you need to include the username and password in the call to createConnection. (I think it may be that this is actually true in the AppClient case as well -- I avoid using the AppClient model as much as possible so my memory there is weaker.)
    If you prefer to go the AppClient route, I would point you to a demo I wrote which had a functioning example, but Oracle seems to have removed it (and all of the 10.1.3 demos?) from OTN. :-(
    Hmm, it seems to still be available on the wayback machine:
    http://web.archive.org/web/20061021064014/www.oracle.com/technology/tech/java/oc4j/1013/how_to/index.html
    (Just look down the page for "With OEMS JMS (In-Memory and File-Based)" -- there is an .html document with info, and there is a .zip file with source code.)
    Question is, my code is there in a single absolutely standalone code..how I can use this application-client.xml and where it has to be placed.The app client in my demo had the following directory structure:
    myjavaclient.class
    jndi.properties
    META-INF\MANIFEST.MF
    META-INF\application-client.xml
    META-INF\orion-application-client.xml
    When you use ApplicationClientInitialContextFactory I think it just looks under .\META-INF for the .xml files.
    -Jeff

  • How to create a JMS standalone client with SAS PE8.2 ?

    HI everyone,
    I use Creator2.1 and I want to write a JMS standalone client that communicate through JMS with a webapp built with Creator.
    My pb is that I dont know how to set up initialContext.
    Hashtable env=new Hashtable();
    env.put(Context.PROVIDER_URL, "mq://localhost:28676/jms");
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.enterprise.naming.SerialInitContextFactory");
    context = new InitialContext(env);
    factory = (TopicConnectionFactory) context.lookup(factoryName);
    For example this code doesnt work and I have the following exception when I try to run my client.
    29 sept. 2006 10:31:03 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; 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:2257)
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
    at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
    at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
    at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
    at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
    at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at com.orange.clara.Main.main(Main.java:59)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
    ... 12 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:464)
    at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
    ... 13 more
    Does anyone had already met this pb ?
    Regards
    R�gis

    Please refer to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6377822, particularly the evaluation. Could your situation be the same too (i.e server ip address changing dynamically)? Also, which OS are you using and do you have any firewalls setup that prevents access to port 3700?

  • Client Applications vs Standalone Applications

    Hi all,
    I'm just confused about differences between
    Client Applications and Standalone Applications.
    Is it right that with a Client Application I don't need
    to specify in my java code (with Properties) the
    INITIAL_CONTEXT_FACTORY and the PROVIDER_URL
    of my application server ?
    For what concerne lookup() method, do Client Applications
    use the "java:comp/env/...." syntax (like co-located bean) ?
    Do they need to use narrow() method to cast EJB references ?
    What are advantages/advantages of using Client Applications
    or Standalone App. ?
    Thanks in advance
    Moreno

    I'm no expert, and I'm not sure that I fully understand your question but...I far as I understand it, a standalone application is just that. It doesn't require anything other than what comes delivered and installed with the application. A client application requires a server (among other things).

  • 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

  • Standalone application can't get JDBC data source from Weblogic 10.3

    We have the following configuration :
    A Weblogic server 10.3 (default installation).
    The server contains a JMS queue (jndi name: "DMQ") and JDBC data sources (jndi names: Oracle thin XA - "dataSource", MS SQL - "dataSource1")
    We have built wlfullclient5.jar for Java 1.5 ([http://edocs.bea.com/wls/docs103/client/jarbuilder.html#wp1078122]) (according to the docs)
    And now we use a test standalone application with the wlfullclient5.jar :
    public static void main (String[] args) throws NamingException {
    bq. Hashtable&lt;String, String&gt; env = new Hashtable&lt;String, String&gt;(); \\     env.put(Context.+INITIAL_CONTEXT_FACTORY+, "weblogic.jndi.WLInitialContextFactory"); \\     env.put(Context.+PROVIDER_URL+, "http://serv1:7001"); \\     env.put(Context.+SECURITY_CREDENTIALS+, "weblogic"); \\     env.put(Context.+SECURITY_PRINCIPAL+, "weblogic"); \\     InitialContext ic = new InitialContext(env); \\ \\ System.+out+.println("Get DMQ"); \\     ic.lookup("DMQ"); \\ System.+out+.println("Get dataSource"); \\     ic.lookup("dataSource");
    bq. System.+out+.println("Get dataSource1"); \\     ic.lookup("dataSource1"); \\ System.+out+.println("Done"); \\
    Here is the output when connected to WLS 10.3:
    bq. Get DMQ \\ Get dataSource \\ Exception in thread "Main Thread" java.lang.AssertionError: Failed to generate class for weblogic.jdbc.common.internal.RmiDataSource_1030_WLStub \\ at weblogic.rmi.internal.StubGenerator.generateStub(_StubGenerator.java:790_) \\ at weblogic.rmi.internal.StubGenerator.generateStub(_StubGenerator.java:779_) \\ at weblogic.rmi.extensions.StubFactory.getStub(_StubFactory.java:74_) \\ at weblogic.rmi.internal.StubInfo.resolveObject(_StubInfo.java:213_) \\ at weblogic.rmi.internal.StubInfo.readResolve(_StubInfo.java:207_) \\ at sun.reflect.NativeMethodAccessorImpl.invoke0(_Native Method_) \\ at sun.reflect.NativeMethodAccessorImpl.invoke(_NativeMethodAccessorImpl.java:39_) \\ at sun.reflect.DelegatingMethodAccessorImpl.invoke(_DelegatingMethodAccessorImpl.java:25_) \\ at java.lang.reflect.Method.invoke(_Method.java:585_) \\ at java.io.ObjectStreamClass.invokeReadResolve(_ObjectStreamClass.java:1033_) \\ at java.io.ObjectInputStream.readOrdinaryObject(_ObjectInputStream.java:1728_) \\ at java.io.ObjectInputStream.readObject0(_ObjectInputStream.java:1305_) \\ at java.io.ObjectInputStream.readObject(_ObjectInputStream.java:348_) \\ at weblogic.utils.io.ChunkedObjectInputStream.readObject(_ChunkedObjectInputStream.java:197_) \\ at weblogic.rjvm.MsgAbbrevInputStream.readObject(_MsgAbbrevInputStream.java:564_) \\ at weblogic.utils.io.ChunkedObjectInputStream.readObject(_ChunkedObjectInputStream.java:193_) \\ at weblogic.rmi.internal.ObjectIO.readObject(_ObjectIO.java:62_) \\ at weblogic.rjvm.ResponseImpl.unmarshalReturn(_ResponseImpl.java:240_) \\ at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(_ClusterableRemoteRef.java:348_) \\ at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(_ClusterableRemoteRef.java:259_) \\ at weblogic.jndi.internal.ServerNamingNode_1030_WLStub.lookup(Unknown Source) \\ at weblogic.jndi.internal.WLContextImpl.lookup(_WLContextImpl.java:392_) \\ at weblogic.jndi.internal.WLContextImpl.lookup(_WLContextImpl.java:380_) \\ at javax.naming.InitialContext.lookup(_InitialContext.java:351_) \\ at test.main(_test.java:23_) \\ Caused by: java.lang.reflect.InvocationTargetException \\ at sun.reflect.NativeConstructorAccessorImpl.newInstance0(_Native Method_) \\ at sun.reflect.NativeConstructorAccessorImpl.newInstance(_NativeConstructorAccessorImpl.java:39_) \\ at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(_DelegatingConstructorAccessorImpl.java:27_) \\ at java.lang.reflect.Constructor.newInstance(_Constructor.java:494_) \\ at weblogic.rmi.internal.StubGenerator.generateStub(_StubGenerator.java:788_) \\ at weblogic.rmi.internal.StubGenerator.generateStub(_StubGenerator.java:779_) \\ at weblogic.rmi.extensions.StubFactory.getStub(_StubFactory.java:74_) \\ at weblogic.rmi.internal.StubInfo.resolveObject(_StubInfo.java:213_) \\ at weblogic.rmi.internal.StubInfo.readResolve(_StubInfo.java:207_) \\ at sun.reflect.NativeMethodAccessorImpl.invoke0(_Native Method_) \\ at sun.reflect.NativeMethodAccessorImpl.invoke(_NativeMethodAccessorImpl.java:39_) \\ at sun.reflect.DelegatingMethodAccessorImpl.invoke(_DelegatingMethodAccessorImpl.java:25_) \\ at java.lang.reflect.Method.invoke(_Method.java:585_) \\ at java.io.ObjectStreamClass.invokeReadResolve(_ObjectStreamClass.java:1033_) \\ at java.io.ObjectInputStream.readOrdinaryObject(_ObjectInputStream.java:1728_) \\ at java.io.ObjectInputStream.readObject0(_ObjectInputStream.java:1305_) \\ at java.io.ObjectInputStream.readObject(_ObjectInputStream.java:348_) \\ at weblogic.utils.io.ChunkedObjectInputStream.readObject(_ChunkedObjectInputStream.java:197_) \\ at weblogic.rjvm.MsgAbbrevInputStream.readObject(_MsgAbbrevInputStream.java:564_) \\ at weblogic.utils.io.ChunkedObjectInputStream.readObject(_ChunkedObjectInputStream.java:193_) \\ at weblogic.rmi.internal.ObjectIO.readObject(_ObjectIO.java:62_) \\ at weblogic.rjvm.ResponseImpl.unmarshalReturn(_ResponseImpl.java:240_) \\ at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(_ClusterableRemoteRef.java:348_) \\ at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(_ClusterableRemoteRef.java:259_) \\ at weblogic.jndi.internal.ServerNamingNode_1030_WLStub.lookup(Unknown Source) \\ at weblogic.jndi.internal.WLContextImpl.lookup(_WLContextImpl.java:392_) \\ at weblogic.jndi.internal.WLContextImpl.lookup(_WLContextImpl.java:381_) \\ at javax.naming.InitialContext.lookup(_InitialContext.java:351_) \\ at test.main(_test.java:26_) \\ Caused by: java.lang.ArrayIndexOutOfBoundsException: 6 \\ at weblogic.jdbc.common.internal.RmiDataSource_1030_WLStub.ensureInitialized(Unknown Source) \\ at weblogic.jdbc.common.internal.RmiDataSource_1030_WLStub.&lt;init&gt;(Unknown Source) \\ at sun.reflect.NativeConstructorAccessorImpl.newInstance0(_Native Method_) \\ at sun.reflect.NativeConstructorAccessorImpl.newInstance(_NativeConstructorAccessorImpl.java:39_) \\ at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(_DelegatingConstructorAccessorImpl.java:27_) \\ at java.lang.reflect.Constructor.newInstance(_Constructor.java:494_) \\ at weblogic.rmi.internal.StubGenerator.generateStub(_StubGenerator.java:788_) \\ at weblogic.rmi.internal.StubGenerator.generateStub(_StubGenerator.java:779_) \\ at weblogic.rmi.extensions.StubFactory.getStub(_StubFactory.java:74_) \\ at weblogic.rmi.internal.StubInfo.resolveObject(_StubInfo.java:213_) \\ at weblogic.rmi.internal.StubInfo.readResolve(_StubInfo.java:207_) \\ at sun.reflect.NativeMethodAccessorImpl.invoke0(_Native Method_) \\ at sun.reflect.NativeMethodAccessorImpl.invoke(_NativeMethodAccessorImpl.java:39_) \\ at sun.reflect.DelegatingMethodAccessorImpl.invoke(_DelegatingMethodAccessorImpl.java:25_) \\ at java.lang.reflect.Method.invoke(_Method.java:585_) \\ at java.io.ObjectStreamClass.invokeReadResolve(_ObjectStreamClass.java:1033_) \\ at java.io.ObjectInputStream.readOrdinaryObject(_ObjectInputStream.java:1728_) \\ at java.io.ObjectInputStream.readObject0(_ObjectInputStream.java:1305_) \\ at java.io.ObjectInputStream.readObject(_ObjectInputStream.java:348_) \\ at weblogic.utils.io.ChunkedObjectInputStream.readObject(_ChunkedObjectInputStream.java:197_) \\ at weblogic.rjvm.MsgAbbrevInputStream.readObject(_MsgAbbrevInputStream.java:564_) \\ at weblogic.utils.io.ChunkedObjectInputStream.readObject(_ChunkedObjectInputStream.java:193_) \\ at weblogic.rmi.internal.ObjectIO.readObject(_ObjectIO.java:62_) \\ at weblogic.rjvm.ResponseImpl.unmarshalReturn(_ResponseImpl.java:240_) \\ at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(_ClusterableRemoteRef.java:348_) \\ at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(_ClusterableRemoteRef.java:259_) \\ at weblogic.jndi.internal.ServerNamingNode_1030_WLStub.lookup(Unknown Source) \\ at weblogic.jndi.internal.WLContextImpl.lookup(_WLContextImpl.java:392_) \\ at weblogic.jndi.internal.WLContextImpl.lookup(_WLContextImpl.java:380_) \\ at javax.naming.InitialContext.lookup(_InitialContext.java:351_) \\ at test.main(_test.java:23_)
    But at the same time the output when connected to WLS 10.0 is :
    Get DMQ \\Get dataSource \\Get dataSource1 \\Done
    (so that the test passed)
    Could you give me a piece of advice ?
    Thanks,
    Sergey

    I hit the same problem as yours. This issue is caused by JDK version. The JDK used by Weblogic 10.3 is java 6, while your client program's jdk version is java5. So change the both of them to java 6. This issue will be fixed.
    Don't forget to rebuild the wlfullclient.jar which also should be java 6.
    Good luck!

  • Standalone proxy client, uknown source!

    Hello experts,
    I am working on a simple standalone java client to test a web service. When I run, I get following stack trace:
    at $Proxy18.salesOrderCreateOut(Unknown Source)
         at test.StandaloneClient.main(StandaloneClient.java:58)
    Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.lookup(Unknown Source)Here is the code:
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try {
                   SalesOrderCreateOutService service = new SalesOrderCreateOutService();
                   SalesOrderCreateOut servicePort = service.getSalesOrderCreate_Out_Port();
                   javax.xml.ws.BindingProvider bp = (javax.xml.ws.BindingProvider) servicePort;
                   Map<String, Object> context = bp.getRequestContext();
    //               context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "<URL>.wsdl");
                   context.put(BindingProvider.USERNAME_PROPERTY, "USER");
                   context.put(BindingProvider.PASSWORD_PROPERTY, "PWD");
                   SalesOrderResponse response = null;
                   Project salesOrderCreateRequest = new Project();
                   Header header = new Header();
                   header.setTitle("EAST COAST SHEET METAL MOTOR WARRANTY");          
                   salesOrderCreateRequest.setHeader(header);
                   try {
                        response = servicePort.salesOrderCreateOut(salesOrderCreateRequest);
                   } catch (SalesOrderError_Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                   TRETURN treturn = response.getTRETURN();
                   Iterator ls = treturn.getItem().iterator();
                   while(ls.hasNext()){
                        TRETURN.Item tempItem = (TRETURN.Item)ls.next();
                        System.out.println(tempItem.getMESSAGE());
                        break;
              } catch (MalformedURLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    Exception is at the bold line.
    Any clues, how to fix this...

    Hi,
    Deployable versus Standalone Proxies
    SAP Web AS Java provides two types of Web service proxies:
    deployable proxy u2013 a Web service client that must be deployed on the J2EE Engine as an application.
    standalone proxy u2013 a Web service client that generates stubs and runs without the J2EE Engine. This proxy can be used only with the release for which it has been generated.
    Although both proxies have similar functions, there are some fundamental differences.
    For the standalone proxy, a stub must be generated and the names and class names of the transport bindings, protocols, and transports that are used must be provided. The drawbacks of this approach are that if a name of a component is changed or requires some modifications, the stub is no longer valid and the whole proxy needs to be regenerated.
    On the other hand, with the deployable proxy all information is either generated during deployment or is retrieved at runtime. Therefore, the deployable proxies are to a certain degree protected from runtime changes.
    For both types of proxies, ServiceInterface and ServiceImpl classes are generated. Their names are derived from the service name of the WSDL that is used to generate the particular proxy.
    For the deployable proxies, only the ServiceInterface is generated at the design time. The client assigns a JNDI name under which the ServiceImpl instace is bound at runtime. The JNDI name is relative to the java:comp/env/ context, which is the default for all J2EE components.
    // for Deployed WS Clients
    import javax.naming.InitialContext;
    InitialContext ctx = new InitialContext();
    FooServiceInterface fsi = (FooServiceInterface)ctx.lookup(u201Cjava:comp/env/FooServiceu201D);
    At deployment, the service implementation and the service stub are generated. To take the service implementation for the standalone proxy, the generated class must be instantiated:
    FooServiceInterface fsi = new FooServiceInterfaceImpl();
    Regards
    Surender Dahiya

  • Standalone applications in UCM

    How to run the standalone applications like Batch Loader, System Properties etc. from client computers i.e. systems not having content server installed on them.
    Any help would be appreciated.
    Regards
    Pradeep

    Would you mind to do one more iteration and put reasons why you need to run each of these applications remotely?
    I will try to give few hints:
    - The Archiver and Batch Loader make perfect sense to be run remotely. The Archiver has an admin applet (in admin web GUI) and Batch Loader was covered in my fist answer. Note that these are more 'Data admin' than 'System admin' apps.
    - System Properties, on the other hand, is probably not something you want to run on regular basis (remotely). Windows Remote Connection should be OK for those admins that need to have access.
    - idcAnalyze is a troubleshooting application. I'd tend to believe that it belongs to the same category as System Properties.

  • JMS: Standalone vs J2EE

    Hello,
    I am looking for comments/advice on implementing a JMS component as a standalone application versus a J2EE (message driven bean). Mainly in terms of experience or pros and cons of each technology. We are implementing the component from scratch and are curious about the performance consequences that people have encountered.
    These JMS components can perform heavy database access, heavy file I/O, and/or heavy computation load. I am if the benefits of running a JMS client as a message driven bean in a J2EE container will outweigh any performance implications when executing many heavy weight tasks within the same JVM.
    Thanks
    Darryl

    Darryl -
    You may want to also post this question on the Oracle9iAS J2EE forum on OTN to reach a wider Java audience.
    http://technet.oracle.com:89/cgi-bin/forumdisplay.cgi?action=topics&forum=Oracle9iAS+J2EE&number=99&DaysPrune=20&LastLogin=

  • RMI - EJB Standalone Java client

    Hello,
    We have a standalone Java client attempting to invoke a EJBs running on OC4J. We get a user not allowed to access namespace...check orion-application.xml file... Any ideas what could be the problem.
    Regards.

    Hi,
    In access namespace tag of your orion-application.xml, you should specify the same user as the one used by your java client.
    Hope that helps
    regards

Maybe you are looking for

  • Display Error Message in ESS

    Dear all, I have a requirement in WEB DynPro, Our ESS system using WEB DynPro. In ESS leave system need to display error message.ie once leave approved, employees are not allowed to change the leave. Any idea to write code to display error message. T

  • Is it possible to reference one cell from the value of another?

    Is it possible to reference one cell from the value of another e.g. value of b1 = value of c(value of a1) So if a1 = 3 then b1 = c3, if a1 = 5 then b1 = c5.

  • Why does my sub-projects open in read only when master is opened

    I have created a master schedule with 4 sub-projects inserted as read only. My problem is that when the master is opened the sub-projects will only open in read only so PMs can not update their schedules when requried. I have sold my company on using

  • HELP ~ Does disputing credit reports really work?? Nervous!!

    Hi Guys,I'm working on my husband's and my credit.  I'm drafting a dispute letter found on the MY Fico site and well, I'm a bit nervous!   I'm hoping to get all the collections removed because of errors and the misrepresentation of reporting as Facto

  • Unable to order Infinity and getting the run-aroun...

    Hi All, Bit of a weird one, but hopefully someone can shed some light on it. First of all, I will state that according to the website and all the agents I have spoken to, I can receive Infinity at my property. Recently, I moved house into a brand new