Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
().configure(); config.setProperty(hibernate.connection.url, connectionUrl); config.setProperty(hibernate.connection.username, username); config.setProperty(hibernate.connection.password, password); config.setProperty(hibernate.current_session_context_class, managed); bind(Configuration.class).toInstance(config); //dao stuff // DO I NEED TO DO THIS FOR EVERY DAO OBJECT? bind(AccountDao.class).to(HibernateAccountDao.class); bind(CountryDao.class).to(HibernateCountryDao.class); bind(LanguageDao.class).to(HibernateLanguageDao.class); bind(TerritorySalesCodesDao.class).to(HibernateTerritorySalesCodesDao.class); bind(RegionSalesCodesDao.class).to(HibernateRegionSalesCodesDao.class); bind(CountrySalesCodesDao.class).to(HibernateCountrySalesCodesDao.class); bind(AccountTypeDao.class).to(HibernateAccountTypeDao.class); bind(AccountAuditDao.class).to(HibernateAccountAuditDao.class); } @Singleton public static class Initializer { @Inject Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. @Inject ProviderSession session; @Transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What am I doing wrong? It doesn't seem to be that difficult to implement. Thanks. -Original Message- From: jWeekend [mailto:jweekend_for...@cabouge.com] Sent: Tuesday, October 06, 2009 9:48 AM To: users@wicket.apache.org Subject: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
(); connectionUrl = (String) context.lookup(java:comp/env/hibernate.connection.url); username = (String) context.lookup(java:comp/env/hibernate.connection.username); password = (String) context.lookup(java:comp/env/hibernate.connection.password); } catch (NamingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // annotation and xml final Configuration config = new Configuration().configure(); config.setProperty(hibernate.connection.url, connectionUrl); config.setProperty(hibernate.connection.username, username); config.setProperty(hibernate.connection.password, password); config.setProperty(hibernate.current_session_context_class, managed); bind(Configuration.class).toInstance(config); //dao stuff // DO I NEED TO DO THIS FOR EVERY DAO OBJECT? bind(AccountDao.class).to(HibernateAccountDao.class); bind(CountryDao.class).to(HibernateCountryDao.class); bind(LanguageDao.class).to(HibernateLanguageDao.class); bind(TerritorySalesCodesDao.class).to(HibernateTerritorySalesCodesDao.class); bind(RegionSalesCodesDao.class).to(HibernateRegionSalesCodesDao.class); bind(CountrySalesCodesDao.class).to(HibernateCountrySalesCodesDao.class); bind(AccountTypeDao.class).to(HibernateAccountTypeDao.class); bind(AccountAuditDao.class).to(HibernateAccountAuditDao.class); } @Singleton public static class Initializer { @Inject Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. @Inject ProviderSession session; @Transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What am I doing wrong? It doesn't seem to be that difficult to implement. Thanks. -Original Message- From: jWeekend [mailto:jweekend_for...@cabouge.com] Sent: Tuesday, October 06, 2009 9:48 AM To: users@wicket.apache.org Subject: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
(); //warp persist stuff install(PersistenceService.usingHibernate() .across(UnitOfWork.REQUEST) .transactedWith(TransactionStrategy.LOCAL) .buildModule()); // hibernate stuff // default values from development String connectionUrl = the url; String username = the username; String password = the password; try { InitialContext context = new InitialContext(); connectionUrl = (String) context.lookup(java:comp/env/hibernate.connection.url); username = (String) context.lookup(java:comp/env/hibernate.connection.username); password = (String) context.lookup(java:comp/env/hibernate.connection.password); } catch (NamingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // annotation and xml final Configuration config = new Configuration().configure(); config.setProperty(hibernate.connection.url, connectionUrl); config.setProperty(hibernate.connection.username, username); config.setProperty(hibernate.connection.password, password); config.setProperty(hibernate.current_session_context_class, managed); bind(Configuration.class).toInstance(config); //dao stuff // DO I NEED TO DO THIS FOR EVERY DAO OBJECT? bind(AccountDao.class).to(HibernateAccountDao.class); bind(CountryDao.class).to(HibernateCountryDao.class); bind(LanguageDao.class).to(HibernateLanguageDao.class); bind(TerritorySalesCodesDao.class).to(HibernateTerritorySalesCodesDao.class); bind(RegionSalesCodesDao.class).to(HibernateRegionSalesCodesDao.class); bind(CountrySalesCodesDao.class).to(HibernateCountrySalesCodesDao.class); bind(AccountTypeDao.class).to(HibernateAccountTypeDao.class); bind(AccountAuditDao.class).to(HibernateAccountAuditDao.class); } @Singleton public static class Initializer { @Inject Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. @Inject ProviderSession session; @Transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
(AccountAuditDao.class).to(HibernateAccountAuditDao.class); } @Singleton public static class Initializer { @Inject Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. �...@inject ProviderSession session; �...@transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What am I doing wrong? It doesn't seem to be that difficult to implement. Thanks. -Original Message- From: jWeekend [mailto:jweekend_for...@cabouge.com] Sent: Tuesday, October 06, 2009 9:48 AM To: users@wicket.apache.org Subject: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - http://richard-wilkinson.co.uk My blog: http://richard-wilkinson.co.uk -- View this message in context: http://www.nabble.com/Leg-Up-for-Wicket%2C-Spring%2C-Guice%2C-JPA%2C-Warp%2C-EclipseLink%2C-Hibernate-...-projects-tp25769134p25774618.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
).to(HibernateAccountDao.class); bind(CountryDao.class).to(HibernateCountryDao.class); bind(LanguageDao.class).to(HibernateLanguageDao.class); bind(TerritorySalesCodesDao.class).to(HibernateTerritorySalesCodesDao.class); bind(RegionSalesCodesDao.class).to(HibernateRegionSalesCodesDao.class); bind(CountrySalesCodesDao.class).to(HibernateCountrySalesCodesDao.class); bind(AccountTypeDao.class).to(HibernateAccountTypeDao.class); bind(AccountAuditDao.class).to(HibernateAccountAuditDao.class); } @Singleton public static class Initializer { @Inject Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. @Inject ProviderSession session; @Transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What am I doing wrong? It doesn't seem to be that difficult to implement. Thanks. -Original Message- From: jWeekend [mailto:jweekend_for...@cabouge.com] Sent: Tuesday, October 06, 2009 9:48 AM To: users@wicket.apache.org Subject: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
). However there are other ways to do it with guice, like the @ImplementedBy annotation (think its called that, check with the guice docs, sending this from my phone so can't check atm). Afaik you would need to make spring beans for every dao if using spring, so its not that bad. Glad you have it working now, Richard Jeffrey Schneller wrote: Here is the My Guice Module that I created. It looks like the one in the archetype. Do I need to bind every DAO? So that then I need to inject the DAO when it is needed? public class AppModule extends AbstractModule { /* (non-Javadoc) * @see com.google.inject.AbstractModule#configure() */ @Override protected void configure() { bind(Initializer.class).asEagerSingleton(); //warp persist stuff install(PersistenceService.usingHibernate() .across(UnitOfWork.REQUEST) .transactedWith(TransactionStrategy.LOCAL) .buildModule()); // hibernate stuff // default values from development String connectionUrl = the url; String username = the username; String password = the password; try { InitialContext context = new InitialContext(); connectionUrl = (String) context.lookup(java:comp/env/hibernate.connection.url); username = (String) context.lookup(java:comp/env/hibernate.connection.username); password = (String) context.lookup(java:comp/env/hibernate.connection.password); } catch (NamingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // annotation and xml final Configuration config = new Configuration().configure(); config.setProperty(hibernate.connection.url, connectionUrl); config.setProperty(hibernate.connection.username, username); config.setProperty(hibernate.connection.password, password); config.setProperty(hibernate.current_session_context_class, managed); bind(Configuration.class).toInstance(config); //dao stuff // DO I NEED TO DO THIS FOR EVERY DAO OBJECT? bind(AccountDao.class).to(HibernateAccountDao.class); bind(CountryDao.class).to(HibernateCountryDao.class); bind(LanguageDao.class).to(HibernateLanguageDao.class); bind(TerritorySalesCodesDao.class).to(HibernateTerritorySalesCodesDao.class); bind(RegionSalesCodesDao.class).to(HibernateRegionSalesCodesDao.class); bind(CountrySalesCodesDao.class).to(HibernateCountrySalesCodesDao.class); bind(AccountTypeDao.class).to(HibernateAccountTypeDao.class); bind(AccountAuditDao.class).to(HibernateAccountAuditDao.class); } @Singleton public static class Initializer { @Inject Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
] [INFO] : java.lang.NullPointerException null [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 2 seconds [INFO] Finished at: Thu Oct 08 13:30:48 CEST 2009 [INFO] Final Memory: 8M/14M [INFO] C:\projects\test 2009/10/6 richardwilko richardjohnwilkin...@gmail.com Hi, Yes, you will need to bind every dao (and eveything you want to inject). However there are other ways to do it with guice, like the @ImplementedBy annotation (think its called that, check with the guice docs, sending this from my phone so can't check atm). Afaik you would need to make spring beans for every dao if using spring, so its not that bad. Glad you have it working now, Richard Jeffrey Schneller wrote: Here is the My Guice Module that I created. It looks like the one in the archetype. Do I need to bind every DAO? So that then I need to inject the DAO when it is needed? public class AppModule extends AbstractModule { /* (non-Javadoc) * @see com.google.inject.AbstractModule#configure() */ @Override protected void configure() { bind(Initializer.class).asEagerSingleton(); //warp persist stuff install(PersistenceService.usingHibernate() .across(UnitOfWork.REQUEST) .transactedWith(TransactionStrategy.LOCAL) .buildModule()); // hibernate stuff // default values from development String connectionUrl = the url; String username = the username; String password = the password; try { InitialContext context = new InitialContext(); connectionUrl = (String) context.lookup(java:comp/env/hibernate.connection.url); username = (String) context.lookup(java:comp/env/hibernate.connection.username); password = (String) context.lookup(java:comp/env/hibernate.connection.password); } catch (NamingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // annotation and xml final Configuration config = new Configuration().configure(); config.setProperty(hibernate.connection.url, connectionUrl); config.setProperty(hibernate.connection.username, username); config.setProperty(hibernate.connection.password, password); config.setProperty(hibernate.current_session_context_class, managed); bind(Configuration.class).toInstance(config); //dao stuff // DO I NEED TO DO THIS FOR EVERY DAO OBJECT? bind(AccountDao.class).to(HibernateAccountDao.class); bind(CountryDao.class).to(HibernateCountryDao.class); bind(LanguageDao.class).to(HibernateLanguageDao.class); bind(TerritorySalesCodesDao.class).to(HibernateTerritorySalesCodesDao.class); bind(RegionSalesCodesDao.class).to(HibernateRegionSalesCodesDao.class); bind(CountrySalesCodesDao.class).to(HibernateCountrySalesCodesDao.class); bind(AccountTypeDao.class).to(HibernateAccountTypeDao.class); bind(AccountAuditDao.class).to(HibernateAccountAuditDao.class); } @Singleton public static class Initializer { @Inject Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon nection.java:1288) at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputD ata(LightweightHttpWagon.java:83) ... 24 more [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] : java.lang.NullPointerException null [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 2 seconds [INFO] Finished at: Thu Oct 08 13:30:48 CEST 2009 [INFO] Final Memory: 8M/14M [INFO] C:\projects\test 2009/10/6 richardwilko richardjohnwilkin...@gmail.com Hi, Yes, you will need to bind every dao (and eveything you want to inject). However there are other ways to do it with guice, like the @ImplementedBy annotation (think its called that, check with the guice docs, sending this from my phone so can't check atm). Afaik you would need to make spring beans for every dao if using spring, so its not that bad. Glad you have it working now, Richard Jeffrey Schneller wrote: Here is the My Guice Module that I created. It looks like the one in the archetype. Do I need to bind every DAO? So that then I need to inject the DAO when it is needed? public class AppModule extends AbstractModule { /* (non-Javadoc) * @see com.google.inject.AbstractModule#configure() */ @Override protected void configure() { bind(Initializer.class).asEagerSingleton(); //warp persist stuff install(PersistenceService.usingHibernate() .across(UnitOfWork.REQUEST) .transactedWith(TransactionStrategy.LOCAL) .buildModule()); // hibernate stuff // default values from development String connectionUrl = the url; String username = the username; String password = the password; try { InitialContext context = new InitialContext(); connectionUrl = (String) context.lookup(java:comp/env/hibernate.connection.url); username = (String) context.lookup(java:comp/env/hibernate.connection.username); password = (String) context.lookup(java:comp/env/hibernate.connection.password); } catch (NamingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // annotation and xml final Configuration config = new Configuration().configure(); config.setProperty(hibernate.connection.url, connectionUrl); config.setProperty(hibernate.connection.username, username); config.setProperty(hibernate.connection.password, password); config.setProperty(hibernate.current_session_context_class, managed); bind(Configuration.class).toInstance(config); //dao stuff // DO I NEED TO DO THIS FOR EVERY DAO OBJECT? bind(AccountDao.class).to(HibernateAccountDao.class); bind(CountryDao.class).to(HibernateCountryDao.class); bind(LanguageDao.class).to(HibernateLanguageDao.class); bind(TerritorySalesCodesDao.class).to(HibernateTerritorySalesCodesDao.class); bind(RegionSalesCodesDao.class).to(HibernateRegionSalesCodesDao.class); bind(CountrySalesCodesDao.class).to(HibernateCountrySalesCodesDao.class); bind(AccountTypeDao.class).to(HibernateAccountTypeDao.class); bind(AccountAuditDao.class).to(HibernateAccountAuditDao.class); } @Singleton public static class Initializer { @Inject Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. @Inject ProviderSession session; @Transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What am I doing wrong? It doesn't seem to be that difficult to implement. Thanks. -Original Message- From: jWeekend [mailto:jweekend_for...@cabouge.com] Sent: Tuesday, October 06, 2009 9:48 AM To: users@wicket.apache.org Subject: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - http://richard-wilkinson.co.uk My blog: http://richard-wilkinson.co.uk -- View this message in context: http://www.nabble.com/Leg-Up-for-Wicket%2C-Spring%2C-Guice%2C-JPA%2C-Warp%2C-EclipseLink%2C-Hibernate-...-projects-tp25769134p25774618.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - http://richard-wilkinson.co.uk My blog: http://richard-wilkinson.co.uk -- View this message
Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
On Tue, 2009-10-06 at 14:47 +0100, jWeekend wrote: http://jweekend.com/dev/LegUp is that really working? coz , when i clicked on Generate Maven Command button, it took me to http://jweekend.com/dev/HomePageBody - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Looks cool :) 2009/10/6 jWeekend jweekend_for...@cabouge.com We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Why dont you have a Guice 2.0 archetype? We could probably bump the warp persist guys to work on their 2.0 imp.. If thats whats stopping you? 2009/10/6 nino martinez wael nino.martinez.w...@gmail.com Looks cool :) 2009/10/6 jWeekend jweekend_for...@cabouge.com We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Works for me.. I took the guice warp persist + etc archetype.. 2009/10/6 Md. Jahid Shohel ja...@outscore.se On Tue, 2009-10-06 at 14:47 +0100, jWeekend wrote: http://jweekend.com/dev/LegUp is that really working? coz , when i clicked on Generate Maven Command button, it took me to http://jweekend.com/dev/HomePageBody - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Nice one Cemal! I will have to use leg up to get a leg over setting up Wicket projects ;-) Best, James. On Tue, Oct 6, 2009 at 2:47 PM, jWeekend jweekend_for...@cabouge.comwrote: We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Nino, We don't have a Guice 2.0 for that very reason; the warp persist guys don't have a final 2.0 release yet. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com nino martinez wael wrote: Why dont you have a Guice 2.0 archetype? We could probably bump the warp persist guys to work on their 2.0 imp.. If thats whats stopping you? 2009/10/6 nino martinez wael nino.martinez.w...@gmail.com Looks cool :) 2009/10/6 jWeekend jweekend_for...@cabouge.com We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - http://richard-wilkinson.co.uk My blog: http://richard-wilkinson.co.uk -- View this message in context: http://www.nabble.com/Leg-Up-for-Wicket%2C-Spring%2C-Guice%2C-JPA%2C-Warp%2C-EclipseLink%2C-Hibernate-...-projects-tp25769134p25769655.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Jahid, Thanks - a little Tomcat PERM_GEN issue. Should be OK now, but at the next scheduled restart we'll bump it up a bit. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com Jahid wrote: On Tue, 2009-10-06 at 14:47 +0100, jWeekend wrote: http://jweekend.com/dev/LegUp is that really working? coz , when i clicked on Generate Maven Command button, it took me to http://jweekend.com/dev/HomePageBody - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Leg-Up-for-Wicket%2C-Spring%2C-Guice%2C-JPA%2C-Warp%2C-EclipseLink%2C-Hibernate-...-projects-tp25769134p25769670.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
seems like its working now. really cool! On Tue, 2009-10-06 at 16:01 +0200, Md. Jahid Shohel wrote: On Tue, 2009-10-06 at 14:47 +0100, jWeekend wrote: http://jweekend.com/dev/LegUp is that really working? coz , when i clicked on Generate Maven Command button, it took me to http://jweekend.com/dev/HomePageBody - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Hey, that's great! Is there any way to contribute to this? Thumbs up, Erik 2009/10/6 jWeekend jweekend_for...@cabouge.com We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
You could always contribute to Wicket Iolite :) Which essentially are the same, or Wicketopia http://wicketopia.sourceforge.net/ http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Iolite 2009/10/6 Erik Post eriksen...@gmail.com Hey, that's great! Is there any way to contribute to this? Thumbs up, Erik 2009/10/6 jWeekend jweekend_for...@cabouge.com We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Hi, I'm a newbie in Wicket. I use Databinder toolkit (wicket+hibernate) to help me develop DB application rapidly. With the built-in Jetty, the development is quite smooth, however, when trying to run my app on Tomcat 5.5 (Java 5), I faced the following error. I wonder if wicket is really compatible with Tomcat, since there's no problem when run it from eclipse (Jetty). TD BGCOLOR=white CLASS=NavBarCell2FONT SIZE=-2 nbsp;A HREF=../../../../../../org/apache/wicket/markup/html/pages/BrowserInfoPage.html title=class in org.apache.wicket.markup.html.pagesBPREV CLASS/B/Anbsp; nbsp;A HREF=../../../../../../org/apache/wicket/markup/html/pages/InternalErrorPage.html title=class in org.apache.wicket.markup.html.pagesBNEXT CLASS/B/A/FONT/TD TD BGCOLOR=white CLASS=NavBarCell2FONT SIZE=-2 A HREF=../../../../../../index.html?org/apache/wicket/markup/html/pages/ExceptionErrorPage.html target=_topBFRAMES/B/A nbsp; nbsp;A HREF=ExceptionErrorPage.html target=_topBNO FRAMES/B/A nbsp; nbsp;SCRIPT type=text/javascript !-- if(window==top) { document.writeln('A HREF=../../../../../../allclasses-noframe.htmlBAll Classes/B/A'); } //-- /SCRIPT NOSCRIPT A HREF=../../../../../../allclasses-noframe.htmlBAll Classes/B/A /NOSCRIPT /FONT/TD /TR TR TD VALIGN=top CLASS=NavBarCell3FONT SIZE=-2 SUMMARY:nbsp;A HREF=#nested_classes_inherited_from_class_org.apache.wicket.PageNESTED/Anbsp;|nbsp;A HREF=#fields_inherited_from_class_org.apache.wicket.PageFIELD/Anbsp;|nbsp;A HREF=#constructor_summaryCONSTR/Anbsp;|nbsp;A HREF=#method_summaryMETHOD/A/FONT/TD TD VALIGN=top CLASS=NavBarCell3FONT SIZE=-2 DETAIL:nbsp;FIELDnbsp;|nbsp;A HREF=#constructor_detailCONSTR/Anbsp;|nbsp;A HREF=#method_detailMETHOD/A/FONT/TD /TR /TABLE A NAME=skip-navbar_bottom/A !-- END OF BOTTOM NAVBAR === -- HR Copyright #169; 2004-2008 a href=http://apache.org;Apache Software Foundation/a. All Rights Reserved. /BODY /HTML , index = 4, current = [Raw markup]] at org.apache.wicket.markup.MarkupParser.parseMarkup(MarkupParser.java:393) at org.apache.wicket.markup.MarkupParser.parse(MarkupParser.java:270) at org.apache.wicket.markup.loader.SimpleMarkupLoader.loadMarkup(SimpleMarkupLoader.java:52) at org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:62) at org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:55) at org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:458) at org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:553) at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:319) at org.apache.wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:215) at org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:343) at org.apache.wicket.Page.onRender(Page.java:1463) at org.apache.wicket.Component.render(Component.java:2317) at org.apache.wicket.Page.renderPage(Page.java:904) at org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:63) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104) at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1190) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1257) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1353) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:355) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:200) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595) Caused by: java.text.ParseException: Tag 'DT' (line 101, column
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Caused by: java.text.ParseException: Tag 'DT' (line 101, column 1) has a mismatched close tag at '/DL' (line 102, column 1) is the issue, your html are broken.. Regarding tomcat compability, I've deployed over dozens of apps the last 4-5 years or so on Tomcat 5.5 .. 2009/10/6 Gw not4spamm...@gmail.com Hi, I'm a newbie in Wicket. I use Databinder toolkit (wicket+hibernate) to help me develop DB application rapidly. With the built-in Jetty, the development is quite smooth, however, when trying to run my app on Tomcat 5.5 (Java 5), I faced the following error. I wonder if wicket is really compatible with Tomcat, since there's no problem when run it from eclipse (Jetty). TD BGCOLOR=white CLASS=NavBarCell2FONT SIZE=-2 nbsp;A HREF=../../../../../../org/apache/wicket/markup/html/pages/BrowserInfoPage.html title=class in org.apache.wicket.markup.html.pagesBPREV CLASS/B/Anbsp; nbsp;A HREF=../../../../../../org/apache/wicket/markup/html/pages/InternalErrorPage.html title=class in org.apache.wicket.markup.html.pagesBNEXT CLASS/B/A/FONT/TD TD BGCOLOR=white CLASS=NavBarCell2FONT SIZE=-2 A HREF=../../../../../../index.html?org/apache/wicket/markup/html/pages/ExceptionErrorPage.html target=_topBFRAMES/B/A nbsp; nbsp;A HREF=ExceptionErrorPage.html target=_topBNO FRAMES/B/A nbsp; nbsp;SCRIPT type=text/javascript !-- if(window==top) { document.writeln('A HREF=../../../../../../allclasses-noframe.htmlBAll Classes/B/A'); } //-- /SCRIPT NOSCRIPT A HREF=../../../../../../allclasses-noframe.htmlBAll Classes/B/A /NOSCRIPT /FONT/TD /TR TR TD VALIGN=top CLASS=NavBarCell3FONT SIZE=-2 SUMMARY:nbsp;A HREF=#nested_classes_inherited_from_class_org.apache.wicket.PageNESTED/Anbsp;|nbsp;A HREF=#fields_inherited_from_class_org.apache.wicket.PageFIELD/Anbsp;|nbsp;A HREF=#constructor_summaryCONSTR/Anbsp;|nbsp;A HREF=#method_summaryMETHOD/A/FONT/TD TD VALIGN=top CLASS=NavBarCell3FONT SIZE=-2 DETAIL:nbsp;FIELDnbsp;|nbsp;A HREF=#constructor_detailCONSTR/Anbsp;|nbsp;A HREF=#method_detailMETHOD/A/FONT/TD /TR /TABLE A NAME=skip-navbar_bottom/A !-- END OF BOTTOM NAVBAR === -- HR Copyright #169; 2004-2008 a href=http://apache.org;Apache Software Foundation/a. All Rights Reserved. /BODY /HTML , index = 4, current = [Raw markup]] at org.apache.wicket.markup.MarkupParser.parseMarkup(MarkupParser.java:393) at org.apache.wicket.markup.MarkupParser.parse(MarkupParser.java:270) at org.apache.wicket.markup.loader.SimpleMarkupLoader.loadMarkup(SimpleMarkupLoader.java:52) at org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:62) at org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:55) at org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:458) at org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:553) at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:319) at org.apache.wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:215) at org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:343) at org.apache.wicket.Page.onRender(Page.java:1463) at org.apache.wicket.Component.render(Component.java:2317) at org.apache.wicket.Page.renderPage(Page.java:904) at org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:63) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104) at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1190) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1257) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1353) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:355) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:200) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Erik, Thanks. We'll review that soon - it is our intention but we need to be ready to take care of the project. Just for the moment, we'll take on ideas for new archetypes, and feel free to contact me via our site if you have some particular ideas and need stuff included quickly. Ideas for further project templates include Scala and Java and maybe WiQuery and possibly Lucene... Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com Erik Post-5 wrote: Hey, that's great! Is there any way to contribute to this? Thumbs up, Erik 2009/10/6 jWeekend jweekend_for...@cabouge.com We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Leg-Up-for-Wicket%2C-Spring%2C-Guice%2C-JPA%2C-Warp%2C-EclipseLink%2C-Hibernate-...-projects-tp25769134p25770548.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Hi Cemal, On Tue, Oct 6, 2009 at 5:05 PM, jWeekend jweekend_for...@cabouge.com wrote: Thanks. We'll review that soon - it is our intention but we need to be ready to take care of the project. Just for the moment, we'll take on ideas for new archetypes, and feel free to contact me via our site if you have some particular ideas and need stuff included quickly. Great! I would like to suggest an EJB archetype. EJB seems to be fairly impopular amongst Wicket people, but what with the upcoming changes to EJB (version 3.1, no XML, a Lite' web profile) and Spring (3.0, proprietaryish goings-on) I think EJB's are looking comparatively sweet. By the way, it would be pretty cool to reference your page from the Wicket quickstart page, wouldn't it? Things are pretty scattered atm and I think this makes Wicket needlessly hard to get into. Ideas for further project templates include Scala and Java I'm experimenting with this atm from an adapted version of Wicketopia, and yeah, it would have been great to have had an archetype for this ;) Cheers, Erik Erik Post-5 wrote: Hey, that's great! Is there any way to contribute to this? Thumbs up, Erik 2009/10/6 jWeekend jweekend_for...@cabouge.com We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Leg-Up-for-Wicket%2C-Spring%2C-Guice%2C-JPA%2C-Warp%2C-EclipseLink%2C-Hibernate-...-projects-tp25769134p25770548.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Erik, No such prejudice here: a Wicket with EJB 3+ archetype is a very good idea and I was already planning on us setting up an archetype for JBoss and wicket-javaee [1] (that contrib library just works by the way - we've used it with no problems so far on a couple of projects, one with JBoss - and IIRC RedHat finally did publish a decent Maven2 repo). I have nothing against a link from the Wicket QuickStart page either, but we are not necessarily promising instantaneous support for users of these archetypes - the idea is just to provide a well-proven starting point for people wanting to skip the sometimes huge (and often off-putting) effort to work out how all these frameworks/libraries and the multitude of version play nicely together (not to mention figuring out all the transitive dependencies and how to best write tests and other, boiler-plate bootstraping code). By the way, we use these archetypes ourselves too, and they do save us plenty of time - it's one less (often non-trivial) thing to worry about when you start your project or just want to experiment with/learn how to use one of these frameworks/libraries. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-javaee Erik Post-5 wrote: Hi Cemal, On Tue, Oct 6, 2009 at 5:05 PM, jWeekend jweekend_for...@cabouge.com wrote: Thanks. We'll review that soon - it is our intention but we need to be ready to take care of the project. Just for the moment, we'll take on ideas for new archetypes, and feel free to contact me via our site if you have some particular ideas and need stuff included quickly. Great! I would like to suggest an EJB archetype. EJB seems to be fairly impopular amongst Wicket people, but what with the upcoming changes to EJB (version 3.1, no XML, a Lite' web profile) and Spring (3.0, proprietaryish goings-on) I think EJB's are looking comparatively sweet. By the way, it would be pretty cool to reference your page from the Wicket quickstart page, wouldn't it? Things are pretty scattered atm and I think this makes Wicket needlessly hard to get into. Ideas for further project templates include Scala and Java I'm experimenting with this atm from an adapted version of Wicketopia, and yeah, it would have been great to have had an archetype for this ;) Cheers, Erik Erik Post-5 wrote: Hey, that's great! Is there any way to contribute to this? Thumbs up, Erik 2009/10/6 jWeekend jweekend_for...@cabouge.com We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Leg-Up-for-Wicket%2C-Spring%2C-Guice%2C-JPA%2C-Warp%2C-EclipseLink%2C-Hibernate-...-projects-tp25769134p25770548.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Leg-Up-for-Wicket%2C-Spring%2C-Guice%2C-JPA%2C-Warp%2C-EclipseLink%2C-Hibernate-...-projects-tp25769134p25773473.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. @Inject ProviderSession session; @Transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What am I doing wrong? It doesn't seem to be that difficult to implement. Thanks. -Original Message- From: jWeekend [mailto:jweekend_for...@cabouge.com] Sent: Tuesday, October 06, 2009 9:48 AM To: users@wicket.apache.org Subject: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. �...@inject ProviderSession session; �...@transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What am I doing wrong? It doesn't seem to be that difficult to implement. Thanks. -Original Message- From: jWeekend [mailto:jweekend_for...@cabouge.com] Sent: Tuesday, October 06, 2009 9:48 AM To: users@wicket.apache.org Subject: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. �...@inject ProviderSession session; �...@transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What am I doing wrong? It doesn't seem to be that difficult to implement. Thanks. -Original Message- From: jWeekend [mailto:jweekend_for...@cabouge.com] Sent: Tuesday, October 06, 2009 9:48 AM To: users@wicket.apache.org Subject: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Thanks for the help. I finally figured it out. I didn't realize that I needed to inject the DAO into each page that was going to need it. Or at least that is how I solved my problem. If I inject the DAO into every page then it seems to work ok. I guess I will see what happens if I have a business layer and the DAO is used in that layer. But at least I can query the db again. -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Tuesday, October 06, 2009 2:21 PM To: users@wicket.apache.org; e...@shinsetsu.nl Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. �...@inject ProviderSession session; �...@transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What am I doing wrong? It doesn't seem to be that difficult to implement. Thanks. -Original Message- From: jWeekend [mailto:jweekend_for...@cabouge.com] Sent: Tuesday, October 06, 2009 9:48 AM To: users@wicket.apache.org Subject: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. �...@inject ProviderSession session; �...@transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list(); } The session in the findAll method is always coming back as null. What am I doing wrong? It doesn't seem to be that difficult to implement. Thanks. -Original Message- From: jWeekend [mailto:jweekend_for...@cabouge.com] Sent: Tuesday, October 06, 2009 9:48 AM To: users@wicket.apache.org Subject: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects We have launched jWeekend's Leg Up page [1]. You can generate a command and run it at your console to create a simple project using one of our archetypes. The projects you will generate will include enough configuration, code and/or some tests to get you started, quickly. Our archetypes currently support various combinations of Spring, Guice, WarpPersist, JPA (with one or more implementation from EclipseLink, Hibernate, OpenJPA) and Wicket. Let us know if this is useful and if you'd like to see more combinations. Also feel free to raise any issues [2]. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/issues/list - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - http://richard-wilkinson.co.uk My blog: http://richard-wilkinson.co.uk -- View this message in context: http://www.nabble.com/Leg-Up-for-Wicket%2C-Spring%2C-Guice%2C-JPA%2C-Warp%2C-EclipseLink%2C-Hibernate-...-projects-tp25769134p25774618.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Here is the My Guice Module that I created. It looks like the one in the archetype. Do I need to bind every DAO? So that then I need to inject the DAO when it is needed? public class AppModule extends AbstractModule { /* (non-Javadoc) * @see com.google.inject.AbstractModule#configure() */ @Override protected void configure() { bind(Initializer.class).asEagerSingleton(); //warp persist stuff install(PersistenceService.usingHibernate() .across(UnitOfWork.REQUEST) .transactedWith(TransactionStrategy.LOCAL) .buildModule()); // hibernate stuff // default values from development String connectionUrl = the url; String username = the username; String password = the password; try { InitialContext context = new InitialContext(); connectionUrl = (String) context.lookup(java:comp/env/hibernate.connection.url); username = (String) context.lookup(java:comp/env/hibernate.connection.username); password = (String) context.lookup(java:comp/env/hibernate.connection.password); } catch (NamingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // annotation and xml final Configuration config = new Configuration().configure(); config.setProperty(hibernate.connection.url, connectionUrl); config.setProperty(hibernate.connection.username, username); config.setProperty(hibernate.connection.password, password); config.setProperty(hibernate.current_session_context_class, managed); bind(Configuration.class).toInstance(config); //dao stuff // DO I NEED TO DO THIS FOR EVERY DAO OBJECT? bind(AccountDao.class).to(HibernateAccountDao.class); bind(CountryDao.class).to(HibernateCountryDao.class); bind(LanguageDao.class).to(HibernateLanguageDao.class); bind(TerritorySalesCodesDao.class).to(HibernateTerritorySalesCodesDao.class); bind(RegionSalesCodesDao.class).to(HibernateRegionSalesCodesDao.class); bind(CountrySalesCodesDao.class).to(HibernateCountrySalesCodesDao.class); bind(AccountTypeDao.class).to(HibernateAccountTypeDao.class); bind(AccountAuditDao.class).to(HibernateAccountAuditDao.class); } @Singleton public static class Initializer { @Inject Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still not able to inject the Hibernate Session into my DAO objects. Any ideas? I don't see any exceptions being thrown. �...@inject ProviderSession session; �...@transactional(type=TransactionType.READ_ONLY) public ListT findAll() { Criteria criteria = session.get().createCriteria(persistentClass); return criteria.list
RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects
Hi, Yes, you will need to bind every dao (and eveything you want to inject). However there are other ways to do it with guice, like the @ImplementedBy annotation (think its called that, check with the guice docs, sending this from my phone so can't check atm). Afaik you would need to make spring beans for every dao if using spring, so its not that bad. Glad you have it working now, Richard Jeffrey Schneller wrote: Here is the My Guice Module that I created. It looks like the one in the archetype. Do I need to bind every DAO? So that then I need to inject the DAO when it is needed? public class AppModule extends AbstractModule { /* (non-Javadoc) * @see com.google.inject.AbstractModule#configure() */ @Override protected void configure() { bind(Initializer.class).asEagerSingleton(); //warp persist stuff install(PersistenceService.usingHibernate() .across(UnitOfWork.REQUEST) .transactedWith(TransactionStrategy.LOCAL) .buildModule()); // hibernate stuff // default values from development String connectionUrl = the url; String username = the username; String password = the password; try { InitialContext context = new InitialContext(); connectionUrl = (String) context.lookup(java:comp/env/hibernate.connection.url); username = (String) context.lookup(java:comp/env/hibernate.connection.username); password = (String) context.lookup(java:comp/env/hibernate.connection.password); } catch (NamingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // annotation and xml final Configuration config = new Configuration().configure(); config.setProperty(hibernate.connection.url, connectionUrl); config.setProperty(hibernate.connection.username, username); config.setProperty(hibernate.connection.password, password); config.setProperty(hibernate.current_session_context_class, managed); bind(Configuration.class).toInstance(config); //dao stuff // DO I NEED TO DO THIS FOR EVERY DAO OBJECT? bind(AccountDao.class).to(HibernateAccountDao.class); bind(CountryDao.class).to(HibernateCountryDao.class); bind(LanguageDao.class).to(HibernateLanguageDao.class); bind(TerritorySalesCodesDao.class).to(HibernateTerritorySalesCodesDao.class); bind(RegionSalesCodesDao.class).to(HibernateRegionSalesCodesDao.class); bind(CountrySalesCodesDao.class).to(HibernateCountrySalesCodesDao.class); bind(AccountTypeDao.class).to(HibernateAccountTypeDao.class); bind(AccountAuditDao.class).to(HibernateAccountAuditDao.class); } @Singleton public static class Initializer { @Inject Initializer(com.wideplay.warp.persist.PersistenceService service) { service.start(); } } } -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Tuesday, October 06, 2009 2:56 PM To: users@wicket.apache.org Subject: RE: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Jeffrey, I expect the changes you made to the Guice Module are the reason why the session is null, could you paste in the contents of it. Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: Thanks for the idea but this didn't work either. Any other ideas? I would expect the archetype to work correctly. -Original Message- From: Erik Post [mailto:eriksen...@gmail.com] Sent: Tuesday, October 06, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: Leg Up for Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate ... projects Hi Jeffrey, I have *absolutely* no idea if this will help you, but I had the same with Spring. It started working when i put the injection annotation on the method instead of on the variable. Good luck, Erik On Tue, Oct 6, 2009 at 7:59 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I took the archetype for Guice, Warp, Hibernate and modified for my application. All my code looks similar to the code from the archetype. The only difference is I am not using the AnnotatinConfiguration but just the plain Configuration. I am also using c3po connection pooling with Oracle. However, I am still