Hi

I havent faced with this issue yet, but the real error is the below:


   Caused by: org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'externalEventConnectionFactory' defined in class 
path resource 
[org/apache/fineract/infrastructure/event/external/config/ExternalEventJMSConfiguration.class]:
 Failed to instantiate 
[org.springframework.jms.connection.CachingConnectionFactory]: Factory method 
'connectionFactory' threw exception with message: Session cache size must be 1 
or higher
           at 
org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657)
           at 
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:489)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1375)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1205)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:569)
           at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339)
           at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:373)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
           at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
           at 
org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
           at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1770)
           at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1653)
           at 
org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:913)
           at 
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
           ... 52 more
   Caused by: org.springframework.beans.BeanInstantiationException: Failed 
to instantiate [org.springframework.jms.connection.CachingConnectionFactory]: 
Factory method 'connectionFactory' threw exception with message: Session cache 
size must be 1 or higher
           at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.lambda$instantiate$0(SimpleInstantiationStrategy.java:200)
           at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiateWithFactoryMethod(SimpleInstantiationStrategy.java:89)
           at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:169)
           at 
org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
           ... 66 more
   Caused by: java.lang.IllegalArgumentException: Session cache size must 
be 1 or higher
           at org.springframework.util.Assert.isTrue(Assert.java:116)
           at 
org.springframework.jms.connection.CachingConnectionFactory.setSessionCacheSize(CachingConnectionFactory.java:145)
           at 
org.apache.fineract.infrastructure.event.external.config.ExternalEventJMSConfiguration.connectionFactory(ExternalEventJMSConfiguration.java:54)
           at 
org.apache.fineract.infrastructure.event.external.config.ExternalEventJMSConfiguration$$SpringCGLIB$$0.CGLIB$connectionFactory$0(<generated>)
           at 
org.apache.fineract.infrastructure.event.external.config.ExternalEventJMSConfiguration$$SpringCGLIB$$FastClass$$1.invoke(<generated>)
           at 
org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:258)
           at 
org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:400)
           at 
org.apache.fineract.infrastructure.event.external.config.ExternalEventJMSConfiguration$$SpringCGLIB$$0.connectionFactory(<generated>)
           at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
           at 
java.base/java.lang.reflect.Method.invoke(Method.java:580)
           at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.lambda$instantiate$0(SimpleInstantiationStrategy.java:172)
           ... 69 more


Seems configuration related error:
t means Fineract is trying to create the JMS external event connection factory, 
but its configured session cache size is 0 or negative.

The important line is:

Session cache size must be 1 or higher
And the failure happens here:

ExternalEventJMSConfiguration.connectionFactory(ExternalEventJMSConfiguration.java:54)
CachingConnectionFactory.setSessionCacheSize(...)
So somewhere in your config, this value is probably set incorrectly:

fineract.events.external.jms.session-cache-size=0
or equivalent YAML/env var.

It must be at least:

fineract.events.external.jms.session-cache-size=1
Common fix:

fineract.events.external.jms.session-cache-size=1
or if using env vars:

FINERACT_EVENTS_EXTERNAL_JMS_SESSION_CACHE_SIZE=1
This is not a broker connection issue yet. The app fails before connecting to 
ActiveMQ/Artemis because Spring refuses to create CachingConnectionFactory with 
an invalid cache size.



We dont have such configuration property in Fineract (at least i dont have it), 
but anyway it seems something was setting incorrect value at your end…



I hope it helps!



Regards,

Adam


