rwth-acis / mobsos-surveys

A simple survey management service and Web application, being part of the MobSOS toolkit.
Other
7 stars 10 forks source link

Unable to Start Service #2

Closed lightonphiri closed 4 years ago

lightonphiri commented 6 years ago

I cloned project and set it up. However, I cannot seem to start it up. Any idea what it is I could be doing wrong? I set this up on a machine already running services on ports 8080 and 8081 and so tried to alter the ports in i5.las2peer.services.mobsos.surveys.SurveyService.properties and i5.las2peer.webConnector.WebConnector.properties but still no luck.

lphiri@LIS:~/projects/lis4014/mobsos-surveys$ ./bin/start_network.sh                                              loading storage...
storage ready, loading took 34ms
Starting new las2peer network...
Node D5FE20F06411CD7DB614751BEF42AEFCD463236D started
Handling: 'startService('i5.las2peer.services.mobsos.surveys.SurveyService@0.2','mobsosrules')'
No library found for i5.las2peer.services.mobsos.surveys.SurveyService@0.2! Trying default classpath. This should not happen in a productive environment!
Starting service failed
i5.las2peer.api.security.AgentException: Problems with the classloader
        at i5.las2peer.security.ServiceAgentImpl.notifyRegistrationTo(ServiceAgentImpl.java:395)
        at i5.las2peer.p2p.Node.registerReceiver(Node.java:635)
        at i5.las2peer.p2p.PastryNodeImpl.registerReceiver(PastryNodeImpl.java:378)
        at i5.las2peer.tools.L2pNodeLauncher.startService(L2pNodeLauncher.java:679)
        at i5.las2peer.tools.L2pNodeLauncher.startServiceXml(L2pNodeLauncher.java:653)
        at i5.las2peer.tools.L2pNodeLauncher.startService(L2pNodeLauncher.java:628)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at i5.las2peer.tools.CommandPrompt.executeMethod(CommandPrompt.java:347)
        at i5.las2peer.tools.CommandPrompt.handleCommand(CommandPrompt.java:295)
        at i5.las2peer.tools.CommandPrompt.handleLine(CommandPrompt.java:454)
        at i5.las2peer.tools.L2pNodeLauncher.launchConfiguration(L2pNodeLauncher.java:954)
        at i5.las2peer.tools.L2pNodeLauncher.main(L2pNodeLauncher.java:1106)
Caused by: i5.las2peer.classLoaders.LibraryNotFoundException: java.lang.ClassNotFoundException: i5.las2peer.services.mobsos.surveys.SurveyService
        at i5.las2peer.classLoaders.ClassManager.getServiceClass(ClassManager.java:154)
        at i5.las2peer.security.ServiceAgentImpl.notifyRegistrationTo(ServiceAgentImpl.java:358)
        ... 14 more
Caused by: java.lang.ClassNotFoundException: i5.las2peer.services.mobsos.surveys.SurveyService
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at i5.las2peer.classLoaders.ClassManager.getServiceClass(ClassManager.java:152)
        ... 15 more
  --> Exception in executed method!
      InvocationTargetException (Problems with the classloader)
      (print StackTrace with pst / printStackTrace)
Handling: 'startWebConnector'
Starting connector with class name: i5.las2peer.connectors.webConnector.WebConnector!
 --> Problems starting the connector
i5.las2peer.connectors.ConnectorException: Connector start failed
        at i5.las2peer.connectors.webConnector.WebConnector.start(WebConnector.java:409)
        at i5.las2peer.tools.L2pNodeLauncher.startConnector(L2pNodeLauncher.java:364)
        at i5.las2peer.tools.L2pNodeLauncher.startWebConnector(L2pNodeLauncher.java:326)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at i5.las2peer.tools.CommandPrompt.executeMethod(CommandPrompt.java:347)
        at i5.las2peer.tools.CommandPrompt.handleCommand(CommandPrompt.java:295)
        at i5.las2peer.tools.CommandPrompt.handleLine(CommandPrompt.java:454)
        at i5.las2peer.tools.L2pNodeLauncher.launchConfiguration(L2pNodeLauncher.java:954)
        at i5.las2peer.tools.L2pNodeLauncher.main(L2pNodeLauncher.java:1106)
Caused by: javax.ws.rs.ProcessingException: IOException thrown when creating the JDK HttpServer.
        at org.glassfish.jersey.jdkhttp.JdkHttpServerFactory.createHttpServer(JdkHttpServerFactory.java:262)
        at org.glassfish.jersey.jdkhttp.JdkHttpServerFactory.createHttpServer(JdkHttpServerFactory.java:171)
        at i5.las2peer.connectors.webConnector.WebConnector.startHttpServer(WebConnector.java:414)
        at i5.las2peer.connectors.webConnector.WebConnector.start(WebConnector.java:379)
        ... 11 more
Caused by: java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:433)
        at sun.nio.ch.Net.bind(Net.java:425)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:100)
        at sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:50)
        at sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35)
        at com.sun.net.httpserver.HttpServer.create(HttpServer.java:130)
        at org.glassfish.jersey.jdkhttp.JdkHttpServerFactory.createHttpServer(JdkHttpServerFactory.java:259)
        ... 14 more
  ok  
        result:  /null/
Handling: 'interactive'
Entering interactive mode
-----------------------------------------------
Enter 'help' for further information of the console.
Use all public methods of the L2pNodeLauncher class for interaction with the P2P network.

3 : i5.las2peer.tools.L2pNodeLauncher@b2c5e07 > 
pedela commented 6 years ago

Hi, this one: "Caused by: java.net.BindException: Address already in use" means you have something else running on the port you either want to start your Web Connector or your las2peer node on (the first one you set in the mentioned config files, the latter is set via a parameter of your startup bash command).

Please also check, that you have a proper Java version (preferably Java 8, latest release).

If you have any other issues, feel free to ask!

Best, Peter

lightonphiri commented 6 years ago

Thanks for this. However, I have tried using different ports and I keep getting the Cause by: java.net.BindException: Address already in use error. Can you help with an example command of setting las2peer node via a parameter?

I have Java 8 installed.

lightonphiri@LIS:~/projects/lis4014/mobsos-surveys$ java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
lightonphiri@LIS:~/projects/lis4014/mobsos-surveys$ 
pedela commented 6 years ago

Sorry for my late reply. In this line of the start script change the "9001" to something else: java -cp "${CLASSPATH}" i5.las2peer.tools.L2pNodeLauncher -p 9001 "startService('i5.las2peer.services.mobsos.surveys.SurveyService@0.2','mobsosrules')" "startWebConnector" "interactive"

lightonphiri commented 6 years ago

Sadly, this does not seem to help either. I still get the errors. I was so hoping I could trying this out. I suppose I will attempt to set it up on a machine that is not running any services.

pedela commented 6 years ago

I'm sorry for your troubles!:-)

Actually the message reads more like your Web connector actually has the wrong address (since the error is thrown after the node itself was already started, but the Web connector fails to start), so you should again try to change this line in the WebConnector config file: httpPort = 8080

pedela commented 6 years ago

Meanwhile..may I direct you to our running installation of the service to try it out? https://las2peer.dbis.rwth-aachen.de:9097/mobsos-surveys/surveys