tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris.Christo" <chris.chri...@mail.com>
Subject @EJB injection in XmlAdapters
Date Mon, 24 Jun 2013 13:09:49 GMT
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