-
1. Re: inject CONVERSATION in session bean
cash1981 Jul 22, 2009 12:58 PM (in response to aj1m)If you have an EJB like in your example you can inject it with the interface name like this:
@In IEpayConsult epayconsult;
I think that should work. If not then try
@In(value="iEpayConsult") IEpayConsult epayconsult;
-
2. Re: inject CONVERSATION in session bean
aj1m Jul 22, 2009 1:30 PM (in response to aj1m)thanks Shervin,
i did
@In IEpayConsult epayconsult;
it generate :
@In attribute requires non-null value: epayconsulttable.epayconsultso i add
(required = false)
so it generate a nullpointerexception.because epayconsult was null
any idea pls
-
3. Re: inject CONVERSATION in session bean
cash1981 Jul 22, 2009 1:39 PM (in response to aj1m)Are you sure you did do
and not
Because the first is correct. You can try
@In(create = true)
IEpayConsult epayconsult;
but that shouldnt be necessary.
If none of these work, then please paste the code of IEpayConsult also, and also you can try
Context.getConversationContext().get("epayconsult") -
4. Re: inject CONVERSATION in session bean
cash1981 Jul 22, 2009 1:41 PM (in response to aj1m)Sorry my formating got screwed.
I meant to say that you should use@In IEpayConsultTable epayconsult;
-
5. Re: inject CONVERSATION in session bean
cash1981 Jul 22, 2009 1:44 PM (in response to aj1m)
Shervin Asgari wrote on Jul 22, 2009 13:41:
Sorry my formating got screwed.
I meant to say that you should use@In IEpayConsultTable epayconsult;
Damnit!! I wish I could have edit in this forum.
Sorry that is absolutely wrong the above.
I meant to say, are you sure you wrote:@In IEpayConsult epayconsult;
and not@In EpayConsult epayconsult;
-
6. Re: inject CONVERSATION in session bean
aj1m Jul 22, 2009 1:47 PM (in response to aj1m)yes i am sure
-
7. Re: inject CONVERSATION in session bean
aj1m Jul 22, 2009 2:02 PM (in response to aj1m)hi Shervin;
i added
(create = true)
and it works now
i think that the bean wasnt been created, have you any explanation of this
thanks a lot
-
8. Re: inject CONVERSATION in session bean
asookazian Jul 22, 2009 7:23 PM (in response to aj1m)
Damnit!! I wish I could have edit in this forum.Hallelujah, I have backing...
-
9. Re: inject CONVERSATION in session bean
asookazian Jul 22, 2009 7:27 PM (in response to aj1m)
Alain McKenna wrote on Jul 22, 2009 14:02:
hi Shervin;
i added(create = true)
and it works now
i think that the bean wasnt been created, have you any explanation of this
thanks a lotYou must use @In(create=true) or @AutoCreate on the injected component. I prefer the latter as it ends up being less headache and coding.
-
10. Re: inject CONVERSATION in session bean
cash1981 Jul 22, 2009 9:11 PM (in response to aj1m)Aaah I didnt see the missing @AutoCreate
Yes you should use that at least in ejb's.