Publishing message to Topic from a standalone application.

Hi,
I have a standalone Java program which will publish a message to the TOPIC. I have found the code to publish to the topic. Please anyone of you can tell me, if I can do it from the standalone application and if yes then how, please provide a code example if possible. We need to specify JNDI's, so tell me where we configure these JNDIs and how would my standalone program would connect to it.

[http://www.google.com/search?q=jms+publish+standalone+example|http://www.google.com/search?q=jms+publish+standalone+example]
Edited by: jtahlborn on Sep 4, 2008 9:07 PM

Similar Messages

  • URGENT: Can't connect to a MDB from a standalone application

    Hi, I hope somebody can help me. I'm trying to send messages to a MDB from a standalone client, but I have problems when looking up JMS queues and connection factories. The code is the following:
    try {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://192.168.64.173:3101/PruebaAS");
    env.put(Context.SECURITY_PRINCIPAL,"admin");
    env.put(Context.SECURITY_CREDENTIALS, "admin");
    jndiContext = new InitialContext(env);
    catch (NamingException e) {
    System.out.println("Can't create JNDI API" +
    "Context:" + e.toString());
    System.exit(1);
    * Look up connection factory and queue. If either does
    not exist, exit.
    try {
    queue = (Queue)
    jndiContext.lookup("java:comp/resource/ojms/Queues/queue2");
    catch (NamingException e) {
    System.out.println("JNDI API lookup failed." +
    e.toString());
    System.exit(1);
    When program tries to look up the queue, I get the message: "JNDI API lookup failed.javax.naming.NamingException: Disconnected: Unknown command: 7"
    What's the meaning of "unknown command:7?? I have deployed the MDB to an Oracle 9iAS 9.0.2 using enterprise manager, and create queues in an Oracle 9i 9.2.0 Server.
    Please, I need some help. Thanks in advance.

    I'm no expert, but I did get something like this working. One gotcha is that you need to have an instance of the database driver, since the Oracle queues use the database. Try something like this before you attempt the JNDI lookup:
    Class.forName("oracle.jdbc.driver.OracleDriver");
    If necessary, replace "oracle.jdbc.driver.OracleDriver" with the appropriate driver for your environment. Good luck.

  • Mail not moving messages or deleting from server until application quitted

    I have an Outlook.com email account. When I delete messages or move them in Apple Mail, the change is not reflected on the server until I quit the program completely. This isn't happening with other actions. Mail is immediately marked as read or flagged on the server for example. When I move or delete messages in Mail they actually show up in both the original location and the new location until the application is quitted.
    Anything I can do to fix this?
    OSX Mavericks 10.9.1
    Apple Mail 7.1

    Hi Thomas
    Yes...personal folders are mailboxes I've created to organize my mail. I know as a fact that this messages still are on the server even after moving them to "personal folders". anyway I think i can get around this issue by rightcliking on the account and then getting account information. I can then filter by "removed from my mac". at that stage there's an option to select those messages and "delete from server"...I think this will work...will try now.
    Thanks for your help

  • Trying to send a message from a standalone application to a Weblogic MQ

    I get the following error:
    Exception in thread "main" weblogic.jms.common.InvalidDestinationException: [JMSClientExceptions:055142]Foreign destination, queue:///IBUS.XXX.XXX.CONSUME
         at weblogic.jms.common.Destination.checkDestinationType(Destination.java:105)
         at weblogic.jms.client.JMSSession.setupJMSProducer(JMSSession.java:2513)
         at weblogic.jms.client.JMSSession.createProducer(JMSSession.java:2541)
         at weblogic.jms.client.JMSSession.createSender(JMSSession.java:2293)
         at weblogic.jms.client.WLSessionImpl.createSender(WLSessionImpl.java:937)
         at com.wellmanage.dop.test.Test.main(Test.java:34)
    Here is my code:
    package com.wellmanage.dop.test;
    import java.util.Hashtable;
    import javax.jms.*;
    import javax.naming.*;
    import org.apache.log4j.Logger;
    public class Test {
         private final static Logger sLogger = Logger.getLogger(Test.class);
    public static void main(String[] args) throws NamingException, JMSException {
         Hashtable props = new Hashtable(2);
         props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
         props.put(Context.PROVIDER_URL, "t3://stage-xxx-1.xxx.com:11274");
         Context ctx = new InitialContext(props);
         QueueConnectionFactory qConFactory =
         (QueueConnectionFactory)
         ctx.lookup("weblogic.jms.ConnectionFactory");
         Queue messageQueue = (Queue) ctx.lookup("xxxToxx1");
         QueueConnection qCon = qConFactory.createQueueConnection();
         QueueSession session = qCon.createQueueSession(
         false, /* not a transacted session */
         Session.AUTO_ACKNOWLEDGE
         QueueSender sender = session.createSender(messageQueue);
         TextMessage msg = session.createTextMessage();
         msg.setText("Hello");
         sender.send(msg);
    I guess the queue I'm trying to send to is pointing to another MQ, but why give me this error?
    Edited by: user8114377 on Oct 15, 2009 6:50 AM

    Hi,
    This is apparently the week for integration questions!
    There's no such product as "WebLogic MQ". I assume that what your trying to do is communicate with MQSeries or some other non-WebLogic vendor.
    You cannot use a WebLogic client to communicate with MQ or vice-versa. You must create an MQ client using a MQ JMS connection factory in order to communicate with an MQ destination. Similarly, you must create a WL client using a WL connection factory in order to communicate with a WL destination. This advice applies to any JMS vendor, and is quite similar to the way JDBC drivers work.
    Note that if you're communicating with MQ from a client rather than an application that's running on a WebLogic server, then there's often little purpose in using the "Foreign JMS" mapping facilities (in addition, these facilities may not work on the client for all foreign vendors -- I assume it depends on whether the foreign vendor connection factories and destinations are fully serializable/transferable between JVMs). Instead, you might want to consider using the standard JNDI and JMS APIs to communicate with MQ directly (eg, there's no need to involve WebLogic code in this case).
    For information on integration, see the WebLogic doc for [ Integrating Remote JMS Providers | http://download.oracle.com/docs/cd/E12839_01/web.1111/e13727/interop.htm#JMSPG553 ] and, if the "MQ" your refering to in this case happens to be MQSeries, also see the blog post [Integrating WebSphere MQ 6 with BEA Weblogic Server 10|http://ibswings.blogspot.com/2008/02/integrating-mq-broker-6-with-bea.html].
    Note that the majority of MQSeries integration customer apps that I've run across require "exactly-once" behavior, which means they must run on a WebLogic server (not a client) in order to participate in a WebLogic JTA transaction.
    Hope this helps,
    Tom

  • JMS message to Topic from C++

    How i can i message to a JMS Topic in an application server from C/C++ , is it possible ?,
    what sort of effort needed to implement this ....
    I would like to know about the 3rd party products which can do this ,
    looking forward for positive reply
    Renjith

    Some of the JMS providers offer C/C++ clients. You might also check into www.codemesh.com.
    _sjz.                                                                                                                                                                                                   

  • Launch webhelp Topic from a web application; problem calling another topic

    My client has a web application for which I have created a WebHelp Help Guide.
    I have RH8 v8.0.2.208 running on Windows XP SP3.
    When the user clicks a Help icon on the web app screen, it launches a corresponding Help topic. The developer has managed to launch the full Help Guide, at the required topic, by using something like "help/imrd_help.htm#edit_subject_details.htm". So far, so good: this works fine for the first topic.
    But if the user leaves the Help Guide open, switches back to the web app, works through to another page in the web app, and clicks for a new Help Topic (say, "help/imrd_help.htm#add_new_user.htm"), the old topic stays on screen: the Help Guide does not update to the required Help topic.
    Any ideas how to fix this please, so that it calls the new topic?
    Thanks.

    See Calling WebHelp on my site. This problem is described there.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • "No response from the backend application". Oracle DB

    Hi everybody,
    I have a problem with a connection to a Oracle DB. Here are the steps:
    1. I created a system in my portal to call a Oracle DB with the SAP template com.sap.portal.systems.jdbc.jdbc_system
    2. I filled the parameters and the conection test is ok.
    3. I created an iView based on com.sap.portal.applications.enterprise.iviews.Database_JDBC_iView
    4. This iView use the system I created before and is sending a simple query.
    The result is the message:
    "No response from the backend application"
    I have been reading the page
    http://help.sap.com/saphelp_nw04/helpdata/en/29/acd8403e37762ae10000000a155106/frameset.htm
    in Help.sap and i supose that my case could be 1.2 because I have mapped an user (case 1.1) and my DB is up and connection is ok (case 1.3), but...what have i to recheck in my configuration to remedy the situation??
    Thanks all.
    Guillermo.

    Hi Ramesh,
    Yes I am using the driver class but in the connection URL I wrote jdbc:sap:oracle://183.145.5.10:1527;sid=HEX
    And here my question is, have I to put user and password of the administrator of the DB in this parameter? I dind't put because I mapped later in user management.
    And the connection tests is successful.
    Thanks for the awnser.
    Guillermo.

  • Creating a user in EP using a java standalone application

    Hi,
      I am trying to create a java application to create a user in Enterprise Portal.
      I am getting the following error:
    com.sap.security.api.UMRuntimeException: Cannot lookup ManageConnectionFactory "jdbc/sapep". Possible reasons: 1) The connector in which ManagedConnectionFactory "jdbc/sapep" is defined is not deployed or not started, 2) Cannot deserialize object due to a naming exception.
    ume.db.connection_pool_type=jdbc/sapep
    ume.db.connection_pool.j2ee.xatransactions_used=false
    ume.db.connection_pool.j2ee.is_unicode=true
    ume.db.connection_pool.j2ee.oracle_native_driver_used=false: Cannot lookup ManageConnectionFactory "jdbc/sapep". Possible reasons: 1) The connector in which ManagedConnectionFactory "jdbc/sapep" is defined is not deployed or not started, 2) Cannot deserialize object due to a naming exception.
      Q1. Is it possible to create user from java standalone application.
      Q2. Pls. help to resolve the error or give any sample code if you have
      Thanks in advance.
    Regards,
      Pratik

    Hi Ravi,
    How about something like this:
    IUserMaint user = UMFactory.getUserFactory().newUser("myNewUser");
    user.setFirstName("1st Name");
    user.setLastName("2nd Name");
    user.setEmail("[email protected]");
    user.save();
    user.commit();
    IUserAccount uacc = UMFactory.getUserAccountFactory().newUserAccount("myNewUser", user.getUniqueID());
    uacc.setPassword("initial");
    uacc.setPasswordChangeRequired(false);
    uacc.save();
    uacc.commit();
    Hope this helps.
    Daniel

  • Getting and passing parameters in standalone application

    Hi,
    I am calling one java standalone application from another standalone application like the following
    Class c=Class.forName("Ivr");
    Object obj=c.newInstance();
    Ivr h=(Ivr)obj;
    h.service(request,channel);I want to pass and get parameters in both the application.Is it possible in standalone application?
    Thanks.
    Edited by: preethaayyappan on Aug 13, 2008 10:15 PM

    DrLaszloJamf wrote:
    Why didn't you do this?
    Ivr h= new Ivr();
    Indeed much of the posted code in the OP looks like a failed attempt to be "enterprisey".
    @OP Why don't you look at the Javadocs for this Ivr or whatever thing you have there?

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

  • Message not deleting from Topic after successfully dequeue

    Hi All,
    Help please..
    I need to design a process where message have to produce into a AQ JMS topic and later i have to consume the message from the same topic and publish to a Queue.
    In order to move on this i have created a sample My_Topic1 and My_Queue1 with below syntax
    Topic:-
    EXEC dbms_aqadm.create_queue_table (queue_table=>'MY_Topic1', queue_payload_type=>'sys.aq$_jms_text_message', multiple_consumers=>true );
    EXEC dbms_aqadm.create_queue(queue_name=>'MY_Topic1', queue_table=>'MY_Topic1');
    EXEC dbms_aqadm.start_queue(queue_name=>'MY_Topic1');
    Queue:-
    EXEC dbms_aqadm.create_queue_table (queue_table=>'My_Queue1', queue_payload_type=>'sys.aq$_jms_text_message', multiple_consumers=>false);
    EXEC dbms_aqadm.create_queue(queue_name=>'My_Queue1', queue_table=>'My_Queue1');
    EXEC dbms_aqadm.start_queue(queue_name=>'My_Queue1');
    Now i created Foreign server and create local and destination topic of queue.topics name and also created Data source of XAType.
    Now my bpel process getting a message(which as one element of sting type) from a web service and i am producing the same message to Topic. Once the message published to topic in a separate composite my JMS Adaptor dequeue/Consume the message from the topic and subscribe it to queue.
    The Above scenario working as expected but here what my observation on this
    1)When i dequeue message from a topic using bpel process successfully i am able to subscribe the message to queue but the message still remain in the topic i think it suppose to get of the topic once successfully dequeued.
    Even i check the subscriber topic table and one subscriber is listening to the topic.
    2)If in case any error generated at the time of subscribing to the queue the message should rollback( because i am using XA Transaction) but i think it is not happening as i can see in my topic view aq$my_topic1 MGS_STATE changed to PROCESSED.
    Can some one please let me know where i am going wrong.
    Thanks in advance.
    Regards,
    Tarak.
    Edited by: Tarak on Sep 9, 2012 8:47 PM

    The behavior should be the process consume a message from the topic and will try to do its job. If this process fail, {code]
    But in this message not there in topic even it is failed in soa process.....i am very much interested how this XA is  working that the reason i am trying all this.What to do with a failed/expired message is usually configurable, but doesn't make sense to place it in the same topic again... If the messages are failing too quickly better to adjust the max_retries and retry_delay...I agress in real senario we will move to error queue. But in that case also some how we need to read the message from queue and publish to the end system.
    I am just trying to understand the behavior and what i came to know is after all the retire fails message not going to topictable _E. But when i pass Expire time property or time to live then it is moving to error table.What do you mean? What server was restarted, the database or the soa server? Messages that still didn't reach the max retry number will still be retried...Wheni am bouncing my managed server soa_server1 i can see the invoke activity is trying to publish the message into queue... this is happens after server restart and suppose not to happen....
    But thanks alot for the inputs...
    Regards,
    Tarak.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to lookup EJBs deployed in OC4J from a standalone client application

    Hello all,
    I am trying to lookup an EJB deployed in OC4J 10.1.3 from a standalone client application using the following code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791");
    env.put(Context.SECURITY_PRINCIPAL, "jazn.com/test");
    env.put(Context.SECURITY_CREDENTIALS, "test");
    Context context = new InitialContext(env);
    Object ref = context.lookup("ejb/Dispatch");
    I get the following error:
    javax.naming.NameNotFoundException: ejb/Dispatch not found
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
    For the lookup string I've also tried:
    "java:comp/env/ejb/Dispatch" and "Dispatch"
    For the Context.PROVIDER_URL property I've also tried:
    opmn:ormi://localhost:6003:instance
    The result is always the same.
    I appreciate if someone could help me with this?
    Thanks,
    Georgi

    Georgi,
    Your question has been discussed many times on this forum. Search the forum archives for "RMIInitialContextFactory".
    The PROVIDER_URL needs to include the name of the deployed application that your EJB is part of, for example:
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791/MyApp");The lookup name has to be the value of the "ejb-name" element in your "ejb-jar.xml" descriptor file.
    Your SECURITY_PRINCIPAL value looks strange to me. Personally, I use "principals" (and not JAZN), so I modified the "application.xml" file (in the "j2ee/home/config" subdirectory) to use "principals". Look for the following comment in that file:
    <!-- Comment out the jazn element to use principals.
          When both jazn and principals are present jazn is used  -->Good Luck,
    Avi.
    Message was edited by:
    Avi Abrami

  • How to check a listener in SAP for a TIBCO topic (published message)?

    Hi,
       We are using TIBCO  as the middle ware between SAP and Documentum. For the last few days none of the IDOCs sent from TIBCO are coming into SAP.
    The concerned person from TIBCO team said that, "TIBCO is publishing messages on the topic SPC.All4One.IncomingInvoiceStart.Topic but there is no subscriber available to pick up the messages. Could you please check if SAP is a subscriber for this topic?".
    I am not sure how should we check this.
    Any pointers on this would be greatly appreciated.
    Regards
    Barada

    Hi,
    I never worked on TIBCO. But generally listner settings  will be in the middle ware. You need to check the listener settings in the middleware. SAP will be registered as listener in the middleweare.  Please check.
    Thanks and Regards,

  • How do i sort out error r6034 on my windows vista when i try to start itunes, the message box is from microsoft visual c++runtime library, it says an application has made an attempt to load the C runtime library incorrectly,

    how do i sort out error r6034 on my windows vista when i try to start itunes ???
    the message box is from microsoft visual c++runtime library, it says an application has made an attempt to load the C runtime library incorrectly, P;ease contact the application's support team for more information.

    Hey deepakmenonfrompune,
    Thanks for the question. I understand that you are experiencing issues with iTunes for Windows. The following article outlines the error message you are receiving and a potential resolution:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Some Windows customers may experience installation issues while trying to install or open iTunes 11.1.4.
    Symptoms may include:
    "The program can't start because MSVCR80.dll is missing from your computer"
    "iTunes was not installed correctly. Please reinstall iTunes. Error 7 (Windows Error 126)”
    "Runtime Error: R6034 - An application has made an attempt to load the C runtime library incorrectly"
    "Entry point not found: videoTracks@QTMovie@@QBE?AV?$Vector@V?$RefPtr@VQTTrack@@@***@@$0A@VCrashOnOverf low@@***@@XZ could not be located in the dynamic link library C:\Program Files(x86)\Common Files\Apple\Apple Application Support\WebKit.dll”
    Resolution
    Follow these steps to resolve the issue:
    Check for .dll files
    1. Go to C:\Program Files (x86)\iTunes and C:\Program Files\iTunes and look for .dll files.
    2. If you find QTMovie.DLL, or any other .dll files, move them to the desktop.
    3. Reboot your computer.
    Note: Depending on your operating system, you may only have one of the listed paths.
    Uninstall and reinstall iTunes
    1. Uninstall iTunes and all of its related components.
    2. Reboot your computer. If you can't uninstall a piece of Apple software, try using theMicrosoft Program Install and Uninstall Utility.
    3. Re-download and reinstall iTunes 11.1.4.
    Thanks,
    Matt M.

  • What should be done in certmap.conf for 2-way SSL support from a standalone Java application to an SSL enabled LDAP Server

    To support certficate based client authentication using 2-way SSL from a standalone java application which uses JNDI and JSSE1.0.2 to connect to an SSL enabled LDAP Server how do we configure the certmap.conf?Is there any additional setup required at the LDAP Server side apart from enablinf SSL with the option"Required Client Authentication" enabled.The 2 way SSL handshake goes through but the access log file (After configuring the certmap.conf for the issuer DN of the client certficate etc..)shows SSL failed to LDAP DN?But inspite of this access log error the Java client does get an SSL Connection object with which it is able to connect to the LDAP.IS the certmap.conf file being looked up by the LDAP Server at all?

    have you out.flush() and out.close() before you call connection.getInputStream()?

Maybe you are looking for

  • Adobe Acrobat 9 Pro - I/O error message when saving

    I'm trying to save an 823KB PDF file that I've worked on many times before and saved successfully in the past, but now when I try to save I get an error message that says "The docuement can not be saved. A file I/O error has occured." I really don't

  • 24" iMac Sleep disorder

    My 24" won't sleep on it's own, I think it has to do with the network connection but it's hard to isolate what is causing it. It only seems to sleep on it's own after rebooting or after I enable then disable airport. This machine on a wired LAN so I

  • I Took apart a mac mini 2007 and i cant put it back together and a part holding the cmos battery broke off

    I Took apart a mac mini 2007 and i cant put it back together and a part holding the cmos battery broke offplease i need serius help

  • Acces TC from an outside network in windows

    The TC is in my small office in town, it contains a lot of files. Can I access this files from another network at home in a Windows environment? Thanks for helping.

  • Unicode conversion BI 7.0 SP15

    Hello, We are planning Unicode conversion for all our systems. Due to large database size of BI, we want to reduce conversion time as much as possible. Our PSA tables occupy around 1 terabyte of disk space. I want to know what action possible to take