Closed metalaureate closed 2 years ago
When I try to run the local install on my M1 mac I get
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at org.dbpedia.spotlight.db.memory.MemoryContextStore.read(MemoryContextStore.scala:122)
at com.esotericsoftware.kryo.serializers.DefaultSerializers$KryoSerializableSerializer.read(DefaultSerializers.java:363)
at com.esotericsoftware.kryo.serializers.DefaultSerializers$KryoSerializableSerializer.read(DefaultSerializers.java:355)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:732)
at org.dbpedia.spotlight.db.memory.MemoryStore$.load(MemoryStore.scala:166)
at org.dbpedia.spotlight.db.memory.MemoryStore$.loadContextStore(MemoryStore.scala:195)
at org.dbpedia.spotlight.db.SpotlightModel$.storesFromFolder(SpotlightModel.scala:62)
at org.dbpedia.spotlight.db.SpotlightModel$.fromFolder(SpotlightModel.scala:80)
at org.dbpedia.spotlight.db.SpotlightModel.fromFolder(SpotlightModel.scala)
at org.dbpedia.spotlight.web.rest.Server.initByModel(Server.java:239)
at org.dbpedia.spotlight.web.rest.Server.main(Server.java:87)
Increasing to -Xmx8G makes it build but then it throws all kinds of errors when you make a request. Lemme see if I can build the docker image locally and I'll delete this thread.
INFO: Scanning for root resource and provider classes in the packages:
org.dbpedia.spotlight.web.rest.resources
Oct 30, 2022 9:24:28 AM com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
class org.dbpedia.spotlight.web.rest.resources.Feedback
class org.dbpedia.spotlight.web.rest.resources.Annotate
class org.dbpedia.spotlight.web.rest.resources.Spot
class org.dbpedia.spotlight.web.rest.resources.Disambiguate
class org.dbpedia.spotlight.web.rest.resources.Candidates
Oct 30, 2022 9:24:28 AM com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
Oct 30, 2022 9:24:28 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.19.3 10/24/2016 03:58 PM'
Oct 30, 2022 9:24:42 AM com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
INFO: Loading wadlGenerator org.dbpedia.spotlight.web.rest.wadl.ExternalUriWadlGenerator
Oct 30, 2022 9:24:43 AM com.github.fommil.netlib.BLAS <clinit>
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
Oct 30, 2022 9:24:43 AM com.github.fommil.netlib.BLAS <clinit>
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeRefBLAS
Oct 30, 2022 9:24:43 AM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at sun.util.xml.PlatformXmlPropertiesProvider.getLoadingDoc(PlatformXmlPropertiesProvider.java:106)
at sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:78)
at java.util.Properties$XmlSupport.load(Properties.java:1201)
at java.util.Properties.loadFromXML(Properties.java:881)
at org.apache.jena.util.Metadata.read(Metadata.java:75)
at org.apache.jena.util.Metadata.addMetadata(Metadata.java:53)
at org.apache.jena.util.Metadata.<init>(Metadata.java:47)
at org.apache.jena.JenaRuntime.<clinit>(JenaRuntime.java:89)
at org.apache.jena.util.LocationMapper.getGlobalConfigPath(LocationMapper.java:241)
at org.apache.jena.util.LocationMapper.get(LocationMapper.java:69)
at org.apache.jena.util.FileManager.makeGlobal(FileManager.java:129)
at org.apache.jena.util.FileManager.get(FileManager.java:95)
at org.apache.jena.riot.system.IO_JenaReaders.wireIntoJena(IO_JenaReaders.java:40)
at org.apache.jena.riot.IO_Jena.wireIntoJena(IO_Jena.java:34)
at org.apache.jena.riot.RIOT.init(RIOT.java:77)
at org.apache.jena.riot.system.InitRIOT.start(InitRIOT.java:29)
at org.apache.jena.system.JenaSystem.lambda$init$1(JenaSystem.java:111)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:186)
at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:163)
at org.apache.jena.system.JenaSystem.init(JenaSystem.java:109)
at org.apache.jena.rdf.model.ModelFactory.<clinit>(ModelFactory.java:49)
at org.nlp2rdf.nif21.impl.NIF21Model.create(NIF21Model.java:10)
at org.nlp2rdf.nif21.impl.NIF21.getModel(NIF21.java:53)
at org.nlp2rdf.nif21.impl.NIF21.getTurtle(NIF21.java:80)
at org.dbpedia.spotlight.web.rest.formats.NIFWrapper.process(NIFWrapper.java:141)
at org.dbpedia.spotlight.web.rest.formats.NIFWrapper.getNIF(NIFWrapper.java:134)
at org.dbpedia.spotlight.web.rest.OutputManager.makeNIF(OutputManager.java:118)
at org.dbpedia.spotlight.web.rest.SpotlightInterface.getNIF(SpotlightInterface.java:287)
at org.dbpedia.spotlight.web.rest.resources.Annotate.getNIF(Annotate.java:154)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.doFilter(ServletAdapter.java:1059)
at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.invokeFilterChain(ServletAdapter.java:999)
at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:434)
at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:379)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 89 more
Oct 30, 2022 9:24:43 AM com.sun.grizzly.http.servlet.ServletAdapter doService
SEVERE: service exception:
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:420)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.doFilter(ServletAdapter.java:1059)
at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.invokeFilterChain(ServletAdapter.java:999)
at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:434)
at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:379)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at sun.util.xml.PlatformXmlPropertiesProvider.getLoadingDoc(PlatformXmlPropertiesProvider.java:106)
at sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:78)
at java.util.Properties$XmlSupport.load(Properties.java:1201)
at java.util.Properties.loadFromXML(Properties.java:881)
at org.apache.jena.util.Metadata.read(Metadata.java:75)
at org.apache.jena.util.Metadata.addMetadata(Metadata.java:53)
at org.apache.jena.util.Metadata.<init>(Metadata.java:47)
at org.apache.jena.JenaRuntime.<clinit>(JenaRuntime.java:89)
at org.apache.jena.util.LocationMapper.getGlobalConfigPath(LocationMapper.java:241)
at org.apache.jena.util.LocationMapper.get(LocationMapper.java:69)
at org.apache.jena.util.FileManager.makeGlobal(FileManager.java:129)
at org.apache.jena.util.FileManager.get(FileManager.java:95)
at org.apache.jena.riot.system.IO_JenaReaders.wireIntoJena(IO_JenaReaders.java:40)
at org.apache.jena.riot.IO_Jena.wireIntoJena(IO_Jena.java:34)
at org.apache.jena.riot.RIOT.init(RIOT.java:77)
at org.apache.jena.riot.system.InitRIOT.start(InitRIOT.java:29)
at org.apache.jena.system.JenaSystem.lambda$init$1(JenaSystem.java:111)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:186)
at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:163)
at org.apache.jena.system.JenaSystem.init(JenaSystem.java:109)
at org.apache.jena.rdf.model.ModelFactory.<clinit>(ModelFactory.java:49)
at org.nlp2rdf.nif21.impl.NIF21Model.create(NIF21Model.java:10)
at org.nlp2rdf.nif21.impl.NIF21.getModel(NIF21.java:53)
at org.nlp2rdf.nif21.impl.NIF21.getTurtle(NIF21.java:80)
at org.dbpedia.spotlight.web.rest.formats.NIFWrapper.process(NIFWrapper.java:141)
at org.dbpedia.spotlight.web.rest.formats.NIFWrapper.getNIF(NIFWrapper.java:134)
at org.dbpedia.spotlight.web.rest.OutputManager.makeNIF(OutputManager.java:118)
at org.dbpedia.spotlight.web.rest.SpotlightInterface.getNIF(SpotlightInterface.java:287)
at org.dbpedia.spotlight.web.rest.resources.Annotate.getNIF(Annotate.java:154)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
... 22 more
Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 89 more
I was able to build the docker file locally by following the instructions at the end of this thread: https://forum.dbpedia.org/t/curl-error-52-empty-reply-from-server-when-trying-to-annotate-with-dbpedia-spotlight-docker/1454/43?page=3
The Spotlight server throws the following warnings and I don't know if they matter:
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
Oct 30, 2022 5:51:59 PM com.github.fommil.netlib.BLAS
Hi @metalaureate, Thank you for opening this issue. I have no personal experience with building the image for/with a M1 processor. I can just confirm that the warning messages that you are seeing also occur in the standard docker hub image.
I am very happy you managed to build the docker image locally. I hope dbpedia publishes a working image also for M1 processors, since this is possible and works as described in the link you mentioned.
Martino
Thank for your package!
Running
on Apple Silicon (M1) produces
I realize this is a DBPedia/Spotlight issue but wondered with your deep knowledge if you had any pointers to a solution?