iqss / dataverse-client-java Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
com.researchspace.dataverse.http.DataverseOperationsTest > testListDataverses FAILED
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Can not deserialize instance of java.lang.String out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token
at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@53c1285c; line: 1, column: 152] (through reference chain: com.researchspace.dataverse.entities.DataverseResponse["data"]->com.researchspace.dataverse.entities.DataverseGet["dataverseContacts"]->java.util.ArrayList[0])
Caused by:
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token
at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@53c1285c; line: 1, column: 152] (through reference chain: com.researchspace.dataverse.entities.DataverseResponse["data"]->com.researchspace.dataverse.entities.DataverseGet["dataverseContacts"]->java.util.ArrayList[0])
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)```
Per IQSS/dataverse#3345 we plan to shut down the https://apitest.dataverse.org server so references to it should be removed.
https://demo.dataverse.org should used instead.
If there is any reason why the apitest is preferred to demo, please let me know.
In the README you say "This project can be added as a Gradle or Maven dependency in your project using JitPack." But you do not provide directly what we need to add into the pom.xml
.
I think this should be in the README instead of giving a link to the kitpack page to let the interested person figure it for himself.
Presumably, as time goes by, the information needed to be added to the pom will not change and most of the people will use the same config.
So, that new part of the readme should be:
You should add this to your pom.xml
:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.IQSS</groupId>
<artifactId>dataverse-client-java</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
</dependencies>
In this case who wants to use the software does not need to know if you are using jitpack or whatever, only pasting things into pom.xml
.
I think this is more clear and I do not see any reason why this explaantion should not be in the README.md
Anyway, thank you for putting all this effort in developing this library.
When using the uploadFile
method, it uses internally the method deposit
from class UploadFile
. Method deposit returns a DepositReceipt
that contains the result of the operation, for example the identifier of the file that you uploaded, but the method uploadFile
does not return anything. This makes impossible to keep manipulating the file for example for metadata addition because you are not returning the identification.
¿Could you please explain if this is the intentional design? ¿Is there a possible workaround to obtain the id of the file that you updated with the uploadFile
method?
If not I will raise another pull request to fix this or add another method that has this behaviour.
Hello,
When I upload a file I would like to also include the metadata of that file but the method uploadFile only accepts the file and the DOI of the dataset where we are going to upload it.
This is an example of a file and its metadata:
I would like to know how to upload the Description and the File Path property, but when I am looking into the implementation I see that you are using the class Deposit
from the SWORD library, which contains fields for a file, a date, a MD5, a mimetype... But I do not see the path or description anywhere.
Could you please explain me how can I upload those metadata (Description and File Path) into each file? The metadata of the name is already an extra parameter of uploadFile
method in my PR #13, which allows to separate the data of the file from its metadata (File Name), so the File Name is already a metadata that we can control separately from the data.
I am looking for a similar modification / extension that allow me to control those fields via uploading the file or via modifying its metadata using another API method.
Hi,
I have encountered some issues while trying to use your client into this multi-module maven project : https://github.com/OpenSILEX/opensilex-dev
I don't realy understand the error I get but it seems to be related to the fact that your project uses a different version of spring_web and maven struggles with this aspect.
I'm still not sure if this issue should be published here or on jitpack's github.
As stated in the title the original error seems to be : java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
I have tryed to switch to absolute ordering but can't seem to figure out how to do it. I was wondering if anyone had the same issue.
Full error :
GRAVE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
at org.opensilex.server.Server.start(Server.java:236)
at org.opensilex.cli.ServerCommands.start(ServerCommands.java:163)
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 picocli.CommandLine.executeUserObject(CommandLine.java:1972)
at picocli.CommandLine.access300(CommandLine.java:145)
at picocli.CommandLine.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine.handle(CommandLine.java:2352)
at picocli.CommandLine.handle(CommandLine.java:2314)
at picocli.CommandLine.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at org.opensilex.dev.DevModule.run(DevModule.java:71)
at org.opensilex.dev.StartServerWithFront.start(StartServerWithFront.java:90)
at org.opensilex.dev.cli.DevCommands.start(DevCommands.java:54)
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 picocli.CommandLine.executeUserObject(CommandLine.java:1972)
at picocli.CommandLine.access300(CommandLine.java:145)
at picocli.CommandLine.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine.handle(CommandLine.java:2352)
at picocli.CommandLine.handle(CommandLine.java:2314)
at picocli.CommandLine.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at org.opensilex.cli.MainCommand.main(MainCommand.java:96)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 45 more
Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2260)
at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2218)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:985)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5082)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 51 more
janv. 09, 2023 4:39:24 PM org.apache.catalina.core.ContainerBase startInternal
GRAVE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
at org.opensilex.server.Server.start(Server.java:236)
at org.opensilex.cli.ServerCommands.start(ServerCommands.java:163)
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 picocli.CommandLine.executeUserObject(CommandLine.java:1972)
at picocli.CommandLine.access300(CommandLine.java:145)
at picocli.CommandLine.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine.handle(CommandLine.java:2352)
at picocli.CommandLine.handle(CommandLine.java:2314)
at picocli.CommandLine.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at org.opensilex.dev.DevModule.run(DevModule.java:71)
at org.opensilex.dev.StartServerWithFront.start(StartServerWithFront.java:90)
at org.opensilex.dev.cli.DevCommands.start(DevCommands.java:54)
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 picocli.CommandLine.executeUserObject(CommandLine.java:1972)
at picocli.CommandLine.access300(CommandLine.java:145)
at picocli.CommandLine.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine.handle(CommandLine.java:2352)
at picocli.CommandLine.handle(CommandLine.java:2314)
at picocli.CommandLine.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at org.opensilex.cli.MainCommand.main(MainCommand.java:96)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 37 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
... 45 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 45 more
Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2260)
at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2218)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:985)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5082)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 51 more
09 janv. 2023;16:39:24.154 [main] ERROR org.opensilex.cli.ServerCommands Tomcat exception while starting OpenSilex server
org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
at org.opensilex.server.Server.start(Server.java:236)
at org.opensilex.cli.ServerCommands.start(ServerCommands.java:163)
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 picocli.CommandLine.executeUserObject(CommandLine.java:1972)
at picocli.CommandLine.access300(CommandLine.java:145)
at picocli.CommandLine.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine.handle(CommandLine.java:2352)
at picocli.CommandLine.handle(CommandLine.java:2314)
at picocli.CommandLine.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at org.opensilex.dev.DevModule.run(DevModule.java:71)
at org.opensilex.dev.StartServerWithFront.start(StartServerWithFront.java:90)
at org.opensilex.dev.cli.DevCommands.start(DevCommands.java:54)
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 picocli.CommandLine.executeUserObject(CommandLine.java:1972)
at picocli.CommandLine.access300(CommandLine.java:145)
at picocli.CommandLine.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine.handle(CommandLine.java:2352)
at picocli.CommandLine.handle(CommandLine.java:2314)
at picocli.CommandLine.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at org.opensilex.cli.MainCommand.main(MainCommand.java:96)
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
... 37 common frames omitted
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 37 common frames omitted
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
... 45 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 45 common frames omitted
Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2260)
at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2218)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:985)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5082)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 51 common frames omitted
org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
at org.opensilex.server.Server.start(Server.java:236)
at org.opensilex.cli.ServerCommands.start(ServerCommands.java:163)
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 picocli.CommandLine.executeUserObject(CommandLine.java:1972)
at picocli.CommandLine.access300(CommandLine.java:145)
at picocli.CommandLine.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine.handle(CommandLine.java:2352)
at picocli.CommandLine.handle(CommandLine.java:2314)
at picocli.CommandLine.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at org.opensilex.dev.DevModule.run(DevModule.java:71)
at org.opensilex.dev.StartServerWithFront.start(StartServerWithFront.java:90)
at org.opensilex.dev.cli.DevCommands.start(DevCommands.java:54)
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 picocli.CommandLine.executeUserObject(CommandLine.java:1972)
at picocli.CommandLine.access300(CommandLine.java:145)
at picocli.CommandLine.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine.handle(CommandLine.java:2352)
at picocli.CommandLine.handle(CommandLine.java:2314)
at picocli.CommandLine.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at org.opensilex.cli.MainCommand.main(MainCommand.java:96)
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
... 37 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 37 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
... 45 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 45 more
Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2260)
at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2218)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:985)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5082)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 51 more
Thank you for your help,
Gabriel Besombes
As I mentioned at https://groups.google.com/d/msg/dataverse-community/8WTs3wYF6dc/AzPOxzRKFwAJ there are two new APIs having to do with adding and replacing files that we expect to ship with Dataverse 4.6.1. They address this issue: IQSS/dataverse#1612
Once the code and docs are final, I'll leave a comment on this issue but if anyone wants to kick the tires on the new APIs now, please follow the link to the Google Group above! 😄
Is there a particular reason why a lot of methods are private rather than simply protected or even public?
For example in this file : https://github.com/IQSS/dataverse-client-java/blob/44e37e12d015105afef26df63db4949b538ce2b4/src/main/java/com/researchspace/dataverse/entities/facade/DatasetBuilder.java
For context I'm using this client to interact with an implementation of the dataverse project. The issue is that there are some differencies between the basic dataverse native API and this implementation. There are some aditional optional or mandatory fields. For this reason I wanted to extend a few classes to add these. But this has proven to be quite difficult.
Tested on 6d72b92 on Ubuntu 16.04. I ran the equivalent of ./gradlew clean test -DdataverseServerURL=https://my.dataverse.org -DdataverseApiKey=xxx-xxx-xxx -DdataverseAlias=MY-DEMO-DATAVERSE
from the readme but one of the tests didn't pass:
Quite possibly I'm doing something wrong! I'm attaching the output I saw and a tarball of the build directory which contains the report in the screenshot above.
We've benefitted from having Travis set up at https://travis-ci.org/IQSS/dataverse and should consider it for this repo as well.
Support API calls to get/set the Info API:
GET http://$SERVER/api/info/settings/:DatasetPublishPopupCustomText
Hello again.
I am trying to do a bulk upload of a project into a dataverse instance. To do so I need to create a dataset for the project and then upload all the files into the created dataset. The problem is that when you create a dataset the method to do so returns an Identifier
which contains an integer. This integer is supposed to identify the dataset that you just created, but when you want to upload a file into that dataset using the identifier you can not do it since the methods to upload a file only accept DOIs to identify datasets and not the identifier that you return from the createDataset
method.
So, I would like to do something like this:
List<Document> documents = new ArrayList(...);
Identifier identifier = api.getDataverseOperations().createDataset(JSONMetadata.toString(), "theDatasetName");
for (Document document: documents)
{
try {
api.getDatasetOperations().uploadFile(identifier.toString(), document.getInputStream(), document.getName() ); // This line fails because the identifier does not identify any dataset and it expects a DOI
} catch (IOException e) {
e.printStackTrace();
}
}
Where Document
is just a class that wraps file data.
But I cant do it since public Identifier createDataset(String dataSetJson, String dataverseAlias) {...}
does not return a DOI.
So, my question is: ¿Is there any way to retrieve the DOI of the dataset that I just created in order to upload files to it inmediately after? Even if it involves doing extra operations. Alternatively: ¿Is there any way to use the Identifier
object that you return to identify a dataset and upload files to it?
If that is not possible I will try to do another pull request. But this time I am going to need a little help, since I do not know what operations are you doing in the last line of public Identifier createDataset(String dataSetJson, String dataverseAlias) {...}
where you do
return resp.getBody().getData();
where I deduce that you are parsing the return, and obtaining the Id from there.
The reason why I am proposing this change is because I think is completely possible to do so and also an improvement to the library: When you use the native API to create a dataset (using curl for example) the server returns a JSON which contains both the identifier that you return and the doi of the dataset that you just created. It is a matter of parsing the DOI and the identifier and returning them in the method or implementing an equivalent method that parses and returns only the DOI.
Please, answer me when you can to know your opinion in this subject.
Currently is hard-coded to zip file. In FileUploader
class:
dep.setMimeType(APPLICATION_ZIP);
dep.setPackaging(ZIP_PACKAGING);
The interface Interface DatasetOperations
defines the specification for the method void uploadFile(String doi, File file);
which as far as my Java knowledge goes (please correct me if there is a workaround for this and I am wrong) it forces the developer to have an instance of File
, which has to be on the disk.
In my case, I am retrieving the file data from the database so I do not have a file, instead I have an InputStream
/ Byte
array (preferably an InputStream
for memory optimization).
In order to use the method void uploadFile(String doi, File file);
from class DatasetOperationsImplV1, I would need to write the InputStream
from my DB into disk in order to obtain my File
. This is wasteful. (again, correct me if I am wrong).
I checked the implementation of method void uploadFile(String doi, File file);
and I noticed that you are using the class FileUploader
. From there you are using the SWORD library to perform the update. I can see that you use the class Deposit
as a model to send data to the SWORD library for the upload.
The Class Deposit
defines the field for the File
as private InputStream file = null;
(line 8), and its setter (the method that you actually use in class FileUploader
to add the file) as public void setFile(InputStream file){...}
(line 87). This means that the SWORD library is actually using an InputStream
, so adding an overloaded method in your library that receives an InputStream
instead of a File
should not be very difficult.
Proposed changes:
Class FileUploader
implement the overloaded method public DepositReceipt deposit(**InputStream file**, String apiKey, URI dataverseServer, String doi) throws IOException, SWORDClientException, SWORDError, ProtocolViolationException {...}
Interface DatasetOperations
add the overloaded method void uploadFile(String doi, **InputStream file**);
Class DatasetOperationsImplV1
implement the overloaded method void uploadFile(String doi, ** InputStream file**){...}
Justification of changes:
With this I should be able to update a "File" using an InputStream
directly from my database without writing to a file temporarily.
Please, tell me what do you think of this proposed changes and also tell me if it makes sense implementing this new way of using your library. If you agree I will try to implement it by myself and when I am finished I will do a pull request.
Any feedback is very much appreciated.
And, again, thanks for this library. It is being very useful for me :D :D
This is currently a bit patchy.
Implementing a Builder pattern to make Dataset construction a little easier.
Also need to handle optional/mandatory fields
Also validation of input.
@pdurbin Is there any way to programmatically get a list of Subjects and IdentifierSchemes?
I can hard-code based on what I see on the website but would be nice to get from an API call.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.