Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ResourceNotFoundException when requesting Resource with String[] or List<String> as attribute #129

Open
Siminho opened this issue Feb 5, 2022 · 2 comments
Assignees
Labels

Comments

@Siminho
Copy link

Siminho commented Feb 5, 2022

  1. 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 attribut. Locally, this problem does not occur.
  2. Bug Details
    1. 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.
    2. 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.
@Siminho Siminho added the bug label Feb 5, 2022
@Siminho
Copy link
Author

Siminho commented Feb 5, 2022

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.(ObjectInputStream.java:2571)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2429)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2229)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1706)
at java.base/java.io.ObjectInputStream$FieldValues.(ObjectInputStream.java:2571)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2429)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2229)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1706)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:496)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:454)
at java.base/java.util.ArrayList.readObject(ArrayList.java:899)
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 java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1224)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2395)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2229)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1706)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:496)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:454)
at i5.las2peer.execution.ExecutionContext.invokeWithAgent(ExecutionContext.java:174)
... 35 more
Caused by: i5.las2peer.classLoaders.libraries.ResourceNotFoundException: the resource '[Ljava/lang/String;.class' could not be loaded from 'service/i5.las2peer.services.noracleService-1.0.0.jar'
at i5.las2peer.classLoaders.libraries.LoadedJarLibrary.getResourceAsUrl(LoadedJarLibrary.java:45)
at i5.las2peer.classLoaders.libraries.LoadedJarLibrary.getResourceAsStream(LoadedJarLibrary.java:60)
at i5.las2peer.classLoaders.libraries.LoadedLibrary.getResourceAsBinary(LoadedLibrary.java:94)
at i5.las2peer.classLoaders.ServiceClassLoader.getResourceContent(ServiceClassLoader.java:53)
at i5.las2peer.classLoaders.ServiceClassLoader.findClass(ServiceClassLoader.java:62)
... 64 more
...

@lakhoune
Copy link
Member

lakhoune commented Feb 5, 2022

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)

@Aran30 Aran30 self-assigned this Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants