How to send a JMS message to a server ....

Hi
I want to know how to send a jms message to a Queue and that is in a different server...
How to send A message using a application client to a Message queue That is in another Machine(Server is in another machine )
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
env.put(Context.PROVIDER_URL, "iiop://127.0.0.1:3700/");
InitialContext initialContext = new InitialContext(env);
connectionFactory = (ConnectionFactory) initialContext.lookup("jms/ConnectionFactory");
queue = (Queue) initialContext.lookup("jms/Queue");
get a NameNotFoundException
Anyone have an Idea
thanks
Ishkmi
Message was edited by:
ishkmi

ok..try this..insert the ip address of the server where ur app server is
running . i understand ur client and server is running on diff machines.
ip address 127.0.0.1 is for local host. it tries to look for the server in
same system as the client.
substitue ip address of server in below line instead of 127.0..0.1
env.put(Context.PROVIDER_URL, "iiop://127.0.0.1:3700/");
best of luck ..lemme know..

Similar Messages

  • How to send a JMS message to a remote Queue?

    Hi,
    I know how to create a JMS message and send it to an MDB that listens to a topic in the same container in which the JMS is created.
    In other words, if I have the following MDB:
    @MessageDriven(mappedName = "jms/MyQueue", ...)
    public class MyMDB implements MessageListener {
    Elsewhere in my JEE app I can create a Queue like this:
    @Resource(mappedName = "jms/MyQueue")
    Queue queue;
    and use it to send a message to the MDB.
    But How can I send a message to an MDB that's deployed in another app server on another machine in the network? Both of the app servers are Glassfish.
    Thanks in advance.
    Edited by: EJP on 9/08/2011 21:49: fixed your meaningless title

    Hi,
    The first thing I would like to suggest is, we never/can't send message directly to MDB. We always send/receive message(s) to/from the destination. In case of MDB, the application server register the MDB as message listener against particular destination, and invoked the onMessage() method when message arrives on particular destination.
    If I am not wrong, what you want to achieve is asynchronous communication between two applications deployed in two different machine. In your case, you want your one application works as message producer and other act as an message consumer, and both are deployed in different machine.
    In this situations, you only need to configure the JMS administration object, connection factories and destinations, on one Application server and configure other application server to use those configuration using JMS resource adapter. you can well achieve this by configuring the JMS Resource Adapter. you need to check the Glassfish documentation.
    If you don't want to break the JMS specification, always communicate with Messaging Provider through Resource Adapter.
    I hope this helps.

  • Sending a jms message from one server to another in a cluster fails..

    Hi,
              My platform is wl6.1 sp7 two servers in a cluster...
              I have problems sending jms messages from one server to the other. When sending to a destination on the same server it works fine, but sending to the other server do not work. I get no exceptions when I send the message. The "Monitor all Active JMS Destinations..."->"Messages Received" column increase number of received messages for the remote server. But the onMessage method in the bean is not called(I am logging all calls to a file...)
              Any suggestions?
              And..
              My understanding is that the JNDINameReplicated default value is set to true? But when I don't set this value to true the jndi name is not replicated too the other server.
              (The state for both servers are Running in the admin console and listed servers in the cluster is 2....
              Server names:
              * bluej, biztalk-lab
              JMS connection factory:
              * xlink.jms.factory.commerceFactory, deplyed on both servers and for the cluster
              Destinations:
              * xlink.jms.service.report.biztalk-lab.Report for the biztalk-lab server active on 'biztalk-labJMSServer' JMS-server
              * xlink.jms.service.report.bluej.Report for the bluej server active on 'bluejJMSServer' JMS-server)
              ~b

    Deployed to the bluej server:
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>xlink.jms.service.report.bluej.Report</ejb-name>
              <message-driven-descriptor>
              <pool>
              <max-beans-in-free-pool>3</max-beans-in-free-pool>
              <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
              </pool>
              <destination-jndi-name>xlink.jms.service.report.bluej.Report</destination-jndi-name>
              </message-driven-descriptor>
              <jndi-name>xlink.jms.service.report.bluej.Report</jndi-name>
              </weblogic-enterprise-bean>
              <weblogic-enterprise-bean>
              <ejb-name>xlink.jms.service.report.bluej.Report</ejb-name>
              <message-driven-descriptor>
              <destination-jndi-name>xlink.jms.service.report.bluej.Report</destination-jndi-name>
              </message-driven-descriptor>
              <jndi-name>xlink.jms.service.report.bluej.Report</jndi-name>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              <ejb-jar>
              <enterprise-beans>
              <message-driven>
              <ejb-name>xlink.jms.service.report.bluej.Report</ejb-name>
              <ejb-class>no.xlink.server.service.report.engine.jms.ReportBean</ejb-class>
              <transaction-type>Bean</transaction-type>
              <message-driven-destination>
              <destination-type>javax.jms.Queue</destination-type>
              </message-driven-destination>
              </message-driven>
              </enterprise-beans>
              </ejb-jar>
              Deployed to the biztalk-lab server:
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>xlink.jms.service.report.biztalk-lab.Report</ejb-name>
              <message-driven-descriptor>
              <pool>
              <max-beans-in-free-pool>3</max-beans-in-free-pool>
              <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
              </pool>
              <destination-jndi-name>xlink.jms.service.report.biztalk-lab.Report</destination-jndi-name>
              </message-driven-descriptor>
              <jndi-name>xlink.jms.service.report.biztalk-lab.Report</jndi-name>
              </weblogic-enterprise-bean>
              <weblogic-enterprise-bean>
              <ejb-name>xlink.jms.service.report.biztalk-lab.Report</ejb-name>
              <message-driven-descriptor>
              <destination-jndi-name>xlink.jms.service.report.biztalk-lab.Report</destination-jndi-name>
              </message-driven-descriptor>
              <jndi-name>xlink.jms.service.report.biztalk-lab.Report</jndi-name>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              <ejb-jar>
              <enterprise-beans>
              <message-driven>
              <ejb-name>xlink.jms.service.report.biztalk-lab.Report</ejb-name>
              <ejb-class>no.xlink.server.service.report.engine.jms.ReportBean</ejb-class>
              <transaction-type>Bean</transaction-type>
              <message-driven-destination>
              <destination-type>javax.jms.Queue</destination-type>
              </message-driven-destination>
              </message-driven>
              </enterprise-beans>
              </ejb-jar>

  • Sending a JMS message inside a PostPersist entity listener method

    Hi to all,
    I have an entity called "Batch" that I want to persist. After the persist, I want to send a JMS message to notify batch insertion to the other clients.
    So I created the "Batch" entity as following :
    @Entity
    @EntityListeners({BatchServiceBean.class})
    @Table(name = "batch")The "BatchServiceBean" is a session bean which persists the batch and sends the JMS notification message.
    Inside this class we have the following method :
    @PostPersist
        private void sendInsertMessage(Batch insertedBatch) throws JMSException {
            AddBatchMessage message = new AddBatchMessage();
            message.setBatch(insertedBatch);
            try {
                messageSenderServiceBean.sendRefreshMessage(message);
            } catch (Exception oups) {
                oups.printStackTrace();
        }In the previous code, I recuperate the inserted batch and the "messageSenderServiceBean" facade to send a refresh message.
    My problem is that I can get the inserted batch, but the object "messageSenderServiceBean" is null knowing that I have the following annotation to get the "messageSenderServiceBean" facade.
    @EJB
        private MessageSenderServiceLocal                   messageSenderServiceBean;Whyhe object "messageSenderServiceBean" is null ??
    Can any one help me ??
    Thanks in advance.

    Hello,
    Injection only occurs on server managed objects, not JPA managed entities or other java objects such as the listeners registered with JPA. So your Listener class will need to look up the server objects or other resources directly from the context rather than rely on them being injected. I don't have any good examples handy, but similar to how you would look up an ejb/datasource etc before injection.
    Best Regards,
    Chris

  • How to send a SOAP message with attachments

    How to send a SOAP message with attachments thru webservice using axis-1_3 can any one sujjest.............................

    Please refer
    http://www.javaworld.com/javaworld/jw-09-2003/jw-0912-webservices.html
    http://xml.sys-con.com/read/40315.htm

  • How to send a text message to a group of people and save the list for next time?

    how to send a text message to a group of people and save the list for next time from an iphone 4s?

    Hey there ipremacha,
    It sounds like you need to enable Text Message Forwarding on your iPhone for your iPad to send MMS/SMS messages through your phone.
    Connect your iPhone, iPad, iPod touch, and Mac using Continuity
    Go to Messages > Text Message Forwarding, and enable the device(s) you would like to forward messages to.
    Your Mac, iPad, or iPod touch will display a code. Enter this code on your iPhone to verify the SMS feature.
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • MDB sending a JMS message to a queue (WLS 8.1.4)

    We are trying to implement a MDB to send a JMS message to a dynamically created JMS queue. Is this possible? We have found documentation stating the JMS Queue destination needs to be in the deployment descriptor, but in our case it changes so this is not an option. Any help would be appreciated.

    Sorry I didn't address the answers more clearly. You were correct on the answers except with:
              Switch from using a resource-reference to a direct reference for a send? Answer: No. We are only trying a direct send, not utilizing the resource-reference.
              We are already using "false" for the connection.create[Queue]Session code.
              Should we be trying something else because of transactional behavior of not utilizing the resource-reference for the send as you thought?
              We have tried the queue as XA and non-XA and neither work.

  • How to send SMS ( Short Message Service ) from java code

    Hi
    How to send SMS ( Short Message Service ) from java code.
    Thanks
    Gaurav

    Do you need to receive SMS? If you need to receive SMS, you will need to host your own GSM device or modem so that people can send you SMS.
    If not, you can just use internet SMS gateways like clickatell as mentioned above will do the work, and post to them by HTTP, XML or email. The cost is about 6-8 cents per SMS. There are cheaper services, but not always reliable. If you need to host your own GSM device, you can use software like http://www.kannel.org (GPL Open Source) or http://www.visualgsm.com. Alternatively, you may obtain a shortcode from your Telco - but these come with monthly subscription of maybe one or two hundreds.
    Regards,
    Joshua
    <SMS Gateway>@Expert

  • TS3276 I have an old version, 10.5. A few days ago, my Inbox stopped showing new messages received, although they are coming in and show under Messages on Server.  How can I get the messages on the server to go to my Inbox so I can access them?

    I have an old version, 10.5. A few days ago, my Inbox stopped showing new messages received, although they are coming in and show under Messages on Server.  How can I get the messages on the server to go to my Inbox so I can access them?

    Make sure Mail is selected in System Preferences > iCloud

  • Can't send mail, get message: the smtp server rejected the password. I tried lock and unlock keychain. I tried unlock captcha. Gmail works okay, it is Mail that does not. Help!! :(

    Can't send mail, get message: the smtp server rejected the password. I tried lock and unlock keychain. I tried unlock captcha. Gmail works okay, it is Mail that does not. Help!!

    Hi
    You need to check with your ISP whether or not the send mail server (SMTP) requires a password.  Some do, but many do not.  When you know the correct password to send mail, then you need to tell Mail as follows:
    Mail menu > Preferences > Accounts > Select the account
    Click on the Outgoing Mail Server (SMTP) combo box, and select Edit SMTP Server List...
    In the Account Information tab put the server name
    In the Advanced Tab, set up the authentication information from your ISP.
    Good luck
    Bob

  • Workshop - How to send a SOAP message directly into a JMS qeue......

    Hi All,
    I need to create a web service in Workshop that sends the received SOAP message
    body to a queue without mapping it to Java object i.e. the JMS message type is
    text message and not Object message. I would very much appreciated if anyone out
    there who can advise me on this.
    Thanks in advance.
    Regards,
    Boon Keong

    Hi,
    Are you open for other solutions besides Workshop?
    WebLogic Server provides another Web Service implementation outside of Workshop.
    This web service implentation has a concept of handlers which intercept SOAP
    messages. It is a way to gain access to the SOAP message. You could then route
    the SOAP message to a JMS queue from the handler.
    These URLs will help:
    http://e-docs.bea.com/wls/docs70/webserv/index.html
    http://e-docs.bea.com/wls/docs70/webserv/design.html#1053805
    Also, there is an examples in the WebLogic Server 7.0 installation:
    %BEA_HOME%\samples\server\src\examples\webservices\handler
    hope this helps,
    pat
    "Boon Keong" <[email protected]> wrote:
    >
    Hi All,
    I need to create a web service in Workshop that sends the received SOAP
    message
    body to a queue without mapping it to Java object i.e. the JMS message
    type is
    text message and not Object message. I would very much appreciated if
    anyone out
    there who can advise me on this.
    Thanks in advance.
    Regards,
    Boon Keong

  • How to send a text message from my desktop computer ?

    How can I send a text message from my desktop computer using Firefox ?

    There are many free web-to-phone text services, such as http://textem.net/
    If you intend to do a lot of this, it may be best to have some IM services that can communicate with cellphones (I use AIM).

  • How to send a text message instead of imessage on Mac and Ipad iOs 8.1?

    My iphone 6 Plus, ipad mini 2 and MBA on OSX Yosemite are all linked together under the same wireless network. However when i send a message on my Mac to my friend who is using an iphone, default sending is via imessage. How can i choose to send a text message instead of imessage? WHy? because sometimes my friend is not online. So i need to send a text message that my messages are received real time.

    Hey there ipremacha,
    It sounds like you need to enable Text Message Forwarding on your iPhone for your iPad to send MMS/SMS messages through your phone.
    Connect your iPhone, iPad, iPod touch, and Mac using Continuity
    Go to Messages > Text Message Forwarding, and enable the device(s) you would like to forward messages to.
    Your Mac, iPad, or iPod touch will display a code. Enter this code on your iPhone to verify the SMS feature.
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • Sending/Receiving JMS message to WMQ from Automated Task

    Hi All,
    I am new to OSM and working on a POC for the implementation of OSM in our company. We have WebSphere MQ for messaging and want to use same for OSM implementation. We don't want to create bridges, foreign server etc configuration in weblogic, rather just connect with MQ objects over JNDI (as supported) from OSM automated task. Having said that, we have following two scenarios:
    1- JMS message is received at OSM
    2- JMS message initiated from OSM (automated task)
    Now our requirement is to create a sort of JMS inbound gateway for first scenario i.e. reading a message from a Queue and CreateOrder and then reply back to caller using JMSReplyTo header.
    Second as JNDI support is available for automated task, can we send JMS message using direct JNDI look up for MQ JNDI objects i.e. using .bindings file (JNDI URL for MQ objects).
    Thanks

    Hi All,
    I am new to OSM and working on a POC for the implementation of OSM in our company. We have WebSphere MQ for messaging and want to use same for OSM implementation. We don't want to create bridges, foreign server etc configuration in weblogic, rather just connect with MQ objects over JNDI (as supported) from OSM automated task. Having said that, we have following two scenarios:
    1- JMS message is received at OSM
    2- JMS message initiated from OSM (automated task)
    Now our requirement is to create a sort of JMS inbound gateway for first scenario i.e. reading a message from a Queue and CreateOrder and then reply back to caller using JMSReplyTo header.
    Second as JNDI support is available for automated task, can we send JMS message using direct JNDI look up for MQ JNDI objects i.e. using .bindings file (JNDI URL for MQ objects).
    Thanks

  • How to send wap push messages in java

    hi,
    i need to send wap push messages through smsc in java,
    can any one give the idea about this,how can i start,
    where can i get the jar file according this,
    (either using smpp or http)
    thanks and regards,
    Karuna.

    Uhm... I'm pretty sure you need a special server for that.

Maybe you are looking for

  • Automatic derivation of Profit centers

    hi all is there a possiblity that profit center can be derived based on the customer? rquirement is .. profit centers are divided geographically, they have only one revenue account . and based on the customer we can tell to which profit center that r

  • Streaming wifi and bluetooth at the same time is it possible in air play from iPod

    Streaming bluetooth and wifi at the same. Is it possible?

  • Boot Camp - removing a partition

    Hi, I created a parition in boot camp and later removed it. When I went to delete the parition boot camp said it had been deleted but the 10 gigs of space I had allocated to the windows parition was not allocated back to the Mac partition and the win

  • Populating the email address (SMTP_ADDR) in Vendor Master using PRAA

    Hi, experts! We would like to start using transaction PRAA (program RPRAPA00) to create and update Vendor Master Data based on HR employee data.  As part of this process, we would like to populate the "E-Mail" field with data from infotype 105.  (We

  • Badi to create PO and PR in backend

    Hi experts I am in SRM 5.0 classic scenario I need use a badi to determine PO or PR in backend because I need to choose betwen it for other fields not only for product category, I am triing to use badi BBP_CREATE_BE_PO_NEW and BBP_CREATE_BE_RS_NEW bu