cancel
Showing results for 
Search instead for 
Did you mean: 

Exception when calling the module activiti-rest

htmfilho
Champ in-the-making
Champ in-the-making
I'm running the default configuration of Activiti (Tomcat, H2, etc.) and everything goes well until I try to use Activiti-REST. I point to this URL: http://localhost:8080/activiti-rest/service/index and the following exception ocurrs in Tomcat:

ATTENTION: Exception or error caught in resource
org.activiti.engine.ActivitiException: No router defined
        at org.activiti.rest.api.DefaultResource.execute(DefaultResource.java:42)
        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.restlet.resource.ServerResource.doHandle(ServerResource.java:449)
        at org.restlet.resource.ServerResource.get(ServerResource.java:645)
        at org.restlet.resource.ServerResource.doHandle(ServerResource.java:527)
        at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:587)
        at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:299)
        at org.restlet.resource.ServerResource.handle(ServerResource.java:846)
        at org.restlet.resource.Finder.handle(Finder.java:510)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:497)
        at org.restlet.routing.Router.handle(Router.java:737)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:151)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
        at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:72)
        at org.restlet.Application.handle(Application.java:388)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:497)
        at org.restlet.routing.Router.handle(Router.java:737)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:497)
        at org.restlet.routing.Router.handle(Router.java:737)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
        at org.restlet.Component.handle(Component.java:387)
        at org.restlet.Server.handle(Server.java:488)
        at org.restlet.engine.ServerHelper.handle(ServerHelper.java:71)
        at org.restlet.engine.http.HttpServerHelper.handle(HttpServerHelper.java:150)
        at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1037)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)
23-ao├╗t-2011 13:21:45 org.restlet.engine.log.LogFilter afterHandle
INFO: 2011-08-23        13:21:45        127.0.0.1       -       127.0.0.1
8080    GET     /activiti-rest/service/index    -       500     410     0
46      http://localhost:8080   Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB;rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7
Firefox simple shows the message below:

Internal Server Error

No router defined

You can get technical details here.
Please continue your visit at our home page.
10 REPLIES 10

htmfilho
Champ in-the-making
Champ in-the-making
Just a small detail: the exception starts like this:
23-ao├╗t-2011 13:19:27 org.apache.catalina.core.ApplicationContext log
INFO: RestletServlet: [Restlet] Attaching application: org.activiti.rest.application.ActivitiRestApplication@c65fb1 to URI: /activiti-rest/service
23-ao├╗t-2011 13:19:27 org.restlet.resource.UniformResource doCatch
And then it continues like I posted before:
ATTENTION: Exception or error caught in resource
org.activiti.engine.ActivitiException: No router defined
        at org.activiti.rest.api.DefaultResource.execute(DefaultResource.java:42)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

Looking forward for some light.  Smiley Wink

trademak
Star Contributor
Star Contributor
Hi,

Right. You can only invoke the actual REST services (like for example http://localhost:8080/activiti-rest/service/process-engine) and not the index URI.
All the URIs are explained in the user guide.

Best regards,

htmfilho
Champ in-the-making
Champ in-the-making
Hi,
You can only invoke the actual REST services (like for example http://localhost:8080/activiti-rest/service/process-engine) and not the index URI.
I'm actually trying to follow the user guide, which says:
It is possible to browse the REST API if you point your browser to http://localhost:8080/activiti-rest/service/index and login as one of the admin users (kermit).
When I do this, the error above happens. So, should I ignore this and consider only the actual REST services?

frederikherema1
Star Contributor
Star Contributor
The userguide hasn't been updated when the REST implementation was no longer using webscripts. I'll fix this Smiley Wink

vnama
Champ in-the-making
Champ in-the-making
I try to go to http://localhost:8080/activiti-rest/service/process-engine in my browser
and I get an authentication is required error. I'm not sure how to login. When I goto http://localhost:8080/activiti-rest/service/login I get no router found error.
Is there a login screen? And will "kermit" "kermit work as a login?

jan_horneck
Champ in-the-making
Champ in-the-making
I stumbled into the same issue a few days ago.
A quick fix is to to use a Rest Client plugin/extension for your webbrowser.
(I used the "REST Console" chrome extension) which allows you to send the authentication information.

the the REST call worked as expected (with the kermit user and password).

Best regards,
Jan

vnama
Champ in-the-making
Champ in-the-making
Thank you. That worked for me.
What would be the request if I want to deploy a bpmn20.xml file to the engine?
http://localhost:8080/activiti-rest/service/deployment?success=alert&deployment='D:\vnama\Downloads\..."

udoderk
Champ in-the-making
Champ in-the-making
The userguide hasn't been updated when the REST implementation was no longer using webscripts. I'll fix this Smiley Wink
The version 5.11 of user guide still contains the section, containing URLs, that are not usable in web browser:
Each REST API call has its individual authorization level and you must be logged in as a user to invoke a REST API call (except for the /login service). Authentication is done using Basic HTTP Authentication, so if you logged in as an admin (i.e. kermit) you should be able to perform all calls as described below.

The API follows normal REST API conventions using……

All rest calls use a content type of "application/json" (except for upload requests which uses "multipart/form-data").

The base URL for invoking a REST call is http://localhost:8080/activiti-rest/service/. So for example to list the process definitions in the engine point your browser to: http://localhost:8080/activiti-rest/service/process-definitions

I think that a few words howto it logged as an admin using Web Browser would be helpful Smiley Wink
Thanks jan.horneck &  goolge i installed the RESTClient, a debugger for RESTful web services for firefox. Then i start it addon and set the kermit/kermit under "authorization " tab of addon using Basic Authentication permanently.

swsw1
Champ in-the-making
Champ in-the-making
Now I am able to access the activiti rest-interface using chrome's "postman" app.

If I enter …runtime/tasks into my rest-client, the data-array is empty:

<code>
{
    "data": [],
    "total": 0,
    "start": 0,
    "sort": "id",
    "order": "asc",
    "size": 0
}
</code>

…although I have two tasks assigned to "kermit" in my inbox. Why am I not able to see them in the response body of my rest-request?