Page 1 of 1

About Question enthuware.ocejws.v6.2.58 :

Posted: Sat Oct 31, 2015 9:42 am
by disznoperzselo
Under option

@Resource(name="WebServiceContext", type=java.lang.Object.class)
@WebService
public class MathTableImpl {     . . . }

you note that
"This is not injecting in the class: it is only creating an entry in the bean's environment."

in the explanation:
"If the type is java.lang.Object, then the resource MUST be injected into a field or a method."

If it is correct to set @Resource on class level with type=java.lang.Object.class the explanation
states what and what Object will be created in the bean's environment?

Re: About Question enthuware.ocejws.v6.2.58 :

Posted: Sun Nov 01, 2015 3:02 am
by fjwalraven
If it is correct to set @Resource on class level with type=java.lang.Object.class the explanation
states what and what Object will be created in the bean's environment?
In this case: no object. It was a general comment about the @Resource annotation on a class level.

I have updated the explanation:
An @Resource annotation on a class is not injecting anything in the class: it is only creating an entry in the bean's environment. In this case where it involves a WebServiceContext and the type is java.lang.Object.class it is only allowed on a field or property inside the class. No entry is created in the bean's environment.
Thanks for your feedback!

Regards,
Frits