Skullabs / kikaha

A fast middleware designed for microservices
https://skullabs.github.io/kikaha/
Apache License 2.0
59 stars 13 forks source link

Dependency Injection's life cycle are StackOverflow prone #106

Closed miere closed 9 years ago

miere commented 9 years ago

Developers aren't able to predict when an injection cycle may occur. Until today, there is only one situation mapped that it is likely to create a StackOverflow: a Hazelcast's MapStore that requires a persistence API produced by the @javax.inject.Produces annotation.

miere commented 9 years ago

Attaching a StackTrace to help on bug identification.

[main] WARN kikaha.core.security.DefaultSecurityContextFactory - The DefaultSecurityContextFactory isn't designed for production proposes. Please consider using the HazelcastSecurityContextFactory.
[main] INFO kikaha.core.impl.HttpHandlerDeploymentHook - Looking for HttpHandler routes...
[main] INFO com.hazelcast.config.XmlConfigLocator - Loading configuration tests-resources/conf/hazelcast-test.xml from System property 'hazelcast.config'
[main] INFO com.hazelcast.config.XmlConfigLocator - Using configuration file at /home/miere/Development/Sizebay/sizebay-recommendation/abacus-db/tests-resources/conf/hazelcast-test.xml

[main] ERROR kikaha.core.impl.HttpHandlerDeploymentHook - trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: java.lang.StackOverflowError
trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: java.lang.StackOverflowError
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:171)
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:162)
    at trip.spi.DefaultServiceProvider.loadServiceFor(DefaultServiceProvider.java:122)
    at trip.spi.DefaultServiceProvider.loadAllServicesImplementingTheInterface(DefaultServiceProvider.java:109)
    at trip.spi.DefaultServiceProvider.loadAll(DefaultServiceProvider.java:102)
    at kikaha.core.impl.HttpHandlerDeploymentHook.deployAllHttpHandlers(HttpHandlerDeploymentHook.java:30)
    at kikaha.core.impl.HttpHandlerDeploymentHook.onDeploy(HttpHandlerDeploymentHook.java:23)
    at kikaha.core.UndertowServer.runDeploymentHooks(UndertowServer.java:111)
    at kikaha.core.UndertowServer.bootstrap(UndertowServer.java:93)
    at kikaha.core.UndertowServer.start(UndertowServer.java:71)
    at kikaha.core.Main.start(Main.java:19)
    at kikaha.core.Main.main(Main.java:38)
    at sizebay.abacus.db.cached.AccountStoreIntegrationTest.ensureSomething(AccountStoreIntegrationTest.java:17)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: java.lang.StackOverflowError
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:171)
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:162)
    at trip.spi.DefaultServiceProvider.loadServiceFor(DefaultServiceProvider.java:122)
    at trip.spi.DefaultServiceProvider.loadAllServicesImplementingTheInterface(DefaultServiceProvider.java:109)
    at trip.spi.DefaultServiceProvider.loadAll(DefaultServiceProvider.java:102)
    at trip.spi.DefaultServiceProvider.loadAll(DefaultServiceProvider.java:92)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:87)
    at trip.spi.helpers.SingleElementProvidableField.provide(SingleElementProvidableField.java:31)
    at trip.spi.helpers.ProvidableClass.provide(ProvidableClass.java:30)
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:169)
    ... 36 more
Caused by: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: java.lang.StackOverflowError
    at kikaha.hazelcast.IMapAutoGeneratedProvider3032794222.provide(IMapAutoGeneratedProvider3032794222.java:13)
    at kikaha.hazelcast.IMapAutoGeneratedProvider3032794222.provide(IMapAutoGeneratedProvider3032794222.java:3)
    at trip.spi.DefaultServiceProvider.produceFromFactory(DefaultServiceProvider.java:179)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:84)
    at trip.spi.helpers.SingleElementProvidableField.provide(SingleElementProvidableField.java:31)
    at trip.spi.helpers.ProvidableClass.provide(ProvidableClass.java:30)
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:169)
    ... 45 more
Caused by: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: java.lang.StackOverflowError
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:171)
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:162)
    at trip.spi.DefaultServiceProvider.loadServiceFor(DefaultServiceProvider.java:122)
    at trip.spi.DefaultServiceProvider.loadAllServicesImplementingTheInterface(DefaultServiceProvider.java:109)
    at trip.spi.DefaultServiceProvider.loadAll(DefaultServiceProvider.java:102)
    at trip.spi.DefaultServiceProvider.loadAll(DefaultServiceProvider.java:92)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:87)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:73)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:68)
    at kikaha.hazelcast.IMapAutoGeneratedProvider3032794222.provide(IMapAutoGeneratedProvider3032794222.java:10)
    ... 51 more
Caused by: trip.spi.ServiceProviderException: java.lang.StackOverflowError
    at kikaha.hazelcast.config.HazelcastInstanceAutoGeneratedProvider468419103.provide(HazelcastInstanceAutoGeneratedProvider468419103.java:13)
    at kikaha.hazelcast.config.HazelcastInstanceAutoGeneratedProvider468419103.provide(HazelcastInstanceAutoGeneratedProvider468419103.java:3)
    at trip.spi.DefaultServiceProvider.produceFromFactory(DefaultServiceProvider.java:179)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:84)
    at trip.spi.helpers.SingleElementProvidableField.provide(SingleElementProvidableField.java:31)
    at trip.spi.helpers.ProvidableClass.provide(ProvidableClass.java:30)
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:169)
    ... 60 more
