jRebel : Application Failed to Start

ZeroTurnaround Homepage Forums JRebel Support jRebel : Application Failed to Start

This topic contains 1 reply, has 3 voices, and was last updated by  Fatih 10 months, 1 week ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #61223

    Fatih
    Member

    Hello,

    We have a spring boot application with a multi tenant feature implemented. When we start our application in intellij (2016.3.2) with regular application launcher => No problem.

    When we start with the latest version of jrebel (7.0.2) we got the following error.

    Any clue for the reason of the failure ?

    ***************************
    APPLICATION FAILED TO START
    ***************************

    Description:

    Field jdbcTemplate in com.gateway.repository.UserRepository required a bean of type ‘org.springframework.jdbc.core.JdbcTemplate’ that could not be found.
    – Bean method ‘jdbcTemplate’ not loaded because @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) did not find a primary bean from beans ‘scopedTarget.dataSource’, ‘dataSource’

    Action:

    Consider revisiting the conditions above or defining a bean of type ‘org.springframework.jdbc.core.JdbcTemplate’ in your configuration.

    *************

    The bean

    @Bean
    @TenantScope
    @ConfigurationProperties(“datasource”)
    public DataSource dataSource(DataSourceProperties properties, TenantPropertyResolver tenantPropertyResolver) {
    properties.setUrl(tenantPropertyResolver.getProperty(“datasource.url”));
    properties.setUsername(tenantPropertyResolver.getProperty(“datasource.username”));
    properties.setPassword(tenantPropertyResolver.getProperty(“datasource.password”));

    return properties.initializeDataSourceBuilder().type(org.apache.tomcat.jdbc.pool.DataSource.class).build();
    }

    The custom scope:

    @Target({ElementType.TYPE, ElementType.METHOD})
    @Retention(RetentionPolicy.RUNTIME)
    @Scope(“tenant”)
    public @interface TenantScope {
    @AliasFor(
    annotation = Scope.class
    )
    ScopedProxyMode proxyMode() default ScopedProxyMode.TARGET_CLASS;
    }

    • This topic was modified 11 months ago by  Fatih.
    #61247

    Fatih
    Member

    Anyone ?

    #61312

    Valerie Avramenko
    Rebel Staff

    Hello!

    Sorry for the delay, request was lost for some reason. Thank you a lot for the detailed description and code snippets! Could you please also send your trace level jrebel.log file after reproducing the issue to support@zeroturnaround.com with the link to this forum topic? To generate it just add -Drebel.log=trace to your VM arguments, restart your server and reproduce the issue.

    Kind regards,
    Valerie

    #61333

    Fatih
    Member

    hello,

    i am sending u by email

    • This reply was modified 10 months, 3 weeks ago by  Fatih.
    #61619

    Fatih
    Member

    Hi,

    Did you have any feedbacks for this issue ?

    #61621

    Veiko Kääp
    Rebel Staff

    Hi,

    Sorry for the long silence!

    We have now managed to reproduce the problem and have passed the development on to our developers.

    However, we’re not yet sure how long the fix will take.

    In my own sample application where I reproduced the problem, the problem seemed to only occur with the annotation @ConditionalOnSingleCandidate in combination with a custom scope so if that annotation is on one of your own classes, then you can try removing it for now and see if it helps.

    I apologize for the inconvenience!
    I’ll let you know as soon as a fix is available.

    #61643

    Veiko Kääp
    Rebel Staff

    Hi,

    I have good news for you! Our developers have now pushed a fix to the nightly.

    Download and extract JRebel standalone nightly build from here: https://zeroturnaround.com/software/jrebel/download/nightly-build/

    If you’re starting your application with an IDE, then in the IDE go to Help > JRebel > Configuration > Advanced > Use jrebel.jar from custom location and point it to the extracted nightly.

    If you’re starting your application from command line, then just change your agentpath or javaagent argument to point to the nightly location.

    Please let me know if the nightly fixes the problem for you.

    #61657

    Fatih
    Member

    Hello Veiko,

    Well done guys !! It is working now.
    I have been using the nightly version 7.0.5-SNAPSHOT of the jRebel agent.

    I will let you if i encounter another issue. If the right bean is used in the right scope, etc …

    Again really appreciate your help.

    Fatih

    • This reply was modified 10 months, 1 week ago by  Fatih.
Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.