[jboss-user] [JBoss Seam] - Re: Obtaining a handle to a EntityHome object

damianharvey do-not-reply at jboss.com
Mon Apr 23 11:19:28 EDT 2007


I was just looking at this myself this morning.

Instead of calling:
SomeObjectHome myHome = new SomeObjectHome();
You should instead use:
SomeObjectHome myHome = Component.getInstance("someObjectHome");

Where "someObjectHome" is the @Name given to the Home Object. If you don't do it this way then 'Seam can't do it's magic' and you'll get NullPointerExceptions on injected objects like @Logger.

Cheers,

Damian.

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

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



More information about the jboss-user mailing list