This content has been marked as final.
Show 3 replies
-
1. Re: Question: Why would a seam component be injected in some
delphi'sghost Jun 26, 2007 2:01 AM (in response to charlesnaude)Depends on a few things, posting some code might help.
What are the create and required attributes on the @In annotation set to?
If Seam cannot create a component because of an error somewhere in the creation process, that might be a source of the problem, but it should raise an exception somewhere down the line. -
2. Re: Question: Why would a seam component be injected in some
charlesnaude Jun 26, 2007 2:48 AM (in response to charlesnaude)Hi thanks for replying
I think (hope) I solved the problem.
here is some of my code..@Name("hocasService") public class HocasService { @In private Session agriCardDatabase; public Element submitRequest(AnyElement request,Session agriCardDatabasess){ AgriSetup setup = (AgriSetup)agriCardDatabase.createQuery("select s from AgriSetup s where s.currentEnvironment = :current ") .setBoolean("current",true) .uniqueResult();
I was instantiating the HocasService like a normal java class instead of letting seam do this for me.
this seamed to do the trick :@In(required=false,create=true) private HocasService hocasService; private void doSomeStuff(){ hocasService.submitRequest(xml); }
please tell me if this could have been the problem or if I'm on the wrong track. -
3. Re: Question: Why would a seam component be injected in some
pmuir Jun 26, 2007 5:47 AM (in response to charlesnaude)Yes. Seam doesn't intercept objects instantiated using the new keyword.