[jboss-user] [JBoss Seam] - Re: Can't inject entityManager into application component?

raja05 do-not-reply at jboss.com
Sun Sep 3 00:24:41 EDT 2006


I modified the registration app not to work with EJBs but as Simple beans. The other changes are to make the REgisterAction bean as a Application scope bean and be available at Startup. I did those modifications just to make sure that your original problem description was happening for me too.

Here is  a diff of what was changed ("registration" is the seam-example folder and "test" is my folder)

  | diff -r ../registration/src/org/jboss/seam/example/registration/RegisterAction.java src/org/jboss/seam/example/registration/RegisterAction.java
  | 11a12,13
  | > import org.jboss.seam.annotations.Startup;
  | > import org.jboss.seam.ScopeType;
  | 12a15
  | > import org.jboss.seam.annotations.Scope;
  | 17d19
  | < @Stateless
  | 18a21,22
  | > @Startup
  | > @Scope(ScopeType.APPLICATION)
  | 25c29
  | <    @PersistenceContext
  | ---
  | >    @In(create=true)
  | 32a37
  | >       log.warn("EM: " + em);
  | diff -r ../registration/src/org/jboss/seam/example/registration/Register.java src/org/jboss/seam/example/registration/Register.java
  | 6d5
  | < @Local
  | 10c9
  | < }
  | \ No newline at end of file
  | ---
  | > }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969079#3969079

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969079



More information about the jboss-user mailing list