> On May 28, 2026, at 10:10 PM, Adam Monsen <[email protected]> wrote:
> 
> I'm unable to run the :fineract-provider:cucumber task locally.
> 
> My build command is:
> 
> ./gradlew --console=plain --no-daemon --stacktrace --info 
> :fineract-provider:cucumber | tee ~/Downloads/build.txt
> gzip ~/Downloads/build.txt
> 
> And I think the relevant part of the log is:
> 
> 2026-05-28 13:05:51.986 [main] WARN  o.s.w.c.s.GenericWebApplicationContext - 
> Exception encountered during context initialization - cancelling refresh 
> attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: 
> Error creating bean with name 'JMSMultiExternalEventProducer' defined in file 
> [/home/adamm/git/apache/fineract/fineract-provider/build/classes/java/main/org/apache/fineract/infrastructure/event/external/producer/jms/JMSMultiExternalEventProducer.class]:
>  Unsatisfied dependency expressed through constructor parameter 1: Error 
> creating bean with name 'externalEventConnectionFactory' defined in class 
> path resource 
> [org/apache/fineract/infrastructure/event/external/config/ExternalEventJMSConfiguration.class]:
>  Failed to instantiate 
> [org.springframework.jms.connection.CachingConnectionFactory]: Factory method 
> 'connectionFactory' threw exception with message: Session cache size must be 
> 1 or higher
> 2026-05-28 13:05:52.039 [main] INFO  
> o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA 
> EntityManagerFactory for persistence unit 'jpa-pu'
> io.cucumber.core.exception.CompositeCucumberException: There were 152 
> exceptions. The details are in the stacktrace below.
>         at 
> io.cucumber.core.runtime.RethrowingThrowableCollector.getThrowable(RethrowingThrowableCollector.java:57)
>         at 
> io.cucumber.core.runtime.CucumberExecutionContext.getThrowable(CucumberExecutionContext.java:108)
>         at 
> io.cucumber.core.runtime.CucumberExecutionContext.finishTestRun(CucumberExecutionContext.java:103)
>         at 
> io.cucumber.core.runtime.CucumberExecutionContext.runFeatures(CucumberExecutionContext.java:152)
>         at io.cucumber.core.runtime.Runtime.run(Runtime.java:79)
>         at io.cucumber.core.cli.Main.run(Main.java:87)
>         at io.cucumber.core.cli.Main.main(Main.java:30)
>         Suppressed: java.lang.IllegalStateException: Failed to load 
> ApplicationContext for [WebMergedContextConfiguration@776b3995 testClass = 
> org.apache.fineract.TestSuite, locations = [], classes = 
> [org.apache.fineract.TestConfiguration], contextInitializerClasses = [], 
> activeProfiles = [], propertySourceDescriptors = 
> [PropertySourceDescriptor[locations=[classpath:application-test.properties], 
> ignoreResourceNotFound=false, name=null, propertySourceFactory=null, 
> encoding=null]], propertySourceProperties = [], contextCustomizers = 
> [org.springframework.boot.test.autoconfigure.OnFailureConditionReportContextCustomizerFactory$OnFailureConditionReportContextCustomizer@46a6f51b,
>  
> org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@1f,
>  
> org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0,
>  
> org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizer@721e5f57,
>  
> org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@12ce9299,
>  
> org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@41fc5625,
>  org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, 
> org.springframework.boot.test.web.reactor.netty.DisableReactorResourceFactoryGlobalResourcesContextCustomizerFactory$DisableReactorResourceFactoryGlobalResourcesContextCustomizerCustomizer@76ad048a,
>  
> org.springframework.test.context.web.socket.MockServerContainerContextCustomizer@2d0f850,
>  
> org.springframework.test.context.support.DynamicPropertiesContextCustomizer@0],
>  resourceBasePath = "src/main/webapp", contextLoader = 
> org.springframework.test.context.web.WebDelegatingSmartContextLoader, parent 
> = null]
>                 at 
> org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:180)
>                 at 
> org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:130)
>                 at 
> io.cucumber.spring.TestContextAdaptor.create(TestContextAdaptor.java:42)
>                 at 
> io.cucumber.spring.SpringFactory.start(SpringFactory.java:121)
>                 at 
> io.cucumber.core.runner.Runner.buildBackendWorlds(Runner.java:135)
>                 at io.cucumber.core.runner.Runner.runPickle(Runner.java:69)
>                 at 
> io.cucumber.core.runtime.Runtime.lambda$executePickle$6(Runtime.java:108)
>                 at 
> io.cucumber.core.runtime.CucumberExecutionContext.lambda$runTestCase$5(CucumberExecutionContext.java:136)
>                 at 
> io.cucumber.core.runtime.RethrowingThrowableCollector.executeAndThrow(RethrowingThrowableCollector.java:23)
>                 at 
> io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:136)
>                 at 
> io.cucumber.core.runtime.Runtime.lambda$executePickle$7(Runtime.java:108)
>                 at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
> 
> Any ideas?
> 
> I searched around a bit but only found this post from me 
> <https://lists.apache.org/thread/9moymgxnxnlz0650np1j881b76nsqnwg> and this 
> post from Kapil 
> <https://lists.apache.org/thread/7x3y5vyngvn2nbpyongjqcp1bcdkon6s>, and 
> neither seems closely related.
> 
> I'm using 64-bit Ubuntu 24.04.4 LTS desktop.
> 
> Java is Zulu 21:
> 
> $ java -version
> openjdk version "21.0.7" 2025-04-15 LTS
> OpenJDK Runtime Environment Zulu21.42+19-CA (build 21.0.7+6-LTS)
> OpenJDK 64-Bit Server VM Zulu21.42+19-CA (build 21.0.7+6-LTS, mixed mode, 
> sharing)
> 
> 
> -- 
> Adam Monsen
> Software Engineer » Mifos Initiative
> Release Manager » Apache Fineract
> Author » Steadfast Self-Hosting
> PGP key » 0xA9A14F22F57DA182
> <build.txt.gz>

Reply via email to