vishal sharma [
http://community.jboss.org/people/2sharma.vishal] created the discussion
"Re: Exception Using port 9123"
To view the discussion, visit:
http://community.jboss.org/message/608705#608705
--------------------------------------------------------------
I have removed the human task from the build.xm and now its not showing the error with the
port 9123, But now I have some other problems, so I am not sure from where the problem
begins I cannot export my package to the guvnor frontend fromt the eclipse side and I also
cannot view the process in the jbpm console.I am not sure which code you are talking about
but I am attaching my java code, bpmn2.0 and the .ftll files and all the configuration
files as well, so that you can have a look.
Thanks
#########main class###########
package com.sample;
import java.util.Properties;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.SystemEventListenerFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.compiler.BPMN2ProcessFactory;
import org.drools.compiler.ProcessBuilderFactory;
import org.drools.impl.EnvironmentFactory;
import org.drools.io.ResourceFactory;
import org.drools.logger.KnowledgeRuntimeLogger;
import org.drools.logger.KnowledgeRuntimeLoggerFactory;
import org.drools.marshalling.impl.ProcessMarshallerFactory;
import org.drools.runtime.KnowledgeSessionConfiguration;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.process.ProcessRuntimeFactory;
import org.jbpm.bpmn2.BPMN2ProcessProviderImpl;
import org.jbpm.marshalling.impl.ProcessMarshallerFactoryServiceImpl;
import org.jbpm.process.builder.ProcessBuilderFactoryServiceImpl;
import org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl;
import org.jbpm.process.workitem.wsht.WSHumanTaskHandler;
import org.jbpm.task.User;
import org.jbpm.task.service.TaskService;
import org.jbpm.task.service.TaskServiceSession;
import org.jbpm.task.service.mina.MinaTaskServer;
/**
* This is a sample file to launch a process.
*/
public class ProcessTest {
public static final void main(String[] args) {
try {
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("org.jbpm.task");
TaskService taskService = new TaskService(emf,
SystemEventListenerFactory.getSystemEventListener());
/*
* Add the required users
*/
TaskServiceSession taskSession = taskService.createSession();
taskSession.addUser(new User("Administrator"));
taskSession.addUser(new User("krisv"));
/* Start Mina server for HT*/
MinaTaskServer server = new MinaTaskServer(taskService);
Thread thread = new Thread(server);
thread.start();
System.out.println("Server started ...");
/*Create the knowledge base for HelloProcss.bpmn */
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = createSession(kbase);
KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "testlog", 1000);
ksession.getWorkItemManager().registerWorkItemHandler("Human
Task", new WSHumanTaskHandler());
//ProcessTest pt = new ProcessTest();
//ksession.insert(pt);
System.out.println(" started the humantask");
ksession.startProcess("com.sample.bpmn.hello");
logger.close();
} catch (Throwable t) {
t.printStackTrace();
}
}
private static KnowledgeBase readKnowledgeBase() throws Exception {
ProcessBuilderFactory.setProcessBuilderFactoryService(new
ProcessBuilderFactoryServiceImpl());
ProcessMarshallerFactory.setProcessMarshallerFactoryService(new
ProcessMarshallerFactoryServiceImpl());
ProcessRuntimeFactory.setProcessRuntimeFactoryService(new
ProcessRuntimeFactoryServiceImpl());
BPMN2ProcessFactory.setBPMN2ProcessProvider(new
BPMN2ProcessProviderImpl());
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("sample.bpmn"),
ResourceType.BPMN2);
return kbuilder.newKnowledgeBase();
}
private static StatefulKnowledgeSession createSession(KnowledgeBase kbase) {
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory",
"org.jbpm.process.instance.impl.DefaultProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory",
"org.jbpm.process.instance.event.DefaultSignalManagerFactory");
KnowledgeSessionConfiguration config =
KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
return kbase.newStatefulKnowledgeSession(config,
EnvironmentFactory.newEnvironment());
}
}
#########hello.ftl##########
<html>
<body>
<h2>Hello</h2>
<hr>
This will start the Hello process !
<form action="complete" method="POST"
enctype="multipart/form-data">
<input type="submit" value="Complete">
</form>
</body>
</html>
######HelloTask.ftl########
<html>
<body>
<h2>Hello</h2>
<hr>
Hello World !
<form action="complete" method="POST"
enctype="multipart/form-data">
<input type="submit" value="Complete">
</form>
</body>
</html>
###########sample.bpmn###########
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
targetNamespace="
http://www.jboss.org/drools
http://www.jboss.org/drools"
typeLanguage="
http://www.java.com/javaTypes
http://www.java.com/javaTypes"
expressionLanguage="
http://www.mvel.org/2.0
http://www.mvel.org/2.0"
xmlns="
http://www.omg.org/spec/BPMN/20100524/MODEL
http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xs="
http://www.w3.org/2001/XMLSchema-instance
http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="
http://www.omg.org/spec/BPMN/20100524/MODEL
http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="
http://www.jboss.org/drools/flow/gpd
http://www.jboss.org/drools/flow/gpd"
xmlns:bpmndi="
http://www.omg.org/spec/BPMN/20100524/DI
http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="
http://www.omg.org/spec/DD/20100524/DC
http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="
http://www.omg.org/spec/DD/20100524/DI
http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns="
http://www.jboss.org/drools
http://www.jboss.org/drools">
<process processType="Private" isExecutable="true"
id="com.sample.bpmn.hello" name="Hello World" >
<!-- nodes -->
<startEvent id="_1" name="StartProcess" />
<userTask id="_2" name="User Task" >
<ioSpecification>
<dataInput id="_2_CommentInput" name="Comment" />
<dataInput id="_2_SkippableInput" name="Skippable" />
<dataInput id="_2_ContentInput" name="Content" />
<dataInput id="_2_TaskNameInput" name="TaskName" />
<dataInput id="_2_PriorityInput" name="Priority" />
<inputSet>
<dataInputRefs>_2_CommentInput</dataInputRefs>
<dataInputRefs>_2_SkippableInput</dataInputRefs>
<dataInputRefs>_2_ContentInput</dataInputRefs>
<dataInputRefs>_2_TaskNameInput</dataInputRefs>
<dataInputRefs>_2_PriorityInput</dataInputRefs>
</inputSet>
<outputSet>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<targetRef>_2_CommentInput</targetRef>
<assignment>
<from xs:type="tFormalExpression">hello!!!!!!!</from>
<to xs:type="tFormalExpression">_2_CommentInput</to>
</assignment>
</dataInputAssociation>
<dataInputAssociation>
<targetRef>_2_SkippableInput</targetRef>
<assignment>
<from xs:type="tFormalExpression">false</from>
<to xs:type="tFormalExpression">_2_SkippableInput</to>
</assignment>
</dataInputAssociation>
<dataInputAssociation>
<targetRef>_2_ContentInput</targetRef>
<assignment>
<from xs:type="tFormalExpression"></from>
<to xs:type="tFormalExpression">_2_ContentInput</to>
</assignment>
</dataInputAssociation>
<dataInputAssociation>
<targetRef>_2_TaskNameInput</targetRef>
<assignment>
<from xs:type="tFormalExpression">HelloTask</from>
<to xs:type="tFormalExpression">_2_TaskNameInput</to>
</assignment>
</dataInputAssociation>
<dataInputAssociation>
<targetRef>_2_PriorityInput</targetRef>
<assignment>
<from xs:type="tFormalExpression"></from>
<to xs:type="tFormalExpression">_2_PriorityInput</to>
</assignment>
</dataInputAssociation>
<potentialOwner>
<resourceAssignmentExpression>
<formalExpression>krisv</formalExpression>
</resourceAssignmentExpression>
</potentialOwner>
</userTask>
<endEvent id="_3" name="End" >
<terminateEventDefinition/>
</endEvent>
<!-- connections -->
<sequenceFlow id="_1-_2" sourceRef="_1"
targetRef="_2" />
<sequenceFlow id="_2-_3" sourceRef="_2"
targetRef="_3" />
</process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="com.sample.bpmn.hello" >
<bpmndi:BPMNShape bpmnElement="_1" >
<dc:Bounds x="37" y="135" width="48"
height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_2" >
<dc:Bounds x="189" y="140" width="100"
height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" >
<dc:Bounds x="475" y="145" width="48"
height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_1-_2" >
<di:waypoint x="61" y="159" />
<di:waypoint x="239" y="164" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_2-_3" >
<di:waypoint x="239" y="164" />
<di:waypoint x="499" y="169" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/608705#608705]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]