JBPM 6 exception while trying to start a process using API
pmehra1 Feb 16, 2014 1:27 AMI created a simple process using the jbpm console (JBPM 6.0.0) which has some user tasks. I wanted to try out controlling the process using the API so created a simple web application and used the following code to start the process that I made in the jbpm console:
String deploymentId = "IncidentManagement";
String url = "http://localhost:8080/jbpm-console/";
URL baseURL = new URL(url);
String user = "krisv";
String password = "krisv";
long procId = 0;
try {
RemoteRestRuntimeFactory restSessionFactory = new RemoteRestRuntimeFactory(
deploymentId, baseURL, user, password);
RuntimeEngine engine = restSessionFactory.newRuntimeEngine();
KieSession ksession = engine.getKieSession();
ProcessInstance processInstance = ksession
.startProcess("IncidentManagement.IncidentManagementProces");
log.info("process instance: " + processInstance);
if (processInstance != null) {
procId = processInstance.getId();
log.info("process id: " + procId);
}
} catch (Exception e) {
e.printStackTrace();
}
However I get the error below:
13:42:32,796 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) java.lang.UnsupportedOperationException: Unsupported JAXB Class during initialization: 2 counts of IllegalAnnotationExceptions
13:42:32,802 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.kie.services.client.serialization.JaxbSerializationProvider.initializeJaxbContext(JaxbSerializationProvider.java:78)
13:42:32,807 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.kie.services.client.serialization.JaxbSerializationProvider.<init>(JaxbSerializationProvider.java:71)
13:42:32,811 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.kie.services.client.api.command.RemoteConfiguration.getJaxbSerializationProvider(RemoteConfiguration.java:395)
13:42:32,815 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:310)
13:42:32,819 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:110)
13:42:32,824 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:232)
13:42:32,827 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223)
13:42:32,832 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at projectx.incidentmgmt.IncidentMgmt.doGet(IncidentMgmt.java:53)
13:42:32,835 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
13:42:32,838 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
13:42:32,842 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
13:42:32,846 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
13:42:32,852 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
13:42:32,856 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
13:42:32,859 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
13:42:32,864 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
13:42:32,868 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
13:42:32,872 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:397)
13:42:32,875 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
13:42:32,879 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
13:42:32,883 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
13:42:32,887 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
13:42:32,892 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
13:42:32,896 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at java.lang.Thread.run(Thread.java:662)
13:42:32,899 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
13:42:32,904 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) java.util.Map is an interface, and JAXB can't handle interfaces.
13:42:32,907 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) this problem is related to the following location:
13:42:32,909 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at java.util.Map
13:42:32,910 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at private java.util.Map org.kie.services.client.serialization.jaxb.impl.process.JaxbWorkItem.parameters
13:42:32,913 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.kie.services.client.serialization.jaxb.impl.process.JaxbWorkItem
13:42:32,915 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at private java.util.List org.kie.services.client.serialization.jaxb.impl.JaxbCommandsResponse.responses
13:42:32,918 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.kie.services.client.serialization.jaxb.impl.JaxbCommandsResponse
13:42:32,920 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) java.util.Map does not have a no-arg default constructor.
13:42:32,923 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) this problem is related to the following location:
13:42:32,927 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at java.util.Map
13:42:32,929 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at private java.util.Map org.kie.services.client.serialization.jaxb.impl.process.JaxbWorkItem.parameters
13:42:32,933 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.kie.services.client.serialization.jaxb.impl.process.JaxbWorkItem
13:42:32,936 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at private java.util.List org.kie.services.client.serialization.jaxb.impl.JaxbCommandsResponse.responses
13:42:32,940 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.kie.services.client.serialization.jaxb.impl.JaxbCommandsResponse
13:42:32,944 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)
13:42:32,945 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:106)
13:42:32,950 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:466)
13:42:32,954 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:298)
13:42:32,958 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:141)
13:42:32,961 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1157)
13:42:32,964 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
13:42:32,966 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:42:32,968 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
13:42:32,972 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
13:42:32,974 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at java.lang.reflect.Method.invoke(Method.java:597)
13:42:32,976 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
13:42:32,978 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at javax.xml.bind.ContextFinder.find(ContextFinder.java:392)
13:42:32,980 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
13:42:32,983 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:565)
13:42:32,985 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.kie.services.client.serialization.JaxbSerializationProvider.initializeJaxbContext(JaxbSerializationProvider.java:76)
13:42:32,989 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) ... 23 more
When I searched up on this error I found this link on it https://bugzilla.redhat.com/show_bug.cgi?id=1033590. So I replaced the 6.0.0 jars with the 6.0.1 jars that are currently the latest available but the error is still coming. Is this an issue for which a fix is not done yet?
Does this happen in JBPM 5 for instance as well?