JMS example

Hi
I am new to JMS in Sun One 7 . I want to run the simpleprogram shown below
import javax.naming.*;
import javax.jms.*;
import java.util.*;
public class SimpleMessageClient
    public static void main (String a[])
        try
            Properties prop = new Properties ();
            prop.put (Context.INITIAL_CONTEXT_FACTORY,
            "com.sun.enterprise.naming.SerialInitContextFactory");
            prop.put (Context.PROVIDER_URL, "localhost:1050");
            prop.put (Context.SECURITY_AUTHENTICATION, "simple");
            prop.put (Context.SECURITY_PRINCIPAL, "admin");
            prop.put (Context.SECURITY_CREDENTIALS, "adminadmin");
            Context jndiContext= new InitialContext (prop);
        QueueConnectionFactory queueConnectionFactory =
          (QueueConnectionFactory)jndiContext.lookup ("java:comp/env/jms/QueueConnectionFactory");
           Queue queue =(Queue)jndiContext.lookup ("java:comp/env/jms/Queue");
          QueueConnection queueConnection = queueConnectionFactory.createQueueConnection ();
           QueueSession queueSession = queueConnection.createQueueSession (false,Session.AUTO_ACKNOWLEDGE);
         QueueSender queueSender = queueSession.createSender (queue);
            TextMessage message =queueSession.createTextMessage ();
           for(int i=0;i<10;i++)
              message.setText ("Message "+i);
               System.out.println ("Sending the message "+message.getText ());
               queueSender.send (message);
        }catch (Exception e)
            e.printStackTrace ();
}I am getting the exception below
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.enterprise.naming.SerialInitContextFactory. Root exception is java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:217)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at SimpleMessageClient.main(SimpleMessageClient.java:20)
Please help me
I have set jms.jar and imq.jar in the class path. I searched for jndi.jar but not able to find
I have doubt in instantiating the InitialContext
Properties prop = new Properties ();
prop.put (Context.INITIAL_CONTEXT_FACTORY,
"com.sun.enterprise.naming.SerialInitContextFactory");
prop.put (Context.PROVIDER_URL, "localhost:1050");
prop.put (Context.SECURITY_AUTHENTICATION, "simple");
prop.put (Context.SECURITY_PRINCIPAL, "admin");
prop.put (Context.SECURITY_CREDENTIALS, "adminadmin");
Context jndiContext= new InitialContext (prop);
Can any one explain the variable that are set
Thanks and regards
Suneesh VR

I could able to solve the above problem by including appserv-rt.jar and appserv-ext.jar But still I am getting the following exception
java.lang.UnsatisfiedLinkError: no cis in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:832)
at com.iplanet.ias.cis.connection.EndPoint.<clinit>(EndPoint.java:254)
at com.sun.corba.ee.internal.iiop.GIOPImpl.createListener(GIOPImpl.java:369)
at com.sun.corba.ee.internal.iiop.GIOPImpl.getEndpoint(GIOPImpl.java:316)
at com.sun.corba.ee.internal.iiop.GIOPImpl.initEndpoints(GIOPImpl.java:149)
at com.sun.corba.ee.internal.POA.POAORB.getServerEndpoint(POAORB.java:505)
at com.sun.corba.ee.internal.POA.POAImpl.pre_initialize(POAImpl.java:157)
at com.sun.corba.ee.internal.POA.POAImpl.<init>(POAImpl.java:115)
at com.sun.corba.ee.internal.POA.POAORB.makeRootPOA(POAORB.java:115)
at com.sun.corba.ee.internal.POA.POAORB$1.evaluate(POAORB.java:133)
at com.sun.corba.ee.internal.core.Future.evaluate(Future.java:26)
at com.sun.corba.ee.internal.corba.ORB.resolveInitialReference(ORB.java:3069)
at com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(ORB.java:3004)
at com.sun.jts.CosTransactions.DefaultTransactionService.createPOAs(DefaultTransactionService.java:309)
at com.sun.jts.CosTransactions.DefaultTransactionService.identify_ORB(DefaultTransactionService.java:180)
at com.sun.corba.ee.internal.TxPOA.TxPIORB.initServices(TxPIORB.java:134)
at com.sun.enterprise.iiop.POAEJBORB.initServices(POAEJBORB.java:475)
at com.sun.corba.ee.internal.POA.POAORB.initPostProcessing(POAORB.java:355)
at com.sun.corba.ee.internal.Interceptors.PIORB.initPostProcessing(PIORB.java:236)
at com.sun.corba.ee.internal.POA.POAORB.set_parameters(POAORB.java:193)
at com.sun.corba.ee.internal.Interceptors.PIORB.set_parameters(PIORB.java:337)
at org.omg.CORBA.ORB.init(ORB.java:337)
at com.sun.enterprise.util.ORBManager.createORB(ORBManager.java:355)
at com.sun.enterprise.util.ORBManager.init(ORBManager.java:257)
at com.sun.enterprise.naming.SerialInitContextFactory.<init>(SerialInitContextFactory.java:31)
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: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:649)
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 QueueClientSenderReceiver.init(QueueClientSenderReceiver.java:60)
at QueueClientSenderReceiver.<init>(QueueClientSenderReceiver.java:36)
at QueueClientSenderReceiver.main(QueueClientSenderReceiver.java:116)
Exception in thread "main"

