-
1. TaskClient not connecting
npereira May 6, 2011 5:21 AM (in response to npereira)Hi Guys,
I have been going at it for a few days, and I can't quite understand why this issue is happening.
My code is the following:
TaskClient client = new TaskClient(new MinaTaskClientConnector("client 1", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
if(client.connect("10.50.1.123", 9123))
{
BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
client.getTasksAssignedAsPotentialOwner("krisv", "en-UK", taskSummaryResponseHandler);
List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();
}
else
System.out.println("Not connected!!!!!");
Everytime I try to connect from a different computer I keep gewtting the "Not Connected!!" message.
Did any of you guys have this problem?
Also I know that for Jboss you have the "./run.sh -b 0.0.0.0" command. Is there any command like this for Human Task Service?
Thanks
-
2. Re: TaskClient not connecting
bpmn2user May 8, 2011 12:25 PM (in response to npereira)Did you try setting the properties using taskHandler.SetConnection?
Try the following:
CommandBasedWSHumanTaskHandler taskHandler = new CommandBasedWSHumanTaskHandler(ksession);
taskHandler.setConnection("10.1.5.13", 9123);
-
3. Re: TaskClient not connecting
npereira May 10, 2011 5:27 AM (in response to bpmn2user)Hi bpmn2user,
Thanks for your reply, but unfortunatly I wasn't able to connect. I tried,
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
CommandBasedWSHumanTaskHandler taskHandler = new CommandBasedWSHumanTaskHandler(ksession);
taskHandler.setConnection("10.1.5.148", 9123);
taskHandler.connect();
TaskClient client = new TaskClient(new MinaTaskClientConnector("client 1", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
taskHandler.setClient(client);
if(client.connect())
System.out.println("OK");
else
System.out.println("NOT OK");
But on the highlighted line, I get the following error,
Exception in thread "main" java.lang.IllegalArgumentException: Could not connect task client
at org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler.connect(CommandBasedWSHumanTaskHandler.java:88)
Does it make any sense to you? Is it something I'm missing in my code?
Regards,
Nelson
-
4. Re: TaskClient not connecting
calca May 11, 2011 9:57 PM (in response to npereira)Hi!
I think the Jbpm5 Mina server will not accept conections outsided 127.0.0.1. If you check the class
The start() method configures the local interface used to accept connections:
acceptor.bind( new InetSocketAddress( "127.0.0.1", port ) );
and this "127.0.0.1" will only accept local conections.
If we want to let clients from outside, should this parameter be configurable?
-
5. TaskClient not connecting
npereira May 14, 2011 8:24 AM (in response to calca)Hi Demian,
Thanks for the help.
It real seems that this is hard coded.
I hope someone in the forum, can shed some light and if there is a the possibility to configure this parameter?
Regards,
Nelson
-
-
7. Re: TaskClient not connecting
npereira Aug 15, 2011 7:34 AM (in response to npereira)Hi forum,
I have been monitoring this issue and I see that it has been resolved.
I tried it out with the latest release but I'm still getting the same error?
Can you guys help me out!
Regards
-
8. Re: TaskClient not connecting
calca Aug 15, 2011 9:28 AM (in response to npereira)Have you tried creating the mina task server with binding all interfaces? Using this constructor:
+ public BaseMinaTaskServer(IoHandlerAdapter handler, int port, + String localInterface) { + this.handler = handler; + this.port = port; + this.localInterface = localInterface; + } with localInterface = "0.0.0.0"
BTW, you should try hornetQ based task client/server, which is more powerful (sending JMS messages, persist messages, include it in transactions).
Regards,
Demian