DICE-UNC / jargon

Jargon core libraries
Other
28 stars 31 forks source link

Creation of symbolic links #333

Closed jjkoehorst closed 5 years ago

jjkoehorst commented 5 years ago

I am using the following code to create a soft link between two folders.

        MountedCollectionAO mountedCollectionAO = connection.irodsFileSystem.getIRODSAccessObjectFactory().getMountedCollectionAO(connection.irodsAccount);
        mountedCollectionAO.createASoftLink(commandOptions.collection.getAbsolutePath(), commandOptions.collection + "/myfolder/test_input");

Thus commandOptions.collection.../myfolder/test_input" should show the content of commandOptions.collection.

However when executing I get the following uninformative message:

org.irods.jargon.core.exception.JargonException: Unknown iRODS exception code recieved:-107000

    at org.irods.jargon.core.connection.IRODSErrorScanner.inspectAndThrowIfNeeded(IRODSErrorScanner.java:105)
    at org.irods.jargon.core.connection.IRODSMidLevelProtocol.processMessageInfoLessThanZero(IRODSMidLevelProtocol.java:1399)
    at org.irods.jargon.core.connection.IRODSMidLevelProtocol.readMessage(IRODSMidLevelProtocol.java:903)
    at org.irods.jargon.core.connection.IRODSMidLevelProtocol.readMessage(IRODSMidLevelProtocol.java:871)
    at org.irods.jargon.core.connection.IRODSMidLevelProtocol.irodsFunction(IRODSMidLevelProtocol.java:284)
    at org.irods.jargon.core.connection.IRODSMidLevelProtocol.irodsFunction(IRODSMidLevelProtocol.java:410)
    at org.irods.jargon.core.connection.IRODSMidLevelProtocol.irodsFunction(IRODSMidLevelProtocol.java:766)
    at org.irods.jargon.core.pub.MountedCollectionAOImpl.createASoftLink(MountedCollectionAOImpl.java:184)
    at nl.munlock.software.quality.FastQC.main(FastQC.java:71)
    at irodsrunners.App.main(App.java:66)
    at irodsrunners.AppTest.testFastQC(AppTest.java:57)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Also why the sudden use of strings in this case and not an irodsfile object?

michael-conway commented 5 years ago

looks like a sys_coll_link_path_error

https://github.com/irods/irods/search?q=-107000&unscoped_q=-107000

Check out these dets, and if you still run into an error we can check out the unit tests or replicate. FWIW we're getting ready to use soft links on our side for some use cases!

If the mountType is 'l' or 'link', the request is for a collection soft
link. the first argument is the iRODS collection to be linked or the
target collection name. The second argument is the link collection name
The link collection must not exist or must be an empty collection.
michael-conway commented 5 years ago

I'm going to consider this one closed, as current development shows the soft links functions working correctly. Pls reopen if any problems persist