Unable to send messag to JMS Queue using Java

Hi all,
I am trying to send a string to the JMS queue using java. I am unable to send the message. It is getting failed at the look up for connection factory. I am using the below code for this purpose.
public static void messageEnqueue(String payload) throws JMSException,
NamingException,
IOException {
Session session = null;
MessageProducer publisher = null;
TextMessage message = null;
Context context = new InitialContext();
QueueConnectionFactory connectionFactory =
(QueueConnectionFactory)context.lookup("*java:comp/env/XAConnectionFactoryJNDIName*");
Connection connection = connectionFactory.createConnection();
Queue Queue1 =
(Queue)context.lookup("*java:comp/env/QueueName*");
session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
publisher = session.createProducer(Queue1);
message = session.createTextMessage(Payload);
connection.start();
publisher.send(message);
connection.stop();
connection.close();
kindly help on this.
Thanks
Edited by: 887737 on Jun 28, 2012 9:47 PM

887737 wrote:
Hi EJP,
This is the Exception I got when I ran the java class directly from Jdeveloper. Can't I run the standalone class directly from Jdeveloper to insert the message into remote queue?
Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
     at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
     at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
     at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
     at javax.naming.InitialContext.lookup(InitialContext.java:392)
     at javamail.MessageEnqueue.messageEnqueue(MessageEnqueue.java:30)
     at javamail.MessageEnqueue.main(MessageEnqueue.java:51)Hmm. The stack trace doesn't involve any JMS code. Is javamail.MessageEnqueue.messageEnqueue your application? It seems to be doing a JNDI lookup, and you haven't configured JNDI properly. Exactly how to do this depends on what JNDI provider you are using. Earlier in the thread you mentioned you were using WebLogic, so the answer may lie in the WebLogic documentation.
Nigel

Similar Messages

  • How to read Java Object message from JMS Queue using JMS Adapter .

    Dear All,
    In my scenario i have to read a java object message from JMS Queue . I tried by using the JMS Adaper ,but i am not getting any Payload . Can any one tell me is there any special settings for JMS Adapter to read the Java Object message .
    I am able to read the Message successfully thru JMS Adapter but in SXMB_MONI it is not showing any payload .
    I also went in Message monitoring but i am getting this type of message in Sender JMS Adapter  in Audit Log.
    JMS Message ID XXXXX Message Type Null unknown.Payload can not be read and will be empty.
    JMS Message ID XXXXX Payload Empty can not read.
    Please Help.
    Lateef

    Hi,
    As far as i know, JMS Object Messages is not supported by XI JMS adapter.
    you need to have the JMS provider to transform the message to bytes messages.
    (Refer to SAP note 856346)

  • Posting a message to JMS queue using B2B

    Hi,
    Could anyone suggest a solution for this scenario?
    I have two trading partners say TP1 & TP2. Suppose TP1 is sending an xml message to TP2 using custom ebMS protocol, then at TP2, the message should be posted to a JMS Queue so that some other application can read it and process it.
    The problem which I am facing is..
    1) where to create that JMS Queue(I could not find any options for creating a JMS Queue neither in B2B console nor in enterprise manager console..!!)?
    2) how to register TP2 to send msg to that JMS Queue(How that queue will be vissible to B2B)?
    3) Should the endpoint be given as that JMS Queue while configuring the Delivery Channel for TP2?
    Thanx in advance for your suggestions,
    Regards,
    Satya.

    Hi Narayanan,
    Thank you for your prompt reply. I understand that we need to create an external delivery channel to post the message to a JMS Queue from TP2. Currently I am using default AQ's (b2b.IP_IN_QUEUE & b2b.IP_OUT_QUEUE) at TP2 end to receive the message.
    But, I want to post the message to JMS Queue. For this I need to create an external delivery channel and the corresponding end point should be the name of that JMS Queue. Is my assumption correct?
    I have already gone through the thread that you have mentioned and the pdf as well. But, I am not able to find an option on how & where to create that JMS Queue?
    Could you clarify on this?
    Regards,
    Satya.

  • Unable to insert messages in JMS QUEUE

    Hi All,
    I am facing an issue while inserting messages in JMS queue.
    The JMS Queue is on another weblogic server and now i created a bpel process which has a jms adapter to insert messages inthe jms queue.I am deploying the Bpel in my server which does not have this particular JMS queue.
    I am unable to insert the messages into the JMS queue present on another weblogic server. where as i am able to insert messages if the queue is present on my server.
    Can you please let me know if its possible to put messages into a queue on remote server from local server.
    Thanks in advance.

    Most probably it seems like an issue of security. Please try to establish cross domain trust between these two Weblogic server domains. For more information refer to http://download.oracle.com/docs/cd/E1284001/wls/docs103/secmanage/domain.html#wp1175687_

  • Send data to JMS queue using CQL in Jdeveloper 11g CEP application

    ALTER QUERY q_basic_event ADD DESTINATION
    “<EndPointReference><Address>_file:///home/cep/test.txt</Add
    ress></EndPointReference>" ---- CQL is being used to transfer data to an output file(test.txt).
    How do we change the destination so that the data is sent to a JMS queue in Jdeveloper 11g where we are using a CEP application?

    Hi Narayanan,
    Thank you for your prompt reply. I understand that we need to create an external delivery channel to post the message to a JMS Queue from TP2. Currently I am using default AQ's (b2b.IP_IN_QUEUE & b2b.IP_OUT_QUEUE) at TP2 end to receive the message.
    But, I want to post the message to JMS Queue. For this I need to create an external delivery channel and the corresponding end point should be the name of that JMS Queue. Is my assumption correct?
    I have already gone through the thread that you have mentioned and the pdf as well. But, I am not able to find an option on how & where to create that JMS Queue?
    Could you clarify on this?
    Regards,
    Satya.

  • How to send message to a queue using JMS adapter

    Hi,
    I need to send messages to the default queue(demoQueue) available in the server using a JMS adapter in a BPEL process.
    I tried doing the same by using an invoke activity that invokes the JMS adapter service to send the message to the queue. I deployed this process in the server and gave an input to send it to the queue. The prcoess executed without any errors in the BPEL console.
    I am also using Hermes v1.0 to monitor the queue but it says that it dint receive any messages in the queue to read.
    I am sorry that i have restrictions from the client that i can't post the code here. Please let me know if anyone has got any solution or if you know any other way of doing the same.
    Thank you
    Message was edited by: prince
    the_prince

    You can use the following procedure :
    DBMS_AQ.ENQUEUE (
    queue_name IN VARCHAR2,
    enqueue_options IN enqueue_options_t,
    message_properties IN message_properties_t,
    payload IN "<ADT_1>",
    msgid OUT RAW);

  • Making DB updates and sending message to JMS queue enclosed in a single transaction

              using a container managed transactions can we achieve sending a message to the JMS
              queue and updating DB as part of single transaction with the data base driver not
              supporting XA. If yes what all configurations setting I need to do. I tried to achieve
              this using 2PC but I am getting the error that "javax.transaction.xa.XAException:
              JDBC driver does not support XA, hence cannot be a participant in two-phase commit.
              To force this participation, set the enableTwoPhaseCommit property on the corresponding
              JDBCTxDataSourceproperty, to true. Pool = ejbPool".
              

    As far as I know, your only options is to do as the exception you cut-and-pasted below
              states:
              "To force this participation, set the enableTwoPhaseCommit property on the corresponding
              JDBCTxDataSourceproperty, to true. Pool = ejbPool"
              The "enableTwoPhaseCommit" property has definite drawbacks
              see the javadoc and/or documentation for configuring
              a "JDBCTxDataSource".
              This problem is specific to non-XA resources in general, not JMS (which is an XA resource),
              you may wish to get more info by posting to the transaction newsgroup.
              Tom
              Manoj Bansal wrote:
              > using a container managed transactions can we achieve sending a message to the JMS
              > queue and updating DB as part of single transaction with the data base driver not
              > supporting XA. If yes what all configurations setting I need to do. I tried to achieve
              > this using 2PC but I am getting the error that "javax.transaction.xa.XAException:
              > JDBC driver does not support XA, hence cannot be a participant in two-phase commit.
              > To force this participation, set the enableTwoPhaseCommit property on the corresponding
              > JDBCTxDataSourceproperty, to true. Pool = ejbPool".
              

  • How to Read Message from JMS Queue using Business Service(ALSB3.0)

    Hi,
     My Project Set up is as follows(using ALSB3.0).
    1>One Proxy Service with transport as HTTP.
    2>The Proxy service is calling another Business Service.
    3>The Business Service has transport layer as JMS.
    So here the business service is posting Request Message into the JMS queue.
    I want at the same time it(The Business Service) should listen to another queue and from there it should read Response Message and forward back to the caller proxy service.
    Can any one help me regarding this...
    Thanks in advance...
    Deba

    Hi ,
    Problem in : Reading / writing messages to the JMS Queue -
    I am stuck with the same problem and I am not able to proceed futher, Can you please help me out in sending an example of how to do right configurations in ALSB and on the server. I read the documentation but still I dont see messages in the queues.
    please help me out. can you post a small sample example
    thanks
    adi

  • Need to publish message from database to a JMS Queue using Java

    I need to publish messages to a Websphere JMS Queue whenever any changes happen on a particular column of a table in oracle 11g. For that I have written a trigger on that particular table which in turn will invoke one java procedure. I have written the java procedure using a standalone java class and uploaded the java class as a schema object. While executing the procedure it is throwing error as it is not able to instantiate some of the java classes. I don't know how to provide the reference of different jar files while executing the java class. Can anyone help me on this.

    Welcome to the forum!
    >
    I have written the java procedure using a standalone java class and uploaded the java class as a schema object. While executing the procedure it is throwing error as it is not able to instantiate some of the java classes. I don't know how to provide the reference of different jar files while executing the java class.
    >
    Clarify your statement. First you say 'standalone java class' but then you talk about instantiating java 'classes' and referencing 'different jar files'. If you are executing your Java class inside Oracle then any Java classes that your java class is referencing also have to be loaded into Oracle or it won't be able to reference or execute them.
    How do you plan to ' publish messages to a Websphere JMS Queue '? Where is this queue you are talking about?
    Why are you using a Java procedure and class instead of PL/SQL?
    What is your 4 digit Oracle version (result of SELECT * FROM V$VERSION)?

  • Push different type of messages to JMS Queue using JMS Adapter

    Platform: Oracle SOA 11g. JMS Adapter.
    I got to push different types of messages as string to same queue. JMS Adapter requires schema to push a message to a queue. Since messages are of different types, how can I push them into queue. I tried to use singleString schema. Result is that actual message gets wrapped into <singleString> root element which is not the required result.
    Any hints or links shall be appreciated.

    Thanks fo ryour reply and help. I appreciate that.
    Wrapping of original message in <singleString>  element is done by JMS Adapter as the very last activity/setting. I am not composing/transforming message into final shape with singleString through transformation.
    Once message is with JMS adapted on one end, it is in Queue on the other end. No control.
    Since consuming end is not in my control and requires the actual message in Text format, I need to have the message target queue in Text format.
    If I select the Opaque schema, following error message is thrown.
    <bpelFault><faultType>0</faultType><mismatchedAssignmentFailure xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"><part name="summary"><summary>Mismatch Assign. cannot set a nonmessage value to a message-based variable. An attempt to assign a nonmessage value to a message-based variable failed. Verify the BPEL source for invalid assign activities.< /summary></part></mismatchedAssignmentFailure></bpelFault>

  • Recieve/Read  Messages  from JMS Queue through ALSB

    Hi,
    I have configured JMS Queue in weblogic server.
    I have created Messaging Service in ALSB which sends messages in MESSAGE QUEUE.
    Now Is it possinle to receive messages from JMS Queue by creating business service in Aqualogic Service bus???

    Hi dear,
    <br>
    I am sending Message through Serializable Object.
    <br>
    I have JMS Proxy which gets invoked when i send message to JMs Queue. JMS Proxy then calls business service.
    <br>
    <br>
    Business Service has two functions. One is taking String as input and one is taking Serializable Object as Input.
    <br>
    <br>
    public void recieveString(String str)<br>
    public void recieveObject(Trade obj)<br>
    --------------------------------------------------<br>
    Now I have configured Proxy Services' Request and Response
    Message Type as a "TEXT". and I am sending ObjectMessage here so what kind of change I require.
    <BR>
    I also want to configure my proxy so that if JMS queue recieves TextMessage then it should invoke reciveString() function and if Object Message then vice versa.....
    <BR><BR>
    But i am not able to handle object even...
    When I am sending Object Message it takes as a TextMessage.
    I am getting following exception when I am sending Object Message to JMS QUEUE. Request and Response Message types are XML Schema of that object.
    <BR>
    <BR>
    <Nov 30, 2006 4:57:19 PM IST> <Warning> <EJB> <BEA-010065>
    <BR>
    <MessageDrivenBean threw an Exception in onMessage(). The exception was: java.lang.AssertionError.<BR>
    java.lang.AssertionError at com.bea.wli.sb.transports.jms.JmsInboundMDB.onMessage(JmsInboundMDB.j
    ava:112)
    at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:42
    9)
    at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDL
    istener.java:335)
    at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:
    291)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4060)
    Truncated. see log file for complete stacktrace
    >
    Message was edited by:
    alwaysvaghu

  • Error while sending the messages to JMS Queue

    Hi ,
    I am trying to pick the file from JMS Queue and send the response xml as outbound message to JMS Queue again using XAI Sender
    I Created XAI Sender, Outbound Message Type(DM-RCVRESP) and configured these two with External System.
    I am able to pick the file from JMS Queue but unable to send the message through XAI Sender (Real-time)
    Plz find below the error trace getting.
    [Wed Jun 15 16:12:09 IST 2011] Error while processing sender "UPLOADSTG" : Unable to update response in staging table: Row id not given.
    com.splwg.mpl.sending.SameThreadSendingManager$ProcessException
         at com.splwg.mpl.sending.SameThreadSendingManager.processDestination(SameThreadSendingManager.java:341)
         at com.splwg.mpl.sending.SameThreadSendingManager.sendResponse(SameThreadSendingManager.java:293)
         at com.splwg.mpl.sending.SameThreadSendingManager.doSend(SameThreadSendingManager.java:249)
         at com.splwg.mpl.server.async.ExecSendRequestProcessor.ProcessRequest(ExecSendRequestProcessor.java:61)
         at com.splwg.mpl.server.async.RequestProcessingThreadAdapter.run(RequestProcessingThreadAdapter.java:46)
         at com.splwg.mpl.server.PooledThread.run(PooledThread.java:91)
         at java.lang.Thread.run(Thread.java:662)
    Please guide me in this regard..
    Thanks,
    sukumar

    What have you configured for the response tab for the sender? Are you using the MPL or the MDB?
    Take a look at:
    MPL Best Practices (Doc Id 1308165.1)
    Oracle WebLogic JMS Integration (Doc Id: 1308181.1)

  • Unable to send message in Service bus queue through Webrole which are connected to Azure VPN

    I have created two Azure VPN and two cloud services(deployed webrole) and one service bus queue
    First Azure VPN and cloud service(deployed webrole) is created in same affinity group.
    Second Azure VPN and cloud service is created in West US
    Service bus queue is also created in West US.
    When I send message in service bus queue from first cloud service (same affinity group) then message sends successfuly
    but when I send message in same service bus queue from second service(West US- Webrole) then unable to send message and not throwing any exception.
    I don't know, whats happening?
    Its very urgent..... client is waiting.
    Please help me... Thanks.
    hema

    Thanks for reply. Got the cause but still looking for solution.
    Actually we have created Azure VPN using Express route and
    all are configured for Private Peering.
    Try to access service bus queue from Web role which is attached to Express route network.
    I am unable to access service bus queue and send message...because cloud services deployed in virtual networks are supported over the private peering path.
    There are 3 types: public, private and default route (forced tunneling). 
    How  can be configured for all 3 which will force all traffic through the tunnel except for Azure public service?
    Do you have any idea on this scenario?
    Thanks.
    hema

  • How to read the messages in the JMS Queue using JMX

    Hi,
              I want to read messages in the JMS queue using JMX. I was able to read using QueueBrowser but want to modify priority of the messages using JMX.
              I tried to use JMSDestinationRuntimeMBean but it does not allow us to read messages unless we pass the message Id. Is there any way that I can get all the messages in the queue.
              I am using Weblogic 8.1 SP4
              Can someone please help me in this regard.
              Thanks,
              Kiran.
              Edited by KGudipati at 10/22/2007 1:22 AM

    Hi,
    As far as i know, JMS Object Messages is not supported by XI JMS adapter.
    you need to have the JMS provider to transform the message to bytes messages.
    (Refer to SAP note 856346)

  • How to Send  message to MQ without using JMS Receiver Adapter

    Hi Frnds,
    Actually i am working one File to JMS scenario,I have to send message to MQ,What are the different ways we can send  message to MQ without using JMS Adapter.
    Regards,
    Raj

    Hi Ramesh,
    Thanks for your replay,could you please eloborate how to integrate that one with XI,and how to use in XI?
    regards,
    raj

Maybe you are looking for

  • Add column to "Customer Receivables Ageing" report

    Hi all! I would need to add a new column via SDK to the matrix in the SAP report "Reports Business Partner -> Ageing -> Customer Receivables Aging". I also want to populate this column with SDK after the report was loaded. Does anyone have any sugges

  • Deploy an  ADF-UIX project

    Hi all! I build a web application workspace, so I have a "model" project in witch I put some business components from tables. In ViewController project I use adf-uix. My problem is I can't deploy my work. How can I do this. I suppose that I should de

  • Expanding/contracting timeline shortcuts. "-" and "+" do not work.

    I have purchased Adobe Premiere Elements 13. One thing I need to do a lot during my project is expand/contract the timeline in Expert view. Everywhere I look online I am directed to using "+" or "-" to do this. However, these buttons do not appear to

  • Keep sleeping with external display

    I just got a brand new samsung syncMaster (730mw to be exact) and went right on to pug it into my 12 inch powerbook, with the help of my minidvi to DVI of course. I followed apple's "correct" procedure. Connecting the power cord, hook up external mon

  • Can I use backlit keyboard with my Satellite C660-2D7?

    Hi all, wondering if there is such a thing as a backlit keyboard that can be fitted to the Satellite C660-2D7 , the old one is very easy to remove.