Hi guys, I'm getting the following exception while trying to run my test.

[VerboseTestNG] org.apache.tapestry5.ioc.internal.OperationException:
Service interface org.hibernate.Session is matched by 2 services:
FullTextSession, Session.  Automatic dependency resolution requires that
exactly one service implement the interface.

I'm not sure if it's related to the following issue found back in 5.0

https://issues.apache.org/jira/browse/TAPESTRY-2615

Does anybody know how to fix this?

AppModuleTest

public static void
contributeApplicationDefaults(MappedConfiguration<String, Object>
configuration, Logger logger) throws IOException {
        configuration.add(SymbolConstants.PRODUCTION_MODE, "false");

    }

    public static void
contributeHibernateSessionSource(OrderedConfiguration<HibernateConfigurer>
configuration) {
        configuration.add("trecstest1", new TestHibernateConfigurer());
    }

    public static void
contributeHibernateEntityPackageManager(org.apache.tapestry5.ioc.Configuration<String>
config) {
        config.add("org.domain.etss.entities");
    }

    @Scope(ScopeConstants.PERTHREAD)
    public static FullTextSession
buildFullTextSession(HibernateSessionManager sessionManager) {
        return Search.getFullTextSession(sessionManager.getSession());
    }

    public static void
contributeApplicationDefaults(MappedConfiguration<String, Object> config) {
        config.add(HibernateSymbols.DEFAULT_CONFIGURATION, false);
    }

    @Match("*DAO")
    public static void adviseTransactions(HibernateTransactionAdvisor
advisor, MethodAdviceReceiver receiver) {
        advisor.addTransactionCommitAdvice(receiver);
    }


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();
    }

-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Reply via email to