【发布时间】:2016-01-25 16:01:23
【问题描述】:
使用 MobileFirst 7.1 (7.1.0.00.20151130-1648) - 工作室和服务器都使用相同的版本。
将 MobileFirst 7.1 应用程序部署到类似于 WebSphere Full-Profile 生产的测试服务器,并从 MobileFirst 中获取 NullPointer。
我已多次尝试修改 worklight.properties 和 authenticationConfig.xml,结果相同,包括设置 mfp.session.independent = false。
我目前已将所有内容设置回开箱即用生成的默认值和相同的问题。适配器目前处于 wl_unprotected 且未对应用进行安全测试。
在您尝试从浏览器调用适配器或应用程序 URL 之前,WAR、应用程序和适配器都可以正常部署,并且日志看起来很干净。
[1/21/16 9:52:08:420 EST] 000000a4 webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[GadgetAPIServlet]: java.lang.NullPointerException
at com.worklight.core.auth.impl.AuthenticationContext.isSessionIndependent(AuthenticationContext.java:1219)
at com.worklight.core.util.HttpSessionUtil.setLockOnSession(HttpSessionUtil.java:108)
at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:136)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3923)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1006)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
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:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)
查看 MobileFirst 源代码,我发现由于当前未设置 Project Local,它无法获取 Worklight Configuration 的实例。
使用 MobileFirst Studio 和 Liberty Profile 在本地进行各种配置都可以正常工作。
非常感谢任何帮助确定我的应用程序设置中可能导致此行为的原因。
【问题讨论】:
-
如果您将 sessionindependent 设置为 false 并且这种情况仍在发生,那么这个问题与您的标题所暗示的会话无关,导致错误的想法。请相应地更新您的问题,只讨论您的实际问题。
-
您需要更加重视实际场景。您提到您从浏览器调用适配器。这在独立于会话的模式中不受支持(7.1 中的默认设置)。哪个环境?你怎么称呼适配器?从控制台预览?生产中没有预览。
-
这个问题已经解决了!他们的构建过程是用旧版 MobileFirst 的旧版本覆盖生成的 web.xml,因此预期 servlet 配置不正确。
标签: ibm-mobilefirst mobilefirst-adapters mobilefirst-server