我试图将带有招摇的休息api注册到wso2 Api Manager 1.8中。 在wso2发布者中我做了#34;导入swagger定义" 它向我展示了"资源"下的所有api,但是如果我这样做的话#34; save"我在日志中得到了以下异常。 我该如何解决?
感谢 阿尔贝托
我的环境是:
Linux hqldvwsos1 2.6.32-504.el6.x86_64#1 SMP Tue Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU / Linux java版" 1.7.0_75" OpenJDK运行时环境(rhel-2.5.4.0.el6_6-x86_64 u75-b13) OpenJDK 64位服务器VM(内置24.75-b04,混合模式)
TID:[0] [AM] [2015-02-10 10:18:14,592] ERROR {org.wso2.carbon.apimgt.impl.UserAwareAPIProvider} - 检索SDRESTAPI-1.1.1的Swagger定义时出错{\ n org.wso2.carbon.apimgt.impl.UserAwareAPIProvider} org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException:路径中不存在资源/_system/governance/apimgt/applicationdata/api-docs/SDRESTAPI-1.1.1-admin/1.2/default/budget-codes 在org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.get(EmbeddedRegistry.java:532) 在org.wso2.carbon.registry.core.caching.CacheBackedRegistry.getGhostResourceFromCache(CacheBackedRegistry.java:194) 在org.wso2.carbon.registry.core.caching.CacheBackedRegistry.get(CacheBackedRegistry.java:167) 在org.wso2.carbon.registry.core.session.UserRegistry.getInternal(UserRegistry.java:620) 在org.wso2.carbon.registry.core.session.UserRegistry.access $ 400(UserRegistry.java:60) 在org.wso2.carbon.registry.core.session.UserRegistry $ 5.run(UserRegistry.java:603) 在org.wso2.carbon.registry.core.session.UserRegistry $ 5.run(UserRegistry.java:600) at java.security.AccessController.doPrivileged(Native Method) 在org.wso2.carbon.registry.core.session.UserRegistry.get(UserRegistry.java:600) at org.wso2.carbon.apimgt.impl.APIProviderImpl.getSwagger12Definition(APIProviderImpl.java:2431) 在org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.getSwagger12Definition(UserAwareAPIProvider.java:33) at org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_getSwagger12Resource(APIProviderHostObject.java:755) 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) 在org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126) 在org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386) 在org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32) 在org.jaggeryjs.rhino.publisher.modules.api.c3._c_anonymous_4(/publisher/modules/api/add.jag:75) 在org.jaggeryjs.rhino.publisher.modules.api.c3.call(/publisher/modules/api/add.jag) 在org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430) 在org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269) 在org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97) 在org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42) at org.jaggeryjs.rhino.publisher.modules.api.c0._c_anonymous_32(/publisher/modules/api/module.jag:104) 在org.jaggeryjs.rhino.publisher.modules.api.c0.call(/publisher/modules/api/module.jag) 在org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32) 在org.jaggeryjs.rhino.publisher.site.blocks.item_design.ajax.c0._c_anonymous_2(/publisher/site/blocks/item-design/ajax/add.jag:209) 在org.jaggeryjs.rhino.publisher.site.blocks.item_design.ajax.c0.call(/publisher/site/blocks/item-design/ajax/add.jag) 在org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23) 在org.jaggeryjs.rhino.publisher.site.blocks.item_design.ajax.c0._c_script_0(/publisher/site/blocks/item-design/ajax/add.jag:18) 在org.jaggeryjs.rhino.publisher.site.blocks.item_design.ajax.c0.call(/publisher/site/blocks/item-design/ajax/add.jag) 在org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394) 在org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091) 在org.jaggeryjs.rhino.publisher.site.blocks.item_design.ajax.c0.call(/publisher/site/blocks/item-design/ajax/add.jag) 在org.jaggeryjs.rhino.publisher.site.blocks.item_design.ajax.c0.exec(/publisher/site/blocks/item-design/ajax/add.jag) at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:570) 在org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273) 在org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:432) 在org.jaggeryjs.jaggery.core.JaggeryServlet.doGet(JaggeryServlet.java:24) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:735) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:848) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 在org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749) 在org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487) 在org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379) 在org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339) 在org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) 在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178) at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve $ 1.invoke(CarbonTomcatValve.java:47) 在org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56) at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47) 在org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141) at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156) 在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52) 在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) 在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:589) 在org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.run(NioEndpoint.java:1653) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615) 在java.lang.Thread.run(Thread.java:745) TID:[0] [AM] [2015-02-10 10:18:14,597] ERROR {JAGGERY.site.blocks.item-design.ajax.add:jag} - org.wso2.carbon.apimgt.api.APIManagementException :检索SDRESTAPI-1.1.1的Swagger定义时出错{JAGGERY.site.blocks.item-design.ajax.add:jag}
-----更新n1 ----
我发现招摇定义中有些不一致。
例如我有
apis:
- path: /api/budget-codes
description: Budget Codes
file:
apiVersion: "1.0"
swaggerVersion: "1.2"
basePath: /fsd
resourcePath: /api/budget
现在我改变了第一个"预算代码"进入"预算"而且我没有得到我记录的例外。我可以保存它,但是如果我去实施步骤或者如果我保存并重新阅读设计步骤,我会得到
TID: [0] [AM] [2015-02-10 11:15:19,655] ERROR {JAGGERY.site.blocks.item-design.ajax.add:jag} - java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to [B {JAGGERY.site.blocks.item-design.ajax.add:jag}
你能帮帮我吗?
感谢
答案 0 :(得分:0)
Alberto,
导入后是否编辑了swagger定义?如果进行了更改,请确保授权标头采用以下格式。
authorizations:
oauth2:
type: oauth2
scopes: []