Phil

Without seeing your projects dependencies it is hard to say.  The referenced 
method is from the Jetty web-app implementation.  Running an embedded server 
will generally require that you have additional dependencies to provide the 
full server runtime, the jena-fuseki-main module is the core server 
implementation without the server runtime.

I think you might want a dependency on jena-fuseki-webapp rather than just 
jena-fuseki-main

Rob

On 23/06/2021, 11:48, "Philipp Leeb" <[email protected]> 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.java:746)

                    at
    org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextH
    andler.java:379)

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

                    at
    org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandle
    r.java:288)

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

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

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

                    at
    org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCyc
    le.java:110)

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

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

                    at
    org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.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