-
1. Re: Newbie - injection problem (getting null)
cash1981 Mar 10, 2010 10:19 PM (in response to carvo)Your UploadService needs to be a seam component as well.
So you need to put @Name("uploadService") on it. -
2. Re: Newbie - injection problem (getting null)
carvo Mar 15, 2010 2:56 PM (in response to carvo)Hi Shervin,
many thx for your reply.
Sorry my inattention, i've put it but i'm still getting null. Something with PAGE SCOPE TYPE ?? I have no ideas...
Thx again.
CARVO.
-
3. Re: Newbie - injection problem (getting null)
cash1981 Mar 15, 2010 10:07 PM (in response to carvo)Please show stacktrace
-
4. Re: Newbie - injection problem (getting null)
cosmo Mar 18, 2010 1:46 PM (in response to carvo)Is your FarmStructureDescriptionHome also a seam component?
-
5. Re: Newbie - injection problem (getting null)
lrpieri May 21, 2010 4:04 PM (in response to carvo)Hi all,
Now I'm working with Carvo and we continue with the same injection problem. I'm working in another point of the application and I'm havin a NPE when usin the @Logger.
The error line is log.info("about entityManager: " + entityManager);
I'm thinking we are havin a generic problem with injections. Maybe any configuration?
Someone have any idea?Thx for all replies.
Pieri
The code is follow:
@Stateless @Name("farmStructureDAO") public class FarmStructureDAOImpl implements FarmStructureDAO { @Logger private Log log; @PersistenceContext private EntityManager entityManager; public List<FarmStructure> list(){ log.info("about entityManager: " + entityManager);//NPE Query query = entityManager.createQuery("from FarmStructure"); return query.getResultList(); } }
-
6. Re: Newbie - injection problem (getting null)
cash1981 May 21, 2010 4:12 PM (in response to carvo)Try using @In instead of @PersistenceContext
-
7. Re: Newbie - injection problem (getting null)
lrpieri May 21, 2010 4:39 PM (in response to carvo)Hi Shervin,
Many thx for your reply but the log also is null.
About the EntityManager, I've tried with using @In also, but the NPE problem persist. When included the @Logger and I saw it was null too, I imagined the problem is generic for injections. -
8. Re: Newbie - injection problem (getting null)
cash1981 May 21, 2010 4:46 PM (in response to carvo)Then I suggest you create the project using seam-gen. That will setup the project for you automatically with everything working.
-
9. Re: Newbie - injection problem (getting null)
lrpieri May 21, 2010 5:34 PM (in response to carvo)The project was created using JBoss Tools. Can it generate any problem?
-
10. Re: Newbie - injection problem (getting null)
lrpieri May 24, 2010 8:27 PM (in response to carvo)Hi Shervin,
I created another project using JBoss Tools again and I got the same problem. After have the project running, I created one more class with @Logger private Log log and when I try to use log.info it is null.
Are there problems generating projects using jboss tools?Thx
Pieri