Hi, in my use-case use the Spring Boot container for handling repository
connections (Spring Data), RESTful web services et cetera. I also want to use
a embedded Fuseki Servers to provide a SPARQL endpoint.
When The Fuseki Servers start it throws a exception saying that the
address/port already in use.
java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:3330
java.net.BindException: Address already in use
My Spring bean fuseki service:
@Service
public class FusekiService {
...
public void initModel() {
model = ModelFactory.createDefaultModel();
InputStream in1 = FileManager.get().open(ARTIST_MODEL_FILE);
model.read(in1, BASE_URL, "TURTLE");
LOGGER.debug("Statements read from file: {}", model.size());
}
@PostConstruct
public void initService() {
initModel();
Dataset dataset = DatasetFactory.createTxnMem();
dataset.addNamedModel(BASE_URL, model);
server = FusekiServer.create().add("/data",
dataset).verbose(true).build();
server.start();
LOGGER.debug("Fuseki service started.");
}
Questions:
1. Can I configure Fuseki to run inside a Spring container which already
uses a Jetty 9.4. Or do I need to runt to separate Jetty instances. Please
provide code pattern?
2. Where am I suppose to place the configure file (config.ttl). The static
web files in Spring Boot is placed under main/resources/static?
Best regards.