Injecting Custom Servlet and Custom Proxy together - CLASSPATH issue

50 views
Skip to first unread message

Tanmay Ghorai

unread,
Jun 20, 2015, 1:51:21 PM6/20/15
to seleniu...@googlegroups.com
Hi,

I was trying to inject both Servlet, Proxy to the grid.

Here is my approach : Built a single jar ( mygrid.jar) including both custom servlet and proxy and kept in a folder where selenium grid jar exists.

Trying below command to invoke and start grid :

java -cp *;. org.openqa.grid.selenium.GridLauncher -role node -hub http://localhost:8080/grid/register -servlets org.test.MyServlet -proxy org.test.MyRemoteProxy    

I am getting below error : 

java.lang.ClassNotFoundException: org.test.MyRemoteProxy
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at org.openqa.grid.internal.BaseRemoteProxy.getNewInstance(BaseRemoteProxy.java:419)
        at org.openqa.grid.web.servlet.RegistrationServlet.process(RegistrationServlet.java:86)
        at org.openqa.grid.web.servlet.RegistrationServlet.doPost(RegistrationServlet.java:60)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565)
        at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479)
        at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(SessionHandler.java:225)
        at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
        at org.seleniumhq.jetty7.servlet.ServletHandler.doScope(ServletHandler.java:406)
        at org.seleniumhq.jetty7.server.session.SessionHandler.doScope(SessionHandler.java:186)
        at org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(ContextHandler.java:965)
        at org.seleniumhq.jetty7.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
        at org.seleniumhq.jetty7.server.Server.handle(Server.java:349)
        at org.seleniumhq.jetty7.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
        at org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
        at org.seleniumhq.jetty7.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
        at org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:
        at org.seleniumhq.jetty7.http.HttpParser.parseNext(HttpParser.java:857)
        at org.seleniumhq.jetty7.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
        at org.seleniumhq.jetty7.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
        at org.seleniumhq.jetty7.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
        at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
        at java.lang.Thread.run(Unknown Source)
2015-06-20 10:34:16.251:WARN:osjs.ServletHandler:/grid/register
java.security.InvalidParameterException: Error: org.test.MyRemoteProxy
        at org.openqa.grid.internal.BaseRemoteProxy.getNewInstance(BaseRemoteProxy.java:438)
        at org.openqa.grid.web.servlet.RegistrationServlet.process(RegistrationServlet.java:86)
        at org.openqa.grid.web.servlet.RegistrationServlet.doPost(RegistrationServlet.java:60)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565)
        at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479)
        at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(SessionHandler.java:225)
        at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
        at org.seleniumhq.jetty7.servlet.ServletHandler.doScope(ServletHandler.java:406)
        at org.seleniumhq.jetty7.server.session.SessionHandler.doScope(SessionHandler.java:186)
        at org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(ContextHandler.java:965)
        at org.seleniumhq.jetty7.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
        at org.seleniumhq.jetty7.server.Server.handle(Server.java:349)
        at org.seleniumhq.jetty7.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
        at org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
        at org.seleniumhq.jetty7.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
        at org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:
        at org.seleniumhq.jetty7.http.HttpParser.parseNext(HttpParser.java:857)
        at org.seleniumhq.jetty7.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
        at org.seleniumhq.jetty7.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
        at org.seleniumhq.jetty7.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
        at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
        at java.lang.Thread.run(Unknown Source)


Appreciate any help.

Regards
Tanmay

krishnan.ma...@gmail.com

unread,
Jun 20, 2015, 10:06:00 PM6/20/15
to seleniu...@googlegroups.com

There are a lot of unknowns here.

But that error is very clear. Java could not find the class in the classpath. So its either not bundled or it perhaps is misspelt.

-Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else"

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/dce865d1-82c2-4621-ac68-155597e9e6fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages