Error in cockpit plugin

535 views
Skip to first unread message

harshal...@gmail.com

unread,
Feb 25, 2016, 8:18:56 AM2/25/16
to camunda BPM users
Hello

I have created a simple cockpit plugin which fetches the key (process definition) and process instance id. Onclick of the process instance id, an error has been encountered.

[1] popup in UI.
[2] Logs/Console.

Please guide me.

Thanks & Regards
Harshal Temkar

[1]
Server Error :
Could not find resource for relative : /plugin/cockpit-plugin/default/process-instance/029fd3f3-da17-11e5-a25f-2e10fc3a895c of full path: http://localhost:8080/camunda/api/cockpit/plugin/cockpit-plugin/default/process-instance/029fd3f3-da17-11e5-a25f-2e10fc3a895c

[2]
25-Feb-2016 18:46:28.045 WARNING [http-nio-8080-exec-9] null.null org.jboss.resteasy.spi.NotFoundException: Could not find resource for relative : /plugin/cockpit-plugin/default/process-instance/029fd3f3-da17-11e5-a25f-2e10fc3a895c of fullpath: http://localhost:8080/camunda/api/cockpit/plugin/cockpit-plugin/default/process-instance/029fd3f3-da17-11e5-a25f-2e10fc3a895c
at org.jboss.resteasy.core.registry.RootSegment.matchChildren(RootSegment.java:360)
at org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:374)
at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:353)
at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:144)
at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:92)
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:41)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilterSecure(SecurityFilter.java:67)
at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilter(SecurityFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:59)
at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:56)
at org.camunda.bpm.webapp.impl.security.SecurityActions.runWithAuthentications(SecurityActions.java:38)
at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:56)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

Roman Smirnov

unread,
Feb 26, 2016, 3:58:25 AM2/26/16
to camunda BPM users, harshal...@gmail.com
Hi Harshal,

Have you added a root resource to your backend of your plugin (see [1])?

Cheers,
Roman

harshal...@gmail.com

unread,
Feb 26, 2016, 8:14:39 AM2/26/16
to camunda BPM users, harshal...@gmail.com
Hi Roman,

Thanks for your reply

I have included the JAX-RS [1 a][1 b], but issue remains [2].
I have also included file in test folder [3]. I am receiving [4] error.

Guide me,

Thanks & Regards
Harshal Temkar

[1 a] https://docs.camunda.org/manual/7.4/examples/tutorials/develop-cockpit-plugin/#server-side
[1 b] https://docs.camunda.org/manual/7.4/reference/rest/overview/embeddability/#required-steps
[2 (UI)]Server Error : Process engine persistence exception
[2 Console] http://localhost:8080/camunda/api/cockpit/plugin/cockpit-plugin/default/process-instance/23b6c169-dbae-11e5-8bc5-2e10fc3a895c 500 (Internal Server Error)
[3] https://docs.camunda.org/manual/7.4/examples/tutorials/develop-cockpit-plugin/#testing-plug-in-discovery
[4] java.lang.ExceptionInInitializerError
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.IllegalStateException: No implementation for the org.camunda.bpm.engine.rest.spi.ProcessEngineProvider spi found on classpath
at org.camunda.bpm.webapp.impl.AbstractAppRuntimeDelegate.loadProcessEngineProvider(AbstractAppRuntimeDelegate.java:78)
at org.camunda.bpm.webapp.impl.AbstractAppRuntimeDelegate.<init>(AbstractAppRuntimeDelegate.java:43)
at org.camunda.bpm.cockpit.impl.DefaultCockpitRuntimeDelegate.<init>(DefaultCockpitRuntimeDelegate.java:48)
at org.camunda.bpm.cockpit.plugin.test.AbstractCockpitPluginTest$TestCockpitRuntimeDelegate.<init>(AbstractCockpitPluginTest.java:101)
at org.camunda.bpm.cockpit.plugin.test.AbstractCockpitPluginTest$TestCockpitRuntimeDelegate.<init>(AbstractCockpitPluginTest.java:101)
at org.camunda.bpm.cockpit.plugin.test.AbstractCockpitPluginTest.<clinit>(AbstractCockpitPluginTest.java:39)
... 16 more
Caused by: java.util.NoSuchElementException
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at org.camunda.bpm.webapp.impl.AbstractAppRuntimeDelegate.loadProcessEngineProvider(AbstractAppRuntimeDelegate.java:75)
... 21 more

