MarketSquare/remoteswinglibrary

java.lang.RuntimeException: Unsupported URL type rsrc:org/robotframework/swing/keyword/

Closed this issue · 2 comments

Hi,

Just trying out a simple test with remoteswinglibrary, using latest version with robotframework-3.2.2.jar and executing a simple Java keyword fails. Application starts ok, agent port is received but then, no matter what I try to execute in order to interact with the remote app's GUI, I get the error below. I am using remoteswinglibrary-2.2.8.jar without any modifications (downloaded from Releases).

OS is Ubuntu Bionic and I have tried with both OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~18.04-b08) and OpenJDK 64-Bit Server VM (build 11.0.10+9-Ubuntu-0ubuntu1.18.04, mixed mode, sharing).

Thank you.

KEYWORD remoteswinglibrary . Select From Main Menu Calculator|Clear
Documentation:

Selects an item from the menu of the window that was opened first. Shortcut for:
Select Window 0
Select From Menu Tools|Testing|MyTestTool
Start / End / Elapsed: 20210214 17:05:57.139 / 20210214 17:05:57.186 / 00:00:00.047
17:05:57.142 TRACE Arguments: [ 'Calculator|Clear' ]

17:05:57.184 FAIL Unsupported URL type rsrc:org/robotframework/swing/keyword/
17:05:57.185 DEBUG java.lang.RuntimeException: Unsupported URL type rsrc:org/robotframework/swing/keyword/
at org.robotframework.javalib.beans.annotation.KeywordBeanLoader.addURLKeywords(KeywordBeanLoader.java:66)
at org.robotframework.javalib.beans.annotation.KeywordBeanLoader.loadBeanDefinitions(KeywordBeanLoader.java:52)
at org.robotframework.javalib.library.AnnotationLibrary.createKeywordFactory(AnnotationLibrary.java:61)
at org.robotframework.javalib.library.KeywordFactoryBasedLibrary.getKeywordFactory(KeywordFactoryBasedLibrary.java:92)
at org.robotframework.javalib.library.KeywordFactoryBasedLibrary.runKeyword(KeywordFactoryBasedLibrary.java:39)
at org.robotframework.javalib.library.AnnotationLibrary.runKeyword(AnnotationLibrary.java:129)
at org.robotframework.swing.SwingLibrary.runKeyword(SwingLibrary.java:127)
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 org.robotframework.remoteserver.library.DynamicApiRemoteLibrary.runKeyword(DynamicApiRemoteLibrary.java:70)
at org.robotframework.remoteserver.servlet.ServerMethods.run_keyword(ServerMethods.java:86)
at org.robotframework.remoteserver.servlet.ServerMethods.run_keyword(ServerMethods.java:148)
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 org.robotframework.remoteswinglibrary.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115)
at org.robotframework.remoteswinglibrary.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRpcHandler.java:106)
at org.robotframework.remoteswinglibrary.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:46)
at org.robotframework.remoteswinglibrary.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86)
at org.robotframework.remoteswinglibrary.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:200)
at org.robotframework.remoteswinglibrary.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:112)
at org.robotframework.remoteswinglibrary.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:196)
at org.robotframework.remoteserver.servlet.RemoteServerServlet.doPost(RemoteServerServlet.java:122)
at org.robotframework.remoteswinglibrary.javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.robotframework.remoteserver.servlet.RemoteServerServlet.service(RemoteServerServlet.java:102)
at org.robotframework.remoteswinglibrary.javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:569)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1377)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:507)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1292)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:135)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
at java.base/java.lang.Thread.run(Thread.java:834)

Can post more information on how you start the application? Is your test app available somewhere online so I can test it myself?

I managed to figure out what fails in my case. If the application'sjar file uses MANIFEST with Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader then KeywordBeanLoader will not work, as it is not supporting this. See: https://github.com/robotframework/JavalibCore/blob/6f0e6402e6a6cd70ee5b1597dc29d5df87dcd523/src/main/java/org/robotframework/javalib/beans/annotation/KeywordBeanLoader.java#L60

The only 2 supported protocols are "jar" and "file". ("rscr" is not supported). I guess this is reproducible with any Java app where the jar file uses jarinjarloader. Probably this can be closed, as it is related to JavalibCore limitation.