Re: session is NULL

2010-11-11 Thread Anas Mughal
into my DAO. That is working well for me. (No constructors.) Best Regards. --Anas Mughal http://anas-mughal.com   --- On Thu, 11/11/10, Everton Agner wrote: From: Everton Agner Subject: Re: session is NULL To: "Tapestry users" Date: Thursday, November 11, 2010, 8:23 AM > @

Re: session is NULL

2010-11-11 Thread Everton Agner
0, Rich M wrote: > > From: Rich M > Subject: Re: session is NULL > To: "Tapestry users" > Date: Wednesday, November 10, 2010, 10:34 AM > > On 11/10/2010 03:42 AM, Anas Mughal wrote: > > I have setup my DAO as a Tapestry service in the AppModule as: > &

Re: session is NULL

2010-11-10 Thread Anas Mughal
Yes, that worked. I wish to thank everyone for their help! Tapestry is great! Coming from the Spring world, I do not miss those verbose Spring configuration files! --Anas Mughal http://anas-mughal.com --- On Wed, 11/10/10, Rich M wrote: From: Rich M Subject: Re: session is NULL To

Re: session is NULL

2010-11-10 Thread Rich M
page classes cleaner. Any suggestion would be greatly appreciated. --- On Wed, 11/10/10, Kalle Korhonen wrote: From: Kalle Korhonen Subject: Re: session is NULL To: "Tapestry users" Date: Wednesday, November 10, 2010, 1:48 AM @Inject is for pages. Make your DAO a T

Re: session is NULL