Caused by: java.lang.IllegalStateException: trip.spi.ServiceProviderException: java.lang.StackOverflowError
    at kikaha.hazelcast.config.HazelcastInstanceProducer.createHazelcastInstance(HazelcastInstanceProducer.java:80)
    at kikaha.hazelcast.config.HazelcastInstanceProducer.getInstance(HazelcastInstanceProducer.java:24)
    at kikaha.hazelcast.config.HazelcastInstanceProducer.produceHazelcastInstance(HazelcastInstanceProducer.java:54)
    at kikaha.hazelcast.config.HazelcastInstanceAutoGeneratedProvider468419103.provide(HazelcastInstanceAutoGeneratedProvider468419103.java:11)
    ... 66 more
Caused by: trip.spi.ServiceProviderException: java.lang.StackOverflowError
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:171)
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:162)
    at trip.spi.DefaultServiceProvider.loadServiceFor(DefaultServiceProvider.java:127)
    at trip.spi.DefaultServiceProvider.loadAllServicesImplementingTheInterface(DefaultServiceProvider.java:109)
    at trip.spi.DefaultServiceProvider.loadAll(DefaultServiceProvider.java:102)
    at trip.spi.DefaultServiceProvider.loadAll(DefaultServiceProvider.java:92)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:87)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:73)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:68)
    at kikaha.hazelcast.config.MapStoreConfigurationListener.setImplementation(MapStoreConfigurationListener.java:69)
    at kikaha.hazelcast.config.MapStoreConfigurationListener.handleStore(MapStoreConfigurationListener.java:58)
    at kikaha.hazelcast.config.MapStoreConfigurationListener.configCreated(MapStoreConfigurationListener.java:28)
    at kikaha.hazelcast.config.HazelcastInstanceProducer.notifyConfigListeners(HazelcastInstanceProducer.java:120)
    at kikaha.hazelcast.config.HazelcastInstanceProducer.loadConfig(HazelcastInstanceProducer.java:107)
    at kikaha.hazelcast.config.HazelcastInstanceProducer.createHazelcastInstance(HazelcastInstanceProducer.java:75)
    ... 69 more
Caused by: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: java.lang.StackOverflowError
    at kikaha.hazelcast.IdGeneratorAutoGeneratedProvider228579692.provide(IdGeneratorAutoGeneratedProvider228579692.java:13)
    at kikaha.hazelcast.IdGeneratorAutoGeneratedProvider228579692.provide(IdGeneratorAutoGeneratedProvider228579692.java:3)
    at trip.spi.DefaultServiceProvider.produceFromFactory(DefaultServiceProvider.java:179)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:84)
    at trip.spi.helpers.SingleElementProvidableField.provide(SingleElementProvidableField.java:31)
    at trip.spi.helpers.ProvidableClass.provide(ProvidableClass.java:30)
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:169)
    ... 83 more
Caused by: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: java.lang.StackOverflowError
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:171)
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:162)
    at trip.spi.DefaultServiceProvider.loadServiceFor(DefaultServiceProvider.java:122)
    at trip.spi.DefaultServiceProvider.loadAllServicesImplementingTheInterface(DefaultServiceProvider.java:109)
    at trip.spi.DefaultServiceProvider.loadAll(DefaultServiceProvider.java:102)
    at trip.spi.DefaultServiceProvider.loadAll(DefaultServiceProvider.java:92)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:87)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:73)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:68)
    at kikaha.hazelcast.IdGeneratorAutoGeneratedProvider228579692.provide(IdGeneratorAutoGeneratedProvider228579692.java:10)
    ... 89 more
Caused by: 
    at kikaha.hazelcast.config.HazelcastInstanceAutoGeneratedProvider468419103.provide(HazelcastInstanceAutoGeneratedProvider468419103.java:13)
    at kikaha.hazelcast.config.HazelcastInstanceAutoGeneratedProvider468419103.provide(HazelcastInstanceAutoGeneratedProvider468419103.java:3)
    at trip.spi.DefaultServiceProvider.produceFromFactory(DefaultServiceProvider.java:179)
    at trip.spi.DefaultServiceProvider.load(DefaultServiceProvider.java:84)
    at trip.spi.helpers.SingleElementProvidableField.provide(SingleElementProvidableField.java:31)
    at trip.spi.helpers.ProvidableClass.provide(ProvidableClass.java:30)
    at trip.spi.DefaultServiceProvider.provideOn(DefaultServiceProvider.java:169)
    ... 98 more
Caused by: java.lang.IllegalStateException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: java.lang.StackOverflowError
    at kikaha.hazelcast.config.HazelcastInstanceProducer.createHazelcastInstance(HazelcastInstanceProducer.java:80)
    at kikaha.hazelcast.config.HazelcastInstanceProducer.getInstance(HazelcastInstanceProducer.java:24)
    at kikaha.hazelcast.config.HazelcastInstanceProducer.produceHazelcastInstance(HazelcastInstanceProducer.java:54)
    at kikaha.hazelcast.config.HazelcastInstanceAutoGeneratedProvider468419103.provide(HazelcastInstanceAutoGeneratedProvider468419103.java:11)
    ... 104 more
Caused by: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderException: trip.spi.ServiceProviderE