Spring integration Splunk: Failed to read schema document - spring-integration

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>

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.

Related

Same bundle always loaded regardless of a accept-language header

I am currently working on a primefaces website and I want to have it with internationalization.
I created a directory for the language bundles in:
src/main/resources/org/test
The bundle contains these files:
language.properties
language_en.properties
The faces config looks like this:
<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
<application>
<locale-config>
<supported-locale>en</supported-locale>
<supported-locale>de</supported-locale>
</locale-config>
<resource-bundle>
<base-name>org.test.language</base-name>
<var>language</var>
</resource-bundle>
</application>
</faces-config>
I tried loading the bundle in my view scoped view:
<f:loadBundle var="lang" basename="org.test.language"></f:loadBundle>
But I always get the german locale even with Accept-Language headers en_US.
What is wrong with it?

wsimport bindings namespace error

I'm trying to change the package name space for some namespaces because they have objects that collide.
Here is the wsdl:
<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tempuri.org/"
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="https://localhost/DS/Search.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="https://localhost/DS/Search.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
</xsd:schema>
</wsdl:types>
</wsdl:definitions>
Here are the bindings:
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
jaxb:version="2.0"
wsdlLocation="https://localhost/DS/Search.svc?wsdl">
<jaxb:bindings node="//wsdl:definitions/wsdl:types/xsd:schema/xsd:import[#namespace='http://tempuri.org/']">
<jaxb:schemaBindings>
<jaxb:package name="directoryservice"/>
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings node="//wsdl:definitions/wsdl:types/xsd:schema/xsd:import[#namespace='http://localhost.datacontract.org/2004/07/Search.Models.SearchAPI']">
<jaxb:schemaBindings>
<jaxb:package name="directoryservice.model"/>
</jaxb:schemaBindings>
</jaxb:bindings>
</jaxb:bindings>
When I run wsimport with the -b option I get this error
[ERROR] XPath evaluation of "//wsdl:definitions/wsdl:types/xsd:schema/xsd:import[#namespace='http://tempuri.org/']" results in empty target node
line 7 of file:service-bindings.xml
I get the error for both bindings..
Am I missing something with the definition of the bindings?
I found a way round this issue by using the global binding. The binding will create the serivce ObjectFactory but not the model pojos.
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
jaxb:version="2.0">
<jaxb:globalBindings generateElementProperty="false"/>
</jaxb:bindings>

JSF Error: Can't find bundle for base name xxxx, locale xxxx

I'm trying to internationalize my application and been searching a lot of tutorials on that. I always get stuck at this point, for no matter what configuration I do, none of them works.
Earlier I made a post onto a parsing exception. After solving this parser exception, now the application does not find bundles.
I arranged and registrated the Core bundle through faces-config.xml, as well as supported locales.
Even though I've searched through existing solutions but none of them seem to apply to my case.
So, where's the thing? Does it have to be at root folder? Is it a misconfig? A typo in my faces-config (don't think so, I redid it many times).
The config is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
<application>
<!-- <message-bundle>messages_en_US</message-bundle> -->
<!-- <message-bundle>messages_es</message-bundle> -->
<!-- <message-bundle>messages_pt_BR</message-bundle> -->
<locale-config>
<default-locale>en_US</default-locale>
<supported-locale>pt_BR</supported-locale>
<supported-locale>es</supported-locale>
</locale-config>
<resource-bundle>
<base-name>com.tfduque.fieldassist.interface</base-name>
<var>msg</var>
</resource-bundle>
</application>
</faces-config>
Folder/package organization:
Stack trace (FULL: https://pastebin.com/69iJrvuX):
Type Exception Report
Message Can't find bundle for base name com.tfduque.fieldassist.interface_es, locale pt_BR
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
javax.servlet.ServletException: Can't find bundle for base name com.tfduque.fieldassist.interface_es, locale pt_BR
javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Solved it by removing the full path to the file - just the name of the file seems to be enough:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
<application>
<!-- <message-bundle>messages_en_US</message-bundle> -->
<!-- <message-bundle>messages_es</message-bundle> -->
<!-- <message-bundle>messages_pt_BR</message-bundle> -->
<locale-config>
<default-locale>en_US</default-locale>
<supported-locale>pt_BR</supported-locale>
<supported-locale>es</supported-locale>
</locale-config>
<!--- Change the path ("com.tfduque.fieldassist.interface") to the filename ("interface") here -->
<resource-bundle>
<base-name>interface</base-name>
<var>msg</var>
</resource-bundle>
</application>
</faces-config>

java.lang.ClassNotFoundException: org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory

I am trying to implement Primeface Exception Handler
My faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
<!-- JSF and Spring are integrated -->
<application>
<el-resolver>
org.springframework.web.jsf.el.SpringBeanFacesELResolver
</el-resolver>
</application>
</faces-config>
when I add the primefaces EL Resolver and factory in config, as follow, my tomcat fail start.
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
<!-- JSF and Spring are integrated -->
<application>
<el-resolver>
org.springframework.web.jsf.el.SpringBeanFacesELResolver
</el-resolver>
<el-resolver>
org.primefaces.application.exceptionhandler.PrimeExceptionHandlerELResolver
</el-resolver>
</application>
<factory>
<exception-handler-factory>
org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory
</exception-handler-factory>
</factory>
</faces-config>
any update ?
-----------EDIT----------
I changes the tomcat version from 7.0.42 to 7.0.64, it showing me the following exception.
SEVERE: Critical error during deployment:
com.sun.faces.config.ConfigurationException: Factory 'javax.faces.context.ExceptionHandlerFactory' was not configured properly.
Caused by: javax.faces.FacesException: org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory
Caused by: java.lang.ClassNotFoundException: org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory
for detail in exception , please click Exception Detail
So the solution was to include the right version of PrimeFaces (5.0), previous versions did not contain this class.

Is it possible to use WSDL in org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition?

I am trying to set up SOAP on Spring WS and now i configure Spring beans with file like this:
<?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:context="http://www.springframework.org/schema/context"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/web-services
http://www.springframework.org/schema/web-services/web-services-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="com.blog.samples.services" />
<sws:annotation-driven />
<!--
Our test service bean
-->
<bean id="AccountDetailsService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition" lazy-init="true">
<property name="schemaCollection">
<bean class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
<property name="inline" value="true" />
<property name="xsds">
<list>
<value>schemas/AccountDetailsServiceOperations.xsd</value>
</list>
</property>
</bean>
</property>
<property name="portTypeName" value="AccountDetailsService"/>
<property name="serviceName" value="AccountDetailsServices" />
<property name="locationUri" value="/endpoints"/>
</bean>
</beans>
Unfortunatly i have not xsd, i have only wsdl which described my service. The question is : may i use somehow my wsdl in this spring configuration file? If yes - how (use wsdl instead of wsdl)? I know that i can extract xsd from wsdl, but would like to use only wsdl. Thank you.
You could use SimpleWsdl11Definition instead of DefaultWsdl11Definition:
Via XML:
<sws:static-wsdl id="operations" location="[your_location]/[your_wsdl].wsdl"/>
Via Java config:
#Bean(name = "operations")
public SimpleWsdl11Definition wsdl11Definition() {
SimpleWsdl11Definition s = new SimpleWsdl11Definition();
s.setWsdl(new ClassPathResource("[your_location]/[your_wsdl].wsdl"));
return s;
}
"id" respectively bean-name is the identifier on how your .wsdl can be accessed. In the case above:
http://[your_server]/[url_mapping_from_message_dispatcher]/operations.wsdl

Resources