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)?

Similar Messages

  • 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

  • How to delete message from the fodler of  AOL account using Java mail

    Hello All,
    I am using Java MAil API in my application, i want to delete message from AOL account's folder,
    when i set the folder as "Recently Deleted" or "Trash" , i get an exception as "folder does not exist".
    when i tested , some times mail is moving into Recently Deleted folder, but not every time.
    this is happening in both the interface as AOl Interface or my application.
    when i use folder.close(true) after setting the flag of message as DELETED. it completely remove the message from the acount.
    but i want to let the message be remained in the Recently Deleted folder. what should i do.
    i dont want to remove the message completely from the account.I am using IMAP also.

    You'll need to figure out what the real name of the "Recently Deleted" folder is on the AOL IMAP server
    (assuming it's a real folder and not some sort of "virtual" folder), then copy the message into that folder.
    See the folderlist.java demo program as a way to explore the names of all the folders on the server.

  • How can I send a message from database to a J2EE application?

    How can I send a message from database to a J2EE application?
    If I have a codetable in database that has new or modified values I have to refresh the codetable in my J2EE application.
    Most effective way would be send a message to initiate a table reload from J2EE app, but I don't know how to do this.
    Now I have a background thread that regular reads the table and looks for changes.

    http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/TechNote_BAM_AQ_Configuration.pdf
    This document details how to create triggers on a table that send out JMS messages.
    In this example, the messages are going to Oracle BAM.. your message could go to your J2EE application listening to its own topic/queue.
    an alternative idea.
    you could also just cache your lookup table with something like Oracle Coherence and than try to ensure that all changes to the lookup go through Coherence, so that you won't need to do notification from the db up to the application. the application and the lookup data management tool would be using the data grid for management of the lookup table data, and the data grid (coherence) would persist the lookup data changes back to the db.

  • Read message synchronously from JMS queue using OSB

    Hi,
    Is it possible to read message from the JMS queue using OSB based on the request invocation. I know messages can be read from the queue but it will be polling based.
    The requirement is to have an OSB proxy service (HTTP service ) an an interface to the client application. Client application invokes the proxy service and the proxy service need to read message from the JMS queue and provide the message as response to the client.
    Let me know if there are any pointers.
    Thanks
    Sandeep

    Hi,
    I spent some time trying to do this and apart from creating custom database tables etc. I was not able to achieve this.
    We wanted to use in memory JMS queues in our situation.
    In the end we developed a Java Web Service which preformed the on-demand read from the queue (using a particular message selector)
    This is working for us without a problem
    Robert

  • Why am I suddenly getting this message from a page I have been using for 6 months(Error code: sec_error_unknown_issuer) how do I get my page back?

    Why am I suddenly getting this message from a page I have been using for 6 months(Error code: sec_error_unknown_issuer) how do I get my page back?

    Did you reset Firefox recently?
    *https://support.mozilla.org/kb/reset-firefox-easily-fix-most-problems
    If that is the case then you may have lost intermediate certificates that were stored in the cert8.db file in the Firefox profile folder.
    Check out why the site is untrusted (see the Technical details) and if this is caused by a missing intermediate certificate then see if you can install this intermediate certificate from another source.
    Some firewalls monitor secure (https) connections and send their own certificate instead of the website's certificate.
    You can retrieve the certificate and check details like who issued certificates and expiration dates of certificates.
    *Click the link at the bottom of the error page: "I Understand the Risks"
    Let Firefox retrieve the certificate: "Add Exception" -> "Get Certificate".
    *Click the "View..." button and inspect the certificate and check who is the issuer.
    You can see more Details like intermediate certificates that are used in the Details pane.

  • I have received text messages from mailer-daemon. Do not use my 4S for email. Is it a virus?

    I have received 2 text message from 'mailer-daemon'  I do not use my 4S for email. Is it a virus?

    No

  • 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)

  • Messages stuck in "Messages Pending" column of a JMS queue.

    Hi
    Is there any way to retrive the messages which are stuck in "Messages Pending" column of a JMS queue.
    weblogic 8.1 SP5 version.
    Thanks

    there is some possibility to prevent the Pending Message or to automatically purge them on WL 9.x or WL 10.x?WebLogic JMS provides "message management" console, scripting, and mbean features to view and manipulate messages in a destination. You can search for "message management" in this newsgroups for more information - here's a good post: Re: WLST Script Help It also provides features for automatically moving problem messages to an error destination, expiring old messages, and/or deleting messages thave have exceeded a configured redelivery limit. I suggest reading through our feature list in the documentation, see "Value-Added WebLogic Server JMS Features" in the [ Information Roadmap | http://download.oracle.com/docs/cd/E15523_01/web.1111/e14529/messaging.htm#sthref23 ].
    Note that it's usually best to try and understand why messages are marked pending and fix the underlying reason instead of purging such messages. Messages are normally pending for a valid reason, and most use cases can't tolerate arbitrarily losing a message.
    Tom

  • Need  to read messages from the log instead of displaying

    Hi,
    I need to read all the messages from the log with a particular log no..
    i was able to display it using FM  BAL_DSP_LOG_DISPLAY..But i want to collect the messages instead of displaying..To display according to my requirement..
    Thanks in advance

    Use this for reading :
    BAL_LOG_MSG_READ
    Regards
    Neha

  • Error message from database stored procedures

    I would like to have some error message show at client side from stored procedures.
    I use MS SQL Server and use RAISEERROR, but ColdFusion does not bring the error message just ignore the error continue to run the other part of code.
    I just want to know are there any way to bring stroed procedure error message to client, or I have to trap the error at Web Server or JavaScript level.
    Your help and information is great appreciated,
    Regards,
    Iccsi,

    Just wrap your cfstoredproc in a cftry/cfcatch.  See this for an example:
    http://stackoverflow.com/questions/1879754/accessing-raiseerror-message-from-cfstoredproc
    There's no way your javascript can trap this server-side error though, unless you were calling your CFM page that calls the stored proc via an AJAX request.

  • Capturing Custom Error Messages from Database Triggers

    Hi Everybody
    When i fired a trigger it should show only the custom message from RAISE_APPLICATION_ERROR
    instead of showing all the message....
    ORA-20103: We Cannot Delete the emp_id 5610
    ORA-06512: at "emp_id", line 89
    ORA-04088: error during execution of trigger 'delete_emp_id.trg'I want to show only the custom message
    We Cannot Delete the emp_id 5610Thanks in Advance

    Not possible AFAIK.
    Instead of RAISE_APPLICATION_ERROR, define a custom exception, call it and just print it onto the console (using dbms_output). You can't pop it out though.

  • 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)

  • Read from database (Access) and update fields using MS ADODB

    Hello,
    I am trying to get records from database using MS ADODB._connection & ADODB._Recordset objects (from LabVIEW 6)
    I can:
    1. open connection (with ADODB._connection)
    2. write into tables (with ADODB._command)
    I can not: gets records and update fields using ADODB._connection & ADODB._Recordset.
    I do not know:
    1. how to connect between the connection that was opened and the recordset object
    2. where I can write the SQL text as input to the recordset
    Attached is DataBase.llb with DB_read.vi that display my steps.
    Thanks.
    Attachments:
    DataBase.llb ‏40 KB

    Try this one, after updating the names for database and the table you want.
    Let me know if it's working.
    p.s.: if you have problems, it could be a different adodb version ... but the sequence of methods is the same
    Attachments:
    EditdatabaseMe.vi ‏57 KB

  • Delaying a message from being available on a Queue

    I have the need to receive messages to a Queue I have set up and have it consumed several days later. The catch is that other messages will be coming in and will be consumed right away.
    I looked at the JMS message properties and I can't see anything in there that might help.
    Does anyone have any ideas?

    Hi Isaac,
    JMS itself does not specify any type of delay header or property field. However, if you're using OJMS (AQ/JMS), which you should be if you're using 9iAS v9.0.2 or v9.0.3, there is an Oracle JMS specific property called JMS_OracleDelay. You can find more information about this property in the Oracle9i Application Developer's Guide - Advanced Queuing.
    You can find this document on OTN at http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/nav/docindex.htm
    You should find the AQ book listed as the sixth book down in the list.
    Hope this helps...
    John