Similar Messages

  • Simple JMS example.

    simple JMS example.
    i am trying to execute this simple example SimpleQueueSender.java from the tutorial provided at http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/client.html#1027210
    in this example it is creating empty initial context;
    jndiContext = new InitialContext();
    with empty InitialContext i got (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)
    so i have modified it to
    Properties prop = new Properties();
    prop.setProperty(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    prop.setProperty(Context.PROVIDER_URL, "t3://192.168.3.91:7001");
    jndiContext = new InitialContext(prop);
    after making this changes and looking up for
    queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("QueueConnectionFactory"); // here it is returning weblogic.jms.common.DestinationImpl.classs
    i am still getting java.lang.ClassCastException
    i have configured weblogic 8.1 and created new JMS server and created JMSQueue named 'QueueConnectionFactory' and JNDI name 'jndi_QueueConnectionFactory'
    what else do i need to add or change to my code or environment
    also tell me is this
    Context.INITIAL_CONTEXT_FACTORY = "weblogic.jndi.WLInitialContextFactory" right value
    ******************************************************************************************

    hmnn...well if I remember correctly you need to create an instance of a ConnectionFactory or a QueueConnectionFactory in weblogic and then request that via jndi.
    To explain, what I believe is happening is that you've said you created a Queue in weblogic and named it xxxQueueConnectionFactory. You are then trying to cast this Queue to a QueueConnectionFactory. Based on what I thought I understood of jms this doesn't work. You need to lookup an instance of an actual ConnectionFactory and then use that to create a queue.
    good luck.

  • Error while compiling JMS example - package javax.jms does not exist

    Dear All,
    I am a newbie trying to use JMS. I have downloaded EE 5 SDK and installed (it contains Message Queue 4.1 as well). After the installation and going to some tutorials, I tried to compile the example 'SimpleQueueSender.java' which was downloaded from Sun website.
    Before running the application, I made sure that I have set the classpath, path environment veriables correctly, but still I got the error "package javax.jms does not exist". I have searched internet for help and in all places I found people replying to similar issues. But I was not able to apply the solution as either the folder names or file names specified in the solution is different from what is existing in my system.
    Please help me. Also could anyone help me in telling the pre-requisites to ensure a proper running of java application.
    Thanks in Advance
    Regards,
    San

    I'm not sure exactly what your JavaEE SDK installation contains (there are so many versions) but it will typically contain a Glassfish installation. Under the Glassfish installation, the imq directory contains all the files needed for MessageQueue.
    The javax.jms package contains the JMS API interfaces. These can be found in jms.jar, which is typically in imq/lib. At runtime you will also need imq.jar from the same directory, which contains the implementation of these interfaces for MessageQueue.
    Note that you will need to start a Message Queue server as well. EIther start a Glassfish server (which includes an embedded Message Queue broker), or (simpler) start a standalone Message Queue broker by running imqbrokerd (from the imq/bin directory).
    Nigel

  • 11g TP4 BAM JMS example

    Hi,
    Just wanted to check if there are any example java applications for pushing data objects through JMS for TP4 ?
    I've tried the examples located in [JMS-EL-BAM.zip|http://www.oracle.com/technology/products/integration/bam/10.1.3/samplefiles/Samples/Zip_Files/JMS-EL-BAM.zip], but I haven't been able to get these to work.
    There seem to be issues here for the ICommand syntax, as well for the syntax of ReadJMSMessage_Car.ems, which I presume needs
    to be provisioned before running the example.
    Thanks,
    Niklas

    To be more specific, when running +"icommand -cmd import -file ReadJMSMessage_Car.ems"+
    I get this error:
    +"Importing of EMS from previous version is not supported."+
    I also get the same basic error when trying to import the ReadCarJMSData.plan:
    +"Importing of Plan from previous version is not supported."+

  • JMS Examples, JMS-Chat & Coffeemaker, where are they ?

    Hello,
    it is very important for us to find JMS samples that are mentioned in OC4J_ServicesGuide (a95879) on 11-2 page. Please help us.
    Radim.
    The OC4J JMS implementation comes with two examples, JMS-Chat and
    Coffeemaker. JMS-Chat demonstrates topics; Coffeemaker demonstrates queues.
    ...

    Radim Kolek ,
    its not there in OC4J_Production9.0.2 bundle..
    but i can see that in J2EE folder JDeveloper production bundle....
    Cheers
    --Venky

  • Urgent ...JMS example client run problem

    HI
    I am facing following error while running a simple JMS client. Please help.
    Regards
    Jaisinh
    D:\jai>java com.monex.prototype.SimpleTopicPublisher
    Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/AssertionError
    at weblogic.security.subject.DelegatingSubjectStack.<clinit>(DelegatingSubjectStack.java:18)
    at weblogic.security.service.SubjectManagerImpl.<init>(SubjectManagerImpl.java:40)
    at weblogic.security.service.SubjectManagerImpl.ensureInitialized(SubjectManagerImpl.java:277)
    at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialContextFactoryDelegate.java:137)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:120)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:131)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:665)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
    at javax.naming.InitialContext.init(InitialContext.java:222)
    at javax.naming.InitialContext.<init>(InitialContext.java:198)
    at com.monex.prototype.SimpleTopicPublisher.main(SimpleTopicPublisher.java:54)

    Thank you sam,
    You are correct.
    I found solution for the problem the same day. Actually it was classpath error.
    I was testing with j2sdk1.3 env instead of j2sdk 1.4. I was not able to access
    the website so posting a reply little late.
    Regards
    Jaisinh
    Sam Pullara <[email protected]> wrote:
    You are running under 1.3 instead of 1.4.
    Sam
    Jaisinh Nimbalkar wrote:
    HI
    I am facing following error while running a simple JMS client. Pleasehelp.
    Regards
    Jaisinh
    D:\jai>java com.monex.prototype.SimpleTopicPublisher
    Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/AssertionError
    at weblogic.security.subject.DelegatingSubjectStack.<clinit>(DelegatingSubjectStack.java:18)
    at weblogic.security.service.SubjectManagerImpl.<init>(SubjectManagerImpl.java:40)
    at weblogic.security.service.SubjectManagerImpl.ensureInitialized(SubjectManagerImpl.java:277)
    at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialContextFactoryDelegate.java:137)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:120)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:131)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:665)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
    at javax.naming.InitialContext.init(InitialContext.java:222)
    at javax.naming.InitialContext.<init>(InitialContext.java:198)
    at com.monex.prototype.SimpleTopicPublisher.main(SimpleTopicPublisher.java:54)

  • Facing problem while implementing JMS in Weblogic 8.1

    Hi all,
    I am very new to JMS.
    I am trying to implement JMS in Weblogic.
    I have cofigured the server properly but while i am executing my receiver class i am getting the following error:
    javax.naming.NameNotFoundException: Unable to resolve 'MyJMSQueue1' Resolved [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'MyJMSQueue1' Resolved ]; remaining name 'MyJMSQueue1'
    Waiting for messages....
    and my receiver program is as follows:
    import java.util.Hashtable;
    import javax.jms.JMSException;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    import javax.jms.Queue;
    import javax.jms.QueueConnection;
    import javax.jms.QueueConnectionFactory;
    import javax.jms.QueueReceiver;
    import javax.jms.QueueSession;
    import javax.jms.TextMessage;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    public class SampleQueueReceiver implements MessageListener
    private boolean done = false;
    private Context ctx = null;
    private QueueConnectionFactory connectionFactory = null;
    private QueueConnection connection = null;
    private QueueSession session = null;
    private QueueReceiver receiver = null;
    private Queue queue = null;
    private Hashtable ht = null;
    public void init()
    try
    ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
    ctx = new InitialContext(ht);
    connectionFactory =(QueueConnectionFactory)ctx.lookup("weblogic.jms.ConnectionFactory");
    connection = connectionFactory.createQueueConnection();
    session = connection.createQueueSession(false,javax.jms.QueueSession.AUTO_ACKNOWLEDGE);
    queue = (Queue) ctx.lookup("MyJMSQueue1");
    receiver = session.createReceiver(queue);
    receiver.setMessageListener(this);
    connection.start();
    catch ( Exception e )
    System.out.println(e);
    public void close() throws JMSException
    try
    receiver.close();
    session.close();
    connection.close();
    catch ( Exception e )
    System.out.println(e);
    public void onMessage(Message message)
    if ( message instanceof TextMessage )
    try
    TextMessage textMessage = (TextMessage) message;
    String msg = textMessage.getText();
    System.out.println("Received message: " + msg);
    if ( msg.equals("exit") )
    synchronized (this)
    done = true;
    this.notifyAll();
    catch ( Exception e )
    System.out.println(e);
    public static void main(String[] args)
    try
    SampleQueueReceiver sqr = new SampleQueueReceiver();
    sqr.init();
    System.out.println("Waiting for messages....");
    synchronized (sqr)
    while ( !sqr.done )
    try
    sqr.wait();
    catch ( InterruptedException ie )
    sqr.close();
    catch ( Exception e )
    System.out.println(e);
    I have already configured MyJMSQueue in the server.....
    Someone please guide me...
    Thanks in Advance........
    Goutam

    Looks like configuration prob.
    Have you tried jms examples of weblogic ? you may need to re-configure your server setup, to create example server.

  • Simple JMS Configuration on OC4J Developers Preview

    What is the minumum required to configure the default OC4J JMS.
    I have a client deployed with the server that tries to get a Topic Connection Factory ....
    InitialContext ctx = new InitialContext();
    tConFactory = (TopicConnectionFactory)ctx.lookup("java:comp/env/jms/TopicConnectionFactory");
    tCon = tConFactory.createTopicConnection();
    tSession = tCon.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
    but the lookup fails with:
    javax.naming.NameNotFoundException: jms/TopicConnectionFactory not found in DriveStartup
    In jms.xml I have the following:
    <jms-server port="9127">
    <topic-connection-factory location="jms/TopicConnectionFactory" port="9127" password="2143768880" username="admin" />
         <!-- path to the log-file where JMS-events/errors are stored -->
         <log>
              <file path="../log/jms.log" />
         </log>
    </jms-server>
    What else do i have to do ?
    Cheers paul

    Hi Paul,
    I had similiar problems like the one you describe.
    I got the JMS example (CoffeeMaker) running, but had problems with my own application ( Object not bound).
    In my case, I got it running now when I only use the absolute necessary (oc4j.jar, junit.jar in my case) in my classpath
    (of course the application client xml's must contain your lookup names, but I did not !!! have to setup
    my queue in jms.xml (wonder why).
    You might try this (oc4j.jar references the required libs for jms,jndi,etc. internally)
    [Comment to "absolute necessary": of course I have a CLASSPATH which contains only the necessary libs.
    But since we are working on a framework which does not only want to connect to OC4J JMS (or EJB), I have
    a CLASSPATH containing other libs. I have to find the correct order, I guess.]
    But still my question to this forum: how is it possible that a queue is started "implicitly" (that means it is
    not configured in jms.xml). Is this desired or mandatory (Sun J2EE reference implementation does the same).
    Or am I missing something ?
    Regards,
    Armin

  • How to test BPEL Process that starts with a pick consuming a JMS message

    Hi,
    We are using App Server v 10.1.3.3.0 and attempting to test a BPEL process which starts with a pick operation which is awaiting a JMS message on a specific queue.
    We are using the Oracle JMS adapter to achieve this.
    Is there any way in which this particular configuration can be easily tested using the BPEL testing framework? I have problems when I write the first initiate XML statement in my test case (stack trace below)
    <2011-01-27 10:23:47,028> <ERROR> <ProvisioningInterface.collaxa.cube.bpeltest> test run failed!
    ORABPEL-20011
    Instance initiation error.
    An error occurred while launching an instance for suite "BasicTest", test "baseline.xml".
    Please examine the log file for details or contact the system administrator.
    at com.collaxa.cube.engine.test.BPELTestRunManager.initiate(BPELTestRunManager.java:218)
    at com.collaxa.cube.ejb.impl.BPELTestBean.runSuites(BPELTestBean.java:625)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    Unfortunately, there are no further details or any example I can see which simulate the kind of setup I have for my test.
    Any help much appreciated,
    Kind Regards,
    Colin.

    Hi,
    I assume you mean the JMS example under the $OH BPEL examples area. Unfortunately, this only shows how to get a BPEL process kicked off by awaiting a JMS message - but there is no test code there! There are specific examples which show off the testing framework facilities but it appears that all the examples which use async type of interactions are in the middle of a process which is kicked off by a normal synchronous client interaction.
    Any further help much appreciated.
    Colin.

  • Dequeuing a Map message from AQ using Java/JMS

    I have a queue in Oracle AQ, created from a queue table with queue_payload_type of SYS.AQ$_JMS_MAP_MESSAGE. I can successfully enqueue a Map message using PL/SQL, but when I try to read a message from the queue using the JMS API (with the Oracle AQ JMS provider JARs) in a standalone Java program, the message is not successfully read. However, the RETRY_COUNT in the queue table is incremented each time I try to read from the queue. I do not receive any error messages on the client side.
    If I change the queue_payload_type of the queue table to SYS.AQ$_JMS_TEXT_MESSAGE instead and enqueue a text message using PL/SQL, I can read the text message successfully in the standalone Java program using JMS. The message is removed from the queue and everything works fine.
    Most Oracle AQ/JMS examples I've found on the web involve text messages. Has anyone been able to read a Map message from an Oracle AQ queue using JMS, or is there a known issue with Map messages?
    I'm running Oracle 10g Standard Edition version 10.2.0.1.0 on Windows XP.
    Thanks for your help,
    Marty

    While you are awaiting an answer you might want to consider applying the 10.2.0.4 patch. Your version is several years old and patches are free.

  • Sample code of jms in jdeveloper

    hi all,
    I am new to JMS and want to develop JMS example with jdeveloper can any one tell me about any article or post some steps for basic examples with jdeveloper.
    Thanks

    Hi jenny,
    if you wanted to eliminate the recodes with itemcateg has value ABC' You can put the code,
    DELETE  data_package where ITEMCATEG = 'ABC'

  • How to do jms with netweaverdeveloperstudio

    hi,
    can u pls tell how to do jms with nwds ?
    which things i need to configure in webas?
    how to write client for jms?
    regards
    Guru

    Please try the J2EE  engine (JMS) example first to have a better understanding of JMS given in portal/index.html
    I hope the following references may also help you
    http://help.sap.com/saphelp_nw04/helpdata/en/a3/63af1bbf09469fa1615c05f0daff6f/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/90/57849e5e3e45d784afc4e3bfa8136f/frameset.htm
    Regards

  • JMS messages lost

    Hi,
    I´ve a JMS example put into a Weblogic 9.2 system.
    I´ve a persistent store to store my messages, I´m using a Queue.
    I´ve a message listener to write my message into a specific table in my BD.
    The creation of the messages work great, the messages are created and apear in the specific table.
    But i´ve created a on/off switch to the message consuming, and this is my problem. When i turn off the message consuming, and the messaging producer continues, when i turn on the consuming only the first message is consumed, the rest of the messages are lost...
    Anyone has any idea what is going on???
    This is how i start a JMS connection :
                 try {
                   InitialContext jndi = new InitialContext();
                   // Look up a JMS connection factory
                   QueueConnectionFactory conFactory = (QueueConnectionFactory)
                                       jndi.lookup(this.queueDetail.getConnFactoryJNDI());
                   //Create a JMS connection
                   this.queueConnection = conFactory.createQueueConnection();
                   this.queueSession =
                             queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                   if(this.isClustered)                    
                        this.queue = this.queueSession.createQueue(this.queueDetail.getQueueModuleQueue());
                   else
                        this.queue = (Queue)jndi.lookup(this.queueDetail.getQueueJNDI());
              } catch (NamingException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (JMSException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              }cheers

    Hello Subhankar,
    Which Weblogic version are you using? What are the configuration parameters of the JMS queue you defined? During server shutdown/restart, do you see any errors in the server log?
    I would suggest you to raise a case with support as it may require an inspection of your environment and settings to find out the root cause.
    Regards,
    Anuj

  • JMS in J2EE

    I have tried to modify the JMS example in /jms/clientmdbentity folder and it works fine. But what I have tried to convert from Container-managed-persistence into Bean-managed-persistence bean and it does not work. And I really don't understand the error message, it says something like this: can not add another resources ....
    I also tried a simple java class which access both database resource and jms resource and the error is similar, if anyone can help that would be great.
    Thanks

    I have to create new jdbc resource which used XA Datasource (PointbasePool) and it works OK now. I only doing this in order to have a better understanding the JMS. Thanks anyway.

  • Sending Emails using JMS

    In my application i want to send n number of emails. for this i'm using java mail currently. it is taking lot of time. to improve the performance this i'm thinking to jms.
    so please help anyone how can i do this? if possible sample code.
    please does anyone help on this....urgent requirement here
    thanks in advance.

    See the JMS examples that come with the Server install for api samples.
    I talk about that in my write-up about resources on learning WLS:
    http://blogs.oracle.com/jamesbayer/2008/12/weblogic_server_resources_my_c.html
    The advantage to using JMS is simply that the application and mail server communication can be asynchronous, so that your application continues to function normally when the mail server is unavailable and isn't affected by mail server performance.
    If you take the JMS approach, you change whatever code currently invokes the java mail api to send that message to a queue using a JMS api. Depending on how flexible your solution is (multiple email recipients that change each time, etc) you will have to understand what the format/type of the message is going to be (text, xml, object). If you use XML for example, you'll need a schema that represents email. This shows a basic email xml schema example:
    http://www.roseindia.net/xml/xml_schema_example.shtml
    Then you would have an MDB read the message from the queue and invoke the java mail API.
    You'll need to make sure to configure the JMS resources correctly to use an error queues or retries, etc in case the mail server is down.
    This is not a simple "hello world" design, this solution is intermediate or advanced, so make sure you have someone with JMS experience help you.
    In fact, if you are simply trying to increase the responsiveness of the request that initiates the email, spawning off a new thread to do the mail server call may be a simpler solution for you. You just need to know what do you do if there is a mail server call returns an error. Good luck.

Maybe you are looking for

  • I deleted all my events in iPhoto

    Hi some how i have managed to delete all my events in iphoto i do not have time machne set up yet and would really like to get them all back can anyone offer any help, do Mac have a system restore point like windows, am still getting use to the Mac o

  • The share button does not seem to be working

    I'm trying to burn a movie I made onto a CD for a project and I click the share button but nothing happens. Is there another way to burn it or am I doing something wrong? Thanks for reading, Clara

  • Client code cast error:EJB returning data in Collection of Objects

    Still trying to understand this EJB stuff..... My BMP EJB returns data to the client in a collection of objects;   // Home interface (CountryHome) nothing unusual here   public Collection findAllCountries()   //Remote interface (Country) nothing unus

  • Ichat not recognising webcam

    I'm new to ichat and have been trying to get a video chat going with a buddy. I have an external logitech USB webcam which works fine except ichat doesn't see it and says there is no camera connected. Is there a setting I am missing? Also my buddy is

  • How to Connect to Mysql databse from Java Studio Enterprise 8

    Hello everybody, I have a database in mysql in linux.I have downloaded Java Studio Enterprise 8. How is it possible to connect to mysql. Could you tell the procedure .., I would be really thankfull From Ranjitha Rao