Sending a JMS message inside a PostPersist entity listener method

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

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

Similar Messages

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

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

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

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

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

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

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

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

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

  • Sending/Receiving JMS message to WMQ from Automated Task

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

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

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

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

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

  • PeerGoneException sending large JMS messages using T3.

    Hello,
              I'm using WL 7.0 SP4 on the backend. I have clients that send JMS messages to this WL server using T3. Some of the messages are ~1MB in size, and sometimes the clients use dial-up connections with a maximum speed of 54 Kbps. (Yes, I know we are living in the dark ages...)
              Anyway, sometimes the WL server throws a PeerGoneException. I realize this is because the CompleteT3MessageTimeout has expired. I have already set it to the maximum of 480 seconds, but sometimes that's not enough. Is there a way to disable this timeout or set it to be infinite?
              Does anyone have any suggestions?
              thanks in advance,
              matt

    sorry for answering myself...
              if you set 480 seconds on client and on server side, you will get a time
              range of 480 seconds.
              you will never be able to get more then 480 seconds. (And yes, there
              only existe the T3MessageTimout, which should be fine to my point of view.
              Another point might be the jta transaction timeout server-side.
              Regards
              Klaas
              Klaas Hagemann schrieb:
              > Hi Matt,
              >
              >
              > the settings have to be the same, client- and serverside. The whole t3
              > connection times out.
              > I only tested it with 8.1, so i cannot give you any advice concerning 7.0.
              > Maybe you should contact BEA Support, they should easily be able to
              > check whether there exists a patch for 7.0
              >
              >
              > Sorry...
              >
              >
              > Klaas
              >
              >
              > Matt Hill schrieb:
              >
              >>Thanks for the reply, Klaus.
              >>
              >>We are using WL 7.0 (not 8.1), so we do not have the CompleteMessageTimeout attribute. WL 7.0 only has the CompleteT3MessageTimeout attribute, which I set to the maximum of 480 secs, but unfortunately it sometimes takes longer to transfer our messages.
              >>
              >>I tried your suggestion of setting the client-side java property, but it did not help. I believe my problem is that the server times out - not the client.
              >>
              >>Any other ideas would be greatly appreciated.
              >>
              >>thanks,
              >>matt

  • Can the AQ Adapter send a JMS Message?

    I'm trying to use the AQ adapter to enqueue an XML message into a queue who's payload type is AQ$JMS_TEXT_MESSAGE so that it can be consumed by a Message Driven Bean in OC4J.
    Simply sending the XML reults in:
    "AQ Adapter: ** Error ** Can not enqueue messages to queue PLEDGE. ADT Payload defined for Queue PLEDGE does not match with OAI Message. Please check attribute "Pledge". In order for the AQ Adapter to enqueue OAI messages to the queue, the queue payload must match the ADT imported through iStudio."
    I tried importing the AQ%JMS_TEXT_MESSAGE but can't see any easy way to construct it.
    Is this even possible?
    -Doug

    Doug,
    the AQ$JMS_TEXT_MESSAGE is an object type. So you'll need to import that type as your application view.
    The problem with this JMS objecttype is how to populate it.
    When your text (XML) is more than 4000 characters in length, the TEXT_LOB attribute should get the text. If less, the TEXT_VC attribute should get the text. In any case, the TEXT_LEN should be set to the length of the XML.
    AFAIK, you can't currently do this with InterConnect directly.
    The most popular solution is to have InterConnect deliver this message to a simple non-JMS queue and have some PL/SQL or java code convert it to a proper JMS text message and put it in the JMS text queue.
    There are some features in the DBMS_AQ package to register a plsql procedure to be triggered when a message arrives (dbms_aq.register). That could be a procedure which converts the message for you.
    In ProcessConnect (coming soon) there is a dedicated JMS adapter available.
    HTH, Marc

  • Sending a JMS message from a Servlet

    Hello All
    I�m using the Sun Java Sysytem Application Server and have been trying to implement a servlet which on receipt of a Post message, takes the message and sends it using JMS to a message queue. I�m developing my first web application so all is fairly new to me but I desparately need to know if this scenario is viable. I have worked through relevant sections of the Java EE5 tutorial and so have the required ConnectionFactory and Queue resouces in place. I located the code below which the author implemented in Eclipse 3.2 and have tried to run it to establish that messages can be successfully sent. The code compiles ok but after the post message has been sent the server appears to lock up.
    The servlet is as follows:
    import java.io.IOException;
    import javax.annotation.Resource;
    import javax.jms.Connection;
    import javax.jms.ConnectionFactory;
    import javax.jms.Destination;
    import javax.jms.JMSException;
    import javax.jms.MessageProducer;
    import javax.jms.Queue;
    import javax.jms.Session;
    import javax.jms.TextMessage;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class NewServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
    @Resource(mappedName = "jms/Queue")
    private Queue queue;
    @Resource(mappedName = "jms/connectionFactory")
    private ConnectionFactory jmsConnectionFactory;
    //private Connection connection;
    public NewServlet() {
    super();
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    Connection connection = null;
    Destination dest = (Destination) queue;
    try {
    connection = jmsConnectionFactory.createConnection();
    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageProducer producer = session.createProducer(dest);
    TextMessage message = session.createTextMessage();
    message.setText("Hello");
    response.getOutputStream().println("Sending message: " + message.getText());
    System.out.println("Sending message: " + message.getText());
    producer.send(message);
    producer.send(session.createMessage());
    } catch (JMSException e) {
    e.printStackTrace();
    } finally {
    if (connection != null) {
    try {
    connection.close();
    } catch (JMSException e) {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    Please could someone point me in the right direction.
    Many Thanks

    Hello All
    I�m using the Sun Java Sysytem Application Server and have been trying to implement a servlet which on receipt of a Post message, takes the message and sends it using JMS to a message queue. I�m developing my first web application so all is fairly new to me but I desparately need to know if this scenario is viable. I have worked through relevant sections of the Java EE5 tutorial and so have the required ConnectionFactory and Queue resouces in place. I located the code below which the author implemented in Eclipse 3.2 and have tried to run it to establish that messages can be successfully sent. The code compiles ok but after the post message has been sent the server appears to lock up.
    The servlet is as follows:
    import java.io.IOException;
    import javax.annotation.Resource;
    import javax.jms.Connection;
    import javax.jms.ConnectionFactory;
    import javax.jms.Destination;
    import javax.jms.JMSException;
    import javax.jms.MessageProducer;
    import javax.jms.Queue;
    import javax.jms.Session;
    import javax.jms.TextMessage;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class NewServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
    @Resource(mappedName = "jms/Queue")
    private Queue queue;
    @Resource(mappedName = "jms/connectionFactory")
    private ConnectionFactory jmsConnectionFactory;
    //private Connection connection;
    public NewServlet() {
    super();
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    Connection connection = null;
    Destination dest = (Destination) queue;
    try {
    connection = jmsConnectionFactory.createConnection();
    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageProducer producer = session.createProducer(dest);
    TextMessage message = session.createTextMessage();
    message.setText("Hello");
    response.getOutputStream().println("Sending message: " + message.getText());
    System.out.println("Sending message: " + message.getText());
    producer.send(message);
    producer.send(session.createMessage());
    } catch (JMSException e) {
    e.printStackTrace();
    } finally {
    if (connection != null) {
    try {
    connection.close();
    } catch (JMSException e) {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    }Please could someone point me in the right direction.
    Many Thanks

  • EJBs sending multiple JMS messages

              I have two EJBs running on my server. Both EJBs are listening to a JMS topic.
              Upon recieveing
              a message from the topic, the EJBs need to do some processing and then write a
              different
              message to the topic. I would like both EJBs to receive the message (to maintain
              a certain
              state), but I do not want both EJBs to write another message to the topic. That
              causes issues
              because then other subscribers are receiving duplicate messages. Does anybody
              have any
              insight in to what I am trying to do?
              Thanks,
              Joel
              

              Yes, the MDBs are the same but are deployed on different servers in the cluster.
              I want both
              MDBs to have the ability to publish, but not at the same time. I would like the
              one MDB to be
              a failover type of service, in that it only publishes when the other is unable
              to for some reason.
              Tom Barnes <[email protected]> wrote:
              >Why can't one of the MDBs be coded such
              >that it won't publish a message? Are they
              >the same MDB but different deployments?
              >
              >
              >Joel wrote:
              >
              >> I have two EJBs running on my server. Both EJBs are listening to a
              >JMS topic.
              >> Upon recieveing
              >> a message from the topic, the EJBs need to do some processing and then
              >write a
              >> different
              >> message to the topic. I would like both EJBs to receive the message
              >(to maintain
              >> a certain
              >> state), but I do not want both EJBs to write another message to the
              >topic. That
              >> causes issues
              >> because then other subscribers are receiving duplicate messages. Does
              >anybody
              >> have any
              >> insight in to what I am trying to do?
              >>
              >> Thanks,
              >> Joel
              >
              

  • How to send JMS Message from a BPM Process

    Hi All
    I have small query regarding sending JMS Message from a bpm process. Is it possible to send JMS message from one bpm process to another bpm process.
    I have a scenario in which I need to send a JMS message to a queue where another process is listening on that queue and as soon as the message is received on the queue the process instance is created.
    I know how to listen for the JMS message on the queue, but I don't how to send a JMS message from a process.
    Also Can I create process by sending the Notification to the process instead of a JMS message. But the process to be created is not a subprocess i.e. Can notification be send accross different processes.
    Any information or example in this regard would be helpful.
    Thanks in advance
    Edited by: user9945154 on Apr 22, 2009 7:46 PM

    Hi,
    Here's one approach to sending JMS messages from an Oracle BPM process. If you're doing this just to send a message into another process, do not take this approach. It's far easier and quicker if you do this using the OOTB "send notification" logic.
    These steps describe how to do this using WebLogic. The steps would be different if you're using another ap server / JMS provider.
    1. Guessing you've already done this, but first expose the two required WebLogic jar files for JMS messaging as Java components in the External Resources. The two files for WebLogic are weblogic.jar and wljmsclient.jar” (located in the < WebLogic home directory > /weblogic/server/lib” directory).
    AquaLogic BPM JMS Queue Listener for WebLogic 8.1
    2. You've probably already done this, but add an External Resource to represent the J2EE container:
    • Name: “weblogicJ2EE” - this is important and will be used in the next step
    • Supported Type: “GENERIC_J2EE”
    • Initial Context Factory: “weblogic.jndi.WLInitialContextFactory”
    • URL: “t3://localhost:7001”
    • Principal: and Credentials: whatever userid and password you defined to access theWebLogic administrative console.
    3. Create the External Resource that represents the send queue configuration. In this example, I'm calling it “WebLogic Send Queue”. This is important - remember what you named it because you will use this name in the logic that sends the JMS message. This new External Resource is configured as:
    • J2EE: “weblogicJ2EE” (same name as the second External Resource you created)
    • Destination Type: “QUEUE”
    • Lookup Name: “weblogic.examples.jms.exampleQueue”
    • Connection Factory Lookup Name: “weblogic.examples.jms.QueueConnectionFactory”
    4. Here's the logic to send a Message to the Queue
    <pre class="jive-pre"><p />msg as String = "Hello World"
    jmsMsg as Fuego.Msg.JmsMessage
    msg = "<?xml version=\"1.0\"?><Msg>" + msg + "</Msg></xml>"
    jmsMsg = JmsMessage(type : JmsMessageType.TEXT)
    jmsMsg.textValue = msg
    sendMessage DynamicJMS
    using configuration = "WebLogic Send Queue",
    message = jmsMsg</pre>
    Note that the “sendMessage” method uses the configuration parameter “WebLogic Send Queue”. You previously created a JMS messaging service External Resource with this name in the third step.
    Again, please don't go this route if you're just using it to send notifications between processes,
    Dan

  • How to send JMS message from oracle to weblogic

    Hello,
    I am facing with a problem of sending jms message from oracle to weblogic. I am using oracle 10g and weblogic server 9.1. Here is the problem. I would like to create a trigger to send JMS message to weblogic server whenever there is an update in oracle database. So I created a java class that will send a jms message to weblogic server. But in that class I use the jndi from weblogic: weblogic.jndi.WLInitialContextFactory
    when I use the loadjava utility to load that class into oracle, the status of that class is invalid though this class is working fine in eclipse with the weblogic.jar included. I was thinking because the jndi from weblogic needs the weblogic.jar in order to work, then I loaded that jar file into oracle (it took about 20 minute to load everything) and everything loaded into oracle from that jar file is invalid and missing some reference.
    So my question is: how do I send a jms message from oracle to weblogic using a java class with the right jndi?
    Any help will be appreciated.
    Thanks
    TL

    It should be quite straightforward to do this. As stated you need weblogic.jar in your classpath, then use 100% standard JMS calls to publish.
    Ensure that you set the following properties before getting your initial context:
    java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://node:7001 (or whatever)
    this will ensure that the correct JMS implementation classes are invoked.
    You can't easily (without some mucking around) build a test implementation in an AQ environment and then deploy to WebLogic because in AQ you don't tend to use JNDI lookups (unless you've implemented oracle JNDI etc) but rather use non standard factory class to create connections etc.

  • Send JMS message from a webapp in Tomcat to JMS queue in SJSAS

    Hi, everybody
    I have a web application. Is is a simple JMS message sender: 2 jsp files(User Interface) and a java helper class which in charge of the sending of jms messages) . It runs well on SJSAS 9 web container.
    After I have moved it to Tomcat5.5.17(bundled with Netbeans5.5.1), I have the following exception when I visit the jsp page:
    type : Exception report
    message :
    description : The server encountered an internal error () that prevented it from fulfilling this request.
    exception:
    javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         java.lang.Thread.run(Thread.java:595)
    root cause :
    java.lang.NoClassDefFoundError
         org.apache.jasper.servlet.JspServlet.init(JspServlet.java:106)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         java.lang.Thread.run(Thread.java:595)I have imported appserv-rt.jar / appserv-ext.jar / appserv-deployment-jar / appserv-ws.jar / imqjmsra.jar / javaee.jar to my web application's library.
    And i have used the argu-ed Context to do JNDI job to find the JMS resources in SJSAS.
    I need your advices, thank you.

    The following is the detailed info contains in Tomcat's logs file
    SEVERE: StandardWrapper.Throwable
    java.lang.NoClassDefFoundError: javax/servlet/jsp/JspApplicationContext
         at org.apache.jasper.compiler.JspRuntimeContext.<clinit>(JspRuntimeContext.java:84)
         at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:106)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
         at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493)
         at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1204)
         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:585)
         at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
         at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
         at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
         at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1377)
         at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:814)
         at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:343)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:174)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    Sep 7, 2007 1:56:10 PM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /zzTomcat threw load() exception
    java.lang.NoClassDefFoundError: javax/servlet/jsp/JspApplicationContext
         at org.apache.jasper.compiler.JspRuntimeContext.<clinit>(JspRuntimeContext.java:84)
         at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:106)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
         at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493)
         at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1204)
         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:585)
         at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
         at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
         at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
         at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1377)
         at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:814)
         at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:343)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:174)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    Sep 7, 2007 1:57:14 PM org.apache.catalina.core.ApplicationContext log
    SEVERE: StandardWrapper.Throwable
    java.lang.NoClassDefFoundError
         at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:106)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    Sep 7, 2007 1:57:14 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Allocate exception for servlet jsp
    java.lang.NoClassDefFoundError
         at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:106)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    Sep 7, 2007 2:07:05 PM org.apache.catalina.core.ApplicationContext log
    SEVERE: StandardWrapper.Throwable
    java.lang.NoClassDefFoundError
         at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:106)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    Sep 7, 2007 2:07:05 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Allocate exception for servlet jsp
    java.lang.NoClassDefFoundError
         at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:106)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)

  • Send JMS messages from Oracle Procedure

    Hi
    I need to write an Oracle procedure that would send a JMS message. So please share your thoughts on how this can be done in Oracle.
    thank you

    sdk11 wrote:
    Hi
    I need to write an Oracle procedure that would send a JMS message. So please share your thoughts on how this can be done in Oracle.
    thank youhttp://www.lmgtfy.com/?q=Oracle+procedure+that+would+send+a+JMS+message
    Handle:      sdk11
    Status Level:      Newbie
    Registered:      Jan 13, 2010
    Total Posts:      56
    Total Questions:      30 (27 unresolved)
    why so many unanswered questions?
    Edited by: sb92075 on Jan 12, 2012 8:44 AM

  • JMS message, RMI calls and OPMN, is it possible?

    Hi all,
    sorry if this ask is OT but i'm not sure where the question would be pubblished.
    I would send a JMS message to the default demoQueue, but i'm not be able to establish the connection.
    if i use this url:
    java.naming.provider.url=opmn:ormi://remotehost:6004/home
    with the port specified into the file opmn.xml:
    <port local="6101" remote="6201" request="6004"/>
    i receve the error
    AVVERTENZA: Error in obtaining server list from OPMN on host quark.pisa.exis.it:6101. Please verify that OPMN is running.
    javax.naming.NameNotFoundException: java:comp/env/jms/ConnectionFactory not found
    at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at Sender.main(Sender.java:53)
    instead if i use the url
    java.naming.provider.url=ormi://remotehost:3204/home
    with the rmi port obteined with opmnctl status -l
    OC4J | home | 25380 | Alive | 734855204 | 61712 | 1193:02:~ | rmi:3204,jms:3704,ajp:3304
    the program start e stay in wait without any message and terminate only with the keys combination CTRL+C.
    Finally, i i try to use the url:
    java.naming.provider.url=ormi://remotehost/home
    i get the exception
    java.net.ConnectException: Connection refused: connect
    Can you help me?
    Thanks a lot.
    Alessandro
    PS Obviusly i use this class: com.evermind.server.rmi.RMIInitialContextFactory.

    Hi,
    I discovered because i was not be able to connect: I used incorrect type library!
    (i used 10.1.3 library for connect to 10.1.2 server; it seems to be not compatible, why?)
    Now i have another problem. When the program arrive at this point:
    // look up the ConnectionFactory
    javax.jms.ConnectionFactory factory = (javax.jms.ConnectionFactory) ctx.lookup("jms/QueueConnectionFactory");
    // create the connection
    javax.jms.Connection connection = factory.createConnection();
    it throwed the following exception:
    Exception in thread "main" java.lang.NoSuchMethodError: javax.jms.ConnectionFactory.createConnection()Ljavax/jms/Connection;
    Any idea?
    Thanks.
    Alessandro

Maybe you are looking for