NoSuchBeanDefinitionException deployng to jelastic Cloud

Hi,
we are trying to deploy our CUBA application to Jelastic Cloud following your documentation link
https://doc.cuba-platform.com/manual-latest/jelastic_deployment.html

the application doesn’t start, in the tomcat log we find this error:

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘io.aik.cuba.services.OPEExecutor’

“io.aik.cuba.services.OPEExecutor” is a class inside our additional jar,

the “spring.xml” of the core module contains the row:
<context:component-scan base-package=“io.aik.cuba”/>

the OPEExecutor is under the io.aik.cuba package and has the @Component annotation

package io.aik.cuba.services;
@Component
public class OPEExecutor {  

all works perfectly running application under local tomcat (directly from cuba studio)

we downloaded and exploded the ROOT.war deployed on Jelastic,
inside the “app-core-0.1-SNAPSHOT.jar” we found the app.properties referencing the correct spring.xml file.

Can you help us to understand why the class is not added to the Spring context?

Thankyou
Massimo

Hi,
Could you bring more details? How have you defined the dependency?
Try to Open the Tomcat settings in Jelastic administrative panel and check whether the jar persists in libraries.
image

Hi Iskandarov,
thank you for your replay.

In the image below you can see the tomcat lib directory with the needed jar inside.
03

Here the root.war (with only my jars and the app-core-0.1-SNAPSHOT.jar for file size reasons)
ROOT.zip (5.7 MB)

I Think the problem is in the Spring context.
it seems that the
<context:component-scan base-package=“io.aik.cuba”/>
row added to the original spring.xml file has no effect

let me know if you need more details.

Thank you
Massimo

Hi,
How have you defined the dependency to your library?
Now singleWar does not work with “simple” dependencies - only application components are supported. If you want to use the same logic(beans) in several CUBA projects create an application component.

However, I have created the following issue SingleWar does not scan custom libraries if they are connected as simple dependencies - not app_components · Issue #69 · cuba-platform/cuba-gradle-plugin · GitHub. And probably it will be fixed someday.

Thank you.

Hi,
I defined the dependencies from CUBA Studio / PROJECT PROPERTIES / ADVANCED tab
myjars

I’m trying to create my application component following the instruction on
https://doc.cuba-platform.com/manual-latest/app_components_dev.html

Thank you so much for your time
Massimo.