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

java.lang.IllegalStateException: Duplicate key stop_remote_server #65

Closed
lasselindqvist opened this issue May 16, 2022 · 1 comment
Closed

Comments

@lasselindqvist
Copy link

Hi. Seems like the newest version starts to throw

Caused by: java.lang.IllegalStateException: Duplicate key stop_remote_server (attempted merging values {args=[], types=[], doc=Stops the remote server.

The server may be configured so that users cannot stop it., tags=[]} and {args=[], types=[], doc=Stops the remote server.

The server may be configured so that users cannot stop it., tags=[]})
	at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:135)
	at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182)
	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at org.robotframework.remoteserver.servlet.ServerMethods.get_library_information(ServerMethods.java:205)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115)
	... 36 common frames omitted

I believe the reason is in


where the "stop_remote_server" is added to the ArrayList.
It has become an issue after
public Map<String, Object> get_library_information() {
started to expect unique keyword names.

This can be reproduced by starting a server and executing some test against it multiple times without stopping the server in between.

Could be fixed by using a Set or calling contains before adding the "stop_remote_server" keyword.

lasselindqvist added a commit to lasselindqvist/jrobotremoteserver that referenced this issue May 20, 2022
…iple times

Also extends tests to cover this behaviour.
lasselindqvist added a commit to lasselindqvist/jrobotremoteserver that referenced this issue Aug 15, 2022
Issue robotframework#65: Fix get_library_information when called multiple times
@Hi-Fi
Copy link
Collaborator

Hi-Fi commented Jul 27, 2023

Fixed in 4.1.1 with #68 .

@Hi-Fi Hi-Fi closed this as completed Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants