Search code examples
scalajettyblazegraph

Possible Reasons for InstantiationError in Jetty's SocketAddressResolver


I am trying to use a remote instance of the graph database Blazegraph, which requires a call to the constructor of a RemoteRepositoryManager. The call looks as follows (serviceURL is the address of my remote Blazegraph server):

val repo = new RemoteRepositoryManager(serviceURL, false /* useLBS */ )

When I run the code inside a Scalatra-SBT project, I receive the following error, thrown by the Jetty class SocketAddressResolver:

Exception in thread "main" java.lang.InstantiationError: org.eclipse.jetty.util.SocketAddressResolver
at org.eclipse.jetty.client.HttpClient.doStart(HttpClient.java:209)
at com.bigdata.rdf.sail.webapp.client.AutoCloseHttpClient.doStart(AutoCloseHttpClient.java:71)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.bigdata.rdf.sail.webapp.client.DefaultHttpClientFactory.newInstance(DefaultHttpClientFactory.java:194)
at com.bigdata.rdf.sail.webapp.client.RemoteRepositoryManager.<init>(RemoteRepositoryManager.java:439)
at com.bigdata.rdf.sail.webapp.client.RemoteRepositoryManager.<init>(RemoteRepositoryManager.java:358)
at com.example.app.BlazegraphRemoteModeConnection$.<init>(BlazegraphRemoteModeConnection.scala:31)
at com.example.app.BlazegraphRemoteModeConnection$.<clinit>(BlazegraphRemoteModeConnection.scala)
at com.example.app.BlazegraphRemoteModeConnection.main(BlazegraphRemoteModeConnection.scala)

I am unsure of what is causing this result; however a colleague was able to successfully run this code in a non-Scalatra SBT project. The URL I am using to provide the address of the remote server is proven to work, so the problem is not there. I am looking for some suggestions in steps I can take to troubleshoot this problem.


Solution

  • I had the exact same issue. I believe the problem is Blazegraph supports an older versions of Jetty.

    Replacing the Jetty dependency with this solved it.

      "org.eclipse.jetty" % "jetty-webapp" % "8.1.8.v20121106" % "container;compile"