las2peer
las2peer copied to clipboard
[BUG] ResourceNotFoundException when requesting Resource with String[] or List<String> as attribute
- Summary - When deploying the Distributed Noracle Application to the developer las2peer network, a ResourceNotFoundException is throwd when calling an API Endpoint with a Object as Response, that has a String[] or List<String> attribut. Locally, this problem does not occur.
-
Bug Details
- Where? - In LoadedJarLibrary.java, when calling getResourceAsUrl(...). Can be reproduced with Noracle (https://noracle.tech4comp.dbis.rwth-aachen.de/). The user only needs to login. After that, the error can be seen in the network tab in the developer tools.
- When?/How often? - When requesting an Noracle (https://git.tech4comp.dbis.rwth-aachen.de/distributed-noracle/agents/{agentId}/spacesubscriptions), the Response is an object, that has a String[] attribute as member.
Here is the call stack from the corresponding las2peer service:
...
Request failed: i5.las2peer.api.execution.ServiceInvocationFailedException: Re-serialization failed
i5.las2peer.api.execution.ServiceInvocationFailedException: Re-serialization failed
at i5.las2peer.execution.ExecutionContext.invokeWithAgent(ExecutionContext.java:176)
at i5.las2peer.execution.ExecutionContext.invoke(ExecutionContext.java:131)
at i5.las2peer.services.noracleService.resources.AgentsResource.getSpaceSubscriptions(AgentsResource.java:56)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
at i5.las2peer.restMapper.RESTService.handle(RESTService.java:148)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at i5.las2peer.execution.ServiceHelper.execute(ServiceHelper.java:139)
at i5.las2peer.security.ServiceAgentImpl.invoke(ServiceAgentImpl.java:453)
at i5.las2peer.security.ServiceAgentImpl.lambda$handle$0(ServiceAgentImpl.java:479)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: java.lang.ClassNotFoundException: The class [Ljava.lang.String; could not be loaded by this classloader!
at i5.las2peer.classLoaders.ServiceClassLoader.findClass(ServiceClassLoader.java:77)
at i5.las2peer.classLoaders.ServiceClassLoader.loadClass(ServiceClassLoader.java:113)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
at i5.las2peer.execution.ExecutionContext$1.resolveClass(ExecutionContext.java:171)
at java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:2022)
at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1889)
at java.base/java.io.ObjectInputStream.readArray(ObjectInputStream.java:2084)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1694)
at java.base/java.io.ObjectInputStream$FieldValues.
I faintly remember having the same issue when I did my bachelor thesis. I think it is due to the serialization issue for Objects. I think the issue occurs when you make an RMI to a method that returns an Object. At least this would at least explain why it is working locally (because you don't need to call a service on another node)