Worklight 6.1 - error on sending notification to a

2019-08-31 23:42发布

问题:

I'm trying to send notification to android device. On my Worklight Studio I have succeeded to make subscription + notification.

When I trying to do it on real worklight server(on liberty), I have succeeded to make subscription, but I can't send notification.

I'm trying to send notification on browser like that:

http://serverIp:9080/worklighttime/dev/invoke?adapter=PushAdapter&procedure=submitNotification&parameters=[%27user%27,%27text message%27]

At the adapter I added:

<procedure name="submitNotification" securityTest="wl_unprotected" />

And, still I get this error:

 Exception thrown by application class 'com.worklight.core.auth.impl.AuthenticationFilter.doFilter:235'
java.lang.RuntimeException: javax.servlet.ServletException: Can not access development servlets in production mode
at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:235)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at [internal classes]
Caused by: javax.servlet.ServletException: Can not access development servlets in production mode
at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:136)
... 2 more

回答1:

Take a look at this part from the error message:

Caused by: javax.servlet.ServletException: Can not access development servlets in production mode at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:136)

Now see the URL you are using:

http://serverIp:9080/worklighttime/dev/invoke?adapter=PushAdapter&procedure=submitNotification&parameters=[%27user%27,%27text
message%27]

The /dev/ denotes basically a "development servlet", which as the error says - cannot be used when in production. "In production" basically means "any server that is not inside Worklight Studio", Worklight Studio being the development environment.

Try to remove the /dev/ from the URL and see whether this helps, or maybe a different error will then be given.