Announcement Announcement Module
Collapse
No announcement yet.
autowired ejb failing to be wired Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • autowired ejb failing to be wired

    I have an ejb defined that runs in jboss.
    The ejb layer is instantiated by jboss but the applicationProperties is never set -- even when I mark it as Autowire. It's as if the at Autowired isn't being read. I have tried changing it to at Resource but then I get a different failure:

    Code:
    [ServiceController] Problem starting service jboss.j2ee:service=EJB3,module=Tpa2LieEjb.jar
    java.lang.RuntimeException: You did not specify a at Resource.mappedName()

    The only problem with the ejb below is the applicationProperties are never set!


    Code:
    Stateless
    public class Tpa2LieControllerImpl implements Tpa2LieControllerLocal, Tpa2LieControllerRemote{
    	PersistenceContext(name="manager1")
    	EntityManager em;
    	
    	Autowired
        private ApplicationProperties applicationProperties;
    	
    	Long currentClaimsProcessed = 0L;
    	private ProcessService processService = null;
    ....
    I have an application-Context.xml which does:

    <context:component-scan base-package="com.xxx.tpa2lie"/>
    and instatiates correctly:

    Code:
    import org.springframework.stereotype.Repository;
    
    Repository
    public class ApplicationProperties {
    	public ApplicationProperties(){
    		System.out.println("initializing ApplicationProperties");
    	}
    }
    Any suggestions or help is appreciated. Thanks.
    I have removed the "at signs" on the annotations because the forum board doesn't like them in posts.

  • #2
    I can answer my own question.

    Ejb 3 spec can only inject j5ee resource dependencies ... DataSources, EJB's, Servlet Context, etc.

    It cannot at this time be used to inject POJO's like applicationProperties into EJB layer.

    Comment

    Working...
    X