Publish to JMS control

Hi,
I want to publish a message to a message queue using JMS control in
pageflow. The JMS control is configured properly, it has set
connection-factory-jndi-name, send-type and send-jndi-name.
Receive-jndi-name is not set because the control doesn't consume messages.
In pageflow, there is an action containing code:
//create message
Message message = myJMSControl.getSession().createTextMessage("some text");
//send message
myJMSControl.sendJMSMessage(message);
In runtime I get an exception when creating a message:
weblogic.jms.common.IllegalStateException: Session is closed
at weblogic.jms.client.JMSSession.checkClosed(JMSSession.java:2729)
at weblogic.jms.client.JMSSession.createMessage(JMSSession.java:548)
at Controller.startPeriod(Controller.jpf:90)
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:324)
at
com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(FlowController.
java:1262)
at
com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(FlowControl
ler.java:1214)
Am I doing something wrong? Is there any other way how to create a message?
I wrote a standalone test client which publish a message to the same queue
using the same factory. All goes well. The code is:
ctx = new InitialContext(env);
qConFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
qCon = qconFactory.createQueueConnection();
qSession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(QUEUE);
qSender = qSession.createSender(queue);
msg = qSession.createTextMessage("some text");
qcon.start();
qsender.send(msg, DeliveryMode.PERSISTENT, priority, ttl);
Thanks for advice,
Tomas

Tomas,
This seems like an issue. The error does not happen when you use the same
code in a WebService. This also does not happen for a JMSControl which
accepts a TextMessage such as
myJMSControl.sendTextMessage("tomas");
I will file a change request for this.
Thanks for the feedback.
Regards,
Anurag
"Tomas Koutny" <[email protected]> wrote in message
news:[email protected]...
Hi,
I want to publish a message to a message queue using JMS control in
pageflow. The JMS control is configured properly, it has set
connection-factory-jndi-name, send-type and send-jndi-name.
Receive-jndi-name is not set because the control doesn't consume messages.
In pageflow, there is an action containing code:
//create message
Message message = myJMSControl.getSession().createTextMessage("sometext");
//send message
myJMSControl.sendJMSMessage(message);
In runtime I get an exception when creating a message:
weblogic.jms.common.IllegalStateException: Session is closed
atweblogic.jms.client.JMSSession.checkClosed(JMSSession.java:2729)
atweblogic.jms.client.JMSSession.createMessage(JMSSession.java:548)
at Controller.startPeriod(Controller.jpf:90)
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:324)
at
com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(FlowController.
java:1262)
at
com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(FlowControl
ler.java:1214)
Am I doing something wrong? Is there any other way how to create amessage?
>
>
I wrote a standalone test client which publish a message to the same queue
using the same factory. All goes well. The code is:
ctx = new InitialContext(env);
qConFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
qCon = qconFactory.createQueueConnection();
qSession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(QUEUE);
qSender = qSession.createSender(queue);
msg = qSession.createTextMessage("some text");
qcon.start();
qsender.send(msg, DeliveryMode.PERSISTENT, priority, ttl);
Thanks for advice,
Tomas

