Search code examples
javaplayframeworkdependenciesivyunsatisfiedlinkerror

UnsatisfiedLinkError -- Play! dependencies


Every time I try to resolve dependencies using Play 1.2.5(also tried 1.2.4) by typing play dependencies at the command line, I get the following error:

~ Resolving dependencies using C:\Workspace\moosejuice\conf\dependencies.yml,
~
Exception in thread "main" java.lang.UnsatisfiedLinkError: java.io.WinNTFileSystem.createFileExclusively(Ljava/lang/String;Z)Z
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)
        at java.io.File.checkAndCreate(Unknown Source)
        at java.io.File.createTempFile0(Unknown Source)
        at java.io.File.createTempFile(Unknown Source)
        at org.apache.ivy.plugins.resolver.RepositoryResolver.findResourceUsingPattern(RepositoryResolver.java:104)
        at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findResourceUsingPatterns(AbstractPatternsBasedResolver.java:93)
        at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findIvyFileRef(AbstractPatternsBasedResolver.java:72)
        at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:223)
        at org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:169)
        at org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:287)
        at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:696)
        at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:781)
        at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
        at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:576)
        at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:237)
        at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:195)
        at play.deps.DependenciesManager.resolve(DependenciesManager.java:341)
        at play.deps.DependenciesManager.main(DependenciesManager.java:39)

I get this error even for freshly created projects, with no changes to dependencies.yml. I thought maybe it was a permissions thing, but there are no limitations I can see on any of those folders, and I've tried cmd.exe in admin mode, as well as normal mode.

I'm fairly sure I've resolved dependencies on this machine before; what could have changed to give me this error?

EDIT: I've tested now to see if it was an antivirus program, firewall, or microsoft security, but even with all of those off, no dice.


Solution

  • java.lang.UnsatisfiedLinkError

    Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native.
    

    This exception means the jvm fails to resolve the native method createFileExclusively on java.io.WinNTFileSystem

    This sounds a lot like a DLL loading problem which can be hell to debug. I am trying to locate the dll containing the linked method but I haven't done that in a long time The dll which contains the native method definition is java.dll in jdk\jre\bin or in jre\bin

    From various tests I was unable to reproduce the exact same issue. I would say you probably have in your dll load path a java.dll with a version which differs from the version of java.exe used by play.

    The quickest would be to reinstall the jre/jdk used by play.