JMS in RAD 6

I have created a JMS client (programatically) in RAD V6 by using all the properties HOST,Port,queue connection factory.
INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory
Server is in different machine.
I am able to createqueque connection and also session , input and output queues ,When i try to send the message I get error message:
[1/24/07 14:20:44:045 EST] 0000002e WASLogger E CLASSNAME METHODNAME an
internal error has occurred. Please contact your system administrator.
Detail: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
[1/24/07 14:20:44:061 EST] 0000002e SystemOut O Exception in method
QueueSend.sendMessage()MQJMS2007: failed to send message to MQ queue
[1/24/07 14:20:44:061 EST] 0000002e SystemErr R javax.jms.JMSException:
MQJMS2007: failed to send message to MQ queue
at
com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:553)
The same code (with same configuration) works fine in WSAD 4.
Do i need to do any configuration in RAD V6?
Can u someone help on this?

Check the configurations of the JMS Destinations in
both of the cases.
Your JMS destination "Time to Live" value may be
overriding the value passed as a parameter.
So check and confirm that values on both of the
servers are same.I should've mentioned that I checked that the "time to live" override values are set to the default (-1) value. A value of -1 should mean that the destination is not overriding any programmatically specified value, right? Thanks for the help, though.

Similar Messages

  • JMS receive in JTA doesn't return message

    Hi
    I am using Websphere Application server 6.1 (the one provided with RAD 7.0.0)and WebSphere MQ 6.0 as JMS provider.
    I have a problem receiving message from queue when JTA transaction is active.
    I configured Connection Factory as following:
    Scope cells:ejbhostname:nodes:ejb:servers:server1
    Name MQQueueConnectionFactory
    JNDI Name foo/bar
    Description empty
    Category empty
    Component-managed Authentication Alias none
    Container-managed Authentication Alias none
    Mapping-Configuration Alias DefaultPrincipalMapping
    Queue Manager QMGR
    Host 192.168.2.100
    Port 1415
    Channel CLIENT_CHANNEL
    Transport Type CLIENT
    Model Queue Definition empty
    Client ID empty
    CCSID empty
    Message Retention enabled
    XA Enabled enabled.
    Everything seems to work fine but message reception time-out occurs when i try to synchronous receive message from queue.
    Below is a code of my stateless session EJB method.
    public void receiveMessage()
        throws NamingException,
        JMSException{
              Connection connection = null;
             Session session = null;
             MessageConsumer consumer = null;
             try {
                 logger.log(myLevel, "Getting Initial Context");
                 InitialContext context = new InitialContext();
                 ConnectionFactory factory = (ConnectionFactory) context.lookup("java:comp/env/jms/JMSExampleConnectionFactoryRef");           
                 Destination dest = (Destination) context.lookup("java:comp/env/jms/JMSExampleQueue2Ref");           
                 connection = factory.createConnection();         
                 session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);         
                 consumer = session.createConsumer(dest);
                 connection.start();
                 Message msg = consumer.receive(1000);
                 if(msg == null){
                      System.out.println(":(");
                 }else{
                      System.out.println("got it " + msg);
             catch (NamingException e) {
                 mySessionCtx.setRollbackOnly();
                 throw e;
             catch (JMSException e) {
                 logger.log(myLevel, e.getLocalizedMessage(), e);
                 mySessionCtx.setRollbackOnly();
                 Exception linked = e.getLinkedException();
                 mySessionCtx.setRollbackOnly();
                 throw e;
             finally {          
                 consumer.close();          
                 session.close();         
                 connection.close();
        }The weird thing is that it only happens (time-out obviously) if i
    i have "XA enabled" checkbox checked (in connection factory settings)AND if i run the method presented above in JTA transaction (setting transaction type for a Ejb to container or set it to Bean and manually start JTA transaction)
    If i do not have "XA enabled" checked the code above work great even inside JTA transaction.
    I tried creating transacted JMS session and not transacted but as far as i know it is ignored in JTA.
    Can someone explain me what is going on ??
    Is it impossible to synchronous receive message in JTA transaction while working with XA connection factory??
    Is it Websphere MQ problem, or sth else ??

    Hi
    I am using Websphere Application server 6.1 (the one provided with RAD 7.0.0)and WebSphere MQ 6.0 as JMS provider.
    I have a problem receiving message from queue when JTA transaction is active.
    I configured Connection Factory as following:
    Scope cells:ejbhostname:nodes:ejb:servers:server1
    Name MQQueueConnectionFactory
    JNDI Name foo/bar
    Description empty
    Category empty
    Component-managed Authentication Alias none
    Container-managed Authentication Alias none
    Mapping-Configuration Alias DefaultPrincipalMapping
    Queue Manager QMGR
    Host 192.168.2.100
    Port 1415
    Channel CLIENT_CHANNEL
    Transport Type CLIENT
    Model Queue Definition empty
    Client ID empty
    CCSID empty
    Message Retention enabled
    XA Enabled enabled.
    Everything seems to work fine but message reception time-out occurs when i try to synchronous receive message from queue.
    Below is a code of my stateless session EJB method.
    public void receiveMessage()
        throws NamingException,
        JMSException{
              Connection connection = null;
             Session session = null;
             MessageConsumer consumer = null;
             try {
                 logger.log(myLevel, "Getting Initial Context");
                 InitialContext context = new InitialContext();
                 ConnectionFactory factory = (ConnectionFactory) context.lookup("java:comp/env/jms/JMSExampleConnectionFactoryRef");           
                 Destination dest = (Destination) context.lookup("java:comp/env/jms/JMSExampleQueue2Ref");           
                 connection = factory.createConnection();         
                 session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);         
                 consumer = session.createConsumer(dest);
                 connection.start();
                 Message msg = consumer.receive(1000);
                 if(msg == null){
                      System.out.println(":(");
                 }else{
                      System.out.println("got it " + msg);
             catch (NamingException e) {
                 mySessionCtx.setRollbackOnly();
                 throw e;
             catch (JMSException e) {
                 logger.log(myLevel, e.getLocalizedMessage(), e);
                 mySessionCtx.setRollbackOnly();
                 Exception linked = e.getLinkedException();
                 mySessionCtx.setRollbackOnly();
                 throw e;
             finally {          
                 consumer.close();          
                 session.close();         
                 connection.close();
        }The weird thing is that it only happens (time-out obviously) if i
    i have "XA enabled" checkbox checked (in connection factory settings)AND if i run the method presented above in JTA transaction (setting transaction type for a Ejb to container or set it to Bean and manually start JTA transaction)
    If i do not have "XA enabled" checked the code above work great even inside JTA transaction.
    I tried creating transacted JMS session and not transacted but as far as i know it is ignored in JTA.
    Can someone explain me what is going on ??
    Is it impossible to synchronous receive message in JTA transaction while working with XA connection factory??
    Is it Websphere MQ problem, or sth else ??

  • Setting the JMS Header from Payload

    Hi Experts,
    My requirement is to send the payment data coming from ECC to non sap system.Sender adapter is proxy and receiver is JMS.ECC will be sending the filename in one field and payload content as a string in another field.PI has to set the filename coming from ECC in JMS header property.What configuration changes should i need to make in JMS adapter to achieve it?
    Converting the XML to string is possible in PI.But my question is converting the string XML data into XML fields is possible in SAP PI?If so how to do that?
    Please provide your suggestion.
    Regards,
    Karthiga

    Hi Karthiga,
    The UDF is there in blog
    DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");
                DynamicConfigurationKey dynamicconfigurationkey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS", "DCJMSMessageProperty0");
                String s = dynamicconfiguration.get(dynamicconfigurationkey);
                CorrID.append(s);
    Please let me know if you have any issue.
    regards,
    Harish

  • How to configure an Alert message if communicationChannel(JMS) stops

    All,
    Is there a way how to configure an alert when the communication channel stops.
    <b>Scenario:</b>
    In the path Runtime workbench->Component Monitoring->Adapter Engine->Communication Channel monitoring, if we see that a communication channel has stopped(RED traffic light as Status), then can we trigger an alert notification for same.
    Currently we have alrerts configured for any message/s failure in the JMS Adapter Framework. So can we trigger simmilar alerts when a comm channel stops(for whatever reason).
    Thanks in advance
    RK

    Hi Sreeram,
    Thanks for the quick reply.
    We have a scenario where we activate individual channels at a given time. So in this case, Adapter will always be in RED as all queues are never running in our scenario.
    So we need an ALERT to be triggered for individual comm channels. Is theer any way that you can think of ?
    Thanks and regards
    RK

  • JDBC connection pool failures when used by JMS stores

              We are using WebLogic 6.1 sp2. We defined a separate connection pool for use by
              a JMS Store.
              <JDBCConnectionPool Name="sybaseJMSPool"
              Targets="cluster00"
              InitialCapacity="2"
              MaxCapacity="10"
              DriverName="com.sybase.jdbc2.jdbc.SybDriver"
              Properties="[email protected]@;[email protected]@;charset=utf8"
              URL="jdbc:sybase:Tds:@jms.db.host@/@jms.db.name@"/>
              (note that the @xxx@ string are replaced by actual values).
              We are using Sybase Jconnect 5.5 to a Sybase ASE 12.5 database.
              We deployed this configuration on a number of environments (testing, staging,
              ..). The actual hardware and network configuration is different for the different
              system, but the WebLogic domain stays the same regarding this issue.
              On the test system we frequently get the following exceptions:
              <Aug 13, 2002 1:56:04 PM CEST> <Alert> <JMS> <www00-test> <node00>
              <ExecuteThread: '6' for queue: 'JMS.TimerClientPool'> <> <> <040048>
              <JMSServer "JMSServer00", store failure while writing message for topic
              OrderChangeTopic, java.io.IOException: JMS JDBC store, connection pool =
              <sybaseJMSPool>, prefix = <JMS00>: write failed
              java.sql.SQLException: JZ006: Caught IOException:
              com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already
              closed.
              at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead
              (ErrorMessage.java:715)
              at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3124)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
              at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
              at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1672)
              at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate
              (SybStatement.java:1625)
              at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate
              (SybPreparedStatement.java:91)
              at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate
              (P6LogPreparedStatement.java:179)
              at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1246)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              .>
              java.io.IOException: JMS JDBC store, connection pool = <sybaseJMSPool>, prefix
              = <JMS00>: write failed
              java.sql.SQLException: JZ006: Caught IOException:
              com.sybase.jdbc2.jdbc.SybConnectionDeadException: JZ0C0: Connection is already
              closed.
              at com.sybase.jdbc2.jdbc.ErrorMessage.raiseErrorCheckDead
              (ErrorMessage.java:715)
              at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:3124)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1412)
              at com.sybase.jdbc2.tds.Tds.cancel(Tds.java:1341)
              at com.sybase.jdbc2.jdbc.SybStatement.doCancel(SybStatement.java:564)
              at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1672)
              at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate
              (SybStatement.java:1625)
              at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate
              (SybPreparedStatement.java:91)
              at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate
              (P6LogPreparedStatement.java:179)
              at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1246)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              at weblogic.jms.store.JDBCIOStream.throwIOException
              (JDBCIOStream.java:1213)
              at weblogic.jms.store.JDBCIOStream.write(JDBCIOStream.java:1256)
              at weblogic.jms.store.StoreRequest.doTheIO(StoreRequest.java:250)
              at weblogic.jms.store.JMSStore.execute(JMSStore.java:182)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              Before that this message appeared:
              <Aug 13, 2002 11:31:16 AM CEST> <Error> <ConnectionManager> <www00-test>
              <node00> <ExecuteThread: '26' for queue: 'default'> <> <> <000000>
              <Closing: 'weblogic.rjvm.t3.T3JVMConnection@795af6' because of: 'Server
              received a message over an uninitialized connection: 'JVMMessage from: 'null'
              to: '-4555218188801970213S:192.168.13.1:[7001,7001,7002,7002,7001,7002,-
              1]:ADIS:node00' cmd: 'CMD_REQUEST', QOS: '101', responseId: '1',
              invokableId: '287', flags: 'JVMIDs Not Sent, TX Context Not Sent', abbrev
              offset: '34'''>
              This problem did not occur on another system which was used during a 2 day stress
              testing session.
              It seems that the problem occurs after a period in which no user request where
              made. The user requests trigger EJB's that start sending JMS messages.
              When the problem occurs, the JMS messaging systems seems to lock up as no messages
              are received anymore by the different listeners (MDBs).
              Undeploying and redeploying the JBDC connection pool solves the problem. This
              solution is unacceptable in case of a production system.
              A similarly defined connection pool, which is used by the EJBs to make database
              connection, does not manifest this problem.
              <JDBCConnectionPool Name="sybasePool"
              Targets="cluster00"
              InitialCapacity="10"
              CapacityIncrement="5"
              MaxCapacity="50"
              PreparedStatementCacheSize="150"
              DriverName="com.sybase.jdbc2.jdbc.SybDriver"
              Properties="[email protected]@;[email protected]@;JCONNECT_VERSION=6;charset=utf8"
              URL="jdbc:sybase:Tds:@db.host@/@db.name@"/>
              The JDBC connection pool is used as follows by the JDBC store
              <JMSJDBCStore ConnectionPool="sybaseJMSPool" Name="JDBCStore00" PrefixName="JMS00"/>
              <JMSServer Name="JMSServer00" Store="JDBCStore00" Targets="node00">
              <JMSTopic JNDIName="ADIS.JMSError" JNDINameReplicated="false" Name="ErrorTopic"/>
              <JMSTopic JNDIName="ADIS.Status"
              Name="StatusTopic" RedeliveryDelayOverride="300000"/>
              <JMSTopic JNDIName="ADIS.OrderChange" JNDINameReplicated="false"
              Name="OrderChangeTopic" RedeliveryLimit="3"/>
              </JMSServer>
              Turning on the "Test Reserved Connection" with a appropriate test table does not
              help.
              Some sources on the internet tell us that JZ0C0 errors in the Jconnect driver
              can be related to network problems. Nevertheless the connection pool should be
              able to cope with this.
              Can you provide any solution for this ? Or give us hints what can cause the problem
              

    Zhenhao Qi wrote:
    thanks! Joe.
    The SQL statement itself can no longer be simplified, the long excuation time is due to the database size and complicated Select criteria. I can easily reproduce the problem by using this SQL. I tried "BEA's Oracle driver (Type 4): Version 8.1.7,9.0.1,9.2.0". the question can be dissect into 2 pieces:
    1) why the jdbc connection (using oracle.jdbc.OracleDriver) won't return anything if the SQL execution time > 5min, that is probably the Oracle's problem
    2) why the occupied connection pool won't release even I set "Statementtimeout=600", this is Weblogic's problem.
    ZhenhaoHi. Yes, (1) is oracle's problem. (2) may also be. The JDBC spec has very few
    allowances for one thread to interrupt a second thread's JDBC call. If we
    transmit your timeout request by calling setQueryTimeout() on the oracle
    statement, and if you have a weblogic-controlled transaction we call
    Statement.cancel() on any ongoing statement, we end up relying on whether
    the Oracle driver implements and responds to those calls.
    Are you doing weblogic-controlled transactions? Are you/can you
    call Statement.setQueryTimeout() on your statements, or are these
    generated JDBC queries?
    If you can duplicate the problem using the weblogic.jdbc.oracle.OracleDriver
    we have some other debug avenues. This would be good even if you really
    want to use the thin driver, because we will do the same JDBC calls to
    either driver, and the debug would prove (if) we set up a query timeout
    and if we call cancel(). If we do, then we can know that it is the Oracle
    driver failing in these regards.
    Joe

  • Not all JMS consumers are created equal

    Hi,
    I am experiencing a very strange problem with weblogic 9.2 JMS.
    I am using JMS as flow control in an application that allows our users to import data into our application.
    the data to be imported varies in size from 100's of records to many hundred thousands of records.
    JMS feed a MDB that takes the request and imports the data. The DD allows to 10 concurrent MDB's to service the requests.
    The problem arises when the 11'th and 12th request comes in. Instead of waiting for the first availibe MDB to service the requests they seems to be put into the queue of the MDB that was started first. If this MDB is in the process of importing a very large file request 11 and 12 will sit and wait until the large one is done even though there are other MDB's that are idle.
    I am hoping that there is an easy fix for this, but for the life of me, I cant seem to find it.
    The DD for the MDB looks as follows
    <weblogic-enterprise-bean>
    <ejb-name>RuleEngineMDB</ejb-name>
    <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>10</max-beans-in-free-pool>
    <initial-beans-in-free-pool>10</initial-beans-in-free-pool>
    </pool>
    <destination-jndi-name>com.company.product.RuleEngineRequestQueue</destination-jndi-name>
    </message-driven-descriptor>
    </weblogic-enterprise-bean>
    the queue is defined in Weblog as
    <queue name="RuleEngineReque
    stQueue">
    <sub-deployment-name>MyJMSServer</sub-deployment-name>
    <delivery-params-overrides>
    <delivery-mode>Non-Persistent</delivery-mode>
    </delivery-params-overrides>
    <message-logging-params>
    <message-logging-enabled>true</message-logging-enabled>
    <message-logging-format>%header%,%properties%,%body%</message-logging-format>
    </message-logging-params>
    <jndi-name>com.company.product.RuleEngineRequestQueue</jndi-name>
    </queue>
    regards,
    Lars Hansson
    CTO Compost Marketing AB.

    A little more detail: You will need to configure and target a custom conection factory with "message maximum" set to 1 (the default is 10), and then modify the MDB descriptor to reference the JNDI name of the custom connection factory. The connection factory should be targeted to the entire cluster, and must be targeted to the same cluster that hosts distributed queue. If the MDB is transactional, ensure that that the custom connection factory is also "xa enabled".
    Edited by: TomB on Mar 2, 2010 2:44 PM

  • JMS connection from SAP PI to Oracle AQ via JNDI...

    Hi,
    I am currently working on a project that requires connections between PI and Oracle AQ. It was advised that we shoule use PI JMS adpater with JNDI driver. However, it seems that not many people have tried this approach.
    Has anyone had similar solutions in production ? How repliable it is ?
    Your help is very much appreciated
    Tim

    Hi Tim,
    We implemented a similar scenario and now itu2019s still working.
    You have to configure a JNDI connection, but not directly with the Oracle AQ. The Oracle AQ are just queues, and you need a JMS provider in order to establish the connection with these queues. The solution we implemented was:
    1. Configure one OC4J server as JMS provider for the Oracle AQ queues.
    2. Configure JMS communication channels in SAP PI to establish the connection with the OC4J server.
    Maybe you can use a different and newer JMS provider, as BEA Weblogic or SAP WAS (I donu2019t know if itu2019s possible).
    We implement the scenario in SAP PI 7.0, and with this version we had a problem: When the communication between JMS adapter and the queues was broken (the DDBB fell down for example), the channel failed, itu2019s normal. But when the DDBB was already running the channel stayed in an error state, and we had to restart the channel manually. The response of SAP to this issue was that the channel behavior was correct because the connection failed.
    But this problem occurred rarely, maybe once a month. The solution is very reliable, we exchange a lot of message with this solution, and support messages of any size with an excellent performance.
    Best Regards,
    Roberto

  • How do I setup Forms not to ask RAD username/password when opening a form

    Good day
    I have setup oid and sso and they work I can sign on to database with an oid user using sqlplus.
    If I set SsoDynamicResourceCreate=true and enter the user id and password in at the popup it works correct and won’t even ask it again
    What I want to know how can set portal to use a RAD/DAS without prompting for a username password.
    We need to do this for all +/- 30000 users and if so how do we do it pragmatically.
    I think because I don’t have much APPS experience I basically don’t know where this must be set globally
    APPS is version 10.1.2
    Regards
    Cliff
    Message was edited by:
    cliffnel

    Got solution in metalink note 262686.1
    Goto <infrastructure :port>/oiddas
    Click Configuration Tab
    Click Preference Tab
    Create Default RAD for database

  • SSO and Form 10g, Setting RAD of OID for DB users identified externally

    Please Help!
    Current environment:
    - All users were created with identified externally in Database (OPS$)
    - SSO was setup correctly according to OID admin guide Ch 43 and SSO admin guide ch 8 for App10g. (user login orasso without seeing basic auth/sso login form)
    - DB parameters:
    remote_os_authent=TRUE
    os_authent_prefix=' '
    issues:
    - set ssoDynamicResourceCreate = true
    When user hit the form link, i.e. http://host:port/forms90/f90servlet?config=test&form=appwelcome
    it redirects to http://host:7777/oiddas/ui/oracle/ldap/das/mypage/AppCreateResourceInfo?...
    where it shows Resource Name TEST and prompts username/password/database
    when user inputs window logon /password/database value (same as in form6i)
    it returns ORA-01017: invalid username/password; logon denied.
    - set ssoDynamicResourceCreate = false
    manually set RAD for the end user (I am not sure if I am doing this correctly):
    Name = test
    TYPE = oracledb
    username = (blank)
    password = (blank)
    datebase = prod
    When enduser hits the form link, it returns ORA-01017.... same errors.
    Any ideas how to trouble shoot and configure RAD for users with OPS$ auth?
    thank you in advance!
    Kan

    Thank you for your input!
    This is how our current production is setup that users use os authent (OPS$) to access forms/reports 6i. I'm just trying to migrate it to app10g environment.
    I did configure SSO with WNA, it works fine. Any users can access NON-DB connected forms/reports. Only when forms/reports require DB conn, users who
    have db password can access them with one click. But users identified externally will keep seeing Oracle Logon and Ora-01017 after authent into MidTier.
    Setup RAI with one real db user account is not ideal since there are 1000+ OS authent users who have different database roles. Turn off the OPS$ and setup dummy password for 1000+ users may be the last solution.
    v/r
    Kan

  • Using socket and JMS protocol in the same logic for OSB

    Hi frnds,
    In my organization...the only communication protocol used is "socket" protocol. However, I want to use JMS protocol to process incoming messages. Can somebody help me figuring out how to go about it.
    Using some nice OSB blogs, I am able to create the JMS connection factory and JMS queues in weblogic. And that works fine when I select the communication protocol as JMS while creating the BS and PS.
    What should be my message flow when the communication protocol used is "socket" for both BS and PS.
    salil

    Hi,
    Make the BS as JMS and the PS as socket, in the PS's flow do a route for the BS... Then if an external call is made to the PS via socket, it will send a messages to a JMS queue...
    Hope this helps...
    Cheers,
    Vlad

  • Difference Between JMS and RMI

    Difference Between JMS and RMI in J2EE Technologies

    STFW
    JMS - http://www.google.co.za/search?hl=en&q=what+is+jms&meta=
    RMI - http://www.google.co.za/search?hl=en&q=what+is+rmi&meta=

  • Problem to send a message with JMS

    Hi
    I'm doing some tests with the api JMS to know how works. I have got some problems. I have been looking for some information but i don't find so much. I have got too doubts.
    I am usinng Netbeans 5.5 with Sun Java System Application Server Platform Edition 9.0_01 (build b14).
    I am trying to do it with ejb. Because in the future the application can have got so many connection in the same time.
    The server shows me the next errors.
    Starting Sun Java System Application Server Platform Edition 9.0_01 (build b14) ...
    CORE5098: AS Socket Service Initialization has been completed.
    CORE5076: Using [Java HotSpot(TM) Client VM, Version 1.6.0_03] from [Sun Microsystems Inc.]
    SEC1002: Security Manager is OFF.
    ADM0001:MBeanServer initialized successfully
    SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
    sgmt.service_initialized
    DPL5400:Exception occurred : error in opening zip file.
    ADM1079: Initialization of AMX MBeans successful
    ADM1504: Here is the JMXServiceURL for the Standard JMXConnectorServer: [service:jmx:rmi:///jndi/rmi://t1:8686/jmxrmi].  This is where the remote administrative clients should connect using the standard JMX connectors
    ADM1506: Status of Standard JMX Connector: Active = [true]
    JTS5014: Recoverable JTS instance, serverId = [3700]
    About to load the system app: MEjbApp
    LDR5010: All ejb(s) of [MEjbApp] loaded successfully!
    About to load the system app: __ejb_container_timer_app
    EJB5109:EJB Timer Service started successfully for datasource [jdbc/__TimerPool]
    LDR5010: All ejb(s) of [__ejb_container_timer_app] loaded successfully!
    NAM0008 : Invalid Destination: jndi/Topic for java:comp/env/jms/Topic
    EJB5090: Exception in creating EJB container [javax.naming.NamingException [Root exception is javax.naming.NameNotFoundException]]
    appId=Chat-ejb moduleName=Chat-ejb ejbName=publicarBean
    LDR5004: UnExpected error occured while creating ejb container
    javax.naming.NamingException [Root exception is javax.naming.NameNotFoundException]
            at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:485)
            at com.sun.ejb.containers.BaseContainer.setupEnvironment(BaseContainer.java:2628)
            at com.sun.ejb.containers.BaseContainer.<init>(BaseContainer.java:629)
            at com.sun.ejb.containers.StatelessSessionContainer.<init>(StatelessSessionContainer.java:163)
            at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:515)
            at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:490)
            at com.sun.enterprise.server.EJBModuleLoader.load(EJBModuleLoader.java:158)
            at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:206)
            at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:198)
            at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:326)
            at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)
            at com.sun.enterprise.server.PEMain.run(PEMain.java:326)
            at com.sun.enterprise.server.PEMain.main(PEMain.java:260)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)
    Caused by: javax.naming.NameNotFoundException
            at com.sun.enterprise.naming.TransientContext.resolveContext(TransientContext.java:255)
            at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:178)
            at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:61)
            at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:98)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:309)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:469)
            ... 17 more
    CORE5021: Application NOT loaded: [Chat-ejb]
    WEB0302: Starting Sun-Java-System/Application-Server.
    WEB0100: Loading web module [__default-admingui] in virtual server [__asadmin] at [/]
    WEB0100: Loading web module [adminapp] in virtual server [__asadmin] at [/web1]
    WEB0100: Loading web module [admingui] in virtual server [__asadmin] at [/asadmin]
    WEB0100: Loading web module [amserver] in virtual server [server] at [/amserver]
    Initializing Sun's JavaServer Faces implementation (1.2_02-b03-FCS) for context ''
    Completed initializing Sun's JavaServer Faces implementation (1.2_02-b03-FCS) for context ''
    Initializing Sun's JavaServer Faces implementation (1.2_02-b03-FCS) for context '/asadmin'
    Completed initializing Sun's JavaServer Faces implementation (1.2_02-b03-FCS) for context '/asadmin'
    WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 8080
    WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 8181
    WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 4848
    About to load the system app: __JWSappclients
    WEB0100: Loading web module [__JWSappclients:sys.war] in virtual server [server] at [/__JWSappclients]
    Using MQ RA for Broker lifecycle control
    JMS Service Connection URL is :mq://t1:7676/
    MQJMSRA_RA1101: SJSMQ JMS Resource Adapter starting...
    EB-start:brokerProps={imq.instancename=imqbroker, imq.jmx.rmiregistry.port=8686, BrokerArgs=-port 7676 -name imqbroker -imqhome D:\Sun\AppServer\imq\bin\.. -varhome D:/sun/AppServer/domains/domain1\imq -useRmiRegistry -rmiRegistryPort 8686, imq.jmx.rmiregistry.use=true, imq.portmapper.port=7676}
    [07/nov/2007:18:35:03 CET]
    ================================================================================
    Sun Java(tm) System Message Queue 4.0
    Sun Microsystems, Inc.
    Version:  4.0  (Build 27-a)
    Compile:  Thu 03/02/2006
    Copyright (c) 2006 Sun Microsystems, Inc.  All rights reserved.
    SUN PROPRIETARY/CONFIDENTIAL.  Use is subject to license terms.
    This product includes code licensed from RSA Data Security.
    ================================================================================
    Java Runtime: 1.6.0_03 Sun Microsystems Inc. D:\sun\Java\jdk1.6.0_03\jre
    [07/nov/2007:18:35:03 CET]    IMQ_HOME=D:\sun\AppServer\imq
    [07/nov/2007:18:35:03 CET] IMQ_VARHOME=D:\sun\AppServer\domains\domain1\imq
    [07/nov/2007:18:35:03 CET] Windows XP 5.1 x86 t1 (1 cpu) pepepc
    [07/nov/2007:18:35:03 CET] Java Heap Size: max=506816k, current=46944k
    [07/nov/2007:18:35:03 CET] Arguments: -port 7676 -name imqbroker -imqhome D:\Sun\AppServer\imq\bin\.. -varhome D:/sun/AppServer/domains/domain1\imq -useRmiRegistry -rmiRegistryPort 8686
    [07/nov/2007:18:35:04 CET] [B1060]: Loading persistent data...
    [07/nov/2007:18:35:04 CET] Using built-in file-based persistent store: D:\sun\AppServer\domains\domain1\imq\instances\imqbroker\
    [07/nov/2007:18:35:04 CET] [B1189]: Cluster Service feature is not available
    [07/nov/2007:18:35:04 CET] [B1039]: Broker "imqbroker@t1:7676" ready.
    MQJMSRA_EB1101: run:EMBEDDED broker started with code =0
    MQJMSRA_RA1101: SJSMQ JMS ResourceAdaapter configuration=
            raUID                               =null
            brokerType                          =EMBEDDED
            brokerInstanceName                  =imqbroker
            brokerBindAddress                   =null
            brokerPort                          =7676
            brokerHomeDir                       =D:\Sun\AppServer\imq\bin\..
            brokerVarDir                        =D:/sun/AppServer/domains/domain1\imq
            brokerJavaDir                       =D:/sun/Java/jdk1.6.0_03
            brokerArgs                          =null
            brokerStartTimeout                  =60000
            adminUsername                       =admin
            adminPassFile                       =E:\tempWin\asmq21980.tmp
            useJNDIRmiServiceURL                =true
            rmiRegistryPort                     =8686
            startRmiRegistry                    =false
            useSSLJMXConnector                  =true
            brokerEnableHA                      =false
            clusterId                           =null
            brokerId                            =null
            jmxServiceURL                       =null
            dbType                              =null
            dbProps                             ={}
            dsProps                             ={}
            ConnectionURL                       =
            UserName                            =guest
            ReconnectEnabled                    =true
            ReconnectInterval                   =5000
            ReconnectAttempts                   =3
            AddressListBehavior                 =RANDOM
            AddressListIterations               =3
            InAppClientContainer                =false
            InClusteredContainer                =false
            GroupName                           =null
    MQJMSRA_RA1101: start:SJSMQ JMSRA Connection Factory Config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000, imqOverrideJMSExpiration=false, imqAddressListIterations=3, imqLoadMaxToServerSession=true, imqConnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false, imqConfiguredClientID=, imqSSLProviderClassname=com.sun.net.ssl.internal.ssl.Provider, imqJMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=http://localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPriority=4, imqBrokerHostName=localhost, imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=false, imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50, imqDefaultPassword=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsername=guest, imqReconnectEnabled=false, imqConnectionFlowCount=100, imqAddressListBehavior=PRIORITY, imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimestamp=false, imqBrokerServicePort=0, imqDisableSetClientID=false, imqSetJMSXConsumerTXID=false, imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueueBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted=false, imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000, imqAddressList=localhost:7676, imqOverrideJMSHeadersToTemporaryDestinations=false}
    MQJMSRA_RA1101: SJSMQ JMSRA Started
    endpoint.determine.destinationtype
    NAM0008 : Invalid Destination: jndi/Topic for java:comp/env/jms/Topic
    EJB5090: Exception in creating EJB container [javax.naming.NamingException [Root exception is javax.naming.NameNotFoundException]]
    appId=Chat moduleName=Chat-ejb_jar ejbName=publicarBean
    LDR5004: UnExpected error occured while creating ejb container
    javax.naming.NamingException [Root exception is javax.naming.NameNotFoundException]
            at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:485)
            at com.sun.ejb.containers.BaseContainer.setupEnvironment(BaseContainer.java:2628)
            at com.sun.ejb.containers.BaseContainer.<init>(BaseContainer.java:629)
            at com.sun.ejb.containers.StatelessSessionContainer.<init>(StatelessSessionContainer.java:163)
            at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:515)
            at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:490)
            at com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:184)
            at com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:113)
            at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:206)
            at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:204)
            at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:326)
            at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)
            at com.sun.enterprise.server.PEMain.run(PEMain.java:326)
            at com.sun.enterprise.server.PEMain.main(PEMain.java:260)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)
    Caused by: javax.naming.NameNotFoundException
            at com.sun.enterprise.naming.TransientContext.resolveContext(TransientContext.java:255)
            at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:178)
            at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:61)
            at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:98)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:309)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:469)
            ... 18 more
    Registering ad hoc servlet: WebPathPath: context root = "/Chat", path = "/Chat-app-client'
    Java Web Start services started for application com.sun.enterprise.appclient.jws.ApplicationContentOrigin@aabc2d registration name=Chat
        [email protected]56b4 registration name=Chat, context root=/Chat/Chat-app-client, module name=
    , parent=Chat
    CORE5021: Application NOT loaded: [Chat]
    SMGT0007: Self Management Rules service is enabled
    Application server startup complete.
    JBISE6013: JavaEEServiceEngine : Java EE Service Engine started successfully.
    CORE5024: EJB module [Chat-ejb] unloaded successfully!
    DeployedItemRef postDeregistration failed. Load Balancer Monitoring MBeans might be lying around if this application is being load balanced
    BPEL service engine started
    ADM1064:The upload file at [E:\tempWin\s1astempdomain1server-162970426\Chat-ejb.jar] exists and will be overwritten.
    ADM1006:Uploading the file to:[E:\tempWin\s1astempdomain1server-162970426\Chat-ejb.jar]
    deployed with moduleid = Chat-ejb
    ADM1041:Sent the event to instance:[ModuleDeployEvent -- enable ejb/Chat-ejb]
    endpoint.determine.destinationtype
    NAM0008 : Invalid Destination: jndi/Topic for java:comp/env/jms/Topic
    EJB5090: Exception in creating EJB container [javax.naming.NamingException [Root exception is javax.naming.NameNotFoundException]]
    appId=Chat-ejb moduleName=D__sun_AppServer_domains_domain1_applications_j2ee-modules_Chat-ejb ejbName=publicarBean
    LDR5004: UnExpected error occured while creating ejb container
    javax.naming.NamingException [Root exception is javax.naming.NameNotFoundException]
            at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:485)
            at com.sun.ejb.containers.BaseContainer.setupEnvironment(BaseContainer.java:2628)
            at com.sun.ejb.containers.BaseContainer.<init>(BaseContainer.java:629)
            at com.sun.ejb.containers.StatelessSessionContainer.<init>(StatelessSessionContainer.java:163)
            at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:515)
            at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:490)
            at com.sun.enterprise.server.EJBModuleLoader.load(EJBModuleLoader.java:158)
            at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:219)
            at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:174)
            at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:406)
            at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleEnabled(StandAloneEJBModulesManager.java:500)
            at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:960)
            at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:941)
            at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:448)
            at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:160)
            at com.sun.enterprise.admin.server.core.AdminNotificationHelper.sendNotification(AdminNotificationHelper.java:128)
            at com.sun.enterprise.admin.server.core.ConfigInterceptor.postInvoke(ConfigInterceptor.java:109)
            at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:97)
            at $Proxy1.invoke(Unknown Source)
            at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:297)
            at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:56)
            at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:142)
            at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:109)
            at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:180)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
            at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:174)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
            at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
            at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
            at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
            at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
            at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
            at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
            at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
            at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    Caused by: javax.naming.NameNotFoundException
            at com.sun.enterprise.naming.TransientContext.resolveContext(TransientContext.java:255)
            at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:178)
            at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:61)
            at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:98)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:309)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:469)
            ... 54 more
    CORE5020: Error while loading ejb module
    {code}
    I know it is very large. I think the error it is in this line.
    {code}
    NAM0008 : Invalid Destination: jndi/Topic for java:comp/env/jms/Topic
    EJB5090: Exception in creating EJB container [javax.naming.NamingException [Root exception is javax.naming.NameNotFoundException]]
    {code}
    also I am going to put the code.
    file PublicarBean.java
    {code}
    package org.pepes;
    import com.sun.tools.ws.processor.model.java.JavaArrayType;
    import javax.annotation.Resource;
    import javax.ejb.SessionContext;
    import javax.ejb.Stateless;
    import javax.jms.ConnectionFactory;
    import javax.jms.QueueConnectionFactory;
    import javax.jms.Topic;
    import javax.naming.NamingException;
    * @author pepes
    @Stateless(mappedName="ejb/publicar")
    public class publicarBean implements org.pepes.publicarRemote {
        /** Creates a new instance of publicarBean */
        @Resource(name="jms/QueueConnectionFactory")
        private QueueConnectionFactory connectionFactory;
        @Resource(name="jms/Topic", mappedName="jndi/Topic")
        private Topic topic;
        private javax.naming.InitialContext ctx;
        public publicarBean() {
        public void creaMensaje() throws javax.naming.NamingException , javax.jms.JMSException {
            try {       
                javax.naming.InitialContext ctx = new javax.naming.InitialContext();
                this.connectionFactory = (javax.jms.QueueConnectionFactory)ctx.lookup("jms/QueueConnectionFactory");
                this.topic = (javax.jms.Topic)ctx.lookup("jms/Topic");
                javax.jms.Connection connection = this.connectionFactory.createConnection();
                javax.jms.TopicSession ts = (javax.jms.TopicSession)connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
                javax.jms.TopicPublisher tp = ts.createPublisher(this.topic);
                javax.jms.TextMessage msg = ts.createTextMessage();
                for (int i = 0; i<3;i++) {
                    msg.setText("Prueba: " + i);
                    tp.publish(msg);
            catch (javax.jms.JMSException jmex) {
                throw jmex;
    {code}
    the file publicarRemote.java
    {code}
    package org.pepes;
    import javax.ejb.Remote;
    * This is the business interface for publicar enterprise bean.
    @Remote
    public interface publicarRemote {
         public void creaMensaje() throws javax.naming.NamingException , javax.jms.JMSException;
    {code}
    file mensaje.java
    {code}
    package org.pepes;
    import javax.annotation.Resource;
    import javax.ejb.ActivationConfigProperty;
    import javax.ejb.MessageDriven;
    import javax.ejb.MessageDrivenContext;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    * Entity class Mensaje
    * @author pepes
    @MessageDriven(mappedName = "jms/Mensaje", activationConfig =  {
            @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
            @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
    public class Mensaje implements MessageListener {
        /** Creates a new instance of Mensaje */
        @Resource
        private MessageDrivenContext mdc;
        public Mensaje() {
        public void onMessage(Message message) {
            javax.jms.TextMessage msg = null;
            try {
                if (message instanceof javax.jms.TextMessage) {
                    msg = (javax.jms.TextMessage) message;
                    System.out.println(msg.getText());
                } else {
                    System.out.println("Message of wrong type: "
                            + message.getClass().getName());
            } catch (javax.jms.JMSException e) {
                e.printStackTrace();
                mdc.setRollbackOnly();
            } catch (Throwable te) {
                te.printStackTrace();
    {code}
    the file prueba.jsp
    {code}
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%--
    The taglib directive below imports the JSTL library. If you uncomment it,
    you must also add the JSTL library to the project. The Add Library... action
    on Libraries node in Projects view can be used to add the JSTL 1.1 library.
    --%>
    <%--
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
        <h1>JSP Page</h1>
        <%--
        This example uses JSTL, uncomment the taglib directive above.
        To test, display the page like this: index.jsp?sayHello=true&name=Murphy
        --%>
        <%--
        <c:if test="${param.sayHello}">
            <!-- Let's welcome the user ${param.name} -->
            Hello ${param.name}!
        </c:if>
        --%>
        <%    
            try {
            javax.naming.InitialContext ctx = new javax.naming.InitialContext();
            org.pepes.publicarRemote publisher = (org.pepes.publicarRemote)ctx.lookup("ejb/publicar");
            if (publisher==null) {
                System.out.println("INFO: Es null");
            else {
                System.out.println("INFO: No es null");
            publisher.creaMensaje();
            } catch (javax.naming.NamingException ex) {
                System.out.println("ERROR naming: " + ex.getMessage());
            catch (javax.jms.JMSException jmex) {
                System.out.println("ERROR jms: " + jmex.getMessage());
            catch (java.lang.NullPointerException nullex) {
                System.out.println("ERROR null: " + nullex.getMessage());
    %>
        </body>
    </html>
    {code}
    I think the problem is because i don't put destination address. if it is so, the true where do I put this address?. if not where is the problem?
    I hope your help.
    Thanks you  in advanced.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Hi,
    Did you create your destinations in your application server? It seems that the destinations such as topics and queues are not created. First you should create them and then start using them.
    For example, in here, it says that jndi/Topic is not valid. To check if the destinations are valid or not; you can do it either through the graphical user interface or the command line console.

  • How do I use a JMS MessageSelector with application-specific properties

    According to a couple of JMS references (Sun, Oreilly) and the oracle documentation (under the heading "Using Oracle Java Messaging Service (JMS) to Access AQ", page 102 of 1082 , Application Developers Guide - Advanced Queuing, Release 2 (8.1.6))
    Standard JMS Features
    "Message selection based on message header fields/properties"
    Is there a special syntax for using application-specific (user defined) JMS message properties as message selectors in Oracle 8.1.7?
    I've tried to create a message selector based on a custom property that I set, i.e. "username != 'William'". (example from O'Reilly JMS book, pg. 44)
    I always get a JMS-159: Invalid selector Selector Parse error unless the property is a JMS-Defined property. i.e., " JMSMessageID = 'ID:9789D65E215B3613E034080020B1456E' " works fine.
    From the docs and the oter examples, I figure application-specific (user-defined) properties are legal.
    Thans for any help in advance.

    Well I found an article in another forum that states in oracle 8i, message selectors are only supported on JMSCorrelationID and JMSMessageID
    (9i will have/has the full JMS spec support for message selectors , or so the response to the message says)
    Thanks anyway
    (Aricle Is In Products > Database > Oracle Advanced Queueing
    Title is JMS AQ: selector in createReceiver does not work)

  • Using MySQL DB on Weblogic 10.3.2 for JMS Store and etc.

    Hi,
    I am planning to use MySQL DB w Weblogic 10.3.2 server.
    I am planning to use Persistent JMS Destinations and planning to use MySQL Datasource for JMS store.
    Can anyone please help me understand any serious issues or considerations of this combination?
    Thanks
    Sagar

    Hi,
    I am planning to use MySQL DB w Weblogic 10.3.2 server.
    I am planning to use Persistent JMS Destinations and planning to use MySQL Datasource for JMS store.
    Can anyone please help me understand any serious issues or considerations of this combination?
    Thanks
    Sagar

  • Some JMS objects do not show up in JNDI tree

    Hello friends. I have a situation where some of my JMS Queues do not show up in
    the JNDI tree. Other Queues / Topics show up fine. I cannot find any difference
    in the interface that tells me what my cause this to happen. Any insight would
    be appreciated.
    brian

    are you using a cluster? if so check the multicast to see if its working
    right.
    Where are you looking up the JNDI tree? in the console or are you checking
    the JNDI tree via weblogic.Admin LIST command? the LIST command may be a
    better way to see it for sure.
    sree
    "Brian" <[email protected]> wrote in message
    news:40b74519$1@mktnews1...
    >
    Hello friends. I have a situation where some of my JMS Queues do not showup in
    the JNDI tree. Other Queues / Topics show up fine. I cannot find anydifference
    in the interface that tells me what my cause this to happen. Any insightwould
    be appreciated.
    brian

Maybe you are looking for