[ 
https://issues.apache.org/jira/browse/FINERACT-1895?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hitesh Prajapati updated FINERACT-1895:
---------------------------------------
    Description: 
When I run fineract with activeMqEnabled profile, it doesn't start and failed 
with below excpetion. I have standalone ActiveMQ running with default port. so 
the MessagingConfiguration should work with it.

java -Dspring.profiles.active=activeMqEnabled -jar 
fineract-provider/build/libs/fineract-provider-0.0.0-6c86e15e.jar
{code:java}
2023-04-08 18:05:59.166 -ERROR 23580  --- [           main] 
o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. 
Exception: org.springframework.beans.factory.BeanCreationException. Message: 
Error creating bean with name 
'tenantAwareBasicAuthenticationFilterRegistration' defined in class path 
resource [org/apache/fineract/infrastructure/core/config/SecurityConfig.class]: 
Bean instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.springframework.boot.web.servlet.FilterRegistrationBean]: Factory method 
'tenantAwareBasicAuthenticationFilterRegistration' threw exception; nested 
exception is org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'tenantAwareBasicAuthenticationFilter': 
Unsatisfied dependency expressed through field 'userNotificationService'; 
nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'userNotificationServiceImpl' defined in URL 
[jar:file:/D:/Work/fineract/source/fineract/fineract-provider/build/libs/fineract-provider-0.0.0-185551c5.jar!/BOOT-INF/classes!/org/apache/fineract/notification/service/UserNotificationServiceImpl.class]:
 Unsatisfied dependency expressed through constructor parameter 0; nested 
exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: 
No qualifying bean of type 
'org.apache.fineract.notification.eventandlistener.NotificationEventPublisher' 
available: expected at least 1 bean which qualifies as autowire candidate. 
Dependency annotations: {}
2023-04-08 18:05:59.280 - INFO 23580  --- [           main] 
o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-04-08 18:05:59.289 - WARN 23580  --- [           main] 
o.a.c.loader.WebappClassLoaderBase       : The web application 
[fineract-provider] appears to have started a thread named [HikariPool-1 
housekeeper] but has failed to stop it. This is very likely to create a memory 
leak. Stack trace of thread:
 [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
 
[email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
 
[email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1672)
 
[email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
 
[email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
 
[email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1062)
 
[email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1122)
 
[email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
 [email protected]/java.lang.Thread.run(Thread.java:833)
2023-04-08 18:05:59.290 - WARN 23580  --- [           main] 
o.a.c.loader.WebappClassLoaderBase       : The web application 
[fineract-provider] appears to have started a thread named [HikariPool-2 
housekeeper] but has failed to stop it. This is very likely to create a memory 
leak. Stack trace of thread:
 [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
 
[email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
 
[email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1672)
 
[email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
 
[email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
 
[email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1062)
 
[email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1122)
 
[email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
 [email protected]/java.lang.Thread.run(Thread.java:833)
2023-04-08 18:05:59.298 - WARN 23580  --- [           main] 
ConfigServletWebServerApplicationContext : Exception encountered during context 
initialization - cancelling refresh attempt: 
org.springframework.context.ApplicationContextException: Unable to start web 
server; nested exception is 
org.springframework.boot.web.server.WebServerException: Unable to start 
embedded Tomcat
2023-04-08 18:05:59.306 - INFO 23580  --- [           main] 
j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for 
persistence unit 'jpa-pu'
2023-04-08 18:05:59.314 - INFO 23580  --- [           main] 
com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2023-04-08 18:05:59.337 - INFO 23580  --- [           main] 
com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2023-04-08 18:05:59.385 - INFO 23580  --- [           main] 
ConditionEvaluationReportLoggingListener :Error starting ApplicationContext. To 
display the conditions report re-run your application with 'debug' enabled.
2023-04-08 18:05:59.494 -ERROR 23580  --- [           main] 
o.s.b.d.LoggingFailureAnalysisReporter   :***************************
APPLICATION FAILED TO START
***************************Description:Parameter 0 of constructor in 
org.apache.fineract.notification.service.UserNotificationServiceImpl required a 
bean of type 
'org.apache.fineract.notification.eventandlistener.NotificationEventPublisher' 
that could not be found.The injection point has the following annotations:
        - @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:Consider defining a bean of type 
'org.apache.fineract.notification.eventandlistener.NotificationEventPublisher' 
in your configuration.{code}

  was:
When I run fineract with activeMqEnabled profile, it doesn't start and failed 
with below excpetion. I have standalone ActiveMQ running with default port. so 
the MessagingConfiguration should work with it.

java -Dspring.profiles.active=activeMqEnabled -jar 
fineract-provider/build/libs/fineract-provider-0.0.0-6c86e15e.jar
{code:java}
Error starting ApplicationContext. To display the conditions report re-run your 
application with 'debug' enabled.
2023-02-19 19:22:24.963 -ERROR 6856  --- [           main] 
o.s.boot.SpringApplication               : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'messageListenerContainer' defined in class path resource 
[org/apache/fineract/notification/config/MessagingConfiguration.class]: Bean 
instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.springframework.jms.listener.DefaultMessageListenerContainer]: Factory 
method 'messageListenerContainer' threw exception; nested exception is 
java.lang.IllegalArgumentException: Message listener needs to be of type 
[javax.jms.MessageListener] or 
[org.springframework.jms.listener.SessionAwareMessageListener]
        at 
org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
        at 
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
        at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
        at 
org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164)
        at org.apache.fineract.ServerApplication.main(ServerApplication.java:57)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at 
org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at 
org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to 
instantiate [org.springframework.jms.listener.DefaultMessageListenerContainer]: 
Factory method 'messageListenerContainer' threw exception; nested exception is 
java.lang.IllegalArgumentException: Message listener needs to be of type 
[javax.jms.MessageListener] or 
[org.springframework.jms.listener.SessionAwareMessageListener]
        at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
        at 
org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
        ... 26 common frames omitted
Caused by: java.lang.IllegalArgumentException: Message listener needs to be of 
type [javax.jms.MessageListener] or 
[org.springframework.jms.listener.SessionAwareMessageListener]
        at 
org.springframework.jms.listener.AbstractMessageListenerContainer.checkMessageListener(AbstractMessageListenerContainer.java:318)
        at 
org.springframework.jms.listener.AbstractMessageListenerContainer.setMessageListener(AbstractMessageListenerContainer.java:287)
        at 
org.apache.fineract.notification.config.MessagingConfiguration.messageListenerContainer(MessagingConfiguration.java:86)
        at 
org.apache.fineract.notification.config.MessagingConfiguration$$EnhancerBySpringCGLIB$$c586ac13.CGLIB$messageListenerContainer$3(<generated>)
        at 
org.apache.fineract.notification.config.MessagingConfiguration$$EnhancerBySpringCGLIB$$c586ac13$$FastClassBySpringCGLIB$$3565dd74.invoke(<generated>)
        at 
org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
        at 
org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
        at 
org.apache.fineract.notification.config.MessagingConfiguration$$EnhancerBySpringCGLIB$$c586ac13.messageListenerContainer(<generated>)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
        ... 27 common frames omitted
{code}
 


> Fineract doesn't start with spring profile activeMqEnabled
> ----------------------------------------------------------
>
>                 Key: FINERACT-1895
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1895
>             Project: Apache Fineract
>          Issue Type: Bug
>          Components: System
>            Reporter: Hitesh Prajapati
>            Priority: Minor
>
> When I run fineract with activeMqEnabled profile, it doesn't start and failed 
> with below excpetion. I have standalone ActiveMQ running with default port. 
> so the MessagingConfiguration should work with it.
> java -Dspring.profiles.active=activeMqEnabled -jar 
> fineract-provider/build/libs/fineract-provider-0.0.0-6c86e15e.jar
> {code:java}
> 2023-04-08 18:05:59.166 -ERROR 23580  --- [           main] 
> o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. 
> Exception: org.springframework.beans.factory.BeanCreationException. Message: 
> Error creating bean with name 
> 'tenantAwareBasicAuthenticationFilterRegistration' defined in class path 
> resource 
> [org/apache/fineract/infrastructure/core/config/SecurityConfig.class]: Bean 
> instantiation via factory method failed; nested exception is 
> org.springframework.beans.BeanInstantiationException: Failed to instantiate 
> [org.springframework.boot.web.servlet.FilterRegistrationBean]: Factory method 
> 'tenantAwareBasicAuthenticationFilterRegistration' threw exception; nested 
> exception is 
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
> creating bean with name 'tenantAwareBasicAuthenticationFilter': Unsatisfied 
> dependency expressed through field 'userNotificationService'; nested 
> exception is 
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
> creating bean with name 'userNotificationServiceImpl' defined in URL 
> [jar:file:/D:/Work/fineract/source/fineract/fineract-provider/build/libs/fineract-provider-0.0.0-185551c5.jar!/BOOT-INF/classes!/org/apache/fineract/notification/service/UserNotificationServiceImpl.class]:
>  Unsatisfied dependency expressed through constructor parameter 0; nested 
> exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: 
> No qualifying bean of type 
> 'org.apache.fineract.notification.eventandlistener.NotificationEventPublisher'
>  available: expected at least 1 bean which qualifies as autowire candidate. 
> Dependency annotations: {}
> 2023-04-08 18:05:59.280 - INFO 23580  --- [           main] 
> o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
> 2023-04-08 18:05:59.289 - WARN 23580  --- [           main] 
> o.a.c.loader.WebappClassLoaderBase       : The web application 
> [fineract-provider] appears to have started a thread named [HikariPool-1 
> housekeeper] but has failed to stop it. This is very likely to create a 
> memory leak. Stack trace of thread:
>  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
>  
> [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
>  
> [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1672)
>  
> [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
>  
> [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
>  
> [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1062)
>  
> [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1122)
>  
> [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
>  [email protected]/java.lang.Thread.run(Thread.java:833)
> 2023-04-08 18:05:59.290 - WARN 23580  --- [           main] 
> o.a.c.loader.WebappClassLoaderBase       : The web application 
> [fineract-provider] appears to have started a thread named [HikariPool-2 
> housekeeper] but has failed to stop it. This is very likely to create a 
> memory leak. Stack trace of thread:
>  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
>  
> [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
>  
> [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1672)
>  
> [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
>  
> [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
>  
> [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1062)
>  
> [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1122)
>  
> [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
>  [email protected]/java.lang.Thread.run(Thread.java:833)
> 2023-04-08 18:05:59.298 - WARN 23580  --- [           main] 
> ConfigServletWebServerApplicationContext : Exception encountered during 
> context initialization - cancelling refresh attempt: 
> org.springframework.context.ApplicationContextException: Unable to start web 
> server; nested exception is 
> org.springframework.boot.web.server.WebServerException: Unable to start 
> embedded Tomcat
> 2023-04-08 18:05:59.306 - INFO 23580  --- [           main] 
> j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory 
> for persistence unit 'jpa-pu'
> 2023-04-08 18:05:59.314 - INFO 23580  --- [           main] 
> com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown 
> initiated...
> 2023-04-08 18:05:59.337 - INFO 23580  --- [           main] 
> com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
> 2023-04-08 18:05:59.385 - INFO 23580  --- [           main] 
> ConditionEvaluationReportLoggingListener :Error starting ApplicationContext. 
> To display the conditions report re-run your application with 'debug' enabled.
> 2023-04-08 18:05:59.494 -ERROR 23580  --- [           main] 
> o.s.b.d.LoggingFailureAnalysisReporter   :***************************
> APPLICATION FAILED TO START
> ***************************Description:Parameter 0 of constructor in 
> org.apache.fineract.notification.service.UserNotificationServiceImpl required 
> a bean of type 
> 'org.apache.fineract.notification.eventandlistener.NotificationEventPublisher'
>  that could not be found.The injection point has the following annotations:
>         - 
> @org.springframework.beans.factory.annotation.Autowired(required=true)
> Action:Consider defining a bean of type 
> 'org.apache.fineract.notification.eventandlistener.NotificationEventPublisher'
>  in your configuration.{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to