IBM Worklight 6.0 - 适配器身份验证失败:“服务器无法处理来自应用程序的请求”

Posted

技术标签:

【中文标题】IBM Worklight 6.0 - 适配器身份验证失败:“服务器无法处理来自应用程序的请求”【英文标题】:IBM Worklight 6.0 - Adapter authentication failure: "The server was unable to process the request from application" 【发布时间】:2013-09-02 09:45:21 【问题描述】:

环境配置:

Windows Server 2008 R2 企业版 WebSphere 应用服务器 v7 Worklight 服务器 v6 Derby 数据库(默认通过 Worklight 安装管理器安装)

在我的 Worklight 生产服务器上部署我的应用程序和适配器后,当我使用 Worklight Console 的 MBS(iPad 环境)测试我的应用程序时,我收到以下错误:

getNewsFeed_CallbackFailure 响应:: "status":500,"invocationContext":null,"errorCode":"UNEXPECTED_ERROR","errorMsg":"The 服务器无法处理来自应用程序的请求。请 请稍后再试。”

当我的 DB2Adapter 的过程 newsFeed 失败时调用 getNewFeed_CallbackFailure

我的 Websphere SystemOut.log 中有这个错误:

[9/2/13 10:38:14:612 CEST] 00000032 SystemOut     O CustomAuthenticationModule
[9/2/13 10:38:14:612 CEST] 00000032 CustomAuthent I   CustomAuthenticationModule initialized
[9/2/13 10:38:14:612 CEST] 00000032 SystemOut     O init CustomLogi nModule
[9/2/13 10:38:14:628 CEST] 00000032 servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet GadgetAPIServlet in application claim_insurance_war. Exception created : com.worklight.server.auth.api.WorkLightAuthenticationException
    at com.worklight.core.auth.impl.AuthenticationContext.checkAuthentication(AuthenticationContext.java:518)
    at com.worklight.core.auth.impl.AuthenticationContext.processRealms(AuthenticationContext.java:384)
    at com.worklight.core.auth.impl.AuthenticationContext.pushCurrentResource(AuthenticationContext.java:361)
    at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:75)
    at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeProcedureInternal(DataAccessServiceImpl.java:377)
    at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeProcedure(DataAccessServiceImpl.java:112)
    at com.worklight.gadgets.serving.handler.BackendQueryHandler.getContent(BackendQueryHandler.java:142)
    at com.worklight.gadgets.serving.handler.BackendQueryHandler.doPost(BackendQueryHandler.java:80)
    at com.worklight.gadgets.serving.GadgetAPIServlet.doGetOrPost(GadgetAPIServlet.java:154)
    at com.worklight.gadgets.serving.GadgetAPIServlet.lockedGetOrPost(GadgetAPIServlet.java:111)
    at com.worklight.gadgets.serving.GadgetAPIServlet.doPost(GadgetAPIServlet.java:102)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1384)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
    at com.worklight.core.auth.impl.AuthenticationFilter$1.execute(AuthenticationFilter.java:192)
    at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:76)
    at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:196)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:852)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:785)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:859)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

日志文件的前 3 行来自我的自定义身份验证登录模块:

            ***Generic custom authentication code from worklight sample***

public class CustomAuthenticationModule implements WorkLightAuthenticator
    private static final Logger logger = Logger.getLogger(CustomAuthenticationModule.class.getName());

    private Map<String, Object> authenticationData = null;

    public void init(Map<String, String> options) throws MissingConfigurationOptionException 
        System.out.println("CustomAuthenticationModule");
        logger.info("CustomAuthenticationModule initialized");
    
     ............

                  ***My custom authentication code***

public class CustomLoginModule implements WorkLightAuthLoginModule 

    private String USERNAME;
    private String PASSWORD;

    public void init(Map<String, String> options) throws MissingConfigurationOptionException 
        System.out.println("init CustomLogi nModule");
    
        ............

除此之外,我在 Worklight 开发服务器上没有任何错误...适配器的工作原理非常棒。

【问题讨论】:

请尝试使用 6.0.0.1 或 6.1.0;我相信这不应该再发生了。 【参考方案1】:

这种类型的错误在 6.0.0.0 之后早就修复了;所以我建议至少升级到 Worklight 6.0.0.2,如果不升级到 6.1.0.1。

没有可采用的本地解决方法。 如果您是 IBM 客户或业务合作伙伴,您可以从 IBM Fix Central 下载上述版本。

【讨论】:

以上是关于IBM Worklight 6.0 - 适配器身份验证失败:“服务器无法处理来自应用程序的请求”的主要内容,如果未能解决你的问题,请参考以下文章

适配器部署失败 IBM Worklight 6.0

IBM Worklight 6.0 - 调用适配器过程时出错

IBM Worklight 6.0 - 将适配器部署到 Worklight Server 后出现 wl_antiXSRFRealm 错误

IBM Worklight 6.0 - 如何在适配器中启用/查看 WL.Logger.debug?

IBM Worklight 6.0 - 启用控制台登录身份验证后混合端口号?

如何在 IBM Worklight 6.0 中实现 OAUTH 2.0