Ibm mobilefirst MobileFirst 7.1 Authentication.IsSessionIndependent引发NullPointerException访问应用程序和适配器

Ibm mobilefirst MobileFirst 7.1 Authentication.IsSessionIndependent引发NullPointerException访问应用程序和适配器,ibm-mobilefirst,mobilefirst-adapters,mobilefirst-server,Ibm Mobilefirst,Mobilefirst Adapters,Mobilefirst Server,使用MobileFirst 7.1(7.1.0.00.20151130-1648)-Studio和server都使用相同的版本 将MobileFirst 7.1应用程序部署到WebSphere完整配置文件生产(如测试服务器)中,并从MobileFirst中抛出空指针 我已多次尝试修改worklight.properties和authenticationConfig.xml,结果相同,包括设置mfp.session.independent=false 目前,我已经将所有内容设置为开箱即用生成的默认

使用MobileFirst 7.1(7.1.0.00.20151130-1648)-Studio和server都使用相同的版本

将MobileFirst 7.1应用程序部署到WebSphere完整配置文件生产(如测试服务器)中,并从MobileFirst中抛出空指针

我已多次尝试修改worklight.properties和authenticationConfig.xml,结果相同,包括设置mfp.session.independent=false

目前,我已经将所有内容设置为开箱即用生成的默认值和相同的问题。适配器目前未受保护,应用程序上没有安全测试

在您尝试从浏览器调用适配器或应用程序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源代码,我发现它无法获取Worklight配置的实例,因为当前未设置Project Local

在本地使用MobileFirst Studio和Liberty配置文件进行各种配置时,这一切都很好


非常感谢您能帮助我确定我的应用程序设置中可能导致这种行为的原因。

对于问题的实际细节,这个问题非常枯燥。相反,它只列出了尝试的内容

唯一真正的线索是这个

将MobileFirst 7.1应用程序部署到WebSphere完整配置文件类似于生产的测试服务器,并从MobileFirst中抛出空指针

这是:

WAR、应用程序和适配器都可以很好地部署,日志看起来很干净,直到您尝试从浏览器调用适配器或应用程序URL为止

在7.1中,不支持会话独立模式下的浏览器环境(更好地称为“桌面浏览器”,还有“移动Web”)。移动环境支持it,而浏览器环境不支持。如果要在浏览器环境中进行测试,则必须更改服务器模式,但在移动环境中它将无法工作

另一件事是,在“类似于生产”的环境中,没有预览servlet。不能在开发环境之外预览应用程序。要进行测试,您需要使用模拟器/模拟器或物理设备


如果这不能回答您的问题,请使用完整的步骤编辑您的问题,以再现您的场景。

此问题已解决!他们的构建过程使用以前版本的MobileFirst的旧版本覆盖生成的web.xml,因此在未正确配置的情况下需要servlet。

如果您已将sessionindependent设置为false,并且这种情况仍在发生,则此问题并非如标题所示与会话无关,从而导致错误思考。请相应地更新您的问题,以便只谈论您的实际问题。您需要更加强调实际情况。您提到从浏览器调用适配器。在会话独立模式下不支持此操作(7.1中的默认设置)。哪种环境?如何调用适配器?从控制台预览?生产中没有预览。此问题已解决!他们的构建过程使用以前版本的MobileFirst中的过时版本覆盖生成的web.xml,因此在未正确配置的情况下需要servlet。