I am using Apache CXF 2.5.2 to create a web service. I have created an endpoint and enabled mtom and schema validation using:
<jaxws:properties>
<entry key="mtom-enabled" value="true"/>
<entry key="schema-validation-enabled" value="true"/>
</jaxws:properties>
If I turn off the mtom-enabled property then the schema validates correctly. If I turn off the schema-validation-enabled property then the mtom works correctly.
<result>
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:2fd0125c-bfb6-454b-8a98-9e3a16083dca-9#cxf.apache.org">
</xop:Include>
</result>
My schema looks like this:
<xsd:complexType name="ResultList">
<xsd:sequence>
<xsd:element name="result" type="myns:ResultType"
minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ResultType">
<xsd:simpleContent>
<xsd:restriction base="xmime:base64Binary">
<xsd:attribute ref="xmime:contentType" use="required" />
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
My Base64Binary class looks somewhat like this:
public class Base64Binary
{
#Lob #XmlValue
protected byte[] value;
#XmlAttribute(namespace = "http://www.w3.org/2005/05/xmlmime")
protected String contentType;
}
With schema validation enabled I get the following error:
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-complex-type.2.2: Element 'result' must have no element [children], and the value must be valid.
at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:261)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:119)
at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:126)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:164)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.bind.MarshalException
- with linked exception:
[org.xml.sax.SAXParseException: cvc-complex-type.2.2: Element 'result' must have no element [children], and the value must be valid.]
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(Unknown Source)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:550)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:236)
... 29 more
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.2: Element 'result' must have no element [children], and the value must be valid.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.endElement(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.endElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.output.SAXOutput.endTag(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.output.XmlOutputAbstractImpl.endTag(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.output.ForkXmlOutput.endTag(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.output.MTOMXmlOutput.endTag(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.output.NamespaceContextImpl$Element.endElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.endElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty.serializeBody(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(Unknown Source)
... 33 more
Any thoughts as to how to get around this validation error?
Thank you.
Can you set your "result" element to just:
<xsd:element name="result" type="xsd:base64Binary"
minOccurs="0" maxOccurs="unbounded" />
and seeing if that helps. Fundamentally, JAXB schema validation and mtom are not really compatible as the mtom stuff is handled after the validation (which is a bit wrong IMO). CXF does make some attempts to make it work together, but I think it can only do it if the element type is the base64Binary type directly.
Related
Getting cross mark on pom.xml and while running testrunner code I am getting this error.
org.testng.TestNGException:
Cannot find class `enter code here`in classpath: testrunner.TestRunner
at org.testng.xml.XmlClass.loadClass(XmlClass.java:81)
at org.testng.xml.XmlClass.init(XmlClass.java:73)
at org.testng.xml.XmlClass.<init>(XmlClass.java:59)
at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:559)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Co`enter code here`nfiguration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.testng.xml.XMLParser.parse(XMLParser.java:39)
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
at org.testng.xml.Parser.parse(Parser.java:172)
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:300)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:103)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:137)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:58)
if You are using eclipse.. just right click on your project -- > Go to maven --> Click on update maven project .
Rebuild the project
I'm using regular Solr 8.10.1 (no Solr Cloud)
I created a new core by cd into solr bin directory and ran solr create -c "mytest"
I start it like C:\solr-8.10.1\bin\solr start -p 8983
My folder structure:
solrconfig.xml
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">sample-data-config.xml</str>
</lst>
</requestHandler>
<lib dir="./lib" />
I also tried this, but I get the same error
<lib dir="./solr/lib" />
I copied these files into the server\lib folder: solr-dataimporthandler-8.10.1.jar and solr-dataimporthandler-extras-8.10.1.jar.
- solr-8.10.1
- server
- lib
solr-dataimporthandler-8.10.1.jar
solr-dataimporthandler-extras-8.10.1.jar
- solr
- configsets
- sample_techproducts_configs
- conf
- mytest
- conf
- lang
data-config.xml
managed-schema
protwords.txt
solrconfig.xml A
stopwords.txt
synonyms.txt
- data
solr.xml
sample-data-config
<dataConfig>
<dataSource driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://localhost:1433;databaseName=test" user="<username>" password="<pwd>" />
<document name="catalogitems">
<entity pk="id" name="catalogitem" query="SELECT id,photo from products">
<field name="id" column="ID" />
<field name="photo" column="photo" />
</entity>
</document>
</dataConfig>
When I run http://localhost:8983/solr/mytest/dataimport?command=full-import
I get error:
HTTP ERROR 500 java.lang.NoClassDefFoundError: org/apache/solr/util/plugin/SolrCoreAware
URI: /solr/mytest/dataimport
STATUS: 500
MESSAGE: java.lang.NoClassDefFoundError: org/apache/solr/util/plugin/SolrCoreAware
SERVLET: default
CAUSED BY: java.lang.NoClassDefFoundError: org/apache/solr/util/plugin/SolrCoreAware
CAUSED BY: java.lang.ClassNotFoundException: org.apache.solr.util.plugin.SolrCoreAware
Caused by:
java.lang.NoClassDefFoundError: org/apache/solr/util/plugin/SolrCoreAware
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:538)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.net.FactoryURLClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.net.FactoryURLClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:538)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:483)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:840)
at org.apache.solr.core.PluginBag.createPlugin(PluginBag.java:154)
at org.apache.solr.core.PluginBag.init(PluginBag.java:300)
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:130)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:1015)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:921)
at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1448)
at org.apache.solr.core.CoreContainer.lambda$load$11(CoreContainer.java:869)
at com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:202)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:218)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.solr.util.plugin.SolrCoreAware
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 35 more
I also checked the error log via the admin console, where I see:
org.apache.solr.core.SolrCoreInitializationException: SolrCore 'mytest' is not available due to init failure: org/apache/solr/util/plugin/SolrCoreAware
at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:1964)
at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:1937)
at org.apache.solr.servlet.HttpSolrCall.init(HttpSolrCall.java:257)
at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:525)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:427)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:357)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
at org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:177)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)
at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:763)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.solr.common.SolrException: org/apache/solr/util/plugin/SolrCoreAware
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:1086)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:921)
at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1448)
at org.apache.solr.core.CoreContainer.lambda$load$11(CoreContainer.java:869)
at com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:202)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:218)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
... 1 more
Caused by: java.lang.NoClassDefFoundError: org/apache/solr/util/plugin/SolrCoreAware
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:538)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.net.FactoryURLClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.net.FactoryURLClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:538)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:483)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:840)
at org.apache.solr.core.PluginBag.createPlugin(PluginBag.java:154)
at org.apache.solr.core.PluginBag.init(PluginBag.java:300)
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:130)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:1015)
... 9 more
Caused by: java.lang.ClassNotFoundException: org.apache.solr.util.plugin.SolrCoreAware
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 35 more
I already checked here, but I think my lib folder structure is correct?
UPDATE 1
When I have in solr.config: <lib dir="./lib" /> my admin UI loads.
Based on Eric's comments I checked https://solr.apache.org/guide/8_10/libs.html#lib-directories so I replaced the above part in solr.config with
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
I also tried:
<lib dir="./lib" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
In both latter 2 configurations I still get error HTTP ERROR 500 java.lang.NoClassDefFoundError: org/apache/solr/util/plugin/SolrCoreAware
UPDATE 2
I've now placed solr-dataimporthandler-8.10.1.jar and solr-dataimporthandler-extras-8.10.1.jar in multiple folders:
C:\Databases\solr-8.10.1\dist
C:\Databases\solr-8.10.1\server\lib
C:\Databases\solr-8.10.1\server\solr\mytest\lib
In my C:\Databases\solr-8.10.1\server\solr\mytest\conf\solrconfig.xml
I tried:
<lib dir="./lib" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
<lib dir="./server/lib" />
<lib dir="${solr.install.dir:../../../..}/server/lib" />
But I keep getting the same error.
Also, I need this jar for multiple cores, so I think I should use folder 1 or 2 above?
Folder structure
UPDATE 3
I have not made any changes to any files/configurations, I just unzipped the download and copied the dataimporthandler jars to some more folders (see my update 2 above).
I see no file solrcore.properties anywhere in my Solr directory (can't find anything on Google either) so I'm not sure where to edit that.
On http://localhost:8983/solr I see:
-DSTOP.KEY=solrrocks
-DSTOP.PORT=7983
-Djava.io.tmpdir=C:\Databases\solr-8.10.1\server\tmp
-Djetty.home=C:\Databases\solr-8.10.1\server
-Djetty.host=0.0.0.0
-Djetty.port=8983
-Dlog4j.configurationFile=C:\Databases\solr-8.10.1\server\resources\log4j2.xml
-Dsolr.default.confdir=C:\Databases\solr-8.10.1\server\solr\configsets\_default\conf
-Dsolr.install.dir=C:\Databases\solr-8.10.1
-Dsolr.jetty.inetaccess.excludes=
-Dsolr.jetty.inetaccess.includes=
-Dsolr.log.dir=C:\Databases\solr-8.10.1\server\logs
-Dsolr.log.muteconsole
-Dsolr.solr.home=C:\Databases\solr-8.10.1\server\solr
-Duser.timezone=UTC
-XX:+AlwaysPreTouch
-XX:+ExplicitGCInvokesConcurrent
-XX:+ParallelRefProcEnabled
-XX:+PerfDisableSharedMem
-XX:+UseG1GC
-XX:+UseLargePages
-XX:-OmitStackTraceInFastThrow
-XX:MaxGCPauseMillis=250
-Xms512m
-Xmx512m
-Xss256k
C:\Databases\solr-8.10.1\server\solr\mytest\core.properties
#Written by CorePropertiesLocator
#Tue Nov 02 14:19:06 UTC 2021
name=mytest
C:\Databases\solr-8.10.1\server\solr\mytest\conf\solrconfig.xml
<lib dir="${solr.install.dir:../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
But still the same error.
As of August 2022.
DIH team stopped support at Solr 8.9. 8.10 is therefore not supported (yet?).
Link to the repository: https://github.com/rohitbemax/dataimporthandler
Link to a discussion about supporting it in Solr 9: https://github.com/rohitbemax/dataimporthandler/issues/32
Link to a PR to support v9: https://github.com/rohitbemax/dataimporthandler/pull/33
With these known issues:
Only MariaDB connector supported right now. The connectors to be used need to be shipped as part of this package, and currently only
MariaDB connector is shipped. (No SQLite for instance).
Solr Admin
UI's Dataimport tab could be a bit glitchy when used with this
package
I'm trying to setup Jenkins on Windows Server 2012 and internet has been enabled. Jenkins --> Plugin Manager --> Available --- shows empty page.
Any help would be appreciated.
I tried this .Manage Jenkins → Manage Plugins → Advanced, then click "Check Now" button --- displayed the following error message.
A problem occurred while processing the request. Please check our bug tracker to see if a similar problem has already been reported. If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. If you think this is a new issue, please file a new issue. When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. The users list might be also useful in understanding what has happened.
Stack trace
java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at hudson.model.DownloadService.loadJSON(DownloadService.java:158)
at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:170)
at hudson.PluginManager.doCheckUpdatesServer(PluginManager.java:891)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:46)
at org.kohsuke.stapler.Function$InterceptedFunction.invoke(Function.java:399)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.MetaClass$3.doDispatch(MetaClass.java:183)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:123)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:114)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I use wsdl2java to generate code, and succeed to create web service client to invoke the service.
But when i put my program to server machine, the program can't create web service client.if the machine can access internet, everything goes ok. so i think this exception is due to that cxf can't access http://schemas.xmlsoap.org/soap/encoding/
stacktrace:
14-11-20 18:51:20 create WSUtil err: [main-com.jadic.ws.WSUtil]
javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:151) ~[cxf-rt-frontend-jaxws-2.7.12.jar:2.7.12]
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:101) ~[cxf-rt-frontend-jaxws-2.7.12.jar:2.7.12]
at javax.xml.ws.Service.<init>(Unknown Source) ~[na:1.6.0_05]
at com.jadic.ws.czsmk.CenterProcess.<init>(CenterProcess.java:43) ~[stserver-1.0.0.jar:na]
at com.jadic.ws.WSUtil.createServiceClient(WSUtil.java:106) [stserver-1.0.0.jar:na]
at com.jadic.ws.WSUtil.<init>(WSUtil.java:95) [stserver-1.0.0.jar:na]
at com.jadic.ws.WSUtil.getWsUtil(WSUtil.java:76) [stserver-1.0.0.jar:na]
at com.jadic.STServer.<init>(STServer.java:34) [stserver-1.0.0.jar:na]
at com.jadic.STServer.main(STServer.java:57) [stserver-1.0.0.jar:na]
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:100) ~[cxf-rt-core-2.7.12.jar:2.7.12]
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:204) ~[cxf-rt-frontend-jaxws-2.7.12.jar:2.7.12]
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:149) ~[cxf-rt-frontend-jaxws-2.7.12.jar:2.7.12]
... 8 common frames omitted
Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/types/schema): faultCode=PARSER_ERROR: Problem parsing 'http://schemas.xmlsoap.org/soap/encoding/'.: java.net.UnknownHostException: schemas.xmlsoap.org
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2198) ~[wsdl4j-1.6.3.jar:1.6.3]
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:830) ~[wsdl4j-1.6.3.jar:1.6.3]
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:654) ~[wsdl4j-1.6.3.jar:1.6.3]
at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(WSDLReaderImpl.java:610) ~[wsdl4j-1.6.3.jar:1.6.3]
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:320) ~[wsdl4j-1.6.3.jar:1.6.3]
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2352) ~[wsdl4j-1.6.3.jar:1.6.3]
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2338) ~[wsdl4j-1.6.3.jar:1.6.3]
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:261) ~[cxf-rt-core-2.7.12.jar:2.7.12]
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:206) ~[cxf-rt-core-2.7.12.jar:2.7.12]
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:98) ~[cxf-rt-core-2.7.12.jar:2.7.12]
... 10 common frames omitted
Caused by: java.net.UnknownHostException: schemas.xmlsoap.org
at java.net.PlainSocketImpl.connect(Unknown Source) ~[na:1.6.0_05]
at java.net.Socket.connect(Unknown Source) ~[na:1.6.0_05]
at java.net.Socket.connect(Unknown Source) ~[na:1.6.0_05]
at sun.net.NetworkClient.doConnect(Unknown Source) ~[na:1.6.0_05]
at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[na:1.6.0_05]
at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[na:1.6.0_05]
at sun.net.www.http.HttpClient.<init>(Unknown Source) ~[na:1.6.0_05]
at sun.net.www.http.HttpClient.New(Unknown Source) ~[na:1.6.0_05]
at sun.net.www.http.HttpClient.New(Unknown Source) ~[na:1.6.0_05]
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) ~[na:1.6.0_05]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) ~[na:1.6.0_05]
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) ~[na:1.6.0_05]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) ~[na:1.6.0_05]
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) ~[na:1.6.0_05]
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source) ~[na:1.6.0_05]
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[na:1.6.0_05]
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[na:1.6.0_05]
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) ~[na:1.6.0_05]
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source) ~[na:1.6.0_05]
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source) ~[na:1.6.0_05]
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188) ~[wsdl4j-1.6.3.jar:1.6.3]
... 19 common frames omitted
so could you tell how to solve this problem,thanks for help
remove all cxf-related jar, works.
because i did't use cxf library in my code, just use cxf tool to generate stub classes
Try configuring saaj(saaj-impl-1.3.2.jar) in the classpath..
To enable full text search, I ever used hibernate-search and solrJ, No I am trying spring-data-solr, but found I seems not working together with spring-data-jpa. I just can't make the configuration correct. If I add the following solr configuration xml to my project.I get error message.
The config xml file of spring-data-solr is:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:solr="http://www.springframework.org/schema/data/solr" xmlns:util="http://www.springframework.org/schema/util" xmlns:cache="http://www.springframework.org/schema/cache" xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/data/solr http://www.springframework.org/schema/data/solr/spring-solr-1.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
<!--
#####################################
CONTEXT SETTINGS
#####################################
-->
<context:property-placeholder location="classpath:laa.properties" ignore-resource-not-found="true" />
<!--
#####################################
SOLR
#####################################
-->
<solr:solr-server id="solrServer" url="${solr.host}" />
<bean id="solrTemplate" class="org.springframework.data.solr.core.SolrTemplate" scope="singleton">
<constructor-arg ref="solrServer" />
</bean>
</beans>
The error message is:
org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/data/jpa/spring-jpa.xsd; lineNumber: 18; columnNumber: 48; src-resolve: Cannot resolve the name 'repository:repository' to a(n) 'type definition' component.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.getGlobalDecl(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexContent(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexTypeDecl(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDComplexTypeTraverser.traverseGlobal(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.traverseSchemas(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
You're missing Spring Data Commons on the classpath.