Similar Messages

  • Usage of Apache Beehive JMS control inside Message Driven Bean

    Hi,
    I am developing a j2ee application using weblogic workshop 10.3. This application contains the following three projects.
    - J2EE Utility Project
    - Message Driven Bean Project
    - Ear Project
    In the Utility project I have created one apache beehive jms control. I am using this control inside the message driven bean application. I haven't got any issues during the development and deployment phase with the beehive control. But during runtime the apache beehive jms control is not getting instantiated and the mdb application is throwing the null pointer exception when the EJB container try to execute the methods on the control instance. I have used the declarative programming model to create the control instance inside the mdb application.
    I am using the weblogic 10.3 server for testing and I have created the 10.3 weblogic+workshop domain. By default it has the beehive libraries deployed.
    Can somebody help me out to resolve this issue?
    Regards,
    Bp

    You can get the message directly with getText() method. Following is the snippet of code.
    if (aMsg instanceof TextMessage) {
    TextMessage msg = (TextMessage) aMsg;
    String testMessage = msg.getText());
    Kishore.

  • QoS issue with OSB publish to JMS business service

    Hi,
    1. I have a http OSB proxy service which is publishing an audit message to a JMS queue through OSB business service.
    MainProxyService (http) --> Publish (best-effort) --> AuditBusinessService (JMS) --> Audit Queue
    2. I want 'Publish to JMS business service' to be a non-blocking call so that proxy service message flow can continue. Transaction support is disabled in proxy service as well as in JMS connection factory.
    3. As default value of QoS (quality of service) for publish action is best-effort, ideally proxy service should continue its message flow immediately after dispatching the message to publish action and it should not block the main proxy flow.
    4. But in my case, proxy service is blocking the message flow until the message is delivered to JMS business service/JMS queue. This is degrading performance of my application.
    5. I think default 'best-effort' QoS is not working with JMS business service as there is a significant time lag between publish action and its next subsequent action.
    6. If I replace the JMS business service with HTTP business service, then it seems to be a non-blocking call and message flow immediately proceeds to next actions.
    Correct me if I am going wrong anywhere or my understanding is wrong.
    Many thanks.

    HI,
    u can use Conditional Branching
    http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageflow.html#wp1061670
    Split join would be used in case u need to split your request and call your Business Service in Serial/parallel & then gather resposnes from multiple callouts to have single response
    http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/userguide/splitjoin.html#wp1137258
    Abhinav

  • JMS Control - receive-correlation-property

    Hi,
    I am using JMS Control in WLI 8.1. This is not a WLI JMS Control. Some application
    puts a message to Weblogic Queue.
    My JMS Control is subscribed to the queue. It gives the following error - when
    it receives the message...
    <Jun 15, 2004 4:02:56 PM EDT> <Error> <WLW> <000000> <Received message without
    correlation
    ID. MessageID=ID:P<323523.1087329776527.0>>
    I am new to this domain. I looked at the receive-correlation-property in my JMS
    control, which is defaulted to JMSCorrelationID. Really appreciate Any suggestions/thoughts.
    TIA,
    Don

    Hi,
    I am using JMS Control in WLI 8.1. This is not a WLI JMS Control. Some application
    puts a message to Weblogic Queue.
    My JMS Control is subscribed to the queue. It gives the following error - when
    it receives the message...
    <Jun 15, 2004 4:02:56 PM EDT> <Error> <WLW> <000000> <Received message without
    correlation
    ID. MessageID=ID:P<323523.1087329776527.0>>
    I am new to this domain. I looked at the receive-correlation-property in my JMS
    control, which is defaulted to JMSCorrelationID. Really appreciate Any suggestions/thoughts.
    TIA,
    Don

  • JMS control

    (How) can I use a JMS control to deploy an MDB to WLS? I tried to do so in a sample app but it seems that Workshop only deploys a control (and the underlying beans) if it is accessed by the application (a JWS in my case). If I develop a JMS control but not use it I can't find the corresponding MDB deployed.
    Can somebody help me?

    My actual workaround is to declare in the JWS a member variable of the type of the JMS control I'm trying to deploy and it works (but doesn't look great).
    Regards.
    Antonio.

  • JMS Control to receive a message

    Hi all,
    I’m trying to createJMS Contro to test my JMS Server. A method to send a message was generated
    @Message(JMSControl.MessageType.Auto)
         public void sendMessage(Object body);but I cannot find how can I write a method to receive a message.
    Can anybody tell me how can I receive messages from JMS server with JMS Control?
    Many thanks
    Pavel

    It is possible till 8.1, but not from 9.2 versions. The suggested way to implement this for 9.2 or greater is:
    In version 9.2, a JMS control can't be used to receive messages. In upgraded code, you can work around this by developing a message-driven bean (MDB) to receive the messages or by invoking a web service using asynchronous request-response.
    Please refer this upgrade guide:
    http://e-docs.bea.com/workshop/docs92/ws_platform/upgrading/conChangesDuringUpgrade.html#features_not_supported
    regards,
    ~Poorna

  • Sensor publish to jms topic

    I am getting following error on server console . It works fine if i use "database" instead of jms topic in sensor action.
    <2005-07-12 10:33:31,504> <ERROR> <default.collaxa.cube.sensor> <PCException::<init>> Reports Error.
    <2005-07-12 10:33:31,506> <ERROR> <default.collaxa.cube.sensor> <PCException::<init>> A problem occurred while
    processing reports data.
    <2005-07-12 10:33:31,507> <ERROR> <default.collaxa.cube.sensor> <PCException::<init>> Please examine the log file to determine the problem.
    <2005-07-12 10:33:31,512> <ERROR> <default.collaxa.cube.sensor> <QueuePublisher::publish> Reports Error.
    <2005-07-12 10:33:31,513> <ERROR> <default.collaxa.cube.sensor> <QueuePublisher::publish> A problem occurred while processing reports data.
    <2005-07-12 10:33:31,515> <ERROR> <default.collaxa.cube.sensor> <QueuePublisher::publish> Please examine the log file to determine the problem.
    <2005-07-12 10:33:31,517> <ERROR> <default.collaxa.cube.sensor> <PCException::<init>> Data Publisher failed.
    <2005-07-12 10:33:31,519> <ERROR> <default.collaxa.cube.sensor> <PCException::<init>> The Reporting Data Publisher JMSQueue of type jms/demoTopic failed.
    <2005-07-12 10:33:31,521> <ERROR> <default.collaxa.cube.sensor> <PCException::<init>> Please examine the log file for more details.
    <2005-07-12 10:33:31,523> <ERROR> <default.collaxa.cube.sensor> <DefaultDataRouter::send> Data Publisher failed.
    <2005-07-12 10:33:31,524> <ERROR> <default.collaxa.cube.sensor> <DefaultDataRouter::send> The Reporting Data Publisher JMSQueue of type jms/demoTopic failed.
    <2005-07-12 10:33:31,526> <ERROR> <default.collaxa.cube.sensor> <DefaultDataRouter::send> Please examine the log file for more details.
    Which log will have more details? what setup is required?

    Hi,
    <2005-07-12 10:33:31,519> <ERROR> <default.collaxa.cube.sensor> <PCException::<init>> The Reporting Data Publisher JMSQueue of type jms/demoTopic failed.
    The Above line suggests that you have configured your sensor for JMS Queue while the target you have provided is of JMS Topic.
    Please provide the follwing for the Sensor Action configuration if you want to use JMS Topic.
    Publish Type : JMS Topic
    JMS Connection Factory : jms/TopicConnectionFactory
    Publish Target : jms/demoTopic
    HTH
    Dhaval

  • Using a JMS control from an EJB project

    I'm developing an EJB in Workshop and my EJB is expected to send messages to a JMS queue. How can I use a JMS control (JCX) from my EJB?

    If you're talking about making an executable jar file that will work with the bouncycastle jar:
    (1) Make a jar as usual with your classes in it
    (2) Include a manifest file that specifies the class containing your app's main() method
    (3) In that same manifest, make sure that the bouncycastle jar is included in the Class-Path
    Details are in Sun's Tutorial: [Packaging Programs in JAR Files|http://java.sun.com/docs/books/tutorial/deployment/jar/index.html] and specifically [http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html|http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html] for the business of having your app recognise the other jar file's classes at runtime.
    Doubtless this can all be done from the comfort of your IDE, but I don't know how. There will be documentation on NetBeans site I suppose.
    Edited by: pbrockway2 on Jul 23, 2008 8:59 PM

  • Platform Domain and  WorkShop JMS Control Problems

    I created a platform domain and created a workflow in WLI. I would like to expose
    the workflow from a web service. I successfully used the JMS control to send
    the XML request into WLI and receive the reply from WLI. My problem is whenever
    I try to execute the callback function when I receive my reply from JMS it his
    a loop and never executes the callback to the client. In the same service i replaced
    the JMS interaction with a timer and it works fine. The problem only occurrs when
    the JMS control receives the reply and then invokes the callback. If I just receive
    the reply without calling the callback everything works fine. Any ideas? Thanks

    I did a little more debugging and it looks like when the message is sent to the
    JMS Queue a different instance of the session EJB is calledback to when the JMS
    reply is received. I noticed when my callback is invoked by JMS i have different
    proxy and context objects. I hope this helps.
    "David" <[email protected]> wrote:
    >
    I created a platform domain and created a workflow in WLI. I would like
    to expose
    the workflow from a web service. I successfully used the JMS control
    to send
    the XML request into WLI and receive the reply from WLI. My problem is
    whenever
    I try to execute the callback function when I receive my reply from JMS
    it his
    a loop and never executes the callback to the client. In the same service
    i replaced
    the JMS interaction with a timer and it works fine. The problem only
    occurrs when
    the JMS control receives the reply and then invokes the callback. If
    I just receive
    the reply without calling the callback everything works fine. Any ideas?
    Thanks

  • How to maintainCorrelation using JMS control

    Hi I am sending and receiving message from differnt Queue in WLI.Using JMS Control how we maintain correlation. Even though it is a asyncroneous communication I want the reply back for further process in JPD. I try it out it shouws the below error message.
    <5/07/2007 12:11:00 PM EST> <Error> <WLW> <000000> <errMsg=onMessage(): Could no
    t deliver message with id=ID:P<851933.1183516529000.0> to Service[jms://TES33269
    5:8001/weblogic.jws.jms.QueueConnectionFactory/jws.queue?URI=/TestWSAccess/proce
    sses/process.jpd(1183516524671):a:AmadausMsgChannel:listener].
    I receive the response upto the Queue. I couldn;t get it back to my jpd.
    Regards
    Ashok

    Hi I am sending and receiving message from differnt
    Queue in WLI.Using JMS Control how we maintain
    correlation. Even though it is a asyncroneous
    communication I want the reply back for further
    process in JPD. I try it out it shouws the below
    error message.
    <5/07/2007 12:11:00 PM EST> <Error> <WLW> <000000>
    <errMsg=onMessage(): Could no
    t deliver message with
    id=ID:P<851933.1183516529000.0> to
    Service[jms://TES33269
    5:8001/weblogic.jws.jms.QueueConnectionFactory/jws.que
    ue?URI=/TestWSAccess/proce
    sses/process.jpd(1183516524671):a:AmadausMsgChannel:li
    stener].
    I receive the response upto the Queue. I couldn;t get
    it back to my jpd.
    Regards
    AshokH! Ashok
    May be following info may help you establishing Co-relation
    Two-way messaging requires that every received messages be correlated with the instance of the application that sent the original outgoing message. This correlation is typically managed for you by the JMS control, so no action is necessary on your part. To learn more about message correlation, see the explanation of the send-correlation-property and receive-correlation-property attributes for the @jc:jms annotation.
    To enable two-way messaging with queues:
    1.
    On the JMS control, specify the name of the JMS queue to which you want to send messages by setting the value of the send-jndi-name attribute on the @jc:jms annotation.
    Specify the name of the JMS queue from which you want to receive messages by setting the value of the receive-jndi-name attribute on the @jc:jms annotation.
    To send a message from your web service, call the JMS control's default method (sendTextMessage, sendBytesMessage, sendObjectMessage or sendJMSMessage depending on the message type selected when the control was created), or a custom method you have defined for the JMS control.
    4.
    To be notified when messages are received on the receive queue, implement a callback handler for the JMS control?s callback (receiveTextMessage, receiveBytesMessage, receiveObjectMessage or receiveJMSMessage depending on the message type selected when the control was created), or a custom callback you have defined for the JMS control.
    The following is an example enabling two-way messaging:
    public class MyService {
    * @common:control
    private MyQueueControl myQueue;
    * @common:operation
    public void sendID(String personID) throws Exception
    myQueue.sendTextMessage( personID );
    myQueue_receiveTextMessage(String message)
    // message has arrived from queue, perform desired operations

  • How to publish a JMS Queue?

    Hi there,
    Does anyone know how to publish a JMS queue? Thanks.
    Edited by: 886478 on Sep 20, 2011 10:17 PM

    Does anyone know how to publish a JMS queue? Thanks.Yes, I do. But rather than write a long posting describing how to use the JMS API. I'd like to invite you to read the JMS tutorial:
    http://download.oracle.com/javaee/1.3/jms/tutorial/index.html
    Look particularly at
    http://download.oracle.com/javaee/1.3/jms/tutorial/1_3_1-fcs/doc/client.html
    Nigel

  • Publish to JMS Queue Exception

    Have a web service based proxy. In a stage in the request pipeline,
    Am using a publish action to publish to a JMS queue using a Business Service.
    The Business Service is of type "Any SOAP Service" and transport is JMS.
    To test the error scenario, Have provided an incorrect queue name in the Business Service configuration.
    During testing from the test console, I do see a connection exception in the log.
    But the flow of control continues to the next action and stage in the request pipeline and then the response pipeline.
    My expectation was that , The Error Handler would be invoked.
    Is this the correct behaviour? Is there any configuration that needs to be done? Or should I be using a service callout instead?
    Thanks
    Raghu
    Edited by: user10219846 on Jun 17, 2009 10:32 AM

    Yes, you can use Service Callout action and you will see exception raised. However, you can't use Service Callout for one-way operations (like simple message enqueuing) and that could be problem sometimes. Fortunately, you can still use Publish action to get your exception. Just use Routing Options with QoS set to "exactly once" in Request Action.
    This behaviour is well documented. You can read this:
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageflow.html#wp1065307

  • Setting JMS Priorities in the Presence of a JMS Control

    I posted the following question to the JMS interest newsgroup and received a response on how to accomplish my objective using the QueueSender class. However, nobody in that newgroup could tell me how to construct a QueueSender from the JMSControl serving as the interface to my Queue. So, while that solution worked, it eliminated the convenience of using the JMSControl. Anybody have an answer that leverages the control?
    Link to original posting and responses is here: http://forums.bea.com/bea/message.jspa?messageID=202440977
    Thanks!
    Todd

    That doesn't change whether the code works or not. Which it still doesn't.

  • Acrobat 3D won't publish with 3D controls in Powerpoint

    Acrobat 3D won't publish with the 3D motion controls when published as a powerpoint packaged CD show or as Adobe Presenter files. Controls only appear in the native powerpoint PPT form.

    I did a little more testing and here's what I found. If your
    audio files reside on a network server (regardless of where your
    presentation resides), the publish process will crash when trying
    to access the audio. I had to copy my audio files from the server
    to my hard drive and import them to the presentation. Then it
    published ok. Go figure.

  • Creating synchronous publisher with JMS

    I wonder, if it's possible to "synchronously publish" the messages with JMS pub/sub model. "Synchronously publish" - that is to say, when a message has been published (publish() method invoked with the message), the thread waits until the message is successfully consumed by all the registered subscribers (i.e. is acknowledged).
    In other words, I would like to be sure that the message has been consumed successfully before I send the next message.
    Thanks.

    Thank you once more for your time and explanations.
    Probably, I might want to use not a JMS-based system, but rather an event system, similar to Spring events framework, because I'm interested rather in a solid-made thread-safe message dispatcher library (not necessarily across network - inside one process would be enough), than in a separate message broker service.
    As for "hardly acceptable" - indeed, I don't want any of my classes to be tightly bound to any broker-specific logic, one of which is the necessity to notify the message sender about the fact that the message had been consumed.
    For example, when using any simple event-system, similar to what AWT presents, a MessageListener implementation is only limited by the obligation to implement one-method interface (kind of actionPerformed, mouseClicked - generally saying - eventOccured) and nothing else. And the side, which raises the event (publisher/sender) and sends the message, naturally waits for the eventOccured method to return (unless the method is launched in a separate thread). This would be the ideal situation for me.
    The reason why I decided to spend time playing with JMS was that I needed a solution which could stand multi-threading, scaling and high-load situations. And at this point it is normally preferred to select an existing time-proven solution rather then inventing anything by my own :).
    Thanks again and all the best to you as well!

