为了让java加载sklearn的模型,各种苦头啊。。
Exception in thread "main" java.lang.IllegalArgumentException: http://www.dmg.org/PMML-4_4
at org.dmg.pmml.Version.forNamespaceURI(Version.java:62)
at org.jpmml.model.filters.PMMLFilter.updateSource(PMMLFilter.java:121)
at org.jpmml.model.filters.PMMLFilter.startPrefixMapping(PMMLFilter.java:43)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startNamespaceMapping(AbstractSAXParser.java:2164)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:469)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:214)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:140)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:123)
at org.jpmml.model.JAXBUtil.unmarshal(JAXBUtil.java:82)
at org.jpmml.model.JAXBUtil.unmarshalPMML(JAXBUtil.java:68)
at org.jpmml.model.PMMLUtil.unmarshal(PMMLUtil.java:35)
at controller.PmmlFile.predictLrHeart(PmmlFile.java:37)
at controller.PmmlFile.main(PmmlFile.java:27)
我都没看懂这个报错到底啥意思。
排查过程很艰难:
先是修改依赖版本,得到:
org.jpmml pmml-evaluator 1.4.13 org.jpmml pmml-evaluator-extension 1.4.13
Exception in thread "main" java.lang.IllegalArgumentException: PMML namespace URI http://www.dmg.org/PMML-4_4 is not supported
at org.dmg.pmml.Version.forNamespaceURI(Version.java:69)
at org.jpmml.model.filters.PMMLFilter.updateSource(PMMLFilter.java:121)
at org.jpmml.model.filters.PMMLFilter.startPrefixMapping(PMMLFilter.java:43)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startNamespaceMapping(AbstractSAXParser.java:2164)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:469)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:214)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:140)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:123)
at org.jpmml.model.JAXBUtil.unmarshal(JAXBUtil.java:55)
at org.jpmml.model.JAXBUtil.unmarshalPMML(JAXBUtil.java:41)
at org.jpmml.model.PMMLUtil.unmarshal(PMMLUtil.java:56)
at controller.PmmlFile.predictLrHeart(PmmlFile.java:37)
at controller.PmmlFile.main(PmmlFile.java:27)
Process finished with exit code 1