Worklight Event Source, what security test

给你一囗甜甜゛ 提交于 2019-12-23 05:30:05

问题


Worklight 6.1, testing in WL Studio on a Mac.

As a follow-up to this question concerning doing background work in a Worklight Server, the accepted answer to which is to use an Event Source.

WL.Server.createEventSource(
   {
       name: "housekeepingEventSource",
       poll: {
           interval: 5,
           onPoll: workToBeDone
       },
       securityTest: "eventTest"
   }
);

The issue concerns which security test to use. Whatever I try I get this error:

Adapter deployment failed: Wrapped java.lang.ClassCastException: org.mozilla.javascript.gen._ (... elisions ...) _chmSecurityService_impl_js_83 cannot be cast to java.lang.String (/integration.js#258)

Referencing this question

I've used this security test:

<mobileSecurityTest name="eventTest"> 
        <testUser realm="wl_anonymousUserRealm"/>
        <testDeviceId provisioningType="none"/>
</mobileSecurityTest>

Hints please ...


回答1:


This was a typo in the poll definition. Sequence was that when security test was incorrectly specified the adapter didn't deploy with other error messages. Once I had a valid security test then the poll was activated, and as it wa`s defective we got the above error.

   poll: {
       interval: 5,
       onPoll: workToBeDone
   },

is wrong, as I should have used a String literal

   poll: {
       interval: 5,
       onPoll: 'workToBeDone'
   },

which if one reads the error message carefully is exactly what it's telling me ...



来源:https://stackoverflow.com/questions/23077319/worklight-event-source-what-security-test

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!