Maybe you are looking for

  • Creation of Article with purchasing view.

    Hi, I am using BAPI_MATERIAL_MAINTAINDATA_RT  to create Article. I am able to create article using Basic view, Log. DC view etc. There is no purchasing view in HEADDATA. Also  fields like Purchase organization, net price etc are not present in any st

  • Moving around within an audiobook: Has this been addressed?

    I love my iPod Touch, but have found that it's useless for audiobooks. I haven't figured out how to use the "playback position slider" to move around inside the audiobook. I must be doing something wrong. For example, if I need to back up a minute or

  • Problem with IR Web client

    Hi, I am new to Interactive Reporting here i have one doubt, i have installed the IR webclient from workspace and when i am trying to open webclient through IR console Tools-> Connection->Web Clients, when i selecte any of the radio buttons it was no

  • Establishing ELSTER encryption in ECC 6.0

    Hello! I would like to set up the ELSTER encryption functionality in ECC 6.0. Has some one experience, helpful information, technical steps (Tcodes), SAP notes for the following operations: <b>- establish ELSTER encryption - establish Business Connec

  • Handle metadata of configuration objects when transported from DEV to QA?

    All, I was reading this blog /people/sravya.talanki2/blog/2005/11/02/overview-of-transition-from-dev-to-qa-in-xi <i>"Unlike IR when we import the scenarios in ID the configuration metadata will be lost and have to be manually entered in the QA ID. Fo