Maybe you are looking for

  • Report Engine SDK: CommunicationException when accessing IReportEngine members

    Hello, I have installed BOXI 3.1 SP3, including the .NET SDK, and I am trying to use the Report Engine SDK part to navigate through a WebIntelligence document (analyse its structure, etc.), via a Console App. I built my console app targeting .NET fra

  • Run script in autosys at a specified time.

    I have created a shell script. I want to run the script in Autosys. Please note that my shell script runs as "$ ksh run.ksh" How do I make autosys run this script at 5:00PM every day? insert_job: abc job_type: c box_name: run.box command: ksh run.ksh

  • Starting an XI (NW 7.0 on Windows) using startsap.exe

    Hi out there, we have an XI 7.0 on a windows machine. Everytime the server has been restarted, the sap services are started automatically. But the XI itself has to be started manually using the SAP MMC. Of course we'd like the XI to be started automa

  • Add srt subtitle to itunes movie?

    Hi everyone, Is there anyway to add an external subtitle (.srt) to a movie downloaded (and playing) in itunes? Thanks,

  • The contact image is gone once you activate call i...

    i just got my nokia 5800.. and i have assigned some image "assign as contact image" to my contacts... so when that particular person calls, his or her picture will be shown.then i went into settings ---> personal---> theme---> this is this option cal