java.lang.NoClassDefFoundError: Could not initialize class org.camunda.bpm.cockpit.plugin.test.AbstractCockpitPluginTest
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Roman Smirnov

unread,
Feb 26, 2016, 8:38:58 AM2/26/16
to camunda BPM users, harshal...@gmail.com
Hi,

Why do want to embed the REST Api?

Please stick to this example.

Cheers,
Roman

harshal...@gmail.com

unread,
Feb 29, 2016, 4:08:10 AM2/29/16
to camunda BPM users, harshal...@gmail.com
Hello Roman,

As per link provided, I did not find any Id passing.

My requirement is based on variable I pass and I need to retrieve some values of that variable.

I have been using [1] and I am getting this error[2].
Note: I am getting the variable/reference Id in SOP.

How do I include Id in [1] and Where/What am I missing.

Thanks and Regards
Harshal Temkar

[1]
public class VariableProcessInstanceResource extends AbstractCockpitPluginResource {

public VariableProcessInstanceResource(String engineName) {
super(engineName);
}

@GET
@Produces(MediaType.APPLICATION_JSON)
public List<VariableProcessInstanceDto> getVariableProcess(@PathParam("id") String id) {
return getQueryService()
.executeQuery(
"org.camunda.bpm.demo.cockpit.plugin.history.selectVariableProcessInstance",
new QueryParameters<VariableProcessInstanceDto>());
}
}

[2]
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionExce
ption: There is no getter for property named 'id' in 'class org.camunda.bpm.cockpit.db.QueryParameters'
### Cause: org.apache.ibatis.reflection.ReflectionException: There is no getterfor property named 'id' in 'class org.camunda.bpm.cockpit.db.QueryParameters'
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:111)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.selectList(DbSqlSession.java:87)
at org.camunda.bpm.cockpit.impl.db.QueryServiceImpl$1.execute(QueryServiceImpl.java:37)
at org.camunda.bpm.cockpit.impl.db.QueryServiceImpl$1.execute(QueryServiceImpl.java:33)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:95)
... 54 more

Roman Smirnov

unread,
Feb 29, 2016, 4:44:15 AM2/29/16
to camunda BPM users, harshal...@gmail.com
Hi,

This can be done as follows:


public VariableInstanceQueryDto extends AbstractRestQueryParametersDto<VariableProcessInstanceDto> {

  protected String id;

  public VariableInstanceQueryDto() {}

  public VariableInstanceQueryDto(MultivaluedMap<String, String> queryParameters) {
    super(queryParameters);
  }

  public String getId() {
    return id;
  }

  @CamundaQueryParam("id")
  public void setId(String id) {
    this.id = id;
  }

  protected boolean isValidSortByValue(String value) {
    return false;
  }

  protected String getOrderByValue(String sortBy) {
    return super.getOrderByValue(sortBy);
  }

}

 

Then:


import javax.ws.rs.core.UriInfo;

@GET
@Produces(MediaType.APPLICATION_JSON)
public List<VariableProcessInstanceDto> getVariableProcess(@Context UriInfo uriInfo) {
  VariableInstanceQueryDto query = new VariableInstanceQueryDto(uriInfo.getQueryParameters());
  return getQueryService()
    executeQuery(
      "org.camunda.bpm.demo.cockpit.plugin.history.selectVariableProcessInstance",
      query
    );
}
 

Cheers,
Roman

harshal...@gmail.com

unread,
Feb 29, 2016, 6:38:50 AM2/29/16
to camunda BPM users, harshal...@gmail.com
Hello Roman,

Thanks For the reply.

[1] With the above reference, I am not able to get the values, its giving me [](blank data) in console (UI).
When I execute the same(query) in Db, it contains values. What should be done for displaying the values.

[2] Could you please explain the above process, which you have defined.

Roman Smirnov

unread,
Mar 1, 2016, 2:52:26 AM3/1/16
to camunda BPM users, harshal...@gmail.com
Hi Harshal,

Could you please share somehow your code? It is quite difficult to say what is missing to get the plugin working without the sources.

In general the necessary steps how to develop a cockpit plugin is described here: https://docs.camunda.org/manual/7.4/examples/tutorials/develop-cockpit-plugin/

Cheers,
Roman

harshal...@gmail.com

unread,
Mar 2, 2016, 11:39:00 PM3/2/16
to camunda BPM users, harshal...@gmail.com
Hello Roman,

Thanks for the reply.

I have changed some of the inbuilt method of uriInfo and works.

Thanks for your support.

Regards
Harshal

Reply all
Reply to author
Forward
0 new messages