PDA

View Full Version : Spring Gemfire New Comer <gfe:client-region> no declaration exception



howardspring
Jun 30th, 2012, 01:43 PM
Just started to explore gemfire and need to use Spring Gemfire Integration.

I alwasys got a runtime error when use: <gfre:client-cache ...> bean declaration. Don't know the root cause. The related bean context definitation and the error msg is attached.

----------------------------------------------------------------------------------------------------------
Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Failed to import bean definitions from relative location [client-worker-cache-context.xml]
Offending resource: class path resource [client-worker-app-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 12 in XML document from class path resource [client-worker-cache-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException;... : The matching wildcard is strict, but no declaration can be found for element 'gfe:client-cache'. at org.springframework.beans.factory.parsing.FailFast ProblemReporter.error(FailFastProblemReporter.java :68)
at org.springframework.beans.factory.parsing.ReaderCo ntext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderCo ntext.error(ReaderContext.java:76)
.......
----Below is the client cache in my cache-context.xml-----

.....
<gfe:client-cache pool-name="client"/>
<gfe:pool subscription-enabled="true" id="client">
<gfe:server host="localhost" port="40404"/>
</gfe:pool>


also I see a bean defination somewhere as:
<gfe:client-region id="dataRegion" cache-ref="data-cache" pool-name="data-pool" data-policy="NORMAL" />p
two questions: 1)where to find the doc regarding the bean shortcut attributes such as cache-ref xml sematics/options? The refrence guide I have doesnot talk about these options.
2) I don't see "data-cache" defined anywhere, how does this config work? in fact when I tried myself, I got error, data-cache is not specified.

howardspring
Jul 1st, 2012, 02:05 PM
Can anybody help? Very frustrated.

...The matching wildcard is strict, but no declaration can be found for element 'gfe:client-cache'. the context.xml below has a smiley icon which is : and p (how to disable smiley ?)


<?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:util="http://www.springframework.org/schema/util"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd">

<!-- Create client cache -->
<gfe:client-cache id="b-cache" pool-name="client" />

<gfe:pool subscription-enabled="true" id="client">
<gfe:server host="localhost" port="40404"/>
</gfe:pool>
<!-- create region -->
<gfe:client-region id="exampleRegion" pool-name="client">
<gfe:cache-listener>
<bean class="quickstart.SimpleCacheListener"/>
</gfe:cache-listener>
</gfe:client-region>
</beans>