Here are the excerpts of my Spring context .xml
file.
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/batch"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<beans:import
resource="classpath:com/batch/jobs/data-source-context.xml" />
<job id="xxxx">
<step id="loadRecord">
<tasklet>
<chunk reader="dtaFileItemReader" writer="dtaGroupWriter"
commit-interval="${job.commit.interval}" />
</tasklet>
</step>
</job>
<jee:jndi-lookup id="dataSource" jndi-name="jdbc"></jee:jndi-lookup>
<beans:bean id="incrementerParent" class="${batch.database.incrementer.class}">
<beans:property name="dataSource" ref="dataSource" />
<beans:property name="incrementerName" value="ID" />
</beans:bean>
I get an exception saying that:
nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jee:jndi-lookup'
JPA Configuration – Model, DAO and Service. With this, you have everything you need in order to use your JNDI datasource in your Spring application.
You have an incorrect namespace declaration somewhere, probably for beans as well as JEE.
As per the documentation, the JEE XMLNS declaration should be:
<?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:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
<!-- <bean/> definitions here -->
</beans>
You are mixing Spring (beans, aop and tx) 2.0 with the JEE schema from Spring 3.0, which will probably lead to issues.
Looks like spring did not found the org/springframework/ejb/config/spring-jee-3.0.xsd
at runtime.
This file is located in spring-context-3.0.x.RELESE.jar
, check that this file is deployed correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With