How to send JMS message from oracle to weblogic

Hello,
I am facing with a problem of sending jms message from oracle to weblogic. I am using oracle 10g and weblogic server 9.1. Here is the problem. I would like to create a trigger to send JMS message to weblogic server whenever there is an update in oracle database. So I created a java class that will send a jms message to weblogic server. But in that class I use the jndi from weblogic: weblogic.jndi.WLInitialContextFactory
when I use the loadjava utility to load that class into oracle, the status of that class is invalid though this class is working fine in eclipse with the weblogic.jar included. I was thinking because the jndi from weblogic needs the weblogic.jar in order to work, then I loaded that jar file into oracle (it took about 20 minute to load everything) and everything loaded into oracle from that jar file is invalid and missing some reference.
So my question is: how do I send a jms message from oracle to weblogic using a java class with the right jndi?
Any help will be appreciated.
Thanks
TL

It should be quite straightforward to do this. As stated you need weblogic.jar in your classpath, then use 100% standard JMS calls to publish.
Ensure that you set the following properties before getting your initial context:
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://node:7001 (or whatever)
this will ensure that the correct JMS implementation classes are invoked.
You can't easily (without some mucking around) build a test implementation in an AQ environment and then deploy to WebLogic because in AQ you don't tend to use JNDI lookups (unless you've implemented oracle JNDI etc) but rather use non standard factory class to create connections etc.

Similar Messages

  • Send JMS message from Oracle to Weblogic topic.. How?

    Hi,
    I need to send messages from within Oracle Database to a topic in Weblogic. I understand that I can create a trigger that executes
    a Java Stored Procedure. This trigger can be invoked upon row
    addition/update or delete .
    The java stored procedure itself can be be a client program that does a jndi lookup, has code to communicate with the topic on a remote Weblogic server. I can write and test this program independently using Oracle supplied jar files (jndi.jar, jar files that have jms api's etc.) then load it into the database and it should work.
    Am I missing something. Is there any complication with jndi lookup, initial context, etc. The Oracle 9i and Weblogic reside on different servers.
    Has anyone done this? Is there a better way of sending messages?
    Should I bother with messaging gateways?
    Thank You for your reply.
    Samir Sahu

    It should be quite straightforward to do this. As stated you need weblogic.jar in your classpath, then use 100% standard JMS calls to publish.
    Ensure that you set the following properties before getting your initial context:
    java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://node:7001 (or whatever)
    this will ensure that the correct JMS implementation classes are invoked.
    You can't easily (without some mucking around) build a test implementation in an AQ environment and then deploy to WebLogic because in AQ you don't tend to use JNDI lookups (unless you've implemented oracle JNDI etc) but rather use non standard factory class to create connections etc.

  • How to send JMS Message from a BPM Process

    Hi All
    I have small query regarding sending JMS Message from a bpm process. Is it possible to send JMS message from one bpm process to another bpm process.
    I have a scenario in which I need to send a JMS message to a queue where another process is listening on that queue and as soon as the message is received on the queue the process instance is created.
    I know how to listen for the JMS message on the queue, but I don't how to send a JMS message from a process.
    Also Can I create process by sending the Notification to the process instead of a JMS message. But the process to be created is not a subprocess i.e. Can notification be send accross different processes.
    Any information or example in this regard would be helpful.
    Thanks in advance
    Edited by: user9945154 on Apr 22, 2009 7:46 PM

    Hi,
    Here's one approach to sending JMS messages from an Oracle BPM process. If you're doing this just to send a message into another process, do not take this approach. It's far easier and quicker if you do this using the OOTB "send notification" logic.
    These steps describe how to do this using WebLogic. The steps would be different if you're using another ap server / JMS provider.
    1. Guessing you've already done this, but first expose the two required WebLogic jar files for JMS messaging as Java components in the External Resources. The two files for WebLogic are weblogic.jar and wljmsclient.jar” (located in the < WebLogic home directory > /weblogic/server/lib” directory).
    AquaLogic BPM JMS Queue Listener for WebLogic 8.1
    2. You've probably already done this, but add an External Resource to represent the J2EE container:
    • Name: “weblogicJ2EE” - this is important and will be used in the next step
    • Supported Type: “GENERIC_J2EE”
    • Initial Context Factory: “weblogic.jndi.WLInitialContextFactory”
    • URL: “t3://localhost:7001”
    • Principal: and Credentials: whatever userid and password you defined to access theWebLogic administrative console.
    3. Create the External Resource that represents the send queue configuration. In this example, I'm calling it “WebLogic Send Queue”. This is important - remember what you named it because you will use this name in the logic that sends the JMS message. This new External Resource is configured as:
    • J2EE: “weblogicJ2EE” (same name as the second External Resource you created)
    • Destination Type: “QUEUE”
    • Lookup Name: “weblogic.examples.jms.exampleQueue”
    • Connection Factory Lookup Name: “weblogic.examples.jms.QueueConnectionFactory”
    4. Here's the logic to send a Message to the Queue
    <pre class="jive-pre"><p />msg as String = "Hello World"
    jmsMsg as Fuego.Msg.JmsMessage
    msg = "<?xml version=\"1.0\"?><Msg>" + msg + "</Msg></xml>"
    jmsMsg = JmsMessage(type : JmsMessageType.TEXT)
    jmsMsg.textValue = msg
    sendMessage DynamicJMS
    using configuration = "WebLogic Send Queue",
    message = jmsMsg</pre>
    Note that the “sendMessage” method uses the configuration parameter “WebLogic Send Queue”. You previously created a JMS messaging service External Resource with this name in the third step.
    Again, please don't go this route if you're just using it to send notifications between processes,
    Dan

  • How to send JMS message from pl/SQL to jBoss

    Hi all,
    I need a helping. This is my problem:
    There's a queue which is definitied under the Jboss. I would like send a message from pl/SQL to jBoss.
    Why is't working??
    http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/jms/Readme.html
    thnk's,
    fgy,,

    You can defince a queue in Oracle, then access this queue from your Jboss application. Not sure if you need JMS, but there are some Oracle OCI functions that are certainly helpful for such a task.
    You might look into further details be reading the manual on Oracle Advanced Queuing or Oracle Streams.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14257/part4.htm#i436427

  • Send JMS messages from Oracle Procedure

    Hi
    I need to write an Oracle procedure that would send a JMS message. So please share your thoughts on how this can be done in Oracle.
    thank you

    sdk11 wrote:
    Hi
    I need to write an Oracle procedure that would send a JMS message. So please share your thoughts on how this can be done in Oracle.
    thank youhttp://www.lmgtfy.com/?q=Oracle+procedure+that+would+send+a+JMS+message
    Handle:      sdk11
    Status Level:      Newbie
    Registered:      Jan 13, 2010
    Total Posts:      56
    Total Questions:      30 (27 unresolved)
    why so many unanswered questions?
    Edited by: sb92075 on Jan 12, 2012 8:44 AM

  • How to send SOAP Message with Oracle B2B

    Hi everyone,
    I need your help to send out from Oracle B2B a SOAP message with attachment of any type of file (image, pdf, etc.). Possibly using a SOA composite application or another way, it doesn't matter. I already create an ebMS partnership with a custom document protocol and I already create a working SOA composite application to send only text message to my trading partner. I have tried this solution: http://anuj-dwivedi.blogspot.it/2011/04/ebms-attachment-handling-in-oracle-b2b.html but it doesn't work for my case... It is to be noticed that I don't give any schema to my component in the SOA application explained firstly, and I select opaque as schema.
    Thanks to all, regards
    Nello

    Hi Anuj and thanks for your help,
    I need to send an ebXML message, with SOAP, and I try to send it with a .war application written in jsp connecting to http://10.85.28.24:8001/b2b/transportServlet to send the SOAP message. The errors reported is:
    javax.xml.soap.SOAPException: Unable to receive message. Received a response from url: http://10.85.28.24:8001/b2b/transportServlet with HTTP status 200 and SOAP content-type: null.
    the code I write is the following (to evaluate the two "null" in the super constructor)
    <%!
    public class EBMSSender extends SOAPRunner
    private String cpaId;
    private String service;
    private String action;
    private String mess;
    private ArrayList<String> allegati=null;
    public EBMSSender(String cpaId, String service, String action, String mess, ArrayList<String> file)
    super("http://10.85.28.24:8001/b2b/transportServlet","null", "null");
    this.cpaId = cpaId;
    this.service = service;
    this.action = action;
    this.mess=mess;
    this.allegati=file;
    @Override
    protected void prepareRequest(SOAPMessage soapMessage, SOAPBody soapBody) throws SOAPException
    soapBody.addChildElement(SOAPUtility.createElement("CPAId", getNsPrefix(), getNsURI(),"agr3"));
    soapBody.addChildElement(SOAPUtility.createElement("service", getNsPrefix(), getNsURI(),"OracleService"));
    soapBody.addChildElement(SOAPUtility.createElement("action", getNsPrefix(), getNsURI(),"Oracletohermesb"));
    soapBody.addChildElement(SOAPUtility.createElement("serviceType", getNsPrefix(), getNsURI(),"OracleServiceType"));
    soapBody.addChildElement(SOAPUtility.createElement("convId", getNsPrefix(), getNsURI(), "convId"));
    soapBody.addChildElement(SOAPUtility.createElement("fromPartyId", getNsPrefix(), getNsURI(), "Oracle"));
    soapBody.addChildElement(SOAPUtility.createElement("fromPartyType", getNsPrefix(), getNsURI(), "Name"));
    soapBody.addChildElement(SOAPUtility.createElement("toPartyId", getNsPrefix(), getNsURI(), "Hermes-b"));
    soapBody.addChildElement(SOAPUtility.createElement("toPartyType", getNsPrefix(), getNsURI(), "Name"));
    attach(soapMessage);
    protected void attach(SOAPMessage soapMessage)
    String h=mess;
    DataHandler dh;
    AttachmentPart ap = soapMessage.createAttachmentPart(h,"text/plain");
    soapMessage.addAttachmentPart(ap);
    if(allegati!=null)
    for(int i=0; i<allegati.size();i++)
    dh=new DataHandler(new FileDataSource(new File(allegati.get(i))));
    ap=soapMessage.createAttachmentPart(dh);
    ap.setContentType(new MimetypesFileTypeMap().getContentType(allegati.get(i)));
    ap.setContentLocation(allegati.get(i));
    soapMessage.addAttachmentPart(ap);
    @Override
    protected void processFault(SOAPFault soapFault) throws SOAPException{}
    @Override
    protected Object processResponse(SOAPMessage responseMessage,SOAPBody responseBody) throws SOAPException
    SOAPElement messageId = SOAPUtility.getChild(responseBody, "message_id", getNsURI());
    return null;
    %>
    The code works fine on the other trading partner side to send ebXML message to Oracle B2B. Apart from this solution (however,it would be my favorite), I find your blog and I try to implement your solution. It works: it sends files with only text payload to the other trading partner without any problem, but if I try to send for example an image in byte array written in a file .txt, the ebxml file received has the byte array with wrong characters. it may be that I have not provided the xsd schema? in case if I wanted to send an ebXML message with text and attachments, what xsd schema do I need to provide?
    or is there another way to implement a SOA composite application to send SOAP messages with attachments?
    Thank for your help!, regards
    Nello

  • How to send a message from server to a particular client

    Hi all,
    I need to send a message from one host to another host which are connected in local domain. Now I'm able to send a message from client to server and vice versa but what I need is the server should route that message which I send through one client to another host(client) .
    How can I do that ?
    Please give me some ideas how to do that .
    Thanks in advance
    Edited by: m.parthiban on Mar 5, 2008 1:20 PM

    ejp, thanks for your reply . can you please explain me bit more by providing code snippet ?
    This is what I have done till now :
    MyServer:
    package connection;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class MyServer {
          * @param args
         public static void main(String[] args) {
              String ss ="",temp ="";
              Socket clientLink=null;
              try {
                        ServerSocket sockServer = new ServerSocket(6000);
                        while(true) {
                             clientLink = sockServer.accept();
                             System.out.println("Connection Established");
                             InputStreamReader isr = new InputStreamReader(clientLink.getInputStream());
                             BufferedReader bufReader = new BufferedReader(isr);
    //                         System.out.println("buf "+bufReader.readLine());
                             try {
                                  while ((temp=bufReader.readLine())!=null) {
                                       ss+=temp;
                                       System.out.println("ss   "+ss+"Temp "+temp );
                                  System.out.println("Client > "+ss);
                             } catch (IOException e) {
                                  System.out.println("while reading");
                                  e.printStackTrace();
                             OutputStreamWriter osw = new OutputStreamWriter(clientLink.getOutputStream());
                             PrintWriter pw = new PrintWriter(osw,true);
                             pw.write("Welcome -by Server !!!");
                             pw.flush();
                             clientLink.shutdownOutput();
                             clientLink.close();
              } catch (IOException e) {
                   System.out.println("Can't able to connect");
                   e.printStackTrace();
    }MyClient:
    package connection;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.net.Socket;
    import javax.swing.JOptionPane;
    public class MyClient {
          * @param args
         public static void main(String[] args) {
              try {
                   String serverMsg="",temp="";
                   Socket client = new Socket("127.0.0.1",6000);
                   PrintWriter pw = new PrintWriter(client.getOutputStream(),true);
                   pw.write("Hi ,Accecpt me");
                   pw.flush();
    //               pw.close();
                   client.shutdownOutput();
                   InputStreamReader isr  = new InputStreamReader(client.getInputStream());
                   BufferedReader bufRead = new BufferedReader(isr);
                   while ((temp=bufRead.readLine())!=null) {
                        serverMsg +=temp;
                   System.out.println("Server > "+serverMsg);
                   JOptionPane.showMessageDialog(null, serverMsg);
                   client.shutdownInput();
                   client.close();
              } catch (IOException e) {
                   System.out.println("Failed to connect");
                   e.printStackTrace();
    }Once again thanks for the time you spend to reply me.

  • How to send the message from front end to XI in sender webservice

    Hi All,
    I am doing webservice to proxy scenario, we want to send the message from front end to XI, front end is java application. can any one please guide me the steps need to done for front end to XI.
    1) we wrote a webservice
    2) i have created data type message type and message interface in IR
    3) i have created sender soap adapter with interface name and namespace.
    4) i have generated webservice in ID
    but how can we send the message from front end to XI sender soap adapter.
    Kind Regards,
    Kiran

    Hi,
    Before going with the SOAP Adapter i suggest you to go through this Disscussion
    Re: about http and soap
    If you are going with the SOAP Adapter means
    >>but how can we send the message from front end to XI sender soap adapter.
    you have to use the XI  Server URL( http://host name:j2ee port/
    Use this as Refference
    http://help.sap.com/saphelp_nw70/helpdata/EN/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    Regards
    Seshagiri

  • Sending jms message from bc4j session bean

    Hi,
    i need to send some message from my bc4j (deployed as session bean).
    i have successfully deployed my mdb to listen for these message via Queue. I try to send some message from test client it works well, this the code snippet :
    String connectionFactoryName = "java:comp/env/jms/QueueConnectionFactory";
    String queueName = "java:comp/env/jms/demoQueue";
    JMSSender sender = new JMSSender(connectionFactoryName,queueName);
    sender.send("test");
    sender.close();
    when i move this code to my bc4j(session bean), message is sent, but my mdb doesn't receive it !( onMessage procedure doesn't come out )
    Really appreciate for help,
    Ricky H.P.

    sorry, this is JMSSender class source code:
    public class JMSSender{
    Context jndiContext;
    QueueConnectionFactory connectionFactory;
    QueueConnection connection;
    QueueSession session;
    TextMessage message;
    QueueSender queueSender;
    Queue queue;
    public JMSSender(String connectionFactoryName,String queueName){
    init(connectionFactoryName,queueName);
    void init(String connectionFactoryName,String queueName){
    * Create a JNDI InitialContext object.
    try {
    jndiContext = new InitialContext();
    } catch (NamingException e) {
    e.printStackTrace();
    * Look up connection factory and queue. If either does
    * not exist, exit.
    try {       
    //connectionFactory = (QueueConnectionFactory)jndiContext.lookup("java:comp/env/jms/QueueConnectionFactory");
    //queue = (Queue)jndiContext.lookup("java:comp/env/jms/demoQueue");
    connectionFactory = (QueueConnectionFactory)jndiContext.lookup(connectionFactoryName);
    queue = (Queue)jndiContext.lookup(queueName);
    }catch (Exception e) {
    e.printStackTrace();
    public void send(String strMessage){
    try {
    connection = connectionFactory.createQueueConnection();
    session = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    String correlationId = Long.toString(System.currentTimeMillis());
    message = session.createTextMessage();
    message.setText(strMessage);
    queueSender = session.createSender(queue);
    queueSender.send(message);
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {
    System.out.println("message sent success !!!");
    public void close(){
    try {
    queueSender.close();
    session.close();
    connection.close();
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {
    public static void main(String args[]){
    new JMSSender("java:comp/env/jms/QueueConnectionFactory","java:comp/env/jms/trgBctQueue");
    }

  • ALDSP 3.2 - How to create JMS message from ALDSP

    Is there a way to write a jms message from ALDSP?
    I want to be able to perform database updates to a database and also write a message to queue in a transaction.
    Thanks

    As per my understanding only one resource can be non-transactional. In this case it would be the Web Service.If you have n data sources and the first n-1 are transactional and the nth one is not - if you update the first n-1 successfully, and the nth one fails - then you just throw an exception and the updates to the n-1 data sources get rolled back. If an update to one of the n-1 data sources fails you throw an exception and the update to the nth data source never happens. In your case, it's up to you to ensure the updates are executed in the correct order (how you write your XQSE procedure).
    Will the call to write a jms message from a Java function in ALDSP participate in the database transaction? DSP doesn't suspend the current transaction when calling a Java function. So yes, the JMS call would participate in the same transaction as the database call.
    If you want to dump out the transactionId in your java function in the same format as it appears in the DSP Audit, you can use :
    public String byteArrayToHexString(byte in[]) {
    StringBuffer out = new StringBuffer(in.length * 2 + 2);
    out.append("0x");
    for(int i = 0; i < in.length; i++) {
    byte ch = 0x00;
    ch = (byte) (in[i] & 0xF0);
    ch = (byte) (ch >>> 4);
    ch = (byte) (ch & 0x0F);
    out.append(HEX[(int) ch]);
    ch = (byte) (in[i] & 0x0F);
    out.append(HEX[(int) ch]);
    return out.toString();
    }

  • How to send jms message to mq series

    Hi all,
    I'm new to JMS and I've been asked to send an xml file to a IBM MQ series message queue.
    I need to send this message from an application running on a tomcat webserver.
    Basically, what packages do I need to start with that?
    Is that possible without installing an MQ client on the webserver?
    What parameters would I need to make a connection? I currently only know the QUEUE name and that the MQ is running on a different machine than the webserver is.
    Thank you!
    Steven

    This can help u writing to MQueue
    ==================================================================
    // Program Name
    // MQWrite
    // Last date of modification
    // 1 Oct 2000
    // Description
    // This java class will read a line of input from the keyboard
    // and send it as a message. The program will loop until the
    // user presses CTL^Z.
    // Sample Command Line Parameters
    // -h 127.0.0.1 -p 1414 -c CLIENT.CHANNEL -m MQA1 -q TEST.QUEUE
    // Copyright(C), Roger Lacroix, Capitalware
    import com.ibm.mq.*;
    import java.io.IOException;
    import java.util.Hashtable;
    import java.io.*;
    public class MQWrite {
    private MQQueueManager _queueManager = null;
    private Hashtable params = null;
    public int port = 1414;
    public String hostname = "127.0.0.1";
    public String channel = "CLIENT.TO.MQA1";
    public String qManager = "MQA1";
    public String outputQName = "SYSTEM.DEFAULT.LOCAL.QUEUE";
    public MQWrite()
    super();
    private boolean allParamsPresent()
    boolean b = params.containsKey("-h") &&
    params.containsKey("-p") &&
    params.containsKey("-c") &&
    params.containsKey("-m") &&
    params.containsKey("-q");
    if (b)
    try
    port = Integer.parseInt((String) params.get("-p"));
    catch (NumberFormatException e)
    b = false;
    // Set up MQ environment
    hostname = (String) params.get("-h");
    channel = (String) params.get("-c");
    qManager = (String) params.get("-m");
    outputQName = (String) params.get("-q");
    return b;
    private void init(String[] args) throws IllegalArgumentException
    params = new Hashtable(5);
    if (args.length > 0 && (args.length % 2) == 0)
    for (int i = 0; i < args.length; i+=2)
    params.put(args, args[i+1]);
    else
    throw new IllegalArgumentException();
    if (allParamsPresent())
    // Set up MQ environment
    MQEnvironment.hostname = hostname;
    MQEnvironment.channel = channel;
    MQEnvironment.port = port;
    else
    throw new IllegalArgumentException();
    public static void main(String[] args)
    MQWrite write = new MQWrite();
    try
    write.init(args);
    write.selectQMgr();
    write.write();
    catch (IllegalArgumentException e)
    System.out.println("Usage: java MQWrite <-h host> <-p port> <-c channel> <-m QueueManagerName> <-q QueueName>");
    System.exit(1);
    catch (MQException e)
    System.out.println(e);
    System.exit(1);
    private void selectQMgr() throws MQException
    _queueManager = new MQQueueManager(qManager);
    private void write() throws MQException
    String line;
    int lineNum=0;
    int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;
    try
    MQQueue queue = _queueManager.accessQueue( outputQName,
    openOptions,
    null, // default q manager
    null, // no dynamic q name
    null ); // no alternate user id
    DataInputStream input = new DataInputStream(System.in);
    System.out.println("MQWrite v1.0 connected");
    System.out.println("and ready for input, terminate with ^Z\n\n");
    // Define a simple MQ message, and write some text in UTF format..
    MQMessage sendmsg = new MQMessage();
    sendmsg.format = MQC.MQFMT_STRING;
    sendmsg.feedback = MQC.MQFB_NONE;
    sendmsg.messageType = MQC.MQMT_DATAGRAM;
    sendmsg.replyToQueueName = "ROGER.QUEUE";
    sendmsg.replyToQueueManagerName = qManager;
    MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults, same
    // as MQPMO_DEFAULT constant
    while ((line = input.readLine()) != null)
    sendmsg.clearMessage();
    sendmsg.messageId = MQC.MQMI_NONE;
    sendmsg.correlationId = MQC.MQCI_NONE;
    sendmsg.writeString(line);
    // put the message on the queue
    queue.put(sendmsg, pmo);
    System.out.println(++lineNum + ": " + line);
    queue.close();
    _queueManager.disconnect();
    catch (com.ibm.mq.MQException mqex)
    System.out.println(mqex);
    catch (java.io.IOException ioex)
    System.out.println("An MQ IO error occurred : " + ioex);
    // Description
    // This java class will read a line of input from the keyboard
    // and send it as a message. The program will loop until the
    // user presses CTL^Z.
    // Sample Command Line Parameters
    // -h 127.0.0.1 -p 1414 -c CLIENT.CHANNEL -m MQA1 -q TEST.QUEUE
    import com.ibm.mq.*;
    import java.io.IOException;
    import java.util.Hashtable;
    import java.io.*;
    public class MQWrite {
    private MQQueueManager _queueManager = null;
    private Hashtable params = null;
    public int port = 1414;
    public String hostname = "127.0.0.1";
    public String channel = "CLIENT.TO.MQA1";
    public String qManager = "MQA1";
    public String outputQName = "SYSTEM.DEFAULT.LOCAL.QUEUE";
    public MQWrite()
    super();
    private boolean allParamsPresent()
    boolean b = params.containsKey("-h") &&
    params.containsKey("-p") &&
    params.containsKey("-c") &&
    params.containsKey("-m") &&
    params.containsKey("-q");
    if (b)
    try
    port = Integer.parseInt((String) params.get("-p"));
    catch (NumberFormatException e)
    b = false;
    // Set up MQ environment
    hostname = (String) params.get("-h");
    channel = (String) params.get("-c");
    qManager = (String) params.get("-m");
    outputQName = (String) params.get("-q");
    return b;
    private void init(String[] args) throws IllegalArgumentException
    params = new Hashtable(5);
    if (args.length > 0 && (args.length % 2) == 0)
    for (int i = 0; i < args.length; i+=2)
    params.put(args[i], args[i+1]);
    else
    throw new IllegalArgumentException();
    if (allParamsPresent())
    // Set up MQ environment
    MQEnvironment.hostname = hostname;
    MQEnvironment.channel = channel;
    MQEnvironment.port = port;
    else
    throw new IllegalArgumentException();
    public static void main(String[] args)
    MQWrite write = new MQWrite();
    try
    write.init(args);
    write.selectQMgr();
    write.write();
    catch (IllegalArgumentException e)
    System.out.println("Usage: java MQWrite <-h host> <-p port> <-c channel> <-m QueueManagerName> <-q QueueName>");
    System.exit(1);
    catch (MQException e)
    System.out.println(e);
    System.exit(1);
    private void selectQMgr() throws MQException
    _queueManager = new MQQueueManager(qManager);
    private void write() throws MQException
    String line;
    int lineNum=0;
    int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;
    try
    MQQueue queue = _queueManager.accessQueue( outputQName,
    openOptions,
    null, // default q manager
    null, // no dynamic q name
    null ); // no alternate user id
    DataInputStream input = new DataInputStream(System.in);
    System.out.println("MQWrite v1.0 connected");
    System.out.println("and ready for input, terminate with ^Z\n\n");
    // Define a simple MQ message, and write some text in UTF format..
    MQMessage sendmsg = new MQMessage();
    sendmsg.format = MQC.MQFMT_STRING;
    sendmsg.feedback = MQC.MQFB_NONE;
    sendmsg.messageType = MQC.MQMT_DATAGRAM;
    sendmsg.replyToQueueName = "ROGER.QUEUE";
    sendmsg.replyToQueueManagerName = qManager;
    MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults, same
    // as MQPMO_DEFAULT constant
    while ((line = input.readLine()) != null)
    sendmsg.clearMessage();
    sendmsg.messageId = MQC.MQMI_NONE;
    sendmsg.correlationId = MQC.MQCI_NONE;
    sendmsg.writeString(line);
    // put the message on the queue
    queue.put(sendmsg, pmo);
    System.out.println(++lineNum + ": " + line);
    queue.close();
    _queueManager.disconnect();
    catch (com.ibm.mq.MQException mqex)
    System.out.println(mqex);
    catch (java.io.IOException ioex)
    System.out.println("An MQ IO error occurred : " + ioex);

  • How to send communication message from application server to load balancer

    Hi,
    Environment: 8 application servers are clustered behind a load balancer. Java/J2EE based client-server application
    When any one of the servers is supposed to go down, I want to send a message from that server, programmatically, to load balancer something which signifies "server is down or going down, do not forward any client connections to me". This is to avoid any CLOSE_WAITs.
    How do I achieve this? How can I send message programmatically from app server to load balancer? From very basic knowledge, SNMP can be used for this. But do not know how to start of. Any other means is also OK. Need details.
    Thanks
    Sunil

    At the same time we stop accepting any new connections [ServerSocket.accept() will be escaped during server shutdown].Just close the ServerSocket.
    Both these are working fine. But during the 25 seconds, still the client connections gets queued up trying to find that serverNot if you close the ServerSocket.
    reason being the load balancer is still forwarding requests to this server whose shutdown has started but not completed. So CLOSE_WAITS happen.Not if you close the ServerSocket. Not that the CLOSE_WAITS are the actual problem, as they will all disappear when the server exits. It's more that the clients shouldn't have been able to create the connection in the first place. Which wouldn't have happened if you had closed the ServerSocket.
    If we tell load balancer not to send any more client socket connections, then we completely avoid getting CLOSE_WAITS.If you close the ServerSocket ditto.

  • Send Synchronous message from Oracle to BPM to CRM in RWB

    Hi All,
    I have a scenario like this Oracle Sender (synchronous interface)-> calling ccBPM -> CRM which is a synchronous process.
    Oracle sends an external message to CRM and get the response back. This is achieved using ccBPM due to some internal calls from ccBPM to MDM also sycnhronously.
    So there are three receive determination created
    Oracle to ccBPM
    ccBPM to MDM
    ccBPM to CRM
    Now, the question is I have some message to be send from RWB for testing whether this process works properly or not in staging system. How do I send the message in RWB for this kind of process. This is a syynchronous process
    And sender should be oracle system, receiver shuld be what? ccBPM or CRM from RWB perspective.
    Hope you all got the question.
    Thanks
    Mike

    Hi,
    How do I send the message in RWB for this kind of process. This is a syynchronous process
    And sender should be oracle system, receiver shuld be what? ccBPM or CRM from RWB perspective.
    You need to mentioned Oracle as sender & receiver would be BPM.
    BTW, why do you put a receiver name, you should only supply Sender parameters (Sender Name, Interface & Namespace), Let PI , determine the receiver which is true testing.
    Regards
    Sushil

  • How to send a message from Servlet to JSP

    Dear all,
    I have JSP, with JavaScript (AJAX). If the user click on the button, the text will be sent to a Servlet parsed by doGet() and the user get a response to his input, without reloading a page.
    How can I send a message to the users (JSP) from Servlet, if he didn't clicked any button and to other visitor of the page also? Is it possible? I think like a chat, the server sends a message to all users who are subscribed.
    I don't know, what should I get from user, maybe session, that I could send him personal or common messages in his textarea. I should also invoke some JavaScript function to update his page. I have met some chats, you don't do nothing and get messages. It is also without a JavaScript timer, which invokes doGet() method. Asynchronous, only when there is a message.
    Please help me with a problem.
    Thanks in advance.

    Hai ,
    You can send any message through response.sendRedirect();
    here is the coding try it
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class SimpleCounter extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    res.setContentType("text/plain");
    PrintWriter out = res.getWriter();
    String username="java";
    res.sendRedirect("http://localhost:8080/yourprojectname/jspfile.jsp?username="+username);
    }

  • How to send an email from oracle?

    Hi I want to send email from oracle database.
    i have tried following procedure
    create or replace
    2 PROCEDURE send_mail (p_sender IN VARCHAR2,
    3 p_recipient IN VARCHAR2,
    4 p_message IN VARCHAR2)
    5 as
    6 l_mailhost VARCHAR2(255) := 'aria.us.oracle.com';
    7 l_mail_conn utl_smtp.connection;
    8 BEGIN
    9 l_mail_conn := utl_smtp.open_connection(l_mailhost, 25);
    10 utl_smtp.helo(l_mail_conn, l_mailhost);
    11 utl_smtp.mail(l_mail_conn, p_sender);
    12 utl_smtp.rcpt(l_mail_conn, p_recipient);
    13 utl_smtp.open_data(l_mail_conn );
    14 utl_smtp.write_data(l_mail_conn, p_message);
    15 utl_smtp.close_data(l_mail_conn );
    16 utl_smtp.quit(l_mail_conn);
    17 end;
    and when i execute the following
    begin
    send_mail( '[email protected]',
    '[email protected]',
    'Hello arun' );
    end;
    I get the following errors
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "TEST.SEND_MAIL", line 8
    ORA-06512: at line 2
    Please help
    Regards
    Arun

    C:\>telnet aria.us.oracle.com 25Only if you work ofr Oracle & start behind their firewall would I expect this to work.
    The SMTP server to which PL/SQL connects needs to be YOUR corporate email (MTA) server & configured to RELAY message.
    Contact your LOCAL postmaster/Network Admin
    NONE of this is related to Oracle RDBMS!

Maybe you are looking for

  • Follow Up Question/Second User Account... Separate iTunes?

    As a follow up to my last question (Thanks Niel) I'd like to know if I decide not to share my iTunes with them (different tastes, etc) can they have their own separate iTunes accounts (same computer)? If so... Do they have to open an iTunes store acc

  • Can I use iAd in my flash package?

    Hello. I start learning to make iOS application using adobe flash. I will make a free application. So I need iAd in my application. Can I use iAd in my flash package?

  • How do I get OpenGL? (for canvas rotation)

    I've tried using the rotate canvas feature in Photoshop CS5 but I get the message: "Could not complete your request because it only works with OpenGL enabled document windows."  I can't use rotate canvas using my Wacom tablet either, which is weird b

  • Lost media need download acrobat X1 standard

    cannot see how I get download replacement.  I have the key for my original download.

  • Need to find original phone number for used iPhone 4...

    I purchased a used iPhone 4 and blew it because the guy I bought it from had factory reset and upgraded the phone to ios7 but he did not disable 'iCloud' and the 'findmyphone' app. Now it won't activate without his old account info. I need to get hol