-
1. Re: Deployment fails when @Resource(name = "java:comp/ValidatorFactory") specified.
ctomc Jun 13, 2014 5:59 PM (in response to rpdeadly)you have validation.xml or bean.xml as part of your app?
-
2. Re: Deployment fails when @Resource(name = "java:comp/ValidatorFactory") specified.
rpdeadly Jun 13, 2014 7:28 PM (in response to ctomc)Hi. I have an empty META-INF/beans.xml but I haven't created a validation.xml.
-
3. Re: Deployment fails when @Resource(name = "java:comp/ValidatorFactory") specified.
jaikiran Jun 16, 2014 3:36 AM (in response to rpdeadly)ritesh parmar wrote:
Hi.
My EAR deployment works only when I comment out @Resource(name = "java:comp/ValidatorFactory") from all the EJB classes.
Are you trying to inject the ValidatorFactory? Then the right way to do that is to use the lookup attribute (or even mappedName) of @Resource annotation or even leave out the JNDI name altogether. The way you have it now, it tries to bind a ValidatorFactory to that JNDI name and from what I can guess it will fail because that's a reserved JNDI name to which the container binds the ValidatorFactory. So change your code to:
@Resource private ValidatorFactory validatorFactory;
or
@Resource(lookup="java:comp/ValidatorFactory") private ValidatorFactory validatorFactory;
-
4. Re: Deployment fails when @Resource(name = "java:comp/ValidatorFactory") specified.
jaikiran Jun 16, 2014 3:38 AM (in response to rpdeadly)ritesh parmar wrote:
I'm running wildfly-8.1.0.CR2 in
By the way, you might want to use 8.1.0.Final which has been released a couple of weeks back.