Triumph Spitfire
Triumph Spitfire

Reputation: 645

MuleSoft DependencyResolutionException while downloading API Spec

We have a nagging issue that we are facing while downloading RAML from AnyPoint Platform, to Studio. I am attaching the error log here. This is not happening for all the APIs that we currently. I can download the RAML and scaffold certain APIs without any issue.

For instance, the below error is captured (in Studio Error Log) when I right click on Mule project > Anypoint Platform > Download RAML from Design Center

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)

If I try to right click on the Mule project > Manage Dependencies > Manage APIs, and try to download the API from Exchange, I get the below error:

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

Multiple people across the team are facing this issue. We have so far been unable to find the root cause. And it's not the same version of Studio that we all have (I am on Studio 7.18). All the APIs belong to the same Org. Any advise is highly appreciated

Upvotes: 0

Views: 215

Answers (1)

Artur
Artur

Reputation: 11

I also faced the same issue some days ago, except I was able to publish the API to Exchange and use it as a dependency.

After a lot of experiments, I found out that it is related to the length of the path in the API. Once I exceed 75 characters, the same error is shown when trying to 'Download API from Design Center'. For me, the solution was to shrink the filenames used, and after that, I was able to download the RAML project without any problems.

Surprisingly there are no documented limits on the maximum filename/path length. I have also raised a question in MuleSoft Slack Community so if you want to look through more details, here is a link to my message there:

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

Upvotes: 1

Related Questions