2010-11-10 Thread Cezary Biernacki
On Wed, Nov 10, 2010 at 9:42 AM, Anas Mughal wrote: > > I have setup my DAO as a Tapestry service in the AppModule as: > > [...] Then, I try to inject the session as follows: > > public class BranchHibernateDAO implements BranchDAO { > > @Inject > private Session session; > > >

Re: session is NULL

2010-11-10 Thread ael
.nabble.com/session-is-NULL-tp3258165p3258344.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h

Re: session is NULL

2010-11-10 Thread Anas Mughal
/10, Kalle Korhonen wrote: From: Kalle Korhonen Subject: Re: session is NULL To: "Tapestry users" Date: Wednesday, November 10, 2010, 1:48 AM @Inject is for pages. Make your DAO a Tapestry service and inject the session to it via its constructor. Kalle On Tue, Nov 9, 2010 at

Re: session is NULL

2010-11-09 Thread Kalle Korhonen
s("unchecked") >     public Object find( Class c , BigDecimal id) >     { >     return  session.get(c, id);  // session is NULL here >     } > } > > > I get a NULL pointer exception because my session does not seem to be >  initialized. > > Searchin

Re: session is NULL

2010-11-09 Thread Josh Kamau
no error with respect to the hibernate configuration.) > > I don't know how to resolve the session object being NULL in my simple DAO > below. > > > > > > > > Thanks for your help! > -- > Anas Mughal > > http://anas-mughal.com > > > > >

Re: session is NULL

2010-11-09 Thread Anas Mughal
Josh Kamau Subject: Re: session is NULL To: "Tapestry users" Date: Wednesday, November 10, 2010, 1:04 AM Hi Anas; Have you added the tapestry-hibernate dependency on your pom.xml? On Wed, Nov 10, 2010 at 12:52 AM, Anas Mughal wrote: > I have setup my Tapestry project using the Mav

Re: session is NULL

2010-11-09 Thread Josh Kamau
> public Object find( Class c , BigDecimal id) > { > return session.get(c, id); // session is NULL here > } > } > > > I get a NULL pointer exception because my session does not seem to be > initialized. > > Searching online, I came accross: > htt

session is NULL

2010-11-09 Thread Anas Mughal
BranchDAO {     @Inject     private Session session;     @SuppressWarnings("unchecked")     public Object find( Class c , BigDecimal id)     {     return  session.get(c, id);  // session is NULL here     } } I get a NULL pointer exception because my session does not seem to be i

Re: [T5]: Hibernate question - session is null

2008-07-28 Thread 9902468
Yep, Injection works only in page and component classes that live the ordinary Page or component lifecycle, and are requested from the web. :) Move the session to a real page and have that util to take the session as parameter, or even better move your logic to service that a page can use. (Secur

Re: [T5]: Hibernate question - session is null

2008-07-28 Thread Sven Homburg
its look like, that your Security class is only a helper class and no page component. in such classes the @Inject annotation doesnt work 2008/7/28 <[EMAIL PROTECTED]> > Ok, I have just checked. I have mysql-connector-java-5.1.5.jar in the maven > repository. > > > Code is: >

Re: [T5]: Hibernate question - session is null

2008-07-28 Thread photos
Ok, I have just checked. I have mysql-connector-java-5.1.5.jar in the maven repository. Code is: - package uk.bl.dlportal.pages.util; import java.util.List; import org.apache.tapestry5.ioc.annotations.Inject; import org.hibernate.Criteria; import org.h

Re: [T5]: Hibernate question - session is null

2008-07-28 Thread 9902468
Check also that you have the mysql-connector-java-5.1.6.jar or similar in your libraries. I have the following list: FieldValidatorSource: DEFINED FormDAO: DEFINED FormSupport: DEFINED FreeMarkerService: DEFIN

Re: [T5]: Hibernate question - session is null

2008-07-28 Thread photos
Quoting 9902468 <[EMAIL PROTECTED]>: Is the hibernate service initialized at all? When Tapestry starts it lists all known services, is Hibernate in that list? - 99 It looks like it: ... FieldValidationSupport: DEFINED FieldValidatorDefaultSource: DEFINED

Re: [T5]: Hibernate question - session is null

2008-07-27 Thread 9902468
Is the hibernate service initialized at all? When Tapestry starts it lists all known services, is Hibernate in that list? - 99 photos-4 wrote: > > Thanks for your help, but so far no joy: > > Quoting 9902468 <[EMAIL PROTECTED]>: > >> And of course, check that you have Hibernate and hibernat

Re: [T5]: Hibernate question - session is null

2008-07-26 Thread Mark Weissenberg
Hi, I also had some trouble configuring hibernate, my session was also null. After searching for a while I found this tutorial: http://linuxboy.javaeye.com/blog/68311 Since I dont use a DAO, my code looks something like the following. my db entity: ... import org.hibernate.Session; @Entity

Re: [T5]: Hibernate question - session is null

2008-07-25 Thread photos
Thanks for your help, but so far no joy: Quoting 9902468 <[EMAIL PROTECTED]>: And of course, check that you have Hibernate and hibernate annotation in your >libraries, they are NOT included automatically by maven if maven is used. The libraries appear in my repository and appear under "sou

Re: [T5]: Hibernate question - session is null

2008-07-25 Thread photos
Quoting 9902468 <[EMAIL PROTECTED]>: Check that the @Inject private Session session; session is org.hibernate.Session. - 99 It is. I notice that when I switch on the mysql log that no attempt is ever made to access the db. Is there any kind of logging I can switch on from Tapestry

Re: [T5]: Hibernate question - session is null

2008-07-25 Thread 9902468
And of course, check that you have Hibernate and hibernate annotation in your libraries, they are NOT included automatically by maven if maven is used. - 99 photos-4 wrote: > > > I'm using Eclipse. The XML config appears in target/classes and > appears to be in the classpath. > > I'm afra

Re: [T5]: Hibernate question - session is null

2008-07-25 Thread 9902468
Tapestry should be quite verbose about hibernate if tapestry is configured to run in debug mode: http://tapestry.apache.org/tapestry5/tapestry-core/guide/conf.html add: //This is the time in seconds that Tapestry waits before checking if a file is modified //Use a big number in product

Re: [T5]: Hibernate question - session is null

2008-07-25 Thread 9902468
Check that the @Inject private Session session; session is org.hibernate.Session. - 99 photos-4 wrote: > > > I'm using Eclipse. The XML config appears in target/classes and > appears to be in the classpath. > > I'm afraid I'm rather new to Tap 5 and also to Hibernate. I'm just > fol

Re: [T5]: Hibernate question - session is null

2008-07-25 Thread photos
I'm using Eclipse. The XML config appears in target/classes and appears to be in the classpath. I'm afraid I'm rather new to Tap 5 and also to Hibernate. I'm just following what is in the Tutorial. Unfortunately the session is still coming out as null. Is there anywhere I can see that T