在 IBM MobileFirst Application Center Console 中使用代理上传外部应用程序时出现问题

Posted

技术标签:

【中文标题】在 IBM MobileFirst Application Center Console 中使用代理上传外部应用程序时出现问题【英文标题】:Issue uploading external apps in IBM MobileFirst Application Center Console with proxy 【发布时间】:2015-10-16 11:37:23 【问题描述】:

当我尝试在 Application Center 控制台中添加外部应用程序(来自 google play)时。它显示错误:“检测到服务器错误”。

服务器位于内部 LAN 中,我们为代理配置了不需要用户/密码。另外,我们在liberty profile(文件jvm.options)的JBM参数中进行了配置:

-Dhttp.useProxy=true
-Dhttp.proxyHost=proxyname
-Dhttp.proxyPort=80

我们尝试使用 Wireshark 应用程序“嗅探”我们的 IBM MobileFirst 服务器和 Google Play 服务器之间的通信,我们获得了下一个跟踪:WireShark capture

另外,在错误message.log中:


    "id": "b50986cc-4ce2-41b9-948f-30a8f4569363",
    "message": "FWLAC0000E: A server error was detected.",
    "productVersion": "7.0.0.00-20150312-0731"

java.net.SocketException: Connection reset
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1676)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1674)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1672)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at com.ibm.puremeap.applinks.GooglePlayStoreMetadataInfo2.parseWebDocument(GooglePlayStoreMetadataInfo2.java:190)
    at com.ibm.puremeap.applinks.GooglePlayStoreMetadataInfo2.collect(GooglePlayStoreMetadataInfo2.java:130)
    at com.ibm.puremeap.services.ApplicationLinkMetadataGrabberService.checkForMetadataQuery(ApplicationLinkMetadataGrabberService.java:126)
    at com.ibm.puremeap.services.ApplicationLinkMetadataGrabberService.findMetadataWithTimeout(ApplicationLinkMetadataGrabberService.java:94)
    at com.ibm.puremeap.services.ApplicationLinkMetadataGrabberService.findMetadata(ApplicationLinkMetadataGrabberService.java:78)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)
    at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    at org.apache.wink.server.internal.handlers.CreateInvocationParametersHandler.handleRequest(CreateInvocationParametersHandler.java:54)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:34)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleResourceMethod(FindResourceMethodHandler.java:151)
    at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:65)
    at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceLocator(FindResourceMethodHandler.java:230)
    at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:115)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    at org.apache.wink.server.internal.handlers.FindRootResourceHandler.handleRequest(FindRootResourceHandler.java:95)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    at org.apache.wink.server.internal.handlers.HeadMethodHandler.handleRequest(HeadMethodHandler.java:53)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    at org.apache.wink.server.internal.handlers.OptionsMethodHandler.handleRequest(OptionsMethodHandler.java:46)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    at org.apache.wink.server.internal.handlers.SearchResultHandler.handleRequest(SearchResultHandler.java:33)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    at org.apache.wink.server.internal.log.ResourceInvocation.handleRequest(ResourceInvocation.java:92)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    at org.apache.wink.server.internal.log.Requests.handleRequest(Requests.java:76)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
    at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
    at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
    at org.apache.wink.server.handlers.AbstractHandlersChain.run(AbstractHandlersChain.java:52)
    at org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:207)
    at org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)
    at org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:133)
    at com.ibm.puremeap.services.RestServlet.service(RestServlet.java:56)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:473)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:135)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
    at com.ibm.puremeap.services.RestFilter.doFilter(RestFilter.java:60)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:206)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:978)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1100)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4845)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:297)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:262)
    at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:955)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:196)
    at java.net.SocketInputStream.read(SocketInputStream.java:122)
    at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
    at sun.security.ssl.InputRecord.read(InputRecord.java:480)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:934)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConnection.java:2714)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderFields(HttpsURLConnectionImpl.java:283)
    at com.ibm.puremeap.applinks.GooglePlayStoreMetadataInfo2.extractCharsetFromConnectionHeaders(GooglePlayStoreMetadataInfo2.java:209)
    at com.ibm.puremeap.applinks.GooglePlayStoreMetadataInfo2.parseWebDocument(GooglePlayStoreMetadataInfo2.java:189)
    ... 76 more

【问题讨论】:

这个问题还没有解决。 【参考方案1】:

在异常发生的时间点,服务器正在尝试使用您提供的应用程序链接联系 Google Playstore。通常这是指向https://play.google.com/store/apps/details?id= 的链接...此时,它正在尝试读取您通过外部应用链接提供的应用的元数据。异常表明在 SSL 握手期间与 Google Playstore 的连接失败。

    我假设您按照说明为应用程序链接配置网络服务器,如此处所述https://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.installconfig.doc/appcenter/c_ac_was_config_applinks.html

    确保可以从您的网络服务器访问 Google Play 商店(如果您有防火墙/代理)。如果可以访问,则可能是以下 SSL 问题: 由于是最新的,请避免使用 Oracle Java 6,最好使用 Java 7 或 Java 8,或 IBM Java 6-8,因为 Oracle Java 6 不完全兼容最新的漏洞有关 SSL 的修复程序,而且 Google 可能已经安装了您的 Java 6 版本不理解的 SSL 修复程序(目前)。

【讨论】:

1.我们按照说明为 Google PlayStore 的应用程序链接配置网络服务器(我们还没有这样做......)但仍然有同样的错误...... 2. 我们确保可以从我们的网络服务器访问 Google PlayStore,并且我们已安装 Java 版本 1.7 u79,但我们不知道发生了什么以及在此之后我们可以做什么......

以上是关于在 IBM MobileFirst Application Center Console 中使用代理上传外部应用程序时出现问题的主要内容,如果未能解决你的问题,请参考以下文章

IBM Mobilefirst 和 IBM Bluemix

在 IBM Containers 上运行 MobileFirst 服务器

Eclipse 氧气找不到 IBM MobileFirst Studio

IBM MobileFirst 服务器预览

IBM MobileFirst 8.0 Neon 插件

IBM MobileFirst Platform 中的证书固定