Hello all,

I'm in the process of writing tests for AppFuse's Tapestry 5 integration and
I've run into an interesting issue. When I use Hibernate or JPA as backends,
my tests pass just fine. However, when I use iBATIS, they take forever and I
get an OOM error and the following shows up in my logs:

Construction of service 'InternalRequestGlobals' has failed due to
recursion: the service depends on itself in some way. Please check
org.apache.tapestry5.internal.services.InternalRequestGlobalsImpl() (at
InternalRequestGlobalsImpl.java:22) via
org.apache.tapestry5.internal.services.InternalModule.bind(ServiceBinder)
(at InternalModule.java:65) for references to another service that is itself
dependent on service 'InternalRequestGlobals'.

Looking at the dependencies differences, my first guess is AspectJ is
causing this, but I'm not sure.

[INFO] +- org.appfuse:appfuse-ibatis:jar:2.1-SNAPSHOT:compile
[INFO] |  +- org.appfuse:appfuse-data-common:jar:2.1-SNAPSHOT:compile
[INFO] |  |  +- javax.persistence:persistence-api:jar:1.0:compile
[INFO] |  |  +- javax.xml.bind:jaxb-api:jar:2.2:compile
[INFO] |  |  |  \- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |  |  \- org.compass-project:compass:jar:2.1.3:compile
[INFO] |  |     \- org.apache.lucene:lucene-core:jar:2.4.1:compile
[INFO] |  +- org.apache.ibatis:ibatis-sqlmap:jar:2.3.4.726:compile
[INFO] |  +- org.aspectj:aspectjweaver:jar:1.6.6:compile
[INFO] |  +- org.aspectj:aspectjrt:jar:1.6.6:compile
[INFO] |  +- org.springframework:spring-aspects:jar:2.5.6:compile
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.8.1:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:2.5.6:compile
[INFO] |  |  \- org.springframework:spring-tx:jar:2.5.6:compile
[INFO] |  \- org.springframework:spring-orm:jar:2.5.6:compile


[INFO] +- org.appfuse:appfuse-hibernate:jar:2.1-SNAPSHOT:compile
[INFO] |  +- org.appfuse:appfuse-data-common:jar:2.1-SNAPSHOT:compile
[INFO] |  |  +- javax.persistence:persistence-api:jar:1.0:compile
[INFO] |  |  +- javax.xml.bind:jaxb-api:jar:2.2:compile
[INFO] |  |  |  \- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |  |  \- org.compass-project:compass:jar:2.1.3:compile
[INFO] |  |     \- org.apache.lucene:lucene-core:jar:2.4.1:compile
[INFO] |  +- org.hibernate:hibernate-annotations:jar:3.4.0.GA:compile
[INFO] |  |  +-
org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA:compile
[INFO] |  |  +- org.slf4j:slf4j-api:jar:1.4.2:compile
[INFO] |  |  \- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:3.3.1.GA:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.6:compile
[INFO] |  |  \- javax.transaction:jta:jar:1.1:compile
[INFO] |  +- javassist:javassist:jar:3.4.GA:compile
[INFO] |  +- org.slf4j:slf4j-log4j12:jar:1.5.2:compile
[INFO] |  +- org.hibernate:hibernate-ehcache:jar:3.3.1.GA:compile
[INFO] |  +- net.sf.ehcache:ehcache-core:jar:1.7.0:compile
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.8.1:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:2.5.6:compile
[INFO] |  |  \- org.springframework:spring-tx:jar:2.5.6:compile
[INFO] |  \- org.springframework:spring-orm:jar:2.5.6:compile

I also suspect it might be coming from my SpringObjectProvider (used for
testing).

http://source.appfuse.org/browse/~raw,r=trunk/appfuse/trunk/web/tapestry/src/test/java/org/appfuse/webapp/services/SpringObjectProvider.java

This is added by an IntegrationTestModule:

public class IntegrationTestModule {

    // contribution master object provider
    public static void contributeMasterObjectProvider(
            OrderedConfiguration<ObjectProvider> configuration,
            ObjectLocator locator) {
        configuration.add("spring", locator
                .autobuild(SpringObjectProvider.class));
    }
}

And wired into PageTester as follows:

String appPackage = "com.mycompany.webapp";
String appName = "app";
tester = new PageTester(appPackage, appName, "src/main/webapp",
IntegrationTestModule.class);

Any help is appreciated.

Thanks,

Matt
-- 
View this message in context: 
http://old.nabble.com/Construction-of-service-%27InternalRequestGlobals%27-has-failed-due-to-recursion%3A-tp26291936p26291936.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to