Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SingleWar does not scan custom libraries if they are connected as simple dependencies - not app_components #69

Open
IskandarovRost opened this issue Sep 19, 2018 · 0 comments
Assignees
Labels
severity: minor The defect does not affect functionality or data. It is merely an inconvenience. type: enhancement New feature or request

Comments

@IskandarovRost
Copy link

IskandarovRost commented Sep 19, 2018

See the topic: https://www.cuba-platform.com/discuss/t/nosuchbeandefinitionexception-deployng-to-jelastic-cloud/6516/4

See the attached WAR.

Description of the bug or enhancement

  • Minimal reproducible example
  1. create a project
  2. put some jars (io.aik in the sample in the forum topic) to project folder
  3. define a dependency to this JAR
configure([globalModule, coreModule, webModule]) {
    apply(plugin: 'java')
    apply(plugin: 'maven')
    apply(plugin: 'idea')
    apply(plugin: 'cuba')

    dependencies {
        testCompile('junit:junit:4.12')
        compile files('aik-java-core-1.0-SNAPSHOT.jar')
        compile files('aik-java-cuba-1.0-SNAPSHOT.jar')
    }
  1. Use the classes from Jars somewhere in the project
    for instance define component scan
<context:component-scan base-package="io.aik.cuba"/>

and use the bean from this library


@Service(NewService.NAME)
public class NewServiceBean implements NewService {

    @Inject
    OPEExecutor opeExecutor;

    public void somemethod(){

        opeExecutor.execVygerBS("1q", new GenericCB());

    }

}
  1. build singleWar
  2. Deploy the singleWar somewhere
  3. Start the application
  • Actual behavior
2018-09-19 20:11:50.501 ERROR [localhost-startStop-1] com.haulmont.cuba.core.sys
.AbstractWebAppContextLoader - Error initializing application
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating
 bean with name 'mgz_NewService': Unsatisfied dependency expressed through field
 'opeExecutor'; nested exception is org.springframework.beans.factory.NoSuchBean
DefinitionException: No qualifying bean of type 'io.aik.cuba.services.OPEExecuto
r' available: expected at least 1 bean which qualifies as autowire candidate. De
pendency annotations: {@javax.inject.Inject()}
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
ostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.j
ava:588) ~[spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject
...
@IskandarovRost IskandarovRost added severity: minor The defect does not affect functionality or data. It is merely an inconvenience. type: enhancement New feature or request labels Sep 19, 2018
@jreznot jreznot changed the title SingleWar does not load custom libraries if they are connected as simple dependencies - not app_components SingleWar does not scan custom libraries if they are connected as simple dependencies - not app_components Sep 19, 2018
@knstvk knstvk assigned t2-cuba and unassigned knstvk Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: minor The defect does not affect functionality or data. It is merely an inconvenience. type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants