>>>>> Steinar Bang <[email protected]>: > The reason I haven tried using FusekiCmd, is that I would like to have > JettyFuseki.instance.start(); > in the startDaemon() method, and > JettyFuseki.instance.join(); > in the stopDaemon() method (unless I've misunderstood how they are > supposed to work...?)
> The failing code, is in > > https://github.com/apache/jena/blob/master/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/jetty/JettyFuseki.java > in the JettyFuseki.createWebApp() method. > The code in createWebapp() looks like it expects a directory, with > WEB-INF/web.xml residing in that directory (ie. WEB-INF a subdirectly of > the webapp directory), so I have been toying with the idea of > downloading and unpacking the fuseki webapp in a directory and give that > directory. Progress! Now the webapp starts in the unit test. Unfortunately, it doesn't stop yet. This means that calling JettyFuseki.instance.join() like I do in FusekiService.stopDaemon() was not the way to stop the server... I have to read a bit more code, I guess...? What I did was to unpack the jena fuseki webapp where the unit test would find it ("./webapp" from the CWD of the unit test): https://github.com/steinarb/fusekiservice/commit/87dbb7be634a0b26137854798eaeaef7074ba5cf I get the following on the console: [2016-02-06 12:17:45] FusekiService INFO FUSEKI_HOME: null [2016-02-06 12:17:46] Server INFO Fuseki 2.3.1 2015-12-08T09:24:07+0000 [2016-02-06 12:17:46] Config INFO FUSEKI_HOME=unset [2016-02-06 12:17:46] Config INFO FUSEKI_BASE=C:\etc\fuseki [2016-02-06 12:17:46] Servlet INFO Initializing Shiro environment [2016-02-06 12:17:46] Config INFO Shiro file: file://C:\etc\fuseki\shiro.ini [2016-02-06 12:17:46] Config INFO Configuration file: C:\etc\fuseki\config.ttl [2016-02-06 12:17:47] riot WARN [line: 5, col: 9 ] Bad IRI: <C:\etc\fuseki\config.ttl#> Code: 4/UNWISE_CHARACTER in PATH: The character matches no grammar rules of URIs/IRIs. These characters are permitted in RDF URI References, XML system identifiers, and XML Schema anyURIs. [2016-02-06 12:17:47] Server INFO Started 2016/02/06 12:17:47 CET on port 4000 And the webapp starts and listens to port 4000. Unfortunately the unit test never stops, and killing the unit test leaves the webapp running, so there is still a way to go...
