That's not my understanding of how the tapestry registry works. Spring ioc
works like this but tapestry should bind the service to the interface
supplied by your module.
 On 10 Sep 2014 07:48, "Chris Poulsen" <mailingl...@nesluop.dk> wrote:

> Hi,
>
> Isn't this a matter of indicating which session you want injected? ( I
> guess both sessions match "Session" ), there are some mechanisms for that
> described here: http://tapestry.apache.org/injection-faq.html
>
> --
> Chris
>
> On Wed, Sep 10, 2014 at 8:35 AM, Lance Java <lance.j...@googlemail.com>
> wrote:
>
> > Hmm, very strange. Are you calling registry.shutdown() ever?
> >
> > Is this perhaps an issue with registry.cleanupThread()?
> >
> > How many @Test annotations in the class? Does the first @Test work and
> the
> > second fail?
> >
> > Just grasping at straws here!
> > On 10 Sep 2014 02:05, "George Christman" <gchrist...@cardaddy.com>
> wrote:
> >
> > > Hi lance, I'm just using constructor injection. I have a DAO that uses
> > >
> > > public class GenericDAO {
> > >     private final Session session;
> > >
> > >     public GenericDAOImpl(Session session) {
> > >         this.session = session;
> > >     }
> > >
> > > }
> > >
> > > in my Module I have
> > >
> > > @Scope(ScopeConstants.
> > > PERTHREAD)
> > >     public static FullTextSession
> > > buildFullTextSession(HibernateSessionManager sessionManager) {
> > >         return Search.getFullTextSession(sessionManager.getSession());
> > >     }
> > >
> > > In my test class
> > >
> > > private Registry registry;
> > >     private GenericDAO genericDAO;
> > >     private EmailService emailService;
> > >
> > >     @BeforeClass
> > >     protected void before() {
> > >         registry = buildRegistry(AppModuleTest.
> > > class, HibernateCoreModule.class);
> > >         emailService = registry.getService(EmailService.class);
> > >         genericDAO = registry.getService(GenericDAO.class);
> > >         buildData();
> > >     }
> > >
> > > @Test
> > > public void SomeTest() {
> > >      genericDAO.get(...)
> > > }
> > >
> > > When I run the test I get that exception.
> > >
> > > If I remove FullTextSession from the module or the genericDAO, problem
> > goes
> > > away. The strange part is this is not an issue with the rest of the
> app,
> > > only the test.
> > >
> > >
> > > On Tue, Sep 9, 2014 at 2:31 PM, Lance Java <lance.j...@googlemail.com>
> > > wrote:
> > >
> > > > From my understanding of the tapestry registry, these are two
> distinct
> > > > services (even though one extends the other).
> > > >
> > > > Where is this exception occurring? Are you using tapestry's @Inject
> > > > annotation? Is spring ioc in the mix somewhere?
> > > >
> > >
> > >
> > >
> > > --
> > > George Christman
> > > www.CarDaddy.com
> > > P.O. Box 735
> > > Johnstown, New York
> > >
> >
>

Reply via email to