下载 API 规范时出现 MuleSoft DependencyResolutionException

问题描述 投票:0回答:1

从 AnyPoint Platform 下载 RAML 到 Studio 时,我们遇到了一个棘手的问题。我在这里附上错误日志。我们目前的所有 API 都没有发生这种情况。我可以毫无问题地下载 RAML 并搭建某些 API。

例如,当我右键单击 Mule 项目 > Anypoint Platform > 从设计中心下载 RAML 时,会捕获以下错误(在 Studio 错误日志中)

java.lang.NullPointerException: Cannot invoke "java.io.File.getAbsolutePath()" because the return value of "org.mule.tooling.apikit.common.wizard.RAMLUrlFileProvider.getFile()" is null
    at org.mule.tooling.apikit.common.wizard.RAMLUrlCompressedFileProvider.importAndSynchronizeFiles(RAMLUrlCompressedFileProvider.java:90)
    at org.mule.tooling.apikit.common.wizard.ApikitRamlDefinitionContribution.createConfiguration(ApikitRamlDefinitionContribution.java:452)
    at org.mule.tooling.apikit.common.wizard.ApikitRamlDefinitionContribution$3.call(ApikitRamlDefinitionContribution.java:364)
    at org.mule.tooling.apikit.common.wizard.ApikitRamlDefinitionContribution$3.call(ApikitRamlDefinitionContribution.java:1)
    at org.mule.tooling.utils.SilentRunner.run(SilentRunner.java:25)
    at org.mule.tooling.core.StudioDesignContextRunner.runSilentWithMuleProject(StudioDesignContextRunner.java:21)
    at org.mule.tooling.core.StudioDesignContextRunner.runSilentWithMuleProject(StudioDesignContextRunner.java:53)
    at org.mule.tooling.apikit.common.wizard.ApikitRamlDefinitionContribution.performFinish(ApikitRamlDefinitionContribution.java:357)
    at org.mule.tooling.apikit.common.action.VCSManagerAction.openVCS(VCSManagerAction.java:59)
    at org.mule.tooling.apikit.common.action.VCSManagerAction$1.onAfterSuccessfulLogin(VCSManagerAction.java:79)
    at org.mule.tooling.ui.authentication.utils.IStudioLoginRequired.runRequiringLogin(IStudioLoginRequired.java:40)
    at org.mule.tooling.apikit.common.action.VCSManagerAction.run(VCSManagerAction.java:87)
    at org.mule.tooling.apikit.common.handlers.ConnectVCSManagerHandler.execute(ConnectVCSManagerHandler.java:39)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:309)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:243)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)
    at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
    at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4274)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:643)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:550)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:171)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
    at org.mule.tooling.Application.start(Application.java:23)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1440)

如果我尝试右键单击 Mule 项目 > 管理依赖项 > 管理 API,并尝试从 Exchange 下载 API,我会收到以下错误:

The following exceptions were encountered while resolving dependency fc8d6fe1-95ff-466d-a677-97914c8051ee:test-el-api:2.0.68: org.mule.tooling.core.m2.DependencyResolutionException: Failed to collect dependencies at fc8d6fe1-95ff-466d-a677-97914c8051ee:test-el-api:zip:raml:2.0.68

团队中有很多人都面临着这个问题。到目前为止,我们还无法找到根本原因。而且它与我们所拥有的 Studio 版本不同(我使用的是 Studio 7.18)。所有 API 都属于同一个组织。任何建议都将受到高度赞赏

mule mulesoft mule4 anypoint-studio raml
1个回答
0
投票

几天前我也遇到了同样的问题,只不过我能够将 API 发布到 Exchange 并将其用作依赖项。

经过大量实验,发现和API中的路径长度有关。一旦超过 75 个字符,尝试“从设计中心下载 API”时就会显示相同的错误。对我来说,解决方案是缩小使用的文件名,之后我就可以毫无问题地下载 RAML 项目了。

令人惊讶的是,没有记录最大文件名/路径长度的限制。我还在 MuleSoft Slack 社区中提出了一个问题,所以如果您想查看更多详细信息,这里有我的消息的链接:

https://mulesoft-community.slack.com/messages/C02BRTGDL3C/p1723013923236319

© www.soinside.com 2019 - 2024. All rights reserved.