Javax.jms.InvalidSelectorException: The selector is invalid

Hi ,
I am getting the following exception while running a JMS program
javax.jms.InvalidSelectorException: The selector is invalid: name !=Doctor
the code as follows
jndiContext = new InitialContext(env);
               TopicConnectionFactory factory = (TopicConnectionFactory) jndiContext.lookup("TopicConnectionFactory");
               //pubtopic = (Topic) jndiContext.lookup("topic/testTopic");
               subtopic = (Topic) jndiContext.lookup("topic/testTopic");
               TopicConnection conn = factory.createTopicConnection();
               tsession = conn.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);
               //publisher = tsession.createPublisher(topic);
               //String name = "Doctor";
               subscriber = tsession.createDurableSubscriber(subtopic,"testTopic","name != 'Doctor'",false);
advance thanks
syamsani

Thanks for the reply.
I think you are correct if i give like following it is working fine.
String filter = "name in('doctor')";
subscriber = tsession.createDurableSubscriber(subtopic,"labtech",filter,false);
Syamsani
I have one more issue regarding durable subscriptions. when i publish a message in persistance mode like below
publisher.publish( myMessage,
          DeliveryMode.PERSISTENT,
          Message.DEFAULT_PRIORITY,
          180
the durable subscriber not able to get the message when he is in both states offline/online. I think in PERSISTENT mode the durable subscriber should receive the message at any cost other wise there is no meaning of guaranteed messaging. The above method is working fine in both offline/online states when the time value given as 0 or more than one second. I am running my application in JBoss 4.2.2GA.
Syamsani
------------------------------------

Similar Messages

  • Javax.jms.InvalidSelectorException occurs when upgrade to weblogic 12c

    Recently, our team upgrade weblogic server from 11g to 12c,  some errors occur when start web application in weblogic domain.
    The error is related to message driven bean,  below is the part of  ejb-jar.xml definition:
      <message-driven id="message-driven_1">
          <description>Message Driven Bean</description>
          <display-name>Message Configuration (MDB)</display-name>
          <ejb-name>Logger</ejb-name>
          <ejb-class>com.logging.mdb.Logger</ejb-class>
          <messaging-type>javax.jms.MessageListener</messaging-type>
          <transaction-type>Container</transaction-type>
          <message-destination-type>javax.jms.Queue</message-destination-type>
          <activation-config>
                <activation-config-property>
                    <activation-config-property-name>messageSelector</activation-config-property-name>
                    <activation-config-property-value>DELIVERY='IMMEDIATE'</activation-config-property-value>
                </activation-config-property>
                <activation-config-property>
                    <activation-config-property-name>acknowledgeMode</activation-config-property-name>
                    <activation-config-property-value>Auto-acknowledge</activation-config-property-value>
                </activation-config-property>
                <activation-config-property>
                     <activation-config-property-name>destinationType</activation-config-property-name>
                     <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
                </activation-config-property>
          </activation-config>
      </message-driven>
    When start application below errors show up:
    <Dec 18, 2013 6:24:05 AM PST> <Warning> <EJB> <SLC02PGO> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1387376645415> <BEA-010061> <The Message-Driven EJB Logger is unable to connect to the JMS destination edx/queue/logger. The Error was:
    javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "DELIVERY='IMMEDIATE'"
    Nested exception: javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "DELIVERY='IMMEDIATE'"
    Nested exception: javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "DELIVERY='IMMEDIATE'"
    Nested exception: javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "DELIVERY='IMMEDIATE'"
    Nested exception: javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "DELIVERY='IMMEDIATE'"
    ####<Dec 18, 2013 6:24:15 AM PST> <Warning> <EJB> <SLC02PGO> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1387376655414> <BEA-010096> <The Message-Driven EJB MessageDispatcher is unable to connect to the JMS destination or bind to JCA resource adapter edx.queue.outbound. The onnection failed after 124 attempts. The MDB will attempt to reconnect/rebind every 10 seconds. This log message will repeat every 600 seconds until the condition clears.>
    It works well in weblogic 11g,   not sure whether there's any changes in weblgic 12c.
    I'm appreciate if there's someone can help me on this issue.
        <message-driven id="message-driven_1">
          <description>Message Driven Bean</description>
          <display-name>Message Configuration (MDB)</display-name>
          <ejb-name>Logger</ejb-name>
          <ejb-class>com.edocs.fs.logging.mdb.Logger</ejb-class>
          <messaging-type>javax.jms.MessageListener</messaging-type>
          <transaction-type>Container</transaction-type>
          <message-destination-type>javax.jms.Queue</message-destination-type>
          <activation-config>
            <activation-config-property>
              <activation-config-property-name>messageSelector</activation-config-property-name>
              <activation-config-property-value>DELIVERY='IMMEDIATE'</activation-config-property-value>
            </activation-config-property>
            <activation-config-property>
              <activation-config-property-name>acknowledgeMode</activation-config-property-name>
              <activation-config-property-value>Auto-acknowledge</activation-config-property-value>
            </activation-config-property>
            <activation-config-property>
              <activation-config-property-name>destinationType</activation-config-property-name>
              <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
            </activation-config-property>
          </activation-config>
          <resource-ref id="ResRef_Logger_1">
            <res-ref-name>jdbc/LoggerDataSource</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
          </resource-ref>
        </message-driven>

    Hi,
    I debug the application, I found my @ViewScoped ManagedBeans, they're recreated after you click a button or select a item in combobox
    Here is a piece of code:
        @PostConstruct
        public void resolveEntity() {
            Object sEntity = FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("entity");
            entity = (BctTbOportunidade) sEntity;
             FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove("entity");
            if (entity == null) {
                entity = new BctTbOportunidade();
    I use @postConstruct to get a entity from another page in sessionMap(I set a item from a table and use this method to modify a entity in a other page).
    When I click a button or select a item in combobox in same page @PostConstruct method is called but values are lost. No Exceptions are thrown by server.
    I found a artice written by BalluC that some versions of jsf 2.1 has this behavior The BalusC Code: The benefits and pitfalls of @ViewScoped
    I already configured my web.xml to set false javax.faces.PARTIAL_STATE_SAVING 
    But this behavior continues.
    The jsf version deployed in my weblogic 12c is 2.1.7.

  • Dequeue queue messages in JAVA, can't use JMSMessageId in the selector

    Hi,
    I am trying to dequeue a message with a selector :
    javax.jms.QueueReceiver l_receiver = null;
    etc.
    l_selector = "JMSMessageID = '" + a_msgId.substring(3) + "'";
    l_receiver = a_session.createReceiver(a_queue, l_selector);
    I got the following error :
    javax.jms.InvalidSelectorException: JMS-159
    Caused by: oracle.jms.ParseException: Invalid JMSMessageID in selector
    I also tried with "MSGID" (instead of "JMSMessageID"), no error but no message returned (I checked the table, it should return a message ...)
    Any idea ?
    Thanks,
    romain.

    This is a REPORTS forum - please ask your question in a more appropriate forum.
    Regards
    The Oracle Reports Team http://technet.oracle.com

  • Javax.jms.InvalidDestinationException: Invalid destination

    Hi!
    Can any one tell me why this error is occured "javax.jms.InvalidDestinationException: Invalid destination" is it because of it unable to find the Destination queue?
    Thanks
    Sreenath

    Yes.. the exception is self explanatory.. check you server admin to see what is the name of destination you are using.

  • Javax.jms.InvalidDestinationException: Destination has invalid type "class

    Dear Sirs,
    I am trying to send a JMS message from an application deployed to AS 10.1.3.3 to a destination (Queue), that was described with help of Oracle Enterprise Manager. This desination is working correctly if I send message from ESB by it's adapter. But my class refuses to execute method "createProducer": I have an exception:
    "javax.jms.InvalidDestinationException: Destination has invalid type "class oracle.jms.AQjmsDestination" and cannot be used with OC4J JMS".
    What is the case?
    Thanks.

    Thank You, Gera!
    My mistake was: I tryed to use oficially registed QueueConnectionFactory. But, indeed, AS notes that "connection factories are only needed for in-memory and file based persistence destinations. Destinations that use database persistence do not require connection factories to be specified - these are created dynamically by the JMS connector (adapter) used for database persistence."
    So, I found ra.xml file in directory of generated adapter, fetched queue factory name that seems correct for me, and use it.
    Now it works!
    Спасибо, Гера.

  • When using rabbitmq-jms for vFabric RabbitMQ javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card

    When using rabbitmq-jms for vFabric RabbitMQ javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card. I have tested with both 1.0.3 and 1.0.5 clients with RabbitMQ 3.1.5.
    I was wondering if the community was aware of this problem and if there are any workarounds? If not what is the proper channel to file a bug report. An example code snippet is below. The test fails because the TextMessageMatcher expects the destination passed in on construction (second parameter) to equal the desination on the message received (aquired from getJMSDestination).
            Mockery context = new Mockery();
            final MessageListener messageListener = context.mock(MessageListener.class);
            final Latch latch = new LatchImpl();
            final String prefix = "test" + System.currentTimeMillis();
            context.checking(new Expectations() {
                    oneOf(messageListener).onMessage(with(new TextMessageMatcher("MSG1", prefix + ".1234")));
                    will(new CustomAction("release latch") {
                        @Override
                        public Object invoke(Invocation invocation) throws Throwable {
                            latch.unlatch();
                            return null;
            final Connection connection = createConnection(null, null);
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            connection.start();
            Topic wildcardTopic = (Topic) getInitialContext().lookup(prefix + "." + "#");
            Topic destination = (Topic) getInitialContext().lookup(prefix + ".1234");
            final MessageConsumer consumer = session.createConsumer(wildcardTopic);
            consumer.setMessageListener(messageListener);
            MessageProducer producer = session.createProducer(null);
            producer.send(destination, session.createTextMessage("MSG1"));
            latch.await(5000);
            connection.close();
            Thread.sleep(5);
            context.assertIsSatisfied();

    Check where your MDB sends the [response] messages to.

  • Javax.jms.Destination found at the specified.....

    I am making a Message Driven EJB, but i get this error when i try to run it."javax.jms.Destination found at the specified destination-location (jms/theTopic) for MessageDrivenBean MessageDrivenEJB".I am using JDeveloper 9.0.5
    My ejb-jar
    <enterprise-beans>
    <message-driven>
    <description>Message Driven Bean</description>
    <display-name>MessageDrivenEJB</display-name>
    <ejb-name>MessageDrivenEJB</ejb-name>
    <ejb-class>mypackage1.MessageDrivenEJBBean</ejb-class>
    <transaction-type>Container</transaction-type>
    <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
    <message-driven-destination>
    <destination-type>javax.jms.Topic</destination-type>
    <subscription-durability>NonDurable</subscription-durability>
    </message-driven-destination>
    <resource-ref>
    <res-ref-name>TopicFactory</res-ref-name>
    <res-type>javax.jms.TopicConnectionFactory</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </message-driven>
    </enterprise-beans>
    <assembly-descriptor/>
    </ejb-jar>
    My orion-ejb-jar
    <orion-ejb-jar>
    <enterprise-beans>
    <message-driven-deployment name="MessageDrivenEJB" destination-location="jms/theTopic" connection-factory-location="jms/theTopicConnectionFactory">
    <resource-ref-mapping name="The Topic" location=" jms/theTopic"/>
    </message-driven-deployment>
    </enterprise-beans>
    <assembly-descriptor>
    <default-method-access>
    <security-role-mapping/>
    </default-method-access>
    </assembly-descriptor>
    </orion-ejb-jar>
    and my jms.xml
    <topic name="The Topic" location="jms/theTopic">
    <description>A dummy topic</description>
    </topic>
    <topic-connection-factory name="jms/theTopicConnectionFactory" location="jms/theTopicConnectionFactory">
    <description>A dummy topic connection factory</description>
    </topic-connection-factory>
    I hope that there i somebody who can help.. :-)

    The files orion-ejb-jar and jms.xml are not defined in JMS or Java EE, so unless there are any Orion experts on this forum you may need to ask in a forum specific to your application server.
    Nigel

  • No javax.jms.Destination found at the specified destination-location (jms/

    i m trying to create new message driven bean
    i made entry in ejb-jar like this
    <message-driven>
    <description>Message Driven Bean</description>
    <display-name>UploadMultiFilesMDB</display-name>
    <ejb-name>UploadMultiFilesMDB</ejb-name>
    <ejb-class>com.tcs.sgv.fms.messagedrivenbeans.impl.UploadMultiFilesMDB</ejb-class>
    <transaction-type>Bean</transaction-type>
    <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
    <message-driven-destination>
    <destination-type>javax.jms.Queue</destination-type>
    </message-driven-destination>
    <ejb-ref>
    <ejb-ref-name>ejb/CommonUtility</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.tcs.sgv.common.entitybeans.CommonUtilityHome</home>
    <remote>com.tcs.sgv.common.entitybeans.CommonUtility</remote>
    <ejb-link>CommonUtility</ejb-link>
    </ejb-ref>
    <ejb-ref>
    <ejb-ref-name>ejb/DmsUtility</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.tcs.sgv.dms.entitybeans.DmsUtilityHome</home>
    <remote>com.tcs.sgv.dms.entitybeans.DmsUtility</remote>
    <ejb-link>DmsUtility</ejb-link>
    </ejb-ref>
    <resource-ref>
    <res-ref-name>jms/QueueConnectionUploadMultiFiles</res-ref-name>
    <res-type>javax.jms.QueueConnectionFactory</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </message-driven>
    in orion-ejb-jar entry is
    <message-driven-deployment name="UploadMultiFilesMDB"
    connection-factory-location="jms/QueueConnectionUploadMultiFiles"
    destination-location="jms/UploadMultiFiles"
    max-instances="0" min-instances="0"/>
    in jms.xml entry is like
    <queue name="UploadMultiFilesQueue" location="jms/UploadMultiFiles">
              <description>Upload Queue</description>
         </queue>
    <queue-connection-factory location="jms/QueueConnectionUploadMultiFiles" />
    but still it is giving me error like ....
    No javax.jms.Destination found at the specified destination-location (jms/UploadMultiFiles) for MessageDrivenBean UploadMultiFilesMDB
    Please do help
    thanks in Advance

    The files orion-ejb-jar and jms.xml are not defined in JMS or Java EE, so unless there are any Orion experts on this forum you may need to ask in a forum specific to your application server.
    Nigel

  • Naming Exception while using the javax.jms.QueueConnectionFactory

    Hi All,
    I am quite new to JMS. I am trying to run the example QueueSender program shipped with weblogic5.1 . When i run the program i get the following error ...
    Exception in thread "main" javax.naming.Name
    NotFoundException:
    'javax.jms.QueueConnectionFactory'; remaining name 'jms.QueueConnectionFactory'
    at weblogic.rmi.extensions.AbstractRequest.sendReceive(AbstractRequest.j
    ava:76)
    at weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLS
    tub.java:246)
    at weblogic.jndi.toolkit.WLContextStub.lookup(WLContextStub.java:545)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at examples.jms.queue.QueueSend.init(QueueSend.java:37)
    at examples.jms.queue.QueueSend.main(QueueSend.java:82)
    I am desperate to get any guidance regarding the above mentioned exception
    Thanx
    Shanks

    I don't use weblogic but the javax.naming.Name
    NotFoundException suggests that the JNDI name cannot be found or resolved.
    The name is specified in 2 locations, one in your java codes and the other during the deployment of the JMS application.
    The error means the java program cannot find the JNDI name which means you did not specify the name correctly during the deployment.
    Make sure both the names in java codes and deployment are right and matching. That should solve the problem.

  • JMS Adapter Message Selector Problem...

    Hi
    I have set the following in the invoke before producing the message and dropping on the queue
    <invoke name="Invoke_1" partnerLink="adapt"
    portType="ns1:Produce_Message_ptt"
    operation="Produce_Message"
    inputVariable="Invoke_1_Produce_Message_InputVariable"
    bpelx:inputHeaderVariable="Sender"/>
    On the receive side I have the message selector configured for the adapter as follows:
    <jca:operation
    ActivationSpec="oracle.tip.adapter.jms.inbound.JmsConsumeActivationSpec"
    DestinationName="dattjndi"
    UseMessageListener="false"
    MessageSelector="Sender=AdaptationRequest"PayloadType="TextMessage"
    OpaqueSchema="false" >
    </jca:operation>
    Where AdaptationRequest is the value for the Sender variable which will be used to filter the message. But this does not work. the messages are still not consumed. What could be the problem?
    Thanks,
    Anil

    did you check the message selector section on
    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Message.html
    explains all the operators you can use and the correct syntax. Make a note of the case sensitivity.

  • No JMS over the network

    hello,
    Im learning JMS and trying the examples from the tutorial. Both my SDK's are version 1.4.
    At home, I have a Linux machine directly connected to a win-XP machine. Im trying to connect the two machines as in the example "Running JMS Client Programs on Multiple Systems" I do exactly what the turorial states. I check, as recommended, that the JmsFactory does exist.
    What happens is somewhat dissapointing: when i issue the command "run SimpleProducer MyQueue queue 3", instead of messages get send over the network they end up in the own local queue at the side of the SimpleProducer. Both on the linux as on the win machine the same happens. I used both the IP-address and the netbios name of the remote machine in "ant add-remote-factory -Dsys=sys-name". The effect is the same.
    Anyone an idea what is wrong??
    Thank i.a.

    hi!
    i went to bed frustrated, turned on my computer and now this comes up:
    I try to lookup the connection factory with this code:
    try {
    connectionFactory = (ConnectionFactory)
    jndiContext.lookup("EarthQueueConnectionFactory");
    if (destType.equals("queue")) {
    dest = (Queue) jndiContext.lookup(destName);
    } else if (destType.equals("topic")) {
    dest = (Topic) jndiContext.lookup(destName);
    } else {
    throw new Exception("Invalid destination type" +
    "; must be queue or topic");
    } catch (Exception e) {
    System.out.println("JNDI API lookup failed: " +
    e.toString());
    System.exit(1);
    This is the error it returns:
    C:\j2sdkee1.4\doc\tutorial\examples\jms\simple>run SimpleProducer MyQueue queue 1
    Destination name is MyQueue, type is queue
    18-feb-2003 11:35:52 com.sun.jms.ConnectionFactoryImpl establishRemoteReferences
    SEVERE: ConnectionFactoryImpl: Failed to lookup or connect to JMS service because: org.omg.CORBA.OBJECT_N
    OT_EXIST: vmcid: SUN minor code: 202 completed: No
    18-feb-2003 11:35:52 com.sun.jms.ConnectionFactoryImpl establishRemoteReferences
    SEVERE: ConnectionFactoryImpl: Failed to lookup or connect to JMS service because: org.omg.CORBA.OBJECT_N
    OT_EXIST: vmcid: SUN minor code: 202 completed: No
    Exception in thread "main" java.lang.NullPointerException
    at com.sun.jms.client.ConnectionImpl.invokeRemoteCreateConnection(ConnectionImpl.java:161)
    at com.sun.jms.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:314)
    at com.sun.jms.ConnectionFactoryImpl.createXAConnection(ConnectionFactoryImpl.java:468)
    at com.sun.jms.ConnectionFactoryImpl.createXAConnection(ConnectionFactoryImpl.java:444)
    at com.sun.jms.connector.ra.JMSConnectionFactoryAdapter.createConnection(JMSConnectionFactoryAdap
    ter.java:129)
    at SimpleProducer.main(Unknown Source)
    MyQueue exists and my j2eeadmin -listJmsFactory looks like this:
    JmsFactory
    < Connector Resource : jms/TopicConnectionFactory, jmsra.rar, , , javax.jms.TopicConnectionFactory
    Properties: NONE >
    < Connector Resource : jms/QueueConnectionFactory, jmsra.rar, , , javax.jms.QueueConnectionFactory
    Properties: NONE >
    < Connector Resource : EarthQueueConnectionFactory, jmsra.rar, , , javax.jms.QueueConnectionFactory
    Properties: >
    I have really no clue what is wrong. Can someone help me please????

  • Javax.jms.IllegalStateException

    Hi there,
    I try to call setMessageListener(this) from a Thread that is created from a jsp. The Thread implements the MessageListener Interface and shall receive messages from the topic jms/Joker
    I created on the J2EE Server. This is what my thread ChatListener@1f76a5 logs:
    ChatListener@1f76a5 Factory com.sun.enterprise.jms.ConnectionFactoryWrapperStandalone@4649ed created.
    ChatListener@1f76a5 Topic com.sun.jms.Topic: jms/Joker created.
    J2EE Server: Warning : Illegal connection factory access to jms/TopicConnectionFactory. J2EE Components should access JMS Connection Factories through a resource-ref in java:comp/env
    ChatListener@1f76a5 Connection com.sun.enterprise.jms.ConnectionWrapperWeb@62fe5d created.
    ChatListener@1f76a5 Session com.sun.enterprise.jms.SessionWrapperWeb@742397 created.
    ChatListener@1f76a5 Subscriber com.sun.enterprise.jms.MessageConsumerWrapperRestricted@48f0a4 create
    d.
    ChatListener@1f76a5 JMSException - javax.jms.IllegalStateException: Operation not allowed
    --> the method setMessageListener was not executed. Why can't I use the jms service from an external java program?
    thanx for your help,
    Nima

    Is it possible to create the object which your JSP uses outside of the container. For instance, some application servers allow you to instantiate classes outside of J2EE, then the you can set up the listener as necessary for that object. You JSP could get a hold of the object using a static method.
    If you don't want the JSP to instruct the object about its connection, session, producer, consumer its listener and selector you could try something like. You object creates a thread and listens on a list waiting for a request. Then the JSP invokes the object saying create me a new connection, session, consumer, etc. The object forms a request, queues it up to that other thread and waits for the response, the other thread processes the request forms a response and gives it back to the JSP thread.
    In this way, all the JMS objects are created outside of the JSP container and hopefully will not have the same restrictions you are seeing in the container. The object that sets up the listener can do whatever it wants (except invoke the JSP).

  • JMS Topics and Selectors

    I'm running into a problem when using JMS Topics and selectors.
    If I just use:
    subscriber = session.createSubscriber(topic);
    everything works fine.
    However, if I use
    subscriber = session.createSubscriber(topic, "Property = 'Value'", false);
    I get an invalid topic exception from EvermindTopicSession.createSubscriber() line 84.
    I'm using OC4J 9.0.3 standalone.
    What might I be doing wrong?

    [bump]
    Incidentally, I've also noticed that JMSTimestamp is not set. I've even tried setDisableTimestamp(false). The timestamp still won't be set. I can set the timestamp manually myself using setJMSTimestamp. Also, message time to live doesn't seem to work with Topics (not sure about queues).
    Is this a well known problem?
    Is it an OC4J problem or a JMS problem?

  • Java Forums - javax.jms.MessageFormatException: IOException: unexpected end

    I'm using jboss 3.2.6 and JDK 1.4
    Since I uppgraded to JDK 1.5, my JMS messaging doesn't work anymore.
    I am able to send and receive String messages without any problem but the getObject() method fails for custom objetcs.
    If someone has any idea, please help me.
    This is my Server and Client sourcecode
    Server Code
    QueueSender queueSender = m_queueSession.createSender( m_queue );
    ObjectMessage objectMessage = m_queueSession.createObjectMessage(serialazableObject);
    objectMessage.setStringProperty("Config", selector);
    queueSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
    queueSender.send( objectMessage );
    Client code
    public void onMessage( Message message )
    Object obj = null;
    ObjectMessage objectMessage = null;
    try
    if ( message instanceof ObjectMessage )
    objectMessage = ( ObjectMessage ) message;
    obj = objectMessage.getObject();
    if (obj instanceof CLPBRRoute)
    onNewRoute( (CLPBRRoute) obj );
    else if (obj instanceof String)
    onStatusMessage((String)obj);
    catch ( Throwable t )
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - javax.jms.MessageFormatException: IOException: unexpected end of block data
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - \n
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] -
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - at org.jboss.mq.SpyObjectMessage.getObject(SpyObjectMessage.java:135)
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - \n
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] -
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - at com.calypso.operatorapps.networkdesigner.gui.bestroute.CLPBRResultPanel$CLPBRBestRouteThread.onMessage(CLPBRResultPanel.java:574)
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - \n
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] -
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - at org.jboss.mq.SpyMessageConsumer.run(SpyMessageConsumer.java:680)
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - \n
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] -
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - at java.lang.Thread.run(Thread.java:595)
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - \n
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] -

    I'm sorry, I posted my message in a wrong forum. Thank you for not considering this message in this forrum.

  • Javax.jms.JMSException: Not supported in XA-backed session outside globaltx

    I am trying to setup OracleOJMS provider and tries to access queue and post to queue from a normal jsp for testing.
    I am getting the following
    code:
    javax.jms.JMSException: Not supported in XA-backed session outside global transaction
         at oracle.j2ee.ra.jms.generic.RAUtils.make(RAUtils.java:525)
         at oracle.j2ee.ra.jms.generic.RAUtils.toJMSException(RAUtils.java:199)
         at oracle.j2ee.ra.jms.generic.RAUtils.toJMSException(RAUtils.java:210)
         at oracle.j2ee.ra.jms.generic.CommonProducerWrapper.prepareForSend(CommonProducerWrapper.java:350)
         at oracle.j2ee.ra.jms.generic.CommonProducerWrapper.send(CommonProducerWrapper.java:159)
         at ResourceProvider.jspService(_ResourceProvider.java:112)
         at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.1.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Steps i have done
    ResourceProvider.jsp
    code:
    <!-- JSP Imports -->
    <%@ page import="javax.jms.QueueConnectionFactory "%>
    <%@ page import="javax.jms.XAQueueConnectionFactory "%>
    <%@ page import="javax.jms.QueueConnection "%>
    <%@ page import="javax.jms.QueueSession "%>
    <%@ page import="javax.jms.Queue "%>
    <%@ page import="javax.jms.QueueSender "%>
    <%@ page import="javax.jms.Message "%>
    <%@ page import="javax.jms.Session "%>
    <%@ page import="javax.naming.Context "%>
    <%@ page import="javax.naming.InitialContext "%>
    <html>
    <head>
    <title>
    Configuration of ResourceProvider for Advanced Queueing
    </title>
    </head>
    <body>
    <form name="TestResourceProvider" method="GET">
    <%
    // Check if the message has to be enqueued
    if (request.getParameter("Message") != null){
    Context jndiContext = new InitialContext();
    XAQueueConnectionFactory queueCF = (XAQueueConnectionFactory)jndiContext.lookup
    ("java:comp/env/jms/InQueueCF");
    Queue queue = (Queue)jndiContext.lookup("java:comp/env/jms/InQueue");
    QueueConnection queueConnection = queueCF.createQueueConnection();
    // Start the Connection
    queueConnection.start();
    QueueSender sender = queueSession.createSender(queue);
    Message msg = queueSession.createTextMessage(request.getParameter("Message"));
    sender.send(msg);
    queueSession.commit();
    sender.close();
    queueSession.close();
    queueConnection.close();
    %>
    <%
    }else{
    // User can enter the message to be enqueued through here
    %>
    Enter the message to be enqueued
    <INPUT type="text" name="Message">
    <br><br>
    <input type="Submit" value="Enqueue Message">
    <%
    %>
    </form>
    </body>
    </html>
    My Steps for OJMS PRovider
    1. Creating AQ queue in DB
    2. configuration of resource adapter and provider
    3. configuration of connection factories for resourceadapter[jmsconnector]
    code:
    1. Created the Queue table in DB using the sql
    DROP USER jmsuser CASCADE;
    GRANT connect, resource,AQ_ADMINISTRATOR_ROLE TO jmsuser IDENTIFIED BY jmsuser;
    GRANT execute ON sys.dbms_aqadm TO jmsuser;
    GRANT execute ON sys.dbms_aq TO jmsuser;
    GRANT execute ON sys.dbms_aqin TO jmsuser;
    GRANT execute ON sys.dbms_aqjms TO jmsuser;
    connect jmsuser/jmsuser;
    -- Create table to hold the queue, then create queue.
    -- For topics multiple_consumers must be true
    BEGIN
    DBMS_AQADM.CREATE_QUEUE_TABLE( Queue_table => 'SMSCP_INQTBL', Queue_payload_type => 'SYS.AQ$_JMS_MESSAGE',
    sort_list => 'PRIORITY,ENQ_TIME', multiple_consumers => false, compatible => '8.1.5');
    DBMS_AQADM.CREATE_QUEUE( Queue_name => 'SMSCP_INQ', Queue_table => 'SMSCP_INQTBL');
    DBMS_AQADM.START_QUEUE(queue_name => 'SMSCP_INQ');
    END;
    quit;
    Now our queue Name is queue Name : SMSCP_INQ table Name: SMSCP_INQTBL
    2. Creating the Cp and datasource for the db [jmsuser] to make java to access queue
    Creating ConnectionPool jmsDBPool
    Creating DataSource jmsDBDataSource
    Jndi jdbc jdbc/JMSDBDS
    After creating, i got the following data-sources.xml
    DATASOURCES.XML
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <data-sources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/data-sources-10_1.xsd" schema-major-version="10" schema-minor-version="1">
    <!-- default one comes with oracle shipping -->
    <managed-data-source connection-pool-name="Example Connection Pool" jndi-name="jdbc/OracleDS" name="OracleDS"/>
    <!-- New one Created -->
         <managed-data-source connection-pool-name="jmsDBPool" jndi-name="jdbc/JMSDBDS" name="jmsDBDataSource"/>
    <!-- default one comes with oracle shipping -->
    <connection-pool name="Example Connection Pool">
    <connection-factory factory-class="oracle.jdbc.pool.OracleDataSource" user="scott" password="tiger" url="jdbc racle:thin:@//localhost:1521/ORCL"/>
    </connection-pool>
    <!-- New one Created -->
    <connection-pool name="jmsDBPool">
    <connection-factory factory-class="oracle.jdbc.pool.OracleDataSource" user="jmsuser" password="jmsuser" url="jdbc racle:thin:@//localhost:1521/xe"/>
    </connection-pool>
    </data-sources>
    3. JMS Connector Task. Customising the ra.xml
    ra.xml
    <!-- resourceadapter -->
    <resourceadapter>
    <resourceadapter-class>oracle.j2ee.ra.jms.generic.JMSResourceAdapter</resourceadapter-class>
    <config-property>
    <config-property-name>lookupMethod</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>resourceProvider</config-property-value>
    </config-property>
    <config-property>
    <config-property-name>resourceProviderName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>testResourceProvider</config-property-value>
    </config-property>
    <!-- adminobject configuration -->
              <adminobject>
    <adminobject-interface>javax.jms.Queue</adminobject-interface>
    <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectQueueImpl</adminobject-class>
    <config-property>
    <config-property-name>jndiName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>Queues/MY_QUEUE</config-property-value>
    </config-property>
    <config-property>
    <config-property-name>resourceProviderName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>testResourceProvider</config-property-value>
    </config-property>
    </adminobject>
    <!--
    <adminobject>
    <adminobject-interface>javax.jms.Topic</adminobject-interface>
    <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
    <config-property>
    <config-property-name>jndiName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>Topics/MY_TOPIC</config-property-value>
    </config-property>
    <config-property>
    <config-property-name>resourceProviderName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>testResourceProvider</config-property-value>
    </config-property>
    </adminobject>
    -->
    <adminobject>
    <adminobject-interface>javax.jms.Queue</adminobject-interface>
    <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectQueueImpl</adminobject-class>
    <config-property>
    <config-property-name>resourceProviderName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>testResourceProvider</config-property-value>
    </config-property>
    </adminobject>
    <adminobject>
    <adminobject-interface>javax.jms.Topic</adminobject-interface>
    <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
    <config-property>
    <config-property-name>resourceProviderName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>testResourceProvider</config-property-value>
    </config-property>
    </adminobject>
    </resourceadapter>
    4. Create a JMS Connector INstance
    oc4j-connectors.xml
         <connector name="testResourceAdapter" path="testResourceAdapter.rar">
              <config-property name="lookupMethod" value="resourceProvider"/>
              <config-property name="resourceProviderName" value="testResourceProvider"/>
              <!-- Default element generated by OC4J. Please uncomment and modify to suit your configuration needs.
              <adminobject-config location="">
                   <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectQueueImpl</adminobject-class>
                   <config-property name="jndiName" value="Queues/MY_QUEUE"/>
                   <config-property name="resourceProviderName" value="ojmsRP"/>
              </adminobject-config>
              -->
              <!-- Default element generated by OC4J. Please uncomment and modify to suit your configuration needs.
              <adminobject-config location="">
                   <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
                   <config-property name="jndiName" value="Topics/MY_TOPIC"/>
                   <config-property name="resourceProviderName" value="ojmsRP"/>
              </adminobject-config>
              -->
         </connector>
    5. RA Connection Factories
    <?xml version="1.0" encoding="UTF-8"?>
    <oc4j-connector-factories xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/oc4j-connector-factories-10_0.xsd"
    schema-major-version="10"
    schema-minor-version="0">
    <connector-factory location="resourceAdapterXAQCF/MYXAQCF" connector-name="testResourceAdapter">
    <config-property name="jndiLocation" value="XAQueueConnectionFactories/XAQCF"/>
    <connection-pooling use="private">
    <property name="waitTimeout" value="300" />
    <property name="scheme" value="fixed_wait" />
    <property name="maxConnections" value="50" />
    <property name="minConnections" value="0" />
    </connection-pooling>
    <connectionfactory-interface>javax.jms.XAQueueConnectionFactory</connectionfactory-interface>
    </connector-factory>
    </oc4j-connector-factories>
    orion-web.xml
    <?xml version="1.0"?>
    <orion-web-app
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-web-10_0.xsd"      deployment-version="10.1.3.1.0"
         deployment-time="1218369811921"
         jsp-cache-directory="./persistence"
         jsp-cache-tlds="standard"
         temporary-directory="./temp"
         context-root="/smscpReceiver"
    schema-major-version="10" schema-minor-version="0" >
         <!-- Uncomment this element to control web application class loader behavior.
              <web-app-class-loader search-local-classes-first="true" include-war-manifest-class-path="true" />
         -->
         <resource-ref-mapping name="jms/InQueueCF" location="resourceAdapterXAQCF/MYXAQCF" />
         <message-destination-ref-mapping location="resourceAdapterInQ/MYINQ" name="jms/InQueue">
              </message-destination-ref-mapping>
         <web-app>
         </web-app>
    </orion-web-app>
    web.xml
    <resource-ref>
         <res-ref-name>jms/InQueueCF</res-ref-name>
         <res-type>javax.jms.XAQueueConnectionFactory</res-type>
         <res-auth>Container</res-auth>
    </resource-ref>
    <message-destination-ref>
         <message-destination-ref-name>jms/InQueue</message-destination-ref-name>
         <message-destination-type>javax.jms.Queue</message-destination-type>
         <message-destination-usage>Produces</message-destination-usage>
         <message-destination-link>jms/InQueue</message-destination-link>
    </message-destination-ref>
    <message-destination>
    <message-destination-name>jms/InQueue</message-destination-name>
    </message-destination>

    Sorry for the jammed one
    Neat one.
    am trying to setup OracleOJMS provider and tries to access queue and post to queue from a normal jsp for testing.
    I am getting the following
    javax.jms.JMSException: Not supported in XA-backed session outside global transaction
    at oracle.j2ee.ra.jms.generic.RAUtils.make(RAUtils.java:525)
    at oracle.j2ee.ra.jms.generic.RAUtils.toJMSException(RAUtils.java:199)
    at oracle.j2ee.ra.jms.generic.RAUtils.toJMSException(RAUtils.java:210)
    at oracle.j2ee.ra.jms.generic.CommonProducerWrapper.prepareForS
    INVOCATION
    <form name="TestResourceProvider" method="GET">
    <%
    // Check if the message has to be enqueued
    if (request.getParameter("Message") != null){
    Context jndiContext = new InitialContext();
    XAQueueConnectionFactory queueCF = (XAQueueConnectionFactory)jndiContext.lookup
    ("java:comp/env/jms/InQueueCF");
    Queue queue = (Queue)jndiContext.lookup("java:comp/env/jms/InQueue");
    QueueConnection queueConnection = queueCF.createQueueConnection();
    // Start the Connection
    queueConnection.start();
    QueueSender sender = queueSession.createSender(queue);
    Message msg = queueSession.createTextMessage(request.getParameter("Message"));
    sender.send(msg);
    queueSession.commit();
    sender.close();
    queueSession.close();
    queueConnection.close();
    %>
    <%
    }else{
    // User can enter the message to be enqueued through here
    %>
    Enter the message to be enqueued
    <INPUT type="text" name="Message">
    <br><br>
    <input type="Submit" value="Enqueue Message">
    <%
    %>
    </form>
    </body>
    </html>
    ---------------------

Maybe you are looking for

  • How can I shorten the "Open With" menu?

    Hi - When I Control-Click on a file, say  one with an HTML extension, and move down to "Open with" I see a list of about 24 apps - only 4 of which are of interest to me for opening this HTML file.  If I right-click an XML file - the apps I'm looking

  • My ipad died all my college notes are on ibooks as a PDF have I lost them all or is there a way I can get them back

    my Ipad died I think because I did not update it.  All of my college notes are on I books is there anyway I can get these notes back on I books also I have no idea how to check if I even stored them on the cloud.  My IPad is still under warranty as o

  • Defaulting Quantiy as 1 in the sales order item

    Dear Experts, I want to default the quanity as 1 in sales order after entering the material at the item level and pressing enter. i tried with the MV45AFZZ user exits if i make forcefully RV45A-KWMENG as '1.000' and VBAP-KWMENG as '1.000' in MOVE FIE

  • How i can make use of  findByPrimaryKey() method ServiceImpl

    Hi All i am trying to update my detail table when i updating my master table data in my Detail table am having compsite primarykey System.out.println(yearCodeDef.findByPrimaryKey(getDBTransaction(),yearCodeKey));// This is giving null value For that

  • 10g AS & FOP SAX Parsers

    Hi, Im deploying an application with FOP on 10g AS, FOP uses SAX parsers to generate PDF docs. On 10g I get the following error:- 2008-01-28 18:05:22,648[<UNKNOWN>][DEBUG] FOIOHelper.convertFOToPDF run 2008-01-28 18:05:22,649[<UNKNOWN>][INFO] Using o