views:

922

answers:

4

I am building an eclipse plugin (a notes plugin, but its a eclipse plugin in the end). One of the plugins my plugin depends on needs to load a native dll.

The problem is, that fails depending on where in the disk such dll is. If it is longer than a certain threshold I get the error below

java.lang.UnsatisfiedLinkError: nlsxbe (The filename or extension is too long. ) at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:952) at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:921) at java.lang.System.loadLibrary(System.java:452) at lotus.domino.NotesThread.load(Unknown Source) at lotus.domino.NotesThread.checkLoaded(Unknown Source) at lotus.domino.NotesThread.sinitThread(Unknown Source) at com.atempo.adam.lotus.plugin.views.TopicView.createPartControl(TopicView.java:609)

I have added the path to Path env var, and also registered the dll to no avail. My env is Ms vista profesional, java1.5, eclipse3.4 (and lotus 8)

Anyone out there have a clue?

Many thanks in advance.

A: 

I have had similar problems and have had to just make sure that files are not in long paths.

There are lots of programs that seem to have problems with long paths, including some of the built in windows programs.

Do you have control over where this DLL resides?

GreenKiwi
A: 

Yuck. Here is a discussion on this problem.

Now that I have been helpful, let me chide the author of the original plugin for making an eclipse plugin that is dependent on a dll, and you by extension for depending on that plugin. What is this? 1993?

Shane C. Mason
A: 

Hello, thanks for reply.

I've tried to register the dll and move it to c:\windows\system32 (a shorter path), but my Lotus Notes plugin can't load the library needed (Notes.jar).

It only works if i install Lotus Notes in a path shorter than "c:\program files\IBM\lotus\Notes" where works perfectly. If i install it in, for example, "c:\Archivos de programa\IBM\lotus\Notes" it can find my dll but cannot load the library.

The error is:

GRAVE Unable to create view ID com.atempo.adam.lotus.plugin.views.TopicView: nlsxbe (The filename or extension is too long. ) ::class.method=unknown ::thread=main ::loggername=org.eclipse.ui.workbench

java.lang.UnsatisfiedLinkError: nlsxbe (The filename or extension is too long. )
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:952)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:921)
at java.lang.System.loadLibrary(System.java:452)
at lotus.domino.NotesThread.load(Unknown Source)
at lotus.domino.NotesThread.checkLoaded(Unknown Source)
at lotus.domino.NotesThread.sinitThread(Unknown Source)
at com.atempo.adam.lotus.plugin.views.TopicView.createPartControl(TopicView.java:639)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:332)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:197)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:290)
at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:525)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:140)
at com.ibm.rcp.ui.internal.presentations.FolderStackPresentation.selectPart(FolderStackPresentation.java:692)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1144)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:620)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:532)
at org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:562)
at org.eclipse.ui.internal.PerspectiveHelper.activate(PerspectiveHelper.java:244)
at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:815)
at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3269)
at org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(WorkbenchPage.java:956)
at org.eclipse.ui.internal.WorkbenchPage.access$12(WorkbenchPage.java:940)
at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.java:3368)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3366)
at org.eclipse.ui.internal.Workbench.showPerspective(Workbench.java:2102)
at com.ibm.rcp.portal.app.ui.internal.serviceImpl.DoInternalUIService.openApplicationPerspective(DoInternalUIService.java:981)
at com.ibm.rcp.portal.app.ui.internal.serviceImpl.DoInternalUIService.openApplicationPerspective(DoInternalUIService.java:886)
at com.ibm.rcp.portal.app.ui.internal.serviceImpl.DoInternalUIService.openApplicationPerspectiveWithNavigator(DoInternalUIService.java:863)
at com.ibm.rcp.portal.app.ui.internal.serviceImpl.DoInternalUIService.access$12(DoInternalUIService.java:857)
at com.ibm.rcp.portal.app.ui.internal.serviceImpl.DoInternalUIService$8.run(DoInternalUIService.java:1197)
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:155)
at org.eclipse.ui.internal.UISynchronizer$1.run(UISynchronizer.java:36)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1931)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1895)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:423)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.ibm.rcp.personality.framework.internal.RCPApplication.run(RCPApplication.java:72)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
at org.eclipse.core.launcher.Main.main(Main.java:30)

Thanks.

A: 

This is one of the symptoms of the Windows MAX_PATH limitation. There are KB notes about it (for example 320081) and several discussions of hand-methods to cope with these files you can easily find by using Google.

The issue is that Windows has a limitation on the length of a full file path used in various system and command-level calls. Although there has been much discussion from the user community (and even some novel things to try in the Microsoft KB) they all boil down to you shortening the file path of the file in question by fair means or foul.

There is some indication in the aether that Microsoft's Unicode APIs allow (up to) 32k byte file paths, though I do not know if this is true. It remains the case, though, that many existing programs do not use these APIs and so fall over this limit. (It is even possible that the Windows APIs use UTF16 (or UCS2), in which case this only means 16k characters—does anyone know about this?)

The system allows you to create ‘unreachable’ file paths by many methods—one is incrementally creating the steps in the path by navigation; another is to mount shares—and sometimes the system functions and utilities rely internally upon a full file path for manipulation which falls over this limitation.

Unless this basic stupid limitation is removed from Windows system code the only recourse is for you to move and/or rename the files…

…or run a Unix.

Steve Powell