JMS Client Program

Hi,
I'm trying to run my JMS Client program to post a message to XI JMS Queue.
But I'm getting the following exception... java.lang.ClassCastException
at QueueConnectionFactory.
Also tried to catch the name of the returned class name...
com.sap.engine.services.jndi.persistent.UnsatisfiedReferenceImpl
Can anyone has an idea what could be the possible solution?
Any help is highly appreciated.
Here are the details...
SAP_NAMING_PROVIDER_URL = localhost:50204 (50200 being J2EE port)
SAP_INITIAL_CONTEXT_FACTORY_IMPL = "com.sap.engine.services.jndi.InitialContextFactoryImpl"
QueueConnectionFactory queueConnectionFactory =(QueueConnectionFactory) jndiContext.lookup("jmsfactory/default/QueueConnectionFactory")
Queue queue = (Queue) jndiContext.lookup(
                  "jmsqueues/default/MyTestQueue")
Thanks and Regards,
Vijay

Hi Archana,
The link isn't working and giving a message as..."Error: Session expired!"
By the way my code is an extract of the one that is available at... <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/44/efec3341ad67d8e10000000a155369/frameset.htm">help.sap.com</a>
If you think this is different to the one that you intend to send, can you please send me the correct one?
Thanks and Regards,
Vijay Kalyan

