访问MobileFirst适配器时出现问题 [英] Issue accessing MobileFirst adapters

查看:98
本文介绍了访问MobileFirst适配器时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MobileFirst CLI 7.1,Java 1.8.0_65(如果重要,请在Mac OS X 10.9.5上).在目前的环境中,我已经工作了一个月左右,但是突然发现我开发的所有适配器都出现了问题,直到现在为止,这些适配器都可以正常工作.

I am using MobileFirst CLI 7.1, Java 1.8.0_65 (on Mac OS X 10.9.5 if it matters). I have been working without issue in my current environment for about a month now but have suddenly hit an issue with all the adapters I developed, which have been working successfully up until this point.

从浏览器进行测试时,出现了初始错误.我认为这可能与WL JavaScript库通过服务器上运行的适配器进行身份验证的方式有关(清除浏览器缓存通常可以解决此问题,但在这种情况下不行).

The initial error surfaced when testing from a browser. I thought perhaps it was related to the way the WL JavaScript libraries authenticate with the adapters which run on the server (clearing the browser cache usually resolves this but not in this case).

[.../common/query] failure. state: 500, response: undefinedWL.Logger.__log @ worklight.js:5377
worklight.js:5377 Client registration failed with error: {"responseHeaders":{"$WSEP":"","Date":"Tue, 08 Dec 2015 14:07:51 GMT","Connection":"Close","Content-Type":"text/html;charset=UTF-8","X-Powered-By":"Servlet/3.0","Transfer-Encoding":"chunked","Content-Language":"en-...

如果这不起作用,我尝试从CLI测试适配器,结果出现错误

When this didn't work I tried testing the adapters from the CLI with a resulting error

undefined:1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.
^
SyntaxError: Unexpected token <
    at Object.parse (native)
...

不是很有帮助,控制台日志中也没有真实信息(至少没有意义)

Not very helpful and no real info in the console log either (at least none which makes sense)

上周我正在编写Java适配器,因此我想尝试一下以查看是否得到不同的响应(我也尝试过创建一个新项目,并且空适配器的结果相同).基本上,从命令行进行测试似乎可以工作(无响应,但也无错误).我认为它虽然没有用(我很怀疑),所以我打算使用Chrome插件(Advanced REST Client插件)测试相同的适配器.实际上,我并没有达到测试适配器的目的,因为获取身份验证令牌的POST失败了(您发布以下url/authorization/v1/testtoken并应返回身份验证令牌).我实际上收到的是一大段HTML.

I was in the process of writing a Java adapter last week, so I thought I would try that to see if I get a different response (I have also tried creating a new project and empty adapter with the same results btw). Basically testing from the command line seemed to work (no response, but no error either). I didn't think it was working though (sceptical as I am), so I aimed to test the same adapter using a Chrome plugin (the Advanced REST Client plugin). I actually didn't get to the point of testing the adapter because the POST to get the auth token failed (you post the following url /authorization/v1/testtoken and should get the auth token back). What I actually received was a chunk of HTML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
...
<div id="error"> Exception thrown by application class 'org.apache.wink.server.internal.RequestProcessor.logException:273'
</div>
<div id="code">
java.lang.NullPointerException: <br>
<div id="stack">at org.apache.wink.server.internal.RequestProcessor.logException(RequestProcessor.java:273)<br>at org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:226)<br>at org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)<br>at org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:133)<br>at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)<br>at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285)<br>at [internal classes]<br>at **com.worklight.authorization.server.AuthorizationServerFilter.doFilter**(AuthorizationServerFilter.java:88)<br>at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:206)<br>at [internal classes]<br>at com.worklight.analytics.AnalyticsFilter.doFilter(AnalyticsFilter.java:124)<br>at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:206)<br>at [internal classes]<br>
</div>
</div>

在我看来,授权过滤器由于某种未知原因而失败. 昨天我确实尝试过卸载并重新安装MF CLI,但此错误刚刚浮出水面.这是我唯一想做的事情,但是也许我错过了一些本地文件,这些文件在卸载完成后需要手动删除...? 上次我几乎删除了〜/.ibm下的所有内容

It looks to me like the authorisation filter is failing for some unknown reason. I did try uninstalling and re-installing MF CLI yesterday but this error just re-surfaced. It is the only thing I can think to do again, but maybe I missed some local files which I need to delete manually after the uninstall is complete ...? Last time I deleted everything under ~/.ibm pretty much

我刚刚在developerWorks中发现了这篇文章,其中提到了与我所看到的类似的问题.

I just found this post in developerworks which mentions a similar issue to the one I am seeing.

https://www.ibm.com/developerworks/community/forums/html/topic?id=ae0a1814-7ce3-49f5-b582-c9ecf16fa51a

之所以如此,是因为我正在玩一个JavaAdapter,我计划将其用于与后台RESTful服务进行接口.我遇到了问题,并且对在某一时刻使用Jersey的想法感到不解.我想我曾经至少将一个Jersey jar文件复制到项目的server/lib文件夹中,并且可能已将其推送到服务器.完成此操作后,虽然我曾期望过,然后再次卸载,删除〜/.ibm下的所有内容并重新安装,但这些jar将不再存在.我仍然遇到同样的问题.

The reason this also rings true is that I was playing around with a JavaAdapter which I was planning on using to interface with a back-office RESTful service. I had problems and toyed with the idea of using Jersey at one point. I think I copied at least one Jersey jar file into the project's server/lib folder at one point and may have pushed this to the server. Having done this though I would have expected, having once again uninstalled, deleted everything under ~/.ibm and re-installed, that the jars would no longer be present. I still get the same issue.

卸载是否可能不会删除自由配置文件或WAS配置,并且这些jar仍以某种方式持续存在?

Is it possible that uninstall does not delete the liberty profile or WAS configuration and that these jars somehow persist?

推荐答案

原来,MobileFirst CLI(20151130-1653)的当前/最新版本存在问题.我备份到以前的版本(20150913-2352),我的适配器又重新开始工作-很明显,我在重新安装过程中清理了服务器和tmp文件.

Turns out there is an issue with the current/latest release of MobileFirst CLI (20151130-1653). I backed up to a previous release (20150913-2352) and my adapters started working again - obviously I cleaned up servers and tmp files during the re-installation process.

我相信已经有很多人提出了同样的问题,并且在IBM内部已将其作为PMR提出.

I believe there have been quite a few people raising the same issue and it has been raised as a PMR internally within IBM.

这篇关于访问MobileFirst适配器时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