tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris.Christo" <chris.chri...@mail.com>
Subject Re: @EJB injection in XmlAdapters
Date Mon, 24 Jun 2013 13:49:45 GMT
hmm ok thanks guys, are LoginModule subclasses managed?

Didn't really know about DeltaSpike, might give it a go later, thanks.

Chris,

@ChriChristo7 
{ https://twitter.com/ChrisChristo7 }
{ http://ChrisChristo7.tumblr.com }

LinkedIn { https://linkedin.com/in/ChrisChristo }
Angel { https://angel.co/chris-christo }
GitHub { https://github.com/ChrisChristo }

On 24 Jun 2013, at 14:12, "John D. Ament" <john.d.ament@gmail.com> wrote:

> I don't believe XmlAdapters are managed objects.
> 
> 
> On Mon, Jun 24, 2013 at 9:09 AM, Chris.Christo <chris.christo@mail.com>wrote:
> 
>> Hi,
>> 
>> So I have a simple XmlAdapter class (shown below), with an @EJB annotated
>> field (where the AccountService is an @Stateless bean). Problem is, it
>> doesn't get injected. The AccountService ejb gets injected into other
>> classes in my project fine, just not in an XmlAdapter.
>> 
>> Is it just not possible to inject ejbs into an XmlAdapter subclass?
>> 
>> 
>> public class AccountXmlAdapter extends XmlAdapter<Long, Account> {
>> 
>>        @EJB
>>        private AccountService service;
>> 
>>        @Override
>>        public Account unmarshal(final Long id) { return service.get(id); }
>> 
>>        @Override
>>        public Long marshal(final Account object) { return object.getId();
>> }
>> }
>> 
>> Chris,
>> 
>> @ChriChristo7
>> { https://twitter.com/ChrisChristo7 }
>> { http://ChrisChristo7.tumblr.com }
>> 
>> LinkedIn { https://linkedin.com/in/ChrisChristo }
>> Angel { https://angel.co/chris-christo }
>> GitHub { https://github.com/ChrisChristo }
>> 
>> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message