[JBoss jBPM] - Have a node wait for JMS message - Problem
by anb@beyondfibre.tv
Hello everyone,
I have a node in my process that I want to wait on a jms message. I'm using the following code:
package ch.siesa.beyondfibre.jbpm.customer.delete;
|
| import javax.jms.*;
| import javax.naming.*;
|
| import org.jbpm.graph.def.ActionHandler;
| import org.jbpm.graph.exe.ExecutionContext;
|
| public class WaitAction implements ActionHandler, MessageListener{
|
| private static final long serialVersionUID = 1L;
|
| Context jndiContext = null;
| ExecutionContext executionContext = null;
| TopicConnectionFactory topicConnectionFactory = null;
| TopicConnection topicConnection = null;
| TopicSession topicSession = null;
| Topic topic = null;
| TopicSubscriber topicSubscriber = null;
|
| public void execute(ExecutionContext ctx) throws Exception {
| System.out.println("Subscribing node to JMS topic...");
| this.executionContext = ctx;
| jndiContext = new InitialContext();
| topicConnectionFactory = (TopicConnectionFactory)jndiContext.lookup("TopicConnectionFactory");
| topic = (Topic) jndiContext.lookup("topic/testTopic");
| topicConnection = topicConnectionFactory.createTopicConnection();
| topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
| topicSubscriber = topicSession.createSubscriber(topic);
| topicSubscriber.setMessageListener(this);
| topicConnection.start();
| System.out.println("Subscription ok, waiting !");
| }
|
| public void onMessage(Message message) {
| executionContext.leaveNode("success");
| }
|
|
| }
|
It is however throwing an exception:
11:09:44,983 ERROR [GraphElement] action threw exception: This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6
javax.jms.IllegalStateException: This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6
I have two questions :
- Is there a workaround this exception ?
- Isn't there a simpler way to have a node wait for a message ?
Thanking you all in advance :)
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4145098#4145098
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4145098
18 years, 3 months
[JBoss jBPM] - Problems with WSDL for incoming asyncronous request in BPEL
by conoroneill
I'm trying to write a BPEL process which receives callbacks from a third-party service. I can successfully invoke synchronous calls to/from that service. It has published a separate WSDL for its callbacks. I have (after some problems) managed to get jBPM to use this WSDL and it can successfully wait for and accept the incoming requests. However, if I try to inspect any of the incoming message data, no matter what I try, I'm getting an uninitialised variable error.
The message definition in the WSDL is element style; it looks like:
< message name="ImportCompleteEventIn" >
< part name="in" element="store-types:ImportCompleteEvent"/ >
< /message >
The variable definition looks like this:
< bpws:variable messageType="scwsdl:ImportCompleteEventIn" name="storeCallbackImportCompleteVar" />
The receive:
< bpws:receive partnerLink="StoreCallbackPL" operation="ImportCompleteEvent" variable="storeCallbackImportCompleteVar" />
Has anyone seen this before? Any suggestions? I can't publish the entire 3rd-party WSDL here.
I have also tried using both a < receive > and a < pick >< onMessage > structure, and they both exhibit the same problems.
However, this might be caused by some other jax-rpc problem. When I deploy this BPEL process, I get these messages appearing on the JBoss stdout:
09:48:27,612 WARN [builder.jaxrpc.JAXRPCMetaDataBuilder] Cannot obtain java type mapping for: {http://www.w3.org/2001/XMLSchema}string
09:48:27,737 INFO [STDOUT] no object for {http://schemas.xmlsoap.org/ws/2004/08/addressing}ReplyAfterType
09:48:27,737 INFO [STDOUT] no object for {http://schemas.xmlsoap.org/ws/2004/08/addressing}AttributedQName
09:48:27,737 INFO [STDOUT] no object for {http://schemas.xmlsoap.org/ws/2004/08/addressing}AttributedURI
...
I also get similar messages for some of the elements defined in my 3rd-party schema.
Many thanks for any help you can give.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4145094#4145094
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4145094
18 years, 3 months