[jboss-user] [JBoss Seam] - Re: Question: Why would a seam component be injected in some

charlesnaude do-not-reply at jboss.com
Tue Jun 26 02:48:14 EDT 2007


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.





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

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



More information about the jboss-user mailing list