Start process error
wesleychen Jan 10, 2015 11:12 AMHi All,
I am starting an HR sample process of jbpm-console, but get error as below. Can you help me? Thanks.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.NoSuchMethodError: org.kie.services.client.serialization.jaxb.impl.JaxbCommandsRequest.setUser(Ljava/lang/String;)V
at org.kie.services.client.api.command.AbstractRemoteCommandObject.prepareCommandRequest(AbstractRemoteCommandObject.java:196)
at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:372)
at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:120)
at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:230)
at com.sample.TestjBPM.test(TestjBPM.java:48)
at com.sample.TestjBPM.main(TestjBPM.java:26)
Code:
public class TestjBPM {
public static void main(String[] args) throws MalformedURLException {
try {
// /maven2/com/test/1.0/test-1.0.jar
new TestjBPM().test("org.jbpm:HR:1.0", new URL("http://localhost:8080/jbpm-console"), "krisv", "krisv");
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void test(String deploymentId, URL deploymentUrl, String user, String password) {
// Create REST session
RemoteRestSessionFactory restSessionFactory
= new RemoteRestSessionFactory(deploymentId, deploymentUrl, user, password);
RuntimeEngine engine = restSessionFactory.newRuntimeEngine();
KieSession ksession = engine.getKieSession();
Map<String, Object> params = new HashMap<String, Object>();
params.put("name", "johny");
ProcessInstance processInstance = ksession.startProcess("hiring", params); // error
processInstance.getProcessId();
// ProcessInstance processInstance = ksession.startProcess("process_1");
Regards,
Wesley Chen