0

I am trying to use batch-int:job-launching-gateway but I get the following error:

Exception in thread "main"     org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:spring/integration-context.xml]
Offending resource: class path resource [spring/application-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 68 in XML document from class path resource [spring/integration-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
lineNumber: 68; columnNumber: 156; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'batch-int:job-launching-gateway'.

My xml contains the following:

<beans:beans xsi:schemaLocation=" http://www.springframework.org/schema/batch-integration
 http://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd
 http://www.springframework.org/schema/batch
 http://www.springframework.org/schema/batch/spring-batch.xsd
 http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/integration
 http://www.springframework.org/schema/integration/spring-integration.xsd
 http://www.springframework.org/schema/integration/file
 http://www.springframework.org/schema/integration/file/spring-integration-file.xsd "
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:int-file="http://www.springframework.org/schema/integration/file"
         xmlns:int="http://www.springframework.org/schema/integration"
         xmlns:beans="http://www.springframework.org/schema/beans"
         xmlns:batch-int="http://www.springframework.org/schema/batch-integration"
         xmlns:batch="http://www.springframework.org/schema/batch"
         xmlns="http://www.springframework.org/schema/beans">

And the line the error occurs at is:

<batch-int:job-launching-gateway job-launcher="jobLauncher" reply-channel="jobLaunchReplyChannel" request-channel="channelStart"/>

The channel "channelStart" is defined above this.

I'm new to spring batch so any help would be great. I also have spring-batch-integration, spring-batch-core, spring-batch-infrastructure and spring-integration-event on the classpath.

sadWal
  • 53
  • 12
  • Possible duplicate: http://stackoverflow.com/questions/13589470/the-matching-wildcard-is-strict-but-no-declaration-can-be-found-for-element-co Did you double check the xml namespace support? http://docs.spring.io/spring-batch/reference/html/springBatchIntegration.html – Sander_M Aug 02 '16 at 10:03
  • Hi, yeah I've checked the xml namespaces. When I hover over the "batch-in:job-launching-gateway" in the xml it gives me the message : "This custom Spring bean has not yet been parsed". If I try to parse it it gives the message: "Cannot find custom handler for namespace 'http://www.springframework.org/schema/batch-integration'" – sadWal Aug 02 '16 at 11:45

1 Answers1

0

I have resolved the issue. I initially had different versions for both spring-batch-core and spring-batch-integration. When I made these two the same versions the error did not appear.

sadWal
  • 53
  • 12