This content has been marked as final.
Show 4 replies
-
1. Re: Problem implementing filters
pmuir Feb 5, 2008 6:07 PM (in response to vicky123)You probably need either auto-create=true in components.xml or create=true on the @In
-
2. Re: Problem implementing filters
vicky123 Feb 6, 2008 3:22 AM (in response to vicky123)I added auto-create in components.xml but it didn't work.
<core:managed-persistence-context name="filteredEntityManager" auto-create="true" persistence-unit-jndi-name="java:/pEntityManagerFactory"> <core:filters> <value>#{companyFilter}</value> </core:filters> </core:managed-persistence-context>
Then i added create=true@In(create=true) protected EntityManager filteredEntityManager;
Exception was same in both the cases.
I am wondering if this error in eclipse is causing the problem?cvc-complex-type.2.4.c:The matching wild card is strict, but no declaration can be found for element 'code:filter'
cvc-complex-type.2.4.c:The matching wild card is strict, but no declaration can be found for element 'core:managed-persistence-context'
-
3. Re: Problem implementing filters
vicky123 Feb 7, 2008 11:31 AM (in response to vicky123)Can anyone please tell me how to solve this problem in eclipse?
cvc-complex-type.2.4.c:The matching wild card is strict, but no declaration can be found for element 'code:filter'
cvc-complex-type.2.4.c:The matching wild card is strict, but no declaration can be found for element 'core:managed-persistence-context'
Is this error in eclipse acting as a root problem while implementing the filters?
Its been two days I am not able to solve this problem.
Thanks in advance.
-Vivek -
4. Re: Problem implementing filters
vicky123 Feb 8, 2008 6:55 AM (in response to vicky123)Thank you all.
I changed my components.xml to this and it worked. And rest all is same.<persistence:filter name="companyFilter"> <persistence:name>companyFilter</persistence:name> <persistence:parameters> <key>currentCompanyId</key> <value>#{currentCompanyId}</value> </persistence:parameters> </persistence:filter> <persistence:managed-persistence-context name="filteredEntityManager" auto-create="true" persistence-unit-jndi-name="java:/PEntityManagerFactory"> <persistence:filters> <value>#{companyFilter}</value> </persistence:filters> </persistence:managed-persistence-context>