0
votes

I am getting the below error while running Splunk integration spring adapter.

org.xml.sax.SAXParseException; lineNumber: 16; columnNumber: 212; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .

I tried to search http://www.springframework.org/schema/integration/splunk/ but it looks like it is not reachable. Has Spring deprecated the support of Splunk?

Configuration:

Beans.xml looks like:

<?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:int="http://www.springframework.org/schema/integration"
        xmlns:int-splunk="http://www.springframework.org/schema/integration/splunk"
        xmlns:stream="http://www.springframework.org/schema/integration/stream"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
                http://www.springframework.org/schema/integration/splunk http://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd
                http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.4.RELEASE.xsd">
        <import resource="SplunkInboundChannelAdapterCommon-context.xml"/>

        <int-splunk:inbound-channel-adapter id="splunkInboundChannelAdapter"
                auto-startup="true" search="sourcetype=SplunkRabbitMQ_messaging | spath input=msg_body | where '3' > 0" splunk-server-ref="splunkServer" channel="inputFromSplunk" mode="realtime" initEarliestTime="-1d">
                <int:poller fixed-rate="5" time-unit="SECONDS"/>
        </int-splunk:inbound-channel-adapter>

</beans>

SplunkCommon-context.xml looks like:

 <?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:int="http://www.springframework.org/schema/integration"
         xmlns:int-splunk="http://www.springframework.org/schema/integration/splunk"
         xmlns:stream="http://www.springframework.org/schema/integration/stream"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="http://www.springframework.org/schema/integration/stream
 http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
                 http://www.springframework.org/schema/integration/splunk
 http://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd
                 http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
                 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.4.RELEASE.xsd">

         <context:component-scan base-package="org.springframework.integration.splunk"></context:component-scan>
         <bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean"/>

         <int-splunk:server id="splunkServer" host="xxx.xx.xx.xxx" port="8089" userName="admin" password="ferggegtg" owner="admin"/>

 </beans>

SplunkInboundChannelAdapterCommon-context.xml looks like:

<?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:int="http://www.springframework.org/schema/integration"
        xmlns:int-splunk="http://www.springframework.org/schema/integration/splunk"
        xmlns:stream="http://www.springframework.org/schema/integration/stream"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
                http://www.springframework.org/schema/integration/splunk http://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd
                http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.4.RELEASE.xsd">

        <import resource="SplunkCommon-context.xml"/>
        <context:component-scan base-package="org.springframework.integration.samples.splunk"></context:component-scan>
        <int:channel id="inputFromSplunk">
        </int:channel>
        <int:service-activator input-channel="inputFromSplunk" ref="splunkDataHandler"></int:service-activator>
        <!-- <stream:stdout-channel-adapter id="stdout" channel="inputFromSplunk" append-newline="true"/> -->


</beans>
1
Can you provide more information about this? What version of SI Splunk are you using? How does your configuration file look like?Marius Bogoevici
I have updated the question with the configuration files. I am using Spring 3.2.4.Release and adapter mentioned in the following link: github.com/spring-projects/spring-integration-splunkGagan

1 Answers

1
votes

The schema is not online, spring resolves it from the class path in the jar from META-INF/spring-schemas in the jar - if this is a runtime error, it appears you don't have the jar on the class path. If this error is just in an IDE (and not at runtime) you are using one that is not spring-aware - you can ignore the error in an IDE, use a spring-aware IDE, or use the IDE features to manually add the schema mappings.