0
votes

Using MobileFirst 7.1 (7.1.0.00.20151130-1648) - Studio and server both using same version.

Deploying MobileFirst 7.1 application to WebSphere Full-Profile production-like test server and getting NullPointer thrown from within MobileFirst.

I have made several attempts to modify worklight.properties and authenticationConfig.xml and same result including setting mfp.session.independent = false.

I currently have everything set back to out-of-box generated defaults and same issue. Adapters are currently wl_unprotected and no security test on the apps.

WAR , Apps and Adapters all deploy fine and logs look clean until you attempt to invoke an adapter or application URL from a browser.

[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)

Looking through the MobileFirst source code I see that it is failing to get an instance of Worklight Configuration due to Project Local not currently be set.

This has all worked fine with various configurations locally using MobileFirst Studio and Liberty Profile.

Any help determining what in my application settings could be causing this behavior is greatly appreciated.

2
If you have set sessionindependent to false and this is still happening then this problem is not about session indepdenent as your title suggests, leading to false thinking. Please update your question accordingly to talk only about your actual problem. - Idan Adar
You need to put more emphasis on the actual scenario. You mention that you call an adapter from a browser. This will not be supported in a session independent mode (default in 7.1). Which environment? how are you calling the adapter? from the console preview? there is no preview in production. - Idan Adar
This issue has been resolved! Their build process was overwriting generated web.xml with a stale version from a previous version of MobileFirst so expected servlets where not configured properly. - burchfr

2 Answers

0
votes

The question is very dull on the actual details of the problem. Instead it only lists what was attempted.

The only real clues are this

eploying MobileFirst 7.1 application to WebSphere Full-Profile production-like test server and getting NullPointer thrown from within MobileFirst.

And this:

WAR , Apps and Adapters all deploy fine and logs look clean until you attempt to invoke an adapter or application URL from a browser.

In 7.1 there is no support for a browser environment (better known as "Desktop Browser", and there's also "Mobile Web") in session-independent mode. Mobile environments support it, browser environments do not. If you want to test in a browser environment you must change the server mode, but then it won't work in mobile environments...

The other thing is that in "production-like" environments there is no preview servlet. You cannot preview your applications outside of the development environment. To test, you need to use either simulators/emulators or physical devices.

If this does not answer your question, edit your question with the full steps to reproduce your scenario.

0
votes

This issue has been resolved! Their build process was overwriting generated web.xml with a stale version from a previous version of MobileFirst so expected servlets where not configured properly.