I am using ehcache to refresh it from DB, but seems its not being refreshed.
ehcache.xml file ->
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd"
updateCheck="true"
monitoring="autodetect"
dynamicConfig="true">
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="100"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskSpoolBufferSizeMB="30"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"/>
<!-- The cache configuration for our Currency cache -->
<cache name="cachename"
maxElementsInMemory="3000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false" >
<persistence strategy="localTempSwap" synchronousWrites="true" />
<cacheDecoratorFactory class="net.sf.ehcache.constructs.refreshahead.RefreshAheadCacheFactory"
properties="name=myCacheRefresher,
timeToRefreshSeconds=180,
batchSize=10,
numberOfThreads=4,
maximumBacklogItems=100,
evictOnLoadMiss=true" />
</cache>
</ehcache>
config.xml
<ehcache:annotation-driven cache-manager="ehcache" />
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager" ref="ehcache" />
</bean>
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" >
<property name="configLocation" value="ehcache.xml" />
</bean>
<bean id="cachingAttributeSource" class="org.springmodules.cache.annotations.AnnotationCachingAttributeSource" />
CatchFetch.java
#GET
#Path("/Mymethod")
#WebMethod(operationName = "mymethodforUI")
public List<Object> mymethodforUI() {
LOGGER.info("Getting mymethod.");
return dao.mymethod("keyname");
}
CacheDAO.java
#Cacheable(value = "cachename", key = "#key")
public List<Object> mymethod(String key) {
List<Object> res -> a slow query getting from Db
return res;
}
Question 1: The caching is working good for first 180 seconds, but after 180 seconds, the cache is supposed to refresh. That behaviour is not being reflected. Can someone figure out why ?
Question 2: Is there any way I can log the timestamps when the cache refresh occurs defined by cacheDecoratorFactory?
Can you confirm that you aren't getting UnsupportedOperationException stating that refresh-ahead not supported under transactions or with GAE?
In order to have refresh ahead working you need to have a cache loader defined. Otherwise, how do you expect the cache to know how to populate a mapping?
A setup without a loader should probably throw an exception as it will not work.
Related
I created the flow below and it's working normally but all the time this information is printed in the log file.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-http="http://www.springframework.org/schema/integration/http"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="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-5.2.xsd
http://www.springframework.org/schema/integration/http
http://www.springframework.org/schema/integration/http/spring-integration-http-5.2.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
<task:executor id="taskExecutorRecursaoRendaVariavel" pool-size="15-20" queue-capacity="100"/>
<task:executor id="taskExecutorProcessamentoRendaVariavel" pool-size="15-20" queue-capacity="100"/>
<task:executor id="taskExecutorSplitterRendaVariavel" pool-size="15-20" queue-capacity="100"/>
<int:channel id="xxx-consolidador-movimentacao-renda-variavel"/>
<int:publish-subscribe-channel id="xxx-consolidador-splitter-recursao-renda-variavel" task-executor="taskExecutorSplitterRendaVariavel"/>
<int:channel id="xxx-consolidador-channel-segrega-renda-variavel"/>
<int:publish-subscribe-channel id="xxx-consolidador-splitter-renda-variavel-recursao-movimentacao" task-executor="taskExecutorRecursaoRendaVariavel"/>
<int:publish-subscribe-channel id="xxx-consolidador-splitter-renda-variavel-processa-movimentacao" task-executor="taskExecutorProcessamentoRendaVariavel"/>
<int:channel id="xxx-consolidador-direct-channel-movimentacao-renda-variavel"/>
<int:channel id="xxx-consolidador-request-ativo-renda-variavel"/>
<int:channel id="xxx-consolidador-request-movimentacao-renda-variavel"/>
<int:channel id="xxx-consolidador-request-notifica-renda-variavel"/>
<int:channel id="xxx-consolidador-filter-channel-renda-variavel"/>
<int-http:outbound-gateway
url="${xxxx.xxxxx.movimentacao-rendavariavel}?startDate={dtInitPosicao}&endDate={dtenddate}&page={page}&recordPerPage=${RECORDS_PER_PAGE:250}&cblc={cblc}&cpfCnpj={cpf}"
http-method="GET"
expected-response-type="br.com.xxxxx.ciar.xxx.xxx.xxx.integration.response.ResponseRendaVariavelMovimentacao"
request-channel="xxx-consolidador-movimentacao-renda-variavel"
reply-channel="xxx-consolidador-splitter-recursao-renda-variavel"
rest-template="restTemplate"
mapped-request-headers="Authorization, cpf, cblc, dtInitPosicao, dtenddate, page">
<int-http:uri-variable name="cpf" expression="headers.cpf"/>
<int-http:uri-variable name="cblc" expression="headers.cblc"/>
<int-http:uri-variable name="dtInitPosicao" expression="headers.dtinitposicao"/>
<int-http:uri-variable name="dtenddate" expression="headers.dtenddate"/>
<int-http:uri-variable name="page" expression="headers.page"/>
</int-http:outbound-gateway>
<int:splitter input-channel="xxx-consolidador-splitter-recursao-renda-variavel"
output-channel="xxx-consolidador-channel-segrega-renda-variavel">
<bean class="br.com.xxx.ciar.xxx.renda.variavel.integration.splitter.SplitterRecursaoRendaVariavel"/>
</int:splitter>
<int:header-value-router id="recursaoRendaVariavel" input-channel="xxx-consolidador-channel-segrega-renda-variavel"
header-name="recursao" resolution-required="false">
<int:mapping value="true" channel="xxx-consolidador-splitter-renda-variavel-recursao-movimentacao"/>
</int:header-value-router>
<int:header-value-router id="processaRendaVariavel" input-channel="agora-consolidador-channel-segrega-renda-variavel"
header-name="processa" resolution-required="false">
<int:mapping value="true" channel="xxxx-consolidador-splitter-renda-variavel-processa-movimentacao"/>
</int:header-value-router>
<int:header-filter input-channel="xxx-consolidador-splitter-renda-variavel-processa-movimentacao"
output-channel="xxx-consolidador-filter-channel-renda-variavel"
header-names="Authorization, authorization"/>
<int:splitter input-channel="xxx-consolidador-filter-channel-renda-variavel"
output-channel="xxx-consolidador-direct-channel-movimentacao-renda-variavel">
<bean class="br.com.xxx.ciar.xxxx.renda.variavel.integration.splitter.RendaVariavelMovimentacaoSplitter"/>
</int:splitter>
<int:header-value-router input-channel="xxx-consolidador-direct-channel-movimentacao-renda-variavel" header-name="type" order="1">
<int:mapping value="ativos" channel="xxx-consolidador-request-ativo-renda-variavel"/>
</int:header-value-router>
<int:header-value-router input-channel="xxx-consolidador-direct-channel-movimentacao-renda-variavel" header-name="type" order="2">
<int:mapping value="posicao" channel="xxx-consolidador-request-movimentacao-renda-variavel"/>
</int:header-value-router>
<int:header-value-router input-channel="xxx-consolidador-direct-channel-movimentacao-renda-variavel" header-name="type" order="3">
<int:mapping value="notifica" channel="xxx-consolidador-request-notifica-renda-variavel"/>
</int:header-value-router>
<int-http:outbound-channel-adapter
http-method="POST"
url="${xxxx.ativos}"
channel="xxx-consolidador-request-ativo-renda-variavel"
rest-template="restTemplate"
mapped-request-headers="Authorization, DESTINO_URL">
</int-http:outbound-channel-adapter>
<int-http:outbound-channel-adapter
http-method="POST"
url="${xxxx.movimento-rendavariavel}"
channel="xxx-consolidador-request-movimentacao-renda-variavel"
rest-template="restTemplate"
mapped-request-headers="Authorization, DESTINO_URL">
</int-http:outbound-channel-adapter>
<int-http:outbound-channel-adapter
http-method="POST"
url="${xxxx.notifica}"
channel="xxx-consolidador-request-notifica-renda-variavel"
rest-template="restTemplate"
mapped-request-headers="Authorization, DESTINO_URL">
</int-http:outbound-channel-adapter>
</beans>
2021-11-05 17:55:16,811 [taskExecutorSplitterRendaVariavel-1] INFO o.s.i.d.UnicastingDispatcher - An exception was thrown by 'bean 'org.springframework.integration.config.RouterFactoryBean#6' for component 'recursaoRendaVariavel'; defined in: 'file []'; from source: ''int:header-value-router' with id='recursaoRendaVariavel''' while handling 'GenericMessage [payload=br.com.bradesco.ciar.agora.renda.variavel.integration.response.ResponseRendaVariavelMovimentacao#2a5ae9, headers={Transfer-Encoding=chunked, http_requestMethod=GET, sequenceNumber=1, processa=true, sequenceSize=2, dtenddate=20211105, Pragma=no-cache, http_statusCode=200 OK, Date=1636145712000, dtinitposicao=20211101, Cache-Control=no-cache, no-store, max-age=0, must-revalidate, cblc=161254, cpf=21333240899, http_requestUrl=http://localhost:8083/renda-variavel/xxxxxxxxxx, contentType=application/json;charset=utf-8, timestamp=1636145716810}]': No channel resolved by router 'recursaoRendaVariavel' and no 'defaultOutputChannel' defined.. Failing over to the next subscriber.
Your <int:channel id="xxx-consolidador-channel-segrega-renda-variavel"/> is a DirectChannel with a UnicastingDispatcher, which has a logic to failover to the next subscriber, if the current one has failed. The logic is like this:
if (!isLast && this.failover) {
logExceptionBeforeFailOver(ex, handler, message);
}
We log that message to inform you that this might not be an expected behavior. For example that was an accident to add another subscriber to this channel. The whole exception info is present there to let you know that your logic in the router has failed: you probably didn't expect that No channel resolved by router 'recursaoRendaVariavel' for your use-case.
From here, if you really think that your flow is doing OK failing over to the next subscriber for that router error, then you just can ignore such an INFO message in the logs or turn off INFO for org.springframework.integration at all.
I Am working in the spring ehcache, where i have the below coding in which the spring junit is working fine. But if run this from my code it is throwing error as below
java.lang.IllegalArgumentException: Cannot find cache named 'productCategoryCache' for Builder[public com.tagit.mobeixbank.db.domain.CardsProductSTB com.tagit.mobeixbank.db.util.MobeixBankCacheManager.getAccountProductDetail(java.lang.String)] caches=[productCategoryCache] | key='' | keyGenerator='' | cacheManager='' | cacheResolver='' | condition='' | unless='' | sync='false'
and I have java code here
#Override
#Cacheable(value="productCategoryCache", key="'productCategories'")
public CardsProductSTB getProductCodeByProductId(String productId) throws ModelException {
LOG.info("getProductCodeByProductId : "+productId);
//my db logic
} catch (Exception e) {
e.printStackTrace();
throw new ModelException("Error occured in [CardsProductSTB.findByProductId]", e);
} finally {
closeSession();
}
return productDetails;
}
Below is my context xml config:`
<diskStore path="java.io.tmpdir/mobeix" />
<defaultCache maxEntriesLocalHeap="10000" eternal="false"
timeToIdleSeconds="120" timeToLiveSeconds="120" diskSpoolBufferSizeMB="30"
maxEntriesLocalDisk="10000000" diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU" statistics="true">
<persistence strategy="localTempSwap" />
</defaultCache>
<cache name="productCategoryCache" maxEntriesLocalHeap="1000"
maxEntriesLocalDisk="1000" eternal="false" diskSpoolBufferSizeMB="20"
timeToIdleSeconds="200" timeToLiveSeconds="500"
memoryStoreEvictionPolicy="LFU" transactionalMode="off">
<persistence strategy="localTempSwap" />
</cache>
<cache name="transactionMatrixCache" maxEntriesLocalHeap="1000"
maxEntriesLocalDisk="1000" eternal="false" diskSpoolBufferSizeMB="20"
timeToIdleSeconds="200" timeToLiveSeconds="500"
memoryStoreEvictionPolicy="LFU" transactionalMode="off">
<persistence strategy="localTempSwap" />
</cache>
</ehcache>`
Please help me where am doing wrong. This issue eating my hell lot of time.
ehcache version 2.8.3 is being used in spring-boot.
The server to be tested is server A and server B based on linux
There are three kinds of cache
Below is the ehcache.xml configuration.
<ehcache>
<diskStore path="java.io.tmpdir" />
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, multicastGroupPort=40001,
timeToLive=1 ,replicatePuts=true,replicatePutsViaCopy=true ,replicateUpdates=true ,replicateUpdatesViaCopy=false,
replicateRemovals=true ,replicateAsynchronously=false"/>
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="socketTimeoutMillis=2000, port=40001"/>
<cache name="aCache"
maxElementsInMemory="0"
eternal="true"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
<bootstrapCacheLoaderFactory
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
properties="bootstrapAsynchronously=true"
propertySeparator="," />
<!-- <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true,
replicateUpdatesViaCopy=false, replicateRemovals=true"/> -->
</cache>
<cache name="bCache"
maxElementsInMemory="0"
eternal="true"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
<bootstrapCacheLoaderFactory
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
properties="bootstrapAsynchronously=true"
propertySeparator="," />
</cache>
<cache name="cCache"
maxElementsInMemory="0"
eternal="true"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
<bootstrapCacheLoaderFactory
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
properties="bootstrapAsynchronously=true"
propertySeparator="," />
</cache>
</ehcache>
Ehcache.xml on Server A and Server B are entered with the same settings.
When I add a cache on server A, I want to see the a cache added on server B
Only the following logs would be displayed, but Server B could not check the added cache.
[Multicast Heartbeat Receiver Thread] DEBUG n.s.e.d.MulticastKeepaliveHeartbeatReceiver - rmiUrls received //192.168.10.20:40001/aCache|//192.168.10.20:40001/bCache|//192.168.10.20:40001/cCache
If you know how, please let me know.
Camel Version: 2.12.2,
CXF Version: 2.7,
Apache Tomcat: 7
I have the following camel-cxf.xml :
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s0="http://www.huawei.com/bme/cbsinterface/cbs/businessmgr"
xmlns:s1="http://www.huawei.com/bme/cbsinterface/cbs/accountmgr"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd">
<bean id="loggingInInterceptor" class="org.apache.cxf.interceptor.LoggingInInterceptor" />
<bean id="loggingOutInterceptor" class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
<cxf:cxfEndpoint id="oneEndpoint"
address="${endpoint.address}"
serviceName="s1:WebService"
serviceClass="WebserviceClass"
endpointName="s1:WebSericePort_http"
wsdlURL="classpath:wsdl/WebService.wsdl">
<cxf:inInterceptors>
<ref bean="loggingInInterceptor" />
<ref bean="setSoapVersionInterceptor"/>
</cxf:inInterceptors>
<cxf:inFaultInterceptors>
<ref bean="loggingInInterceptor" />
<ref bean="setSoapVersionInterceptor"/>
</cxf:inFaultInterceptors>
<cxf:outInterceptors>
<ref bean="loggingOutInterceptor" />
</cxf:outInterceptors>
<cxf:outFaultInterceptors>
<ref bean="loggingOutInterceptor" />
</cxf:outFaultInterceptors>
</cxf:cxfEndpoint>
<http-conf:conduit name="*.http-conduit">
<http-conf:client
Connection="Keep-Alive"
ConnectionTimeout="60000"
ReceiveTimeout="90000"/>
</http-conf:conduit>
</beans>
In my camel-context I have two processors that use the cxf endpoint to invoke two different operations. To do that I use a producerTemplate which uses "cxf:bean:oneEndpoint" as a uri.
The project is a web application deployed in Tomcat 7.
The processors consume from two different queues. After deployment both queues are propagated with a message. The problem is that one of the processors will throw an exception upon invoking the send method on the producer template. The other will work fine. The exception is:
org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint:
cxf://bean:oneEndpoint due to: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'oneEndpoint': Initialization of bean failed;
nested exception is java.lang.IllegalStateException: Could not register object [org.apache.cxf.bus.spring.SpringBus#4b0af74c] under bean name 'cxf':
there is already object [org.apache.cxf.bus.spring.SpringBus#24c0fe59] bound
Full stacktrace can be found here: http://pastebin.com/cDsQZ9r3
The second time the queues receive a message at the same time, everything works fine.
Any ideas?
PS. My web.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/META-INF/spring/*.xml</param-value>
</context-param>
</web-app>
Routes & Processors:
<route id="route1" errorHandlerRef="eh1">
<from uri="{{queue1}}" />
<setHeader headerName="operationName">
<constant>Operation_1</constant>
</setHeader>
<process ref="FirstProcessor" />
<choice>
<when>
<simple>${in.headers.STATUS} == 'OK'</simple>
<inOnly uri="{{result_queue}}" />
</when>
<otherwise>
<inOnly uri="{{nok_result_queue}}" />
</otherwise>
</choice>
</route>
<route id="route2" errorHandlerRef="eh2">
<from uri="{{queue2}}" />
<setHeader headerName="operationName">
<constant>Operation_2</constant>
</setHeader>
<process ref="SecondProcessor" />
<choice>
<when>
<simple>${in.headers.STATUS} == 'OK'</simple>
<inOnly uri="{{result_queue}}" />
</when>
<otherwise>
<inOnly uri="{{nok_result_queue}}" />
</otherwise>
</choice>
</route>
<property name="producerTemplate" ref="firstProcessorTemplate" />
<property name="producerTemplateUri"
value="cxf:bean:oneEndpoint?headerFilterStrategy=#headerFilterStrategy" />
<property name="producerTemplate" ref="secondProcessorTemplate" />
<property name="producerTemplateUri"
value="cxf:bean:oneEndpoint?headerFilterStrategy=#headerFilterStrategy" />
The problem is that both queues are getting a message at the same time so both of them are trying to initialise the SpringBus at the same time.
The problem is that in BusWiringBeanFactoryPostProcessor it this code:
if (!context.containsBean(name) && (create || Bus.DEFAULT_BUS_ID.equals(name))) {
SpringBus b = new SpringBus();
ConfigurableApplicationContext cctx = (ConfigurableApplicationContext)context;
cctx.getBeanFactory().registerSingleton(name, b);
b.setApplicationContext(context);
}
So when two beans both try and initialise the SpringBus in two different threads, they can both enter the if statement at the same time leading to the exception.
The solution is to define a SpringBus in the application context so neither bean will try create a new SpringBus as one already exists.
Please share the routes definition which consumes messages from two different queues. Also you can look for option of using multicasting to have parallel processing in consuming messages from both queues and proceed with further opertion.<route>
<from uri="cxf:bean:oneEndpoint"></from>
<recipientList>
<simple>direct:${header.operationName}</simple>
<log message="Got ${header.operationName}" />
</recipientList>
</route>
Your routes (route1 and route) can be renamed as same as webservice operation name. Our code is also something similar to yours. We haven't faced problem with this approach.
My Context file looks like this
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cacheManager-ref="ehcache"/>
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:configLocation="classpath:spring/cache/ehcache.xml" p:shared="true"/>
My EhCache.xml looks like this:
<defaultCache eternal="false" maxElementsInMemory="1000"
overflowToDisk="false" diskPersistent="false" timeToIdleSeconds="0"
timeToLiveSeconds="600" memoryStoreEvictionPolicy="LRU"/>
<cache name="bdmCache" eternal="false"
maxElementsInMemory="100" overflowToDisk="false" diskPersistent="false"
timeToIdleSeconds="0" timeToLiveSeconds="300"
memoryStoreEvictionPolicy="LRU" />
I get below copied exception when i start my tomcat
28/Jul/2014 09:32:05 977 ERROR org.springframework.web.servlet.DispatcherServlet [localhost-startStop-1] - Context initialization failed (org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:467))
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 38 in XML document from class path resource [spring/web/spring-web.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 38; columnNumber: 118; The prefix "p" for attribute "p:cacheManager-ref" associated with an element type "bean" is not bound.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
Please tell me what i am missing here.
There is some problem with your namespaces configuration as the exception suggests: The prefix "p" for attribute "p:cacheManager-ref" associated with an element type "bean" is not bound.
Share your namespace configuration here. As per the current information present nothing more can be added. More on namespace and configurations here.
Related question.