-
15. Re: REST interface for JBPM
jkranes Jul 23, 2010 9:37 AM (in response to jump)I just ran across this post and wish I had found it a few months ago, as I've already done much the same thing as you for my own project. My REST API is not nearly as complete, as I've been building it out on an as-needed basis as we have added features to the application. My intent was not to create a full REST version of JBPM but rather a REST API to a specific JBPM-based application. In practice however many of the REST API methods have turned out to be pretty much the same as yours -- i.e. straight passthroughs to underlying JBPM engine.
I am also using JAXB but in a somewhat different manner. I am letting JAXB generate java classes from my schema and then using conversion code to translate between the JAXB generated classes and the JBPM classes. I am using Spring Framework 3.0 web MVC features, which integrate both the JAXB marshalling and also Jackson JAXB-aware JSON marshalling, so the application will switch from XML to JSON responses just by changing the 'Accept' header of the request.
I will have a look at your implementation in more detail and see if there are any areas where we might share code or technical info. Thanks for posting your code!
-
16. REST interface for JBPM
kaissun May 4, 2011 5:02 AM (in response to jump)My app server is Jboss, not tomcat as you use but i change the build properties.
And the poylement is succesful.
i have some problems in my application Server
like this
CONFIG [EJBComponentProviderFactoryInitilizer] The EJB interceptor binding API is not available. JAX-RS EJB support is disabled.
javax.naming.NameNotFoundException: org.glassfish.ejb.container.interceptor_binding_spi not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.sun.jersey.server.impl.ejb.EJBComponentProviderFactoryInitilizer.initialize(EJBComponentProviderFactoryInitilizer.java:56)
at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:486)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:246)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:520)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:199)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:308)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:471)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
at $Proxy38.start(Unknown Source)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
at org.jboss.system.ServiceController.start(ServiceController.java:460)
at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:619)
Could you help me to solve the problem please !
thanks in advance.
-
17. Re: REST interface for JBPM
jump May 4, 2011 7:16 AM (in response to kaissun)I guess, there is a problem with your Jersey servlet. Plz check your web.xml . Compare it with my one in attachment. I havn't deployed it yet on any enterprise containers, cause my idea was to use something lightweight, until there is no leak of functionality.
P.S. by the way dont forget to update from repository. And now it is a maven project, so you can simply type mvn clean package tomcat:deploy to deploy it on your tomcat server (I assume, that you already added you tomcat manager to maven settings.xml), so why not to deploy jbpm + rest wrapper as a standalone server?
P.P.S. There is a lot of new features not yet described in wiki article. I hope to rebuild it soon. Check /jbpm-rest/application.wadl for the full list.
-
web.xml 1.1 KB
-
-
18. Re: REST interface for JBPM
arosselet May 27, 2011 6:13 AM (in response to jump)Hi,
We're trying to build the project and this dependency is not resolvable.. and we can't find a repo with it anywhere:
<dependency>
<groupId>eu.bmstu.ru</groupId>
<artifactId>bmstu-bpm-handlers</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
the only repo in the pom.xml that looks relevant points to a local repo:
http://localhost:8081/nexus/content/repositories/bmstu-repo
Could someone possibly give us a link to a repo with this artifact, or an URL where we could download it from?
Thnx
-
19. Re: REST interface for JBPM
jump May 27, 2011 6:42 AM (in response to arosselet)Sorry, that's my proprietary shit you can remove it. That's nothing but transition handlers for my processes.
-
20. Re: REST interface for JBPM
arosselet May 27, 2011 7:22 AM (in response to jump)ah.. great. thnx
-
21. Re: REST interface for JBPM
arosselet May 31, 2011 4:56 AM (in response to jump)Hi Alex,
When trying to get a list with /exec/executions we are getting a heap space error - it seems to go into a recursive loop when it encounters
an execution with children - it gets the first child, then that gets it's parent, which gets the first child which.... and so on. Have you encountered this and/or have a fix for it?
http://localhost:8080/jbpm-rest/exec/executions
and we have for example a bunch of executions and 1 execution with 2 children gives logging output like this:
10:54:22,411 INFO [ClearNamespaceFilter] no cleanup required
10:54:31,939 INFO [JaxbFilter] I can write xml myself! Yeah, I dont trust jetty!
10:54:31,939 INFO [Execution] getting parent for choicetest.20049 <------------- this one is fine - no children
10:54:31,939 INFO [Execution] getting parent for tasktest.270014 <------------- this one have 2 children - but we never get to the second one...
10:54:31,939 INFO [Execution] getting parent for tasktest.270014.to taskForPeter.270030
10:54:31,939 INFO [Execution] getting parent for tasktest.270014
10:54:31,939 INFO [Execution] getting parent for tasktest.270014.to taskForPeter.270030
10:54:31,940 INFO [Execution] getting parent for tasktest.270014
10:54:31,940 INFO [Execution] getting parent for tasktest.270014.to taskForPeter.270030
10:54:31,940 INFO [Execution] getting parent for tasktest.270014
10:54:31,940 INFO [Execution] getting parent for tasktest.270014.to taskForPeter.270030
10:54:31,940 INFO [Execution] getting parent for tasktest.270014
10:54:31,940 INFO [Execution] getting parent for tasktest.270014.to taskForPeter.270030
10:54:31,940 INFO [Execution] getting parent for tasktest.270014
.... and so on.....
Any ideas would be great..
Cheers+Thanks
Ati
-
22. Re: REST interface for JBPM
jump May 31, 2011 5:09 AM (in response to arosselet)Thx for bug report. Can I get your process definition to reproduce this bug?
-
23. Re: REST interface for JBPM
arosselet May 31, 2011 6:59 AM (in response to jump)I Hope this is what you mean. I can't see how to attach a file, but its small, so I'll just paste it here. We have a couple instances in the executions, but it never gets past the first one.. you'll probably have to remove the custom activity ..
-------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<process name="test" xmlns="http://jbpm.org/4.4/jpdl" key="tasktest">
<start g="66,327,48,48" name="start1">
<transition name="to taskForPeterOrMary" to="taskForPeterOrMary" g="-126,-19"/>
</start>
<task g="115,202,138,52" name="taskForPeterOrMary">
<assignment-handler class="wftest.MyAssignmentHandler"/>
<transition name="to fork1" to="fork1" g="-45,-19"/>
</task>
<task g="419,69,92,52" name="taskForPeter">
<assignment-handler class="wftest.MyAssignmentHandler"/>
<transition name="to join1" to="join1" g="-45,-19"/>
</task>
<task g="417,352,92,52" name="taskForMary">
<assignment-handler class="wftest.MyAssignmentHandler"/>
<transition name="to join1" to="join1" g="-45,-19"/>
</task>
<fork name="fork1" g="362,199,48,48">
<transition name="to taskForPeter" to="taskForPeter" g="-88,-19"/>
<transition name="to TaskForMary" to="taskForMary" g="-87,-19"/>
</fork>
<join name="join1" g="549,208,48,48">
<transition name="to custom1" to="customActivity" g="-66,-19"/>
</join>
<custom name="customActivity" g="628,74,92,52" class="wftest.MyExternalActivity">
<transition name="to end1" to="end1" g="-46,-19"/>
</custom>
<end name="end1" g="749,211,48,48"/>
</process>