Similar Messages

  • Running JMS Client Programs on Multiple Systems using J2EE1.4

    Hi all,
    I have 1 message producer and about 100 clients on different systems in the network which receive the messages.
    At the moment I am running a J2EE1.3 server on the sender side and the client programs are startet with -Dorg.omg.CORBA.ORBInitialHost=sender hostname to access the remote system.
    My problems:
    1. I upgraded my client program to java1.5 , but jdk1.5.0_01/jre/lib/rt.jar doesn't contain com/sun/corba/se/internal/util/JDKBridge -> it`s not possible to execute corba calls any more.
    2. If you upgrade J2EE1.3 to J2EE1.4 sender and receiver system must both be running the J2EE Application Server, but I want only the the sender system to run J2EE.
    I have no idea how to solve these problems and would be happy about every assistance.
    Thanks,
    Elke

    Hi
    I would suggest posting this into the J2EE 1.4 (application server) forum. You will have a better chance of getting help there, since, while your application is JMS based, it is not a JMS issue.
    TE

  • Running JMS Client Programs on Multiple Systems?

    Has anyone gotten JMS to work on Multiple Systems
    using Windows 2000 on both systems? The JMS Tutorial
    doesn't seem to work for me even if I repeat the steps
    over an over again (maybe it's incorrect)?
    Well, anyway, what I'd really like to do is to run
    JMS between different systems using tcp/ip. Is this
    possible?

    Hey There,
    Same thing happens to me. Since your message and others went unanswered, I am being to think this is a dirty little secret.

  • JMS Client disconnects often randomly in Weblogic10.3 cluster setup

    Hi,
    It would be very helpful for us if someone can suggest the way to overcome the below jms issue.
    Our application recently migrated to Weblogic 10.3 from Weblogic8.1, It is a clustered set up with two managed servers each on different solaris machine.
    Client connects to jms using wljmsclient.jar and wlclient.jar with t3 protocol.
    When client starts jms connection, it is getting connected to server with no errors, however we often see that client jms connection disconnects in between,
    It sometimes calls onException() and some times we do not even see any error message in console log when it disconnects,
    When onException() is called, we can see below exception stack trace:
    ==========================
    JMS exception class = weblogic.messaging.dispatcher.DispatcherException: java.rmi.MarshalException: CORBA COMM_FAILURE 1398079697 No; nested exception is:      
         org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 209 completed: No
    weblogic.jms.common.JMSException: weblogic.messaging.dispatcher.DispatcherException: java.rmi.MarshalException: CORBA COMM_FAILURE 1398079697 No; nested exception is:      
         org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 209 completed: No
         at weblogic.jms.dispatcher.DispatcherAdapter.convertToJMSExceptionAndThrow(DispatcherAdapter.java:116)
         at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSyncNoTran(DispatcherAdapter.java:61)
         at weblogic.jms.client.JMSSession.acknowledge(JMSSession.java:2191)
         at weblogic.jms.client.JMSSession.acknowledge(JMSSession.java:2120)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4588)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
         at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
    JMS exception class = java.rmi.MarshalException: CORBA COMM_FAILURE 1398079697 No; nested exception is:      
         org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 209 completed: No
    weblogic.jms.common.LostServerException: java.rmi.MarshalException: CORBA COMM_FAILURE 1398079697 No; nested exception is:      
         org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 209 completed: No
         at weblogic.jms.client.JMSConnection.dispatcherPeerGone(JMSConnection.java:1436)
         at weblogic.messaging.dispatcher.DispatcherWrapperState.run(DispatcherWrapperState.java:692)
         at weblogic.messaging.dispatcher.DispatcherWrapperState.timerExpired(DispatcherWrapperState.java:617)
         at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
    =======================
    When onException() is triggered, TopicConnection and TopicSession gets recreated in program, however jms is not getting reconnected once onException() is called. Some times jms session is lost in between with out any errors in log. We did not see this issue when our app used Weblogic8.1.
    We greatly appreciate if someone can help to resolve this issue.

    Hi,
    This is a common issue if you use wljmsclient.jar and wlclient.jar at client side. Many times we get "org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 209 completed: No" Please try using weblogic.jar at client end or even there is a better option to create the "*wlfullclient.jar*" using the jarBuilder utility provided as part of WebLogic.
    To create the "wlfullclient.jar" please refer to the following link:
    [http://download-llnw.oracle.com/docs/cd/E11035_01/wls100/client/jarbuilder.html#wp1077742|http://download-llnw.oracle.com/docs/cd/E11035_01/wls100/client/jarbuilder.html#wp1077742]
    Thanks
    Jay SenSharma
    http://jaysensharma.woardpress.com

  • Error while running client program

    Hi,
    I am writing a sample program. Below is the server code.
    package helloWorld;
    import javax.jws.*;
    @WebService
    public class HelloWorld {
         @WebMethod
         public String hello() {
              System.out.println("Print data");
              return "Test";
    Firstly when I start the server I get
    <WSEE>Warning: JMS Queue 'weblogic.wsee.DefaultQueue' is not found, as a result, Web Service async responses via jms transport is not supported. If the target service uses JMS transport, the responses will not be able to come back.<JmsQueueListener.connect:227>
    Ignoring this I wrote a client program
    package web;
    import java.io.IOException;
    import java.io.PrintWriter;
    * Servlet implementation class for Servlet: WebClient
    public class WebClient {
              public static void main(String[] argc)
              try {
                   HelloWorldService_Impl service = new HelloWorldService_Impl();
                   HelloWorld port = service.getHelloWorldSoapPort();
                   java.lang.String message = "Hi";
                   // TODO process result here
                   String result = port.hello();
                   System.out.println("Result = "+result);
              }catch(Exception e)
                   e.printStackTrace();
    When I run the client I get runtime error
    D:\test\2105\WebClient\src>D:\bea\jdk150_04\bin\java -cp .;jaxrpc.jar;weblogic.jar;webservices.jar;webservicesclient.jar;xbean.jar;ant.jar;ant-antlr.jar;ant-weblogic.jar web/WebClient
    Exception in thread "main" java.lang.AssertionError: java.io.IOException
    at weblogic.descriptor.DescriptorManager$DefaultMarshallerFactorySingleton.<clinit>(DescriptorManager.java:42)
    at weblogic.descriptor.DescriptorManager.getDefaultMF(DescriptorManager.java:116)
    at weblogic.descriptor.DescriptorManager.getMarshallerFactory(DescriptorManager.java:125)
    at weblogic.descriptor.DescriptorManager.getDescriptorFactory(DescriptorManager.java:147)
    at weblogic.descriptor.DescriptorManager.createDescriptor(DescriptorManager.java:215)
    at weblogic.descriptor.DescriptorManager.createDescriptor(DescriptorManager.java:185)
    at weblogic.descriptor.DescriptorManager.createDescriptor(DescriptorManager.java:170)
    at weblogic.wsee.jaxrpc.ServiceImpl.loadWeblogicDD(ServiceImpl.java:404)
    at weblogic.wsee.jaxrpc.ServiceImpl.loadInternalDD(ServiceImpl.java:346)
    at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:110)
    at web.HelloWorldService_Impl.<init>(HelloWorldService_Impl.java:21)
    at web.HelloWorldService_Impl.<init>(HelloWorldService_Impl.java:13)
    at web.WebClient.main(WebClient.java:15)
    Caused by: java.io.IOException
    at weblogic.descriptor.internal.MarshallerFactory.<init>(MarshallerFactory.java:50)
    at weblogic.descriptor.DescriptorManager$DefaultMarshallerFactorySingleton.<clinit>(DescriptorManager.java:40)
    ... 12 more
    Caused by: com.bea.xml.XmlException: unable to load type library from classloader sun.misc.Launcher$AppClassLoader@e39a3e
    at com.bea.staxb.runtime.internal.BindingContextFactoryImpl.createBindingContext(BindingContextFactoryImpl.java:50)
    at weblogic.descriptor.internal.MarshallerFactory.<init>(MarshallerFactory.java:48)
    Can anyone let me know what could be the problem?

    Hi,
    My Client Program is as follows:
    import javax.ejb.*;
    public class Client{
    public static void main(String[] args){
    Account account = null;
         try{
    Context = new
    Context = new
    InitialContext(System.getProperties());
    AccountHome home = (AccountHome)
    AccountHome)
    ctx.lookup("java:comp/env/ejb/AccountBean");
         home.create("123-456-7890","John");
         }catch(...){
    }What are the System Properties? Are you running the client remotely? Are you running the client as a stand alone Java app or using the Weblogic's Client Runner? 'java:comp' as the jndi name is usually used when the client runs inside the container... But it doesn't seem to be the case.
    Kexkey

  • Client Program accessing J2EE entity Bean

    I have trouble find my Course J2EE bean from a client. (The client
    runs on the same computer but a different VM from the bean.)
    In Glassfish (Sun Application Server Nine), I set up a simple
    Container-Managed Entity Bean. I tried to access it from an external
    client as described in the glassfish EJB
    FAQ https://glassfish.dev.java.net/javaee5/ejb/EJB-FAQ.html
    Here is the client program:
    package RS;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.xml.parsers.*;
    import org.apache.xml.serialize.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import RS.CourseHome;
    import RS.CoursePK;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.naming.NamingException;
    import java.rmi.RemoteException;
    import javax.rmi.*;
    import java.util.Properties;
    import Debug.*;
    public class Client {
    public static void main (String arg[]) throws IOException {
    try {
    InitialContext jndiContext = new InitialContext ();
    Debug.P("jndic ongtext" + jndiContext);
    Object o = jndiContext.lookup("RS.CourseHome");
    Debug.P("looked up object "+o + "|"+o.getClass().getName());
    RS.CourseHome home =
        (RS.CourseHome)PortableRemoteObject.narrow(o,RS.CourseHome.class);
    Debug.P("got home "+home);
    Course C = home.create(1);
    C.setName("blah");
    CoursePK PK = new CoursePK();
    PK.number=1;
    C = home.findByPrimaryKey(PK);
    Debug.P(C.getName());
    catch (java.rmi.RemoteException re) {Debug.P("Remote Exception" + re.getMessage());}
    catch (javax.naming.NamingException ne){Debug.P("Naming Exception"+ne.getMessage());}
    catch (javax.ejb.CreateException ce){Debug.P("Create Exception"+ce.getMessage());}
    catch (javax.ejb.FinderException fe){Debug.P("Finder Exception"+fe.getMessage());}
    }Here is the error message:
    Exception in thread "main" java.lang.ClassCastException
    at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow
                       (PortableRemoteObject.java:294)
      at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
      at RS.Client.main(Client.java:26)The debugging indicates that I got the Initial Context
    and got the object but the PortableObject.narrow failed:
    jndic ongtextjavax.naming.InitialContext@1d85f79
    looked up object IOR: (huge number deleted)
    com.sun.corba.ee.impl.corba.CORBAObjectImplEarlier, I tried the version below, but based on the suggestion by Mr. Ebbert
    in the forum started "Error When running the Client Program" by sree_devi,
    I checked
    the following. I went to "Jndi Tree Browsing" from the Administrative Console
    and I found a "RS.CourseHome" entry under "ejb" I found RS.CourseHome there
    but did not see the "Course" tghat I expected to see
    Thus, I tried the version above:
    package RS;
       --- imports deleted for conciseness
    import Debug.*;
    public class Client {
    public static void main (String arg[]) throws IOException {
    try {
    InitialContext jndiContext = new InitialContext ();
    Object o = jndiContext.lookup("Course");
    CourseHome home =
        (CourseHome)PortableRemoteObject.narrow(o,CourseHome.class);
    Course C = home.create(1);
    C.setName("blah");
    CoursePK PK = new CoursePK();
    PK.number=1;
    C = home.findByPrimaryKey(PK);
    Debug.P(C.getName());
    catch (java.rmi.RemoteException re) {Debug.P("Remote Exception" + re.getMessage());}
    catch (javax.naming.NamingException ne){Debug.P("Naming Exception"+ne.getMessage());}
    catch (javax.ejb.CreateException ce){Debug.P("Create Exception"+ce.getMessage());}
    catch (javax.ejb.FinderException fe){Debug.P("Finder Exception"+fe.getMessage());}
    }When I run it, I get the following Naming Exception: Course not found
    I confirmed at the administrative console, that I have "Course" listed
    under Enterprise Applications:
    As per the ejb FAQ, I set up my $CLASSPATH so it starts as follows:
    /opt/j2ee/SUNWappserver/lib/appserv-rt.jar:
    /opt/j2ee/SUNWappserver/lib/javaee.jar:I also verifed in my domain.xml that the orb-listener-1, the default
    naming service port was at 3700.
    Here is the info on the Bean that I have running for both of the tries
    at my Client code.
    ejb-jar.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
    version="2.1">
      <enterprise-beans>
        <entity>
           <description>Course</description>
           <display-name>CourseBean</display-name>
           <ejb-name>CourseBean</ejb-name>
           <home>RS.CourseHome</home>
           <remote>RS.Course</remote>
           <ejb-class>RS.CourseBean</ejb-class>
           <persistence-type>Container</persistence-type>
           <prim-key-class>RS.CoursePK</prim-key-class>
           <reentrant>false</reentrant>
           <abstract-schema-name>Course</abstract-schema-name>
           <cmp-field><field-name>number</field-name></cmp-field>
           <cmp-field><field-name>name</field-name></cmp-field>
        </entity>
      </enterprise-beans>
      <assembly-descriptor>
         <security-role>
            <description>Everyone</description>
           <role-name>everyone</role-name>
         </security-role>
         <method-permission>
            <unchecked/>
            <method>
               <ejb-name>CourseBean</ejb-name>
               <method-name>*</method-name>
            </method>
          </method-permission>
         <container-transaction>
            <method>
               <ejb-name>CourseBean</ejb-name>
               <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
         </container-transaction>
      </assembly-descriptor>
    </ejb-jar>
    Sun-ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 EJB 2.1//EN"
    "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_1-1.dtd">
    <sun-ejb-jar>
      <enterprise-beans>
         <name>CourseBean</name>
         <ejb>
           <ejb-name>CourseBean</ejb-name>
           <jndi-name>Course</jndi-name>
         </ejb>
      <cmp-resource>
         <jndi-name>jdbc/__default</jndi-name>
         <create-tables-at-deploy>true</create-tables-at-deploy>
         <drop-tables-at-undeploy>true</drop-tables-at-undeploy>
      </cmp-resource>
      </enterprise-beans>
    </sun-ejb-jar>
    Course.java
    package RS;
    import java.rmi.RemoteException;
    public interface Course extends javax.ejb.EJBObject {
      public String getName() throws RemoteException;
      public void setName (String Str) throws RemoteException;
      public int getNumber() throws RemoteException;
      public void setNumber (int n) throws RemoteException;
    CourseHome.java
    package RS;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    public interface CourseHome extends javax.ejb.EJBHome {
    public Course create(int id) throws
    CreateException,RemoteException;
    public Course findByPrimaryKey(CoursePK pk)
    throws FinderException,RemoteException;
    CourseBean.java
    package RS;
    import javax.ejb.EntityContext;
    public abstract class CourseBean implements javax.ejb.EntityBean {
    public CoursePK ejbCreate (int number) throws javax.ejb.CreateException{
      this.setNumber(number);
      return null;
    public void ejbPostCreate (int number) {
    public abstract String getName();
    public abstract void setName (String str);
    public abstract int getNumber ();
    public abstract void setNumber (int number);
    public void setEntityContext (EntityContext ctx) {}
    public void unsetEntityContext() {}
    public void ejbActivate () {}
    public void ejbPassivate () {}
    public void ejbLoad () {}
    public void ejbStore () {}
    public void ejbRemove() {}
    }Laurence L. Leff, Ph.D. Associate Professor of Computer Science
    Western Illinois University, 1 University Circle 61455, Pager: 309 367 0787
    FAX 309 298 2302

    hi s-mcgowan,
    "some other processing" comprises of printing of debug lines and publishing to the message queue using JMS. I added more debug lines so that i could see whats really happening... here is the result
    myTableHome.create(...); <----------- no exception was thrown and it returned LocalMyTable object
    print out "Insert successful"
    print out "publishing message"
    ... publish message to message queue using JMS...
    print out "Publish done"
    ... after few milliseconds...
    java.sql.BatchUpdateException: Data exception -- row already exist in index PK_MYTABLE on table MYTABLE.
    From the exception it seems like its doing a batch insert. So that seems to explain why the java.sql.BatchUpdateException is thrown few milliseconds after my call to myTableHome.create(...);
    Is it possible to disable batch update / insert? how?
    thanks in advance,
    leigh

  • How to configure for remote JMS client?

    I have my own Java JMS test program for performance measurements.
              I am using the JNDI and JMS provider functionality of the WebLogic 9.1 app-server but my test program is just pure JMS 1.02 sender/receiver clients - ie it is NOT part of, or deployed as a J2EE application.
              SINGLE MACHINE TEST
              ===================
              In a single machine environment I was able to
              - configure a JMSServer
              - configure a JMSSystemModule
              - configure resources for ConnectionFactories and Queue and Topics
              I then made what I believe to be a 'standalone' application module copied from some mysystemmodule-jms.xml and with that I somehow worked out how to deploy it using the weblogic.Deployer tool.
              The deployment apparently set up the JNDI and my JMS client could gain access to the administered objects and do what it does.
              Everything works.
              TWO MACHINE TEST
              ================
              I now have a second machine.
              I want to put my JMS sender client on this new machine and I want the JMS server and JMS receiver client to be unchanged from the SINGLE MACHINE TEST.
              But I really don't know quite how to proceed from here...
              Do I need to install the WebLogic app-server on the sender machine or is the weblogic.jar all I need?
              What is necessary configuration for JNDI access on the sender machine?
              Can I in fact use my original SINGLE MACHINE server unchanged as I am hoping?
              I don't think I want a "thin" client because I read that performance is impacted (and these are performance tests)
              Remember this is NOT a J2EE application. There is no MDB; no client-container; no descriptors etc. Maybe that makes it more complicated - I don't know.
              Sorry for such basic questions but if somebody can just point me to an appropriate example or tutorial it could save me days...
              Thankyou.

    Hi,
              My problem is on similar lines. I have an applet based UI working on RMI/t3 protocol.
              I am using weblogic 9.2 as my app server.
              When my applet is executed on JRE 1.5x it works fine.
              But when I use JRE1.4x it gives the following exception
              java.lang.NoClassDefFoundError: javax/management/InvalidAttributeValueException
              at weblogic.rmi.internal.Stub.<clinit>(Stub.java:21)
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:141)
              at weblogic.rmi.internal.StubInfo.class$(StubInfo.java:34)
              at weblogic.rmi.internal.StubInfo.<clinit>(StubInfo.java:34)
              at java.lang.Class.forName0(Native Method)
              I have analyzed the reason for this.
              the class javax/management/InvalidAttributeValueException was included in java 1.5 and above. So JRE 1.4 does not have it.
              In previous versions of weblogic this class was a part of their 'weblogic.jar' file and in weblogic 9.2 it is not a part of weblogic.jar file so when I am using JRE1.4 and weblogic 9.2 then it obviously does not find this class hence the above exception.
              I tried to put this all together and made custom made client jar file incliding the necessary classes. I was able to get throght this exception only land up in following exception.
              java.lang.VerifyError: class weblogic.utils.classloaders.GenericClassLoader overrides final method .
                   at java.lang.ClassLoader.defineClass0(Native Method)
                   at java.lang.ClassLoader.defineClass(Unknown Source)
                   at java.security.SecureClassLoader.defineClass(Unknown Source)
                   at sun.applet.AppletClassLoader.findClass(Unknown Source)
                   at java.lang.ClassLoader.loadClass(Unknown Source)
                   at sun.applet.AppletClassLoader.loadClass(Unknown Source)
                   at java.lang.ClassLoader.loadClass(Unknown Source)
                   at java.lang.ClassLoader.loadClassInternal(Unknown Source)
                   at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialContextFactoryDelegate.java:204)
                   at weblogic.jndi.spi.EnvironmentManager$DefaultFactoryMaker.<clinit>(EnvironmentManager.java:26)
                   at weblogic.jndi.spi.EnvironmentManager.getInstance(EnvironmentManager.java:48)
                   at weblogic.jndi.Environment.getContext(Environment.java:307)
                   at weblogic.jndi.Environment.getContext(Environment.java:277)
                   at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
                   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)
              I really need to support clients using Jre 1.4 and Jre 1.5
              I will really appreciate any help on this one.
              Please advise.
              Thank you all.

  • Smallest JMS Client footprint?

              Hi everyone,
              I would like to deploy a JMS client applet and avoid downloading the 38MB weblogic.jar
              file. The WebLogicThinClient whitepaper gives a few suggestions on how to reduce
              the size of the JAR file. After getting the first method to work (using utils.verboseTozip),
              I'm left with a JAR file containing 1058 class files and weighing in at a little
              over 5 Mb. Is this really the smallest set of files required to support JMS functionality?
              Thanks,
              Elias
              

    Hi Elias,
              I don't know the answer the to all your problems, hopefully someone else
              in the newsgroup can contribute here. More in-line.
              Tom
              [email protected] wrote:
              > Hi again,
              >
              > I've been experimenting with the URLClassLoader and you were right, the
              > JAR file produced using this method is much smaller (1Mb) than the one
              > produced with the verboseToZip utility (5Mb). Furthermore, I am now able
              > to run my JMS tests without seeing any exceptions.
              As a safety precaution: if you plan on disabling the URLClassLoader once
              you've got the classes, you may wish to consider including all "Exception"
              classes that occur in the same package as any other class you download.
              This is in case your tests don't cover all error conditions...
              > Unfortunately, there
              > are still a couple of vexing problems:
              >
              > Just after starting the URLClassLoader program the following message
              > appears.
              > "Unable to access Localizer, weblogic.i18n.L10nLogLocalizer"
              > Not one of the jar files in the server/lib directory contains this
              > class. There is a L10nLogLocalizer.properties file, which should be
              > located by the URLClassLoader but isn't...?
              I think you're correct. I'm not sure how to force the URLClassLoader
              to find such files. If you find out, please let me know.
              In this case, I think this file is only used for localizing client side log messages that
              get dumped to stdout, but there are very few such messages. If your app runs,
              I think you can safely ignore the "Unable to access..." message.
              >
              >
              > After setting up the JMS environment (connections, sessions, producers,
              > consumers, etc.), the test driver publishes some messages of different
              > types. The onMessage() method I implemented should print out "received X
              > message", where X is the message type. Unfortunately, I don't see this
              > message printed out at all and instead see "testSync TX = null" instead.
              > I have no idea what this means, but it appears that the onMessage()
              > method is not being invoked for some reason. Do you have any idea what
              > this indicates?
              No.
              > Am I somehow missing a class that I need?
              To narrow down the problem:
              Try with the full weblogic.jar in the applet.
              Try running as regular client with full weblogic.jar, then with your small.jar.
              > Has anyone
              > else ever seen this message print out when they were expecting something
              > else? Thanks again for any assistance, I feel quite close to a workable
              > solution! Please let the BEA developers working with JMS that the "thin
              > JMS client" JAR file will be well received.
              Just send cash directly to BEA's Liberty Corner, NJ site.
              >
              >
              > Elias
              >
              > Tom Barnes wrote:
              >
              > > The URLClassLoader method in the same white-paper will likely produce a smaller client than the
              > > verboseTozip method - perhaps at least half the size.
              > >
              > > The next release of WL (unofficially 7.1) will include the long-awaited pre-packaged thin JMS
              > > client. (Yes finally!) Really really. I think the beta is scheduled to be out before the
              > > end of the year (sorry I can't give out the planned dates - I don't know if they are public
              > > yet.)
              > >
              > > Currently, I think the smallest J2EE style applet client can be achieved by proxying JMS calls
              > > via an EJB, where calls to the EJB are made via the JVM's built-in IIOP client.
              

  • -- Error during running JMS client --

    Hello ,i m novice in JMS,just trying to Implement my first JMS programming on WL8.1,I m getting error during Run client program
    My client program is below :
    package examples;
    import javax.naming.*;
    import javax.jms.*;
    import java.util.*;
    public class Client
    public static void main(String[] args)throws Exception
         Properties props = System.getProperties();
         props.put(Context.PROVIDER_URL,"t3://localhost:7001");
         props.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    Context ctx=new InitialContext(System.getProperties());
    TopicConnectionFactory factory=(TopicConnectionFactory)ctx.lookup("javax.jms.TopicConnectionFactory");
    TopicConnection connection = factory.createTopicConnection();
    TopicSession session=connection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
    System.out.println("Envi Veraibles" + ctx.getEnvironment().toString());
    System.out.println("Object Retrived "+ctx.lookup("testtopic").toString());
    Topic topic =(Topic)ctx.lookup("testtopic");
    TopicPublisher publisher=session.createPublisher(topic);
    TextMessage msg=session.createTextMessage();
    msg.setText("This is a test message");
    publisher.publish(msg);
    I m getting error during running client ::
    Exception in thread "main" java.lang.ClassCastException: weblogic.jms.client.JMSConnectionFactory  examples.Client.main(Client.java:23)
    i think error is due to this line
    Topic topic =(Topic)ctx.lookup("testtopic");
    Pls Help me
    Thnx in Advance ...

    First of thanks for gave me a Reply.
    (1) System.out.println("Object Retrived "+ctx.lookup("testtopic").toString()); this line is nothing just i wanted to check that program giving me a object or not .and output of this line is
    Object Retrived weblogic.jms.client.JMSConnectionFactory@1f66cff
    (2)Testtopic is not a object but it is JNDI name whichever i specified in webligic-ejb-jar.xml
    (3)i added this line System.out.print("Second output"+ctx.getClass().getName()); and i got this output:
    Second output javax.naming.InitialContext
    but still i m getting same error
    here i m describing my code for ejb-jar.xml
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <!-- Generated XML! -->
    <ejb-jar>
    <enterprise-beans>
    <message-driven>
    <ejb-name>LogBean</ejb-name>
    <ejb-class>examples.LogBean</ejb-class>
    <transaction-type>Container</transaction-type>
    <message-driven-destination>
    <destination-type>javax.jms.Topic</destination-type>
    </message-driven-destination>
    </message-driven>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>LogBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    (2)*LogBean.java*
    package examples;
    import javax.ejb.*;
    import javax.jms.*;
    import javax.naming.*;
    public class LogBean implements MessageDrivenBean,MessageListener
         protected MessageDrivenContext ctx;
    public void setMessageDrivenContext(MessageDrivenContext ctx)
         this.ctx=ctx;
    public void ejbCreate()
         System.err.println("ejbCreate()");
         public void onMessage(Message msg)
              if(msg instanceof TextMessage)          {
                   TextMessage tm=(TextMessage)msg;
                   try
                        String text=tm.getText();
                        System.err.println("Received new message:"+text);
                   catch (JMSException e)
                        e.printStackTrace();
    public void ejbRemove()
         System.err.println("ejbRemove()");
    (3)*webogic-ejb-jar.xml*
    <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN' 'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>
    <!-- Generated XML! -->
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>LogBean</ejb-name>
    <message-driven-descriptor>
    <pool>
    </pool>
    <destination-jndi-name>testtopic</destination-jndi-name>
    </message-driven-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    you have already client program ,i sent it on first time.
    Thnx again ...

  • Help getting JMS Client Working

    I am trying to set up a simple JMS Chat program. I installed AS7 on my Windows XP workstation and configured a Physical Destination (topic1), a Destination (myTopic) and a Connection Factory (myTCF).
    I followed the documentation exactly and when I run the following code, I am getting a lot of exceptions.
    try {
    String CONTEXT_LOOKUP = "java:comp/env/jms/TopicConnectionFactory/myTCF";
    String TOPIC_LOOKUP = "java:comp/env/jms/myTopic";
    initialContext = new InitialContext();
    TCFactory = (TopicConnectionFactory) intialContext.lookup(CONTEXT_LOOKUP);
    topic = (Topic) initialContext.lookup(TOPIC_LOOKUP);
    } catch (NamingException ne) {}
    try {
    topicConnection = TCFactory.createTopicConnection();
    topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
    topicPublisher = topicSession.createPublisher(topic);
    topicConnection.start();
    } catch (JMSException jmse) {}
    I just need to get a simple JMS client to work to evaluate AS7. Anyone have something like this?

    I went and ran the example for jms topics. It is a servlet and it works just fine.
    I followed the same step as in the example with my client and I received the errors below. There must be some setting that I don't know about as mine is an applications and the example is a servlet.
    Errors:
    Feb 5, 2003 1:50:40 PM com.sun.enterprise.util.ORBManager initializeORBMonitorin
    g
    SEVERE: UTIL6034:Could not initialize ORB monitoring
    java.lang.IllegalStateException: Monitorable component can not be registered bec
    ause admin service has not been initialized.
    at com.iplanet.ias.admin.monitor.MonitoringHelper.registerORBMonitoringM
    Bean(MonitoringHelper.java:305)
    at com.iplanet.ias.admin.monitor.MonitoringHelper.registerSystemORBMonit
    oringMBean(MonitoringHelper.java:252)
    at com.sun.enterprise.util.ORBManager.initializeORBMonitoring(ORBManager
    .java:732)
    at com.sun.enterprise.util.ORBManager.init(ORBManager.java:261)
    at com.sun.enterprise.naming.SerialInitContextFactory.<init>(SerialInitC
    ontextFactory.java:31)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
    orAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
    onstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at java.lang.Class.newInstance0(Class.java:306)
    at java.lang.Class.newInstance(Class.java:259)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    49)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:175)
    at prototypec.ClientUI.<init>(ClientUI.java:115)
    at prototypec.ClientMain.<init>(ClientMain.java:24)
    at prototypec.ClientMain.main(ClientMain.java:31)

  • Running JMS client on multiple systems (using J2EE 1.4)

    Hello all,
    Can anyone tell me if it is possible to run a JMS client on a system that is not running a J2EE server on localhost? Is there any way to reference the server on another machine (using J2EE 1.4 server)??
    I found information in the J2EE 1.3.1 tutorial that tells of ways to
    - run the client program with both systems running the server
    - run the client program with only one system running the server (which isn't localhost)
    However, the corresponding portion of J2EE 1.4 tutorial only specifies running the client with App server running on both systems...... does this mean that we cannot run a standalone client program with no server on localhost in case of the 1.4 server?
    Also, most of the tutorials on JMS I have seen so far only explain the scenario with both the client and the server on a single machine. Is this how average JMS applications work?? What I mean to ask is, in a typical scenario where does a JMS client run....?? at the server, or at the client (which may or may not be running a server at localhost).
    Thanks for your time.

    The functionality has not changed in J2EE 1.4 outside of reving to JMS 1.1

  • C or C++ JMS Client

              Hi,
              Is there any way to have a C++ or a C program running as a JMS client?
              Thanks in advance,
              Goutam.
              

    Hi,
              See attached FAQ for C JMS client and other
              C integration approaches.
              Tom
              Goutam Mukherjee wrote:
              > Hi,
              >
              > Is there any way to have a C++ or a C program running as a JMS client?
              >
              > Thanks in advance,
              > Goutam.
              JMS Integration of Foreign Vendors with BEA WebLogic Server
              The following notes are derived mostly from "http://dev2dev.bea.com/technologies/jms/index.jsp".
              For additional questions, a good forum for WebLogic questions in general is "newsgroups.bea.com". These can be mined for information by using Google's newsgroup search function.
              JMS Integration Overview
              - For integration with "non-Java" and/or "non-JMS" platforms, see "Non-Java Integration Options" below.
              - For a foreign JMS vendor to participate in a WL transaction it must support XA. Specifically, it must support the javax.jms.XA* interfaces.
              - In WL versions 6.0 and up it is possible to make synchronous calls to foreign JMS vendors participate in a WL transaction as long as the foreign vendor supports XA.
              - WL 6.0 and 6.1 MDBs can be driven by foreign vendors non-transactionally. They can be driven transactionally by a select few foreign vendors (MQ is not part of the select few)
              - WL 7.0 and later, MDBs can be driven by foreign vendors transactionally and non-transationally.
              - WL 6.1 and later WL provides a messaging bridge feature. Messaging bridges forward messages between any two JMS destinations, including foreign destinations, and can transfer messages transactionally or non-transactionally.
              - WL 8.1 JMS provides additional features that simplify transactional and JNDI integration of foreign vendors. See http://edocs.bea.com/wls/docs81/jms/intro.html#jms_features
              Integration with 8.1 Details
              A good overview of 8.1 JMS interop capability is the presentation "Integrating Foreign JMS Providers with BEA WebLogic Server" here:
              http://www.bea.com/content/files/eworld/presentations/Wed_03_05_03/Application_Servers/1097-Foreign_JMS_Providers_WLS.pdf
              This document refers to helpful new 8.1 features, which simplify integration. These include:
              http://edocs.bea.com/wls/docs81/ConsoleHelp/jms_config.html#accessing_foreign_providers
              http://edocs.bea.com/wls/docs81/jms/j2ee_components.html#1033768
              And are also summarized here (under interoperability):
              http://edocs.bea.com/wls/docs81/jms/intro.html#jms_features
              Also read the extensive MDB documentation, which extensively covers integrating foreign vendors:
              http://edocs.bea.com/wls/docs81/ejb/message_beans.html
              The 8.1 features are likely sufficient for most 8.1 integration needs, and you may not need to refer "Using Foreign JMS Providers With WLS" white-paper mentioned below.
              Integration with 6.1 and 7.0 Details
              Read the "Using Foreign JMS Providers With WLS" white-paper:
              http://dev2dev.bea.com/products/wlserver/whitepapers/jmsproviders.jsp
              Note that this white-paper does not take into account 8.1 features.
              For 7.0 read the extensive 8.1 MDB documentation, which largely also applies to 7.0:
              http://edocs.bea.com/wls/docs81/ejb/message_beans.html
              Non-Java Integration Options
              - WL JMS has a JNI based C client which can be called directly from windows. This C client supports 7.0 and up, and will be officially packaged with WLS in 9.0 (virtually unchanged). The C API is currently only supported through the jms newsgroup. See "JMS C API", here:
              http://dev2dev.bea.com/technologies/jms/index.jsp
              - WL supports direct Windows COM access through its "JCOM" feature. This doesn't include the JMS API, but one can invoke EJBs which in turn invoke JMS. See
              http://e-docs.bea.com/wls/docs61/jcom.html
              http://e-docs.bea.com/wls/docs70/jcom/
              http://e-docs.bea.com/wls/docs81/jcom/
              - Similar to JCOM, but more advanced, WL supports IIOP standard based access on multiple platforms. You can use the BEA Tuxedo C client for this purpose (no license fee). This doesn't include the JMS API, but one can invoke EJBs which in turn invoke JMS. See
              http://e-docs.bea.com/wls/docs81/rmi_iiop/
              http://e-docs.bea.com/wls/docs70/rmi_iiop/
              http://e-docs.bea.com/wls/docs61/rmi_iiop/
              Unlike most other approaches, the IIOP client approach also allows the client to begin and commit user (JTA) transactions (not configured).
              - If you already have a BEA Tuxedo license, one option is communicate through BEA Tuxedo (which has various APIs on Windows) and configure a WebLogic Server to respond to these requests via the WTC bridge. Search for "WTC" in the BEA docs. Unlike most other approaches, the Tuxedo API approach also allows the client to begin and commit user (JTA) transactions.
              - Another approach is to interop via web-service standards. Or even to simply to invoke a servlet on the WL server using a basic HTTP call from Windows. These in turn can invoke the JMS API. There is a white-paper on "Interoperability Study of BEA WebLogic Workshop 8.1 and Microsoft .NET 1.1 Web Services", that demonstrates web-services here:
              http://ftpna2.bea.com/pub/downloads/WebLogic-DotNet-Interop.pdf
              - Yet another approach is to use a third party product that is designed to wrap any JMS vendor. There are even open source versions. In no particular order, here are some examples: Open3 WinJMS, CodeMesh, Active JMS, SpiritSoft
              Notes on MQ Remote Capable XA Clients
              Until recently, IBM MQ JMS clients could not work transactionally unless they were running on the same host as their MQ server. This is a limitation unique to MQ that was relaxed with the introduction of IBM's new "WebSphere MQ Extended Transactional Client". See:
              http://publibfp.boulder.ibm.com/epubs/pdf/csqzar00.pdf
              The product is new, and for some reason, configuration of this client seems to be tricky, even when WebLogic is not involved at all. Oddly, the main sticking point seems to be simply making sure that class paths refer to the required IBM jars:
              - Required on WLS where MQ objects are bound into JNDI:
              com.ibm.mq.jar, com.ibm.mqjms.jar
              - Required only if MQ objects are bound into JNDI on a different server:
              com.ibm.mq.jar
              If there are problems when using this client, first get it to work using a pure IBM client without any BEA classes involved. Once that is working, search the WL JMS newsgroup for answers and/or contact BEA customer support.
              MDB Thread Pool Notes
              WL7.0SP? and WL8.1 and later support the "dispatch-policy" field to specify which thread pool an MDB uses to run its instances. In most cases this field should be configured to help address potential performance issues and/or dead-locks:
              http://edocs.bea.com/wls/docs81/ejb/DDreference-ejb-jar.html#dispatch-policy
              (Note that "dispatch-policy" is ignored for non-transactional foreign vendors; in this case, the MDB "onMessage" callback runs in the foreign vendor's thread.)
              MDB Concurrency Notes
              Queue MDBs driven by foreign providers can run multiple instances concurrently. Topic MDBs driven by foreign providers are limited to one instance (not sure, but transactional foreign driven topic MDBs may not have this limitation). The size of the thread pool that the MDB runs in and the "max-beans-in-free-pool" descriptor limit how many instances run concurrently.
              Design Guide-Lines and Performance Tuning Notes
              The "WebLogic JMS Performance Guide" white-paper contains detailed design, performance, and tuning information for Clustering, Messaging Bridge, JMS, and MDBs.
              http://dev2dev.bea.com/products/wlserver/whitepapers/WL_JMS_Perform_GD.jsp
              

  • How can connect different ejb server in one client program

    hi , every
    i want to make connect ejb server into one client program.
    for that , but i try to change PROVIDER_URL property , it's not correct
    who solve this problem for novice? :(

    You need to create separate initialContext to each of the different servers
    and lookup up the different ejbs.
    -Sabha
    "inking" <[email protected]> wrote in message
    news:[email protected]..
    hi , every
    i want to make connect ejb server into one client program.
    for that , but i try to change PROVIDER_URL property , it's not correct
    who solve this problem for novice? :(

  • How to run the client program in weblogic 8.1 server

    Hi
    I am new to EJB 2.0. I am deployed sucessfully a session ejb program.
    While running an ejb client program it throws an exception. In my session ejb program i created two jar file. one is sessionejb.jar and another one is sessionejbclient.jar. In sessionejb.jar contains home ,remote ,session bean class and deployment descriptor.In sessionejbclient.jar contains home,remote and client program. Both jar files are included in class path of environment variable( i am using Standalone server).
    Plese guide me how to run an session ejb client correctly.
    Regards
    Jaiganesh

    Both jar files are
    included in class path of environment variable( i am
    using Standalone server).did u include both these jars in the "weblogic's class path" ?
    in that case, it obviously wont work.
    what u need is an understanding of the following topics (i have described them briefly, but for details u can always check the documentation of weblogic):
    1. Class loaders in weblogic: there are various levels of class loaders. at the top is the weblogic's class loader. below it are various EARs' class-loaders. and so on....
    2. Packaging. You must ensure that in the same class loader, there are not two classes from 2 different jars.
    hope that helps

  • How to run a client program in Session bean using weblogic 8.1

    Hi
    I am new to weblogic server 8.1. I sucessfully deployed session ejb Session Bean. I created sessionbean jar file and put it it classpath also.
    and also i created sessiobeanclient jar file, it included in class path.
    While running client program it throws exception like noclass def found exception
    plz tell me the right way to run the session ejb program.
    bye

    Hi,
    You have to follow the given steps before you are going to run the client program that invokes the session bean .
    1)set the Weblogic Environment using the tool setWLSEnv
    2)place the Session bean jar file in classpath
    3)run the client program
    Note:If the client has to execute on remote machine we need to copy client class,remote interface, home interface and other classes which are used as
    parameters and return types.
    Regards
    Anilkumar kari

Maybe you are looking for