On 23/06/2021 15:27, Philipp Leeb wrote:
Hi Andy,

so i should exclude Jetty from city.sane.wot-servient if i get you right?

Yes - try it.

A change to dependencies can have other effects as well because the dependency tree is what maven decided, not the inputs it was choosing from.

(maven dependency defaults to "nearest" - the artifact with the shortest path in the dependency graph)

    Andy


Kind regards
Phil

-----Ursprüngliche Nachricht-----
Von: Andy Seaborne <[email protected]>
Gesendet: Mittwoch, 23. Juni 2021 16:12
An: [email protected]
Betreff: Re: AW: Unable to start embedded fuseki

You got multiple Jetty's with different versions. Probaly causing interference 
in dependency resolution.

You haven't got all the Fuseki dependencies from the version it was compiled 
and tested against.

Exclude Jetty from one of the routes into you application POM. usually, exlcude 
the earlier version because Jetty is quite good at compatibility.

      Andy

On 23/06/2021 14:38, Philipp Leeb wrote:
Hi Andy Seaborne and Rob Vesse,

this my complete dependy tree:
[INFO] org.leebphil:wot-td-query:jar:0.0.1-SNAPSHOT
[INFO] +- junit:junit:jar:4.13.1:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- city.sane.wot-servient:wot-servient:jar:1.15:compile
[INFO] |  +- com.damnhandy:handy-uri-templates:jar:2.1.8:compile
[INFO] |  |  \- joda-time:joda-time:jar:2.10.2:compile
[INFO] |  +-
com.fasterxml.jackson.core:jackson-databind:jar:2.10.5:compile
[INFO] |  |  +-
com.fasterxml.jackson.core:jackson-annotations:jar:2.10.5:compile
[INFO] |  |  \-
com.fasterxml.jackson.core:jackson-core:jar:2.10.5:compile
[INFO] |  +-
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.10.5:co
mpile [INFO] |  +- org.eclipse.rdf4j:rdf4j-client:jar:2.5.5:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.10:compile
[INFO] |  |  +- commons-codec:commons-codec:jar:1.11:compile
[INFO] |  |  +- com.opencsv:opencsv:jar:4.3.2:compile
[INFO] |  |  +- org.apache.commons:commons-lang3:jar:3.8.1:compile
[INFO] |  |  +- org.apache.commons:commons-text:jar:1.3:compile
[INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.9.3:compile
[INFO] |  |  +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  |  +-
commons-collections:commons-collections:jar:3.2.2:compile
[INFO] |  |  +-
org.apache.commons:commons-collections4:jar:4.2:compile
[INFO] |  |  +- com.github.jsonld-java:jsonld-java:jar:0.12.3:compile
[INFO] |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.26:compile
[INFO] |  |  +-
org.apache.httpcomponents:httpclient-cache:jar:4.5.6:compile
[INFO] |  |  \- commons-io:commons-io:jar:2.6:compile
[INFO] |  +- org.eclipse.rdf4j:rdf4j-repository-sail:jar:2.5.5:compile
[INFO] |  |  +-
org.eclipse.rdf4j:rdf4j-repository-api:jar:2.5.5:compile
[INFO] |  |  +- org.eclipse.rdf4j:rdf4j-sail-api:jar:2.5.5:compile
[INFO] |  |  +- org.eclipse.rdf4j:rdf4j-http-client:jar:2.5.5:compile
[INFO] |  |  |  +-
org.eclipse.rdf4j:rdf4j-http-protocol:jar:2.5.5:compile
[INFO] |  |  |  |  \-
org.eclipse.rdf4j:rdf4j-rio-ntriples:jar:2.5.5:compile
[INFO] |  |  |  \-
org.eclipse.rdf4j:rdf4j-queryresultio-api:jar:2.5.5:compile
[INFO] |  |  +-
org.eclipse.rdf4j:rdf4j-queryparser-api:jar:2.5.5:compile
[INFO] |  |  +-
org.eclipse.rdf4j:rdf4j-queryalgebra-model:jar:2.5.5:compile
[INFO] |  |  +- org.eclipse.rdf4j:rdf4j-query:jar:2.5.5:compile
[INFO] |  |  +- org.eclipse.rdf4j:rdf4j-rio-api:jar:2.5.5:compile
[INFO] |  |  +- org.eclipse.rdf4j:rdf4j-rio-trig:jar:2.5.5:compile
[INFO] |  |  |  +-
org.eclipse.rdf4j:rdf4j-rio-datatypes:jar:2.5.5:runtime
[INFO] |  |  |  \-
org.eclipse.rdf4j:rdf4j-rio-languages:jar:2.5.5:runtime
[INFO] |  |  +- org.eclipse.rdf4j:rdf4j-model:jar:2.5.5:compile
[INFO] |  |  +-
org.eclipse.rdf4j:rdf4j-queryalgebra-evaluation:jar:2.5.5:compile
[INFO] |  |  |  +-
org.eclipse.rdf4j:rdf4j-repository-sparql:jar:2.5.5:compile
[INFO] |  |  |  |  +-
org.eclipse.rdf4j:rdf4j-queryparser-sparql:jar:2.5.5:compile
[INFO] |  |  |  |  \-
org.eclipse.rdf4j:rdf4j-queryresultio-sparqlxml:jar:2.5.5:compile
[INFO] |  |  |  +- org.mapdb:mapdb:jar:1.0.8:compile [INFO] |  |  |
\- com.google.guava:guava:jar:18.0:compile
[INFO] |  |  \- org.eclipse.rdf4j:rdf4j-rio-turtle:jar:2.5.5:compile
[INFO] |  +- org.eclipse.rdf4j:rdf4j-sail-memory:jar:2.5.5:compile
[INFO] |  |  +- org.eclipse.rdf4j:rdf4j-sail-base:jar:2.5.5:compile
[INFO] |  |  +-
org.eclipse.rdf4j:rdf4j-sail-inferencer:jar:2.5.5:compile
[INFO] |  |  |  +-
org.eclipse.rdf4j:rdf4j-queryparser-serql:jar:2.5.5:runtime
[INFO] |  |  |  \-
org.eclipse.rdf4j:rdf4j-sail-model:jar:2.5.5:compile
[INFO] |  |  \- org.eclipse.rdf4j:rdf4j-util:jar:2.5.5:compile
[INFO] |  +- com.typesafe:config:jar:1.4.1:compile
[INFO] |  +- io.github.classgraph:classgraph:jar:4.8.95:compile
[INFO] |  +- io.netty:netty-transport:jar:4.1.55.Final:compile
[INFO] |  |  +- io.netty:netty-common:jar:4.1.55.Final:compile
[INFO] |  |  +- io.netty:netty-buffer:jar:4.1.55.Final:compile
[INFO] |  |  \- io.netty:netty-resolver:jar:4.1.55.Final:compile
[INFO] |  +- io.netty:netty-codec:jar:4.1.55.Final:compile
[INFO] |  +- io.reactivex.rxjava3:rxjava:jar:3.0.8:compile
[INFO] |  |  \- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] +-
city.sane.wot-servient:wot-servient-binding-http:jar:1.13:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.6:compile
[INFO] |  +- com.sparkjava:spark-core:jar:2.9.1:compile
[INFO] |  |  +-
org.eclipse.jetty:jetty-server:jar:9.4.18.v20190429:compile
[INFO] |  |  |  +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] |  |  |  +-
org.eclipse.jetty:jetty-http:jar:9.4.18.v20190429:compile
[INFO] |  |  |  \-
org.eclipse.jetty:jetty-io:jar:9.4.18.v20190429:compile
[INFO] |  |  +-
org.eclipse.jetty:jetty-webapp:jar:9.4.18.v20190429:compile
[INFO] |  |  +-
org.eclipse.jetty.websocket:websocket-server:jar:9.4.18.v20190429:comp
ile
[INFO] |  |  |  +-
org.eclipse.jetty.websocket:websocket-common:jar:9.4.18.v20190429:comp
ile
[INFO] |  |  |  \-
org.eclipse.jetty.websocket:websocket-client:jar:9.4.18.v20190429:compile
[INFO] |  |  |     \-
org.eclipse.jetty:jetty-client:jar:9.4.18.v20190429:compile
[INFO] |  |  \-
org.eclipse.jetty.websocket:websocket-servlet:jar:9.4.18.v20190429:compile
[INFO] |  |     \-
org.eclipse.jetty.websocket:websocket-api:jar:9.4.18.v20190429:compile
[INFO] |  \- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] |     \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] +- org.apache.jena:apache-jena-libs:pom:4.1.0:compile
[INFO] |  +- org.apache.jena:jena-shacl:jar:4.1.0:compile
[INFO] |  |  \- org.apache.jena:jena-arq:jar:4.1.0:compile
[INFO] |  |     +- org.apache.jena:jena-core:jar:4.1.0:compile
[INFO] |  |     |  +- org.apache.jena:jena-base:jar:4.1.0:compile
[INFO] |  |     |  |  +- org.apache.jena:jena-shaded-guava:jar:4.1.0:compile
[INFO] |  |     |  |  +- org.apache.commons:commons-csv:jar:1.8:compile
[INFO] |  |     |  |  +-
org.apache.commons:commons-compress:jar:1.20:compile
[INFO] |  |     |  |  \-
com.github.andrewoma.dexx:collection:jar:0.7:compile
[INFO] |  |     |  +- org.apache.jena:jena-iri:jar:4.1.0:compile
[INFO] |  |     |  \- commons-cli:commons-cli:jar:1.4:compile
[INFO] |  |     \- org.apache.thrift:libthrift:jar:0.14.1:compile
[INFO] |  |        \-
javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  +- org.apache.jena:jena-tdb:jar:4.1.0:compile
[INFO] |  +- org.apache.jena:jena-tdb2:jar:4.1.0:compile
[INFO] |  |  \- org.apache.jena:jena-dboe-storage:jar:4.1.0:compile
[INFO] |  |     \- org.apache.jena:jena-dboe-trans-data:jar:4.1.0:compile
[INFO] |  |        +-
org.apache.jena:jena-dboe-transaction:jar:4.1.0:compile
[INFO] |  |        |  \- org.apache.jena:jena-dboe-base:jar:4.1.0:compile
[INFO] |  |        \- org.apache.jena:jena-dboe-index:jar:4.1.0:compile
[INFO] |  \- org.apache.jena:jena-rdfconnection:jar:4.1.0:compile
[INFO] +- org.apache.jena:jena-fuseki-main:jar:4.1.0:compile
[INFO] |  +- org.apache.jena:jena-fuseki-core:jar:4.1.0:compile
[INFO] |  |  +- commons-fileupload:commons-fileupload:jar:1.4:compile
[INFO] |  |  +-
org.eclipse.jetty:jetty-servlet:jar:9.4.40.v20210413:compile
[INFO] |  |  |  +-
org.eclipse.jetty:jetty-security:jar:9.4.40.v20210413:compile
[INFO] |  |  |  \-
org.eclipse.jetty:jetty-util-ajax:jar:9.4.40.v20210413:compile
[INFO] |  |  +-
org.eclipse.jetty:jetty-servlets:jar:9.4.40.v20210413:compile
[INFO] |  |  |  \-
org.eclipse.jetty:jetty-continuation:jar:9.4.40.v20210413:compile
[INFO] |  |  +- io.micrometer:micrometer-core:jar:1.6.6:compile
[INFO] |  |  |  +- org.hdrhistogram:HdrHistogram:jar:2.1.12:compile
[INFO] |  |  |  \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] |  |  \-
io.micrometer:micrometer-registry-prometheus:jar:1.6.6:compile
[INFO] |  |     \- io.prometheus:simpleclient_common:jar:0.9.0:compile
[INFO] |  |        \- io.prometheus:simpleclient:jar:0.9.0:compile
[INFO] |  +- org.apache.jena:jena-fuseki-access:jar:4.1.0:compile
[INFO] |  +- org.apache.jena:jena-cmds:jar:4.1.0:compile
[INFO] |  \- org.eclipse.jetty:jetty-xml:jar:9.4.40.v20210413:compile
[INFO] |     \- org.eclipse.jetty:jetty-util:jar:9.4.40.v20210413:compile
[INFO] \- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.13.1:compile
[INFO]    +- org.apache.logging.log4j:log4j-api:jar:2.13.1:compile
[INFO]    \- org.apache.logging.log4j:log4j-core:jar:2.13.1:runtime
[INFO]
----------------------------------------------------------------------
--
[INFO] BUILD SUCCESS
[INFO]
----------------------------------------------------------------------
--
[INFO] Total time:  15.368 s
[INFO] Finished at: 2021-06-23T15:35:34+02:00 [INFO]
----------------------------------------------------------------------
--

Best regards
Philipp

-----Ursprüngliche Nachricht-----
Von: Andy Seaborne <[email protected]>
Gesendet: Mittwoch, 23. Juni 2021 15:33
An: [email protected]
Betreff: Re: Unable to start embedded fuseki

Hi Philipp,

java.lang.NoSuchMethodError means the method was there when compiled,
and isn't at runtime.

ServletContextHandler.contextInitialized is in the "jetty-server" jar;
ServletHandler in "jetty-servlet"

Check the classpath and make sure all the necessary jars are present
and compatible.

The code was compiled for Jetty 9.4.40.

mvn dependency:tree shows:

+- org.apache.jena:jena-fuseki-main:jar:4.1.0
|  +- org.apache.jena:jena-fuseki-core:jar:4.1.0

|  |  +- org.eclipse.jetty:jetty-servlet:jar:9.4.40.v20210413
|  |  |  +- org.eclipse.jetty:jetty-security:jar:9.4.40.v20210413
|  |  |  |  \- org.eclipse.jetty:jetty-server:jar:9.4.40.v20210413
|  |  |  |     \- javax.servlet:javax.servlet-api:jar:3.1.0
|  |  |  \- org.eclipse.jetty:jetty-util-ajax:jar:9.4.40.v20210413
|  |  +- org.eclipse.jetty:jetty-servlets:jar:9.4.40.v20210413
|  |  |  +- org.eclipse.jetty:jetty-continuation:jar:9.4.40.v20210413
|  |  |  +- org.eclipse.jetty:jetty-http:jar:9.4.40.v20210413
|  |  |  \- org.eclipse.jetty:jetty-io:jar:9.4.40.v20210413

|  +- org.apache.jena:jena-fuseki-access:jar:4.1.0
|  \- org.eclipse.jetty:jetty-xml:jar:9.4.40.v20210413
|     \- org.eclipse.jetty:jetty-util:jar:9.4.40.v20210413

       Andy

On 23/06/2021 11:48, Philipp Leeb wrote:
Hey guys,

the following code gives me a:

Exception in thread "main" java.lang.NoSuchMethodError: 'void
org.eclipse.jetty.servlet.ServletContextHandler.contextInitialized()'

                   at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.ja
v
a:746)

                   at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletC
o
ntextH
andler.java:379)

                   at

org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:
852)

                   at
org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContex
t
Handle
r.java:288)

                   at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
C
ycle.j
ava:73)

                   at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLi
f
eCycle
.java:169)

                   at
org.eclipse.jetty.server.Server.start(Server.java:418)

                   at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Container
L
ifeCyc
le.java:110)

                   at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHand
l
er.jav
a:113)

                   at
org.eclipse.jetty.server.Server.doStart(Server.java:382)

                   at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
C
ycle.j
ava:73)

                   at
org.apache.jena.fuseki.main.FusekiServer.start(FusekiServer.java:260)

                   at
helper.EmbeddedDatabase.<init>(EmbeddedDatabase.java:27)

public EmbeddedDatabase(Dataset ds, String path, int port, String
logFilePath) throws IOException {
       logger = MyLogger.getInstance(EmbeddedDatabase.class.getName(),
logFilePath);
       fusekiServer = FusekiServer.create()
               .port(port)
               .add(path, ds)
               .build();
       fusekiServer.start();
       isRunning = true;
       registry = fusekiServer.getDataAccessPointRegistry();
       dataset = ds;
       MyLogger.logInfo(logger, "FusekiServer up and running."); }

The error is thrown when calling fusekiServer.start(). Using version
4.1.0 of apache-jena-libs and jena-fuseki-main.

Is this a known bug? I just "copied" the code from
https://jena.apache.org/documentation/fuseki2/fuseki-embedded.html or
are the examples incomplete?

Kind regards

Phil




Reply via email to