Skip to content

java.lang.IllegalStateException: Duplicate key stop_remote_server  #65

@lasselindqvist

Description

@lasselindqvist

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions