Giter VIP home page Giter VIP logo

Comments (7)

frct1 avatar frct1 commented on July 17, 2024

UPD:
As far as i can see, new schema is getting copied to out folder with correct content but for some reason DGS doesn't reload it

type Query {
    hey(name: String! = "Spring"): String!
}

Digged into sources, tried to debug more:

boolean hotReloadSetting = env.getProperty("dgs.reload", Boolean.class);

shows true. What else needs to be checked ?

from dgs-framework.

frct1 avatar frct1 commented on July 17, 2024

UPD2:
As i can see in case of Spring Gradle plugin is being used i have to add ext['kotlin.version'] = '1.4.31' it leads to things get broken at all

2024-01-13T18:09:02.024+03:00  INFO 26848 --- [           main] .s.b.a.l.ConditionEvaluationReportLogger : 

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-01-13T18:09:02.049+03:00 ERROR 26848 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.beans.BeanUtils$KotlinDelegate.findPrimaryConstructor(BeanUtils.java:861)

The following method did not exist:

    'boolean kotlin.reflect.KClass.isValue()'

The calling method's class, org.springframework.beans.BeanUtils$KotlinDelegate, was loaded from the following location:

    jar:file:/C:/Users/admin/.gradle/caches/modules-2/files-2.1/org.springframework/spring-beans/6.1.2/abf52f2254975a3b1e95b2b63fb8b01d891cdc51/spring-beans-6.1.2.jar!/org/springframework/beans/BeanUtils$KotlinDelegate.class

The called method's class, kotlin.reflect.KClass, is available from the following locations:

    jar:file:/C:/Users/admin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.31/a58e0fb9812a6a93ca24b5da75e4b5a0cb89c957/kotlin-stdlib-1.4.31.jar!/kotlin/reflect/KClass.class

The called method's class hierarchy was loaded from the following locations:

    kotlin.reflect.KClass: file:/C:/Users/admin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.31/a58e0fb9812a6a93ca24b5da75e4b5a0cb89c957/kotlin-stdlib-1.4.31.jar


Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.beans.BeanUtils$KotlinDelegate and kotlin.reflect.KClass

Here is build.gradle deps

plugins {
    id 'java'
    id 'org.springframework.boot' version '3.2.1'
    id 'io.spring.dependency-management' version '1.1.4'
    id 'org.hibernate.orm' version '6.4.1.Final'
    id 'org.graalvm.buildtools.native' version '0.9.27'
    id 'org.asciidoctor.jvm.convert' version '3.3.2'
}
...
dependencyManagement {
    imports {
        mavenBom("com.netflix.graphql.dgs:graphql-dgs-platform-dependencies:latest.release")
    }
}
ext['kotlin.version'] = '1.4.31'
dependencies {
...
implementation 'com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter'
}

from dgs-framework.

frct1 avatar frct1 commented on July 17, 2024

Upd3:
I can see in release that kotlin has update, so tried next thing

ext['kotlin.version'] = '1.9.22'

and it's make it start but hot-reload still doesn't work, have no clue what could be wrong 🤔

from dgs-framework.

paulbakker avatar paulbakker commented on July 17, 2024

@baikov-ilia I just validated the reload behavior and it works, so I'm not sure why it's not working for you.

In Intellij you need to explicitly "build" (cmnd-f9 on Macos) for file to be copied, so make sure you do that.
The next thing you could try is set a breakpoint in DgsSchemaProvider to see if it goes through the re-loading logic.

I'm going to close this issue for now, assuming it's something related to your setup, since the functionality seems to be working fine.

from dgs-framework.

frct1 avatar frct1 commented on July 17, 2024

Yep, found out that in order to sync schema from resources folder to build it's needed to run processResources manually in idea and schema is being reloaded on a next request. No clue on how to run this task after a build, but seems like reload is working.

from dgs-framework.

paulbakker avatar paulbakker commented on July 17, 2024

from dgs-framework.

frct1 avatar frct1 commented on July 17, 2024

What build system are you using? I was testing with Gradle, and that "just works" in Intellij if I hit the "build" command. I'm actually really not sure about other builds systems.

I'm using Gradle along with JRebel since devtools throw some exception related to classpath when mapstruct is used. Firing processResources even when JRebel is running helps to update schema and then it is get reloaded fine.

from dgs-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.