Could not find or load main class io.jmix.gradle.ClassPathCommandLine

Hi,

I tried to install the Charts addon in my JMIX application and got the following problem:

Could not find or load main class io.jmix.gradle.ClassPathCommandLine

I couldn’t manage to start the app anymore. So I uninstalled the plugin to solve the problem.

Unfortunately the problem persists and I am not able to start my app anymore.

Have tried to find information to solve the problem but the class doesn’t show up nor in this forum nor in a generic search in Google.

Would appreciate if someone could give a hint to resolve the problem.

My build.gradle file is as follows:

    plugins {
    id 'io.jmix' version '1.0.2'
    id 'java'
}

apply plugin: 'org.springframework.boot'

jmix {
    bomVersion = '1.0.1' 
    projectId = 'contabi'
}

group = 'com.company'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
    mavenCentral() 
    maven {
        url 'https://global.repo.jmix.io/repository/public'
    } 
}

dependencies {
    implementation 'io.jmix.core:jmix-core-starter'
    implementation 'io.jmix.data:jmix-eclipselink-starter'
    implementation 'io.jmix.ui:jmix-ui-starter'
    implementation 'io.jmix.ui:jmix-ui-data-starter'
    implementation 'io.jmix.ui:jmix-ui-themes-compiled'
    implementation 'io.jmix.security:jmix-security-starter'
    implementation 'io.jmix.security:jmix-security-ui-starter'
    implementation 'io.jmix.security:jmix-security-data-starter'
    implementation 'io.jmix.localfs:jmix-localfs-starter'

    implementation 'org.springframework.boot:spring-boot-starter-web'


    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
    runtimeOnly 'mysql:mysql-connector-java'
    implementation "io.jmix.reports:jmix-reports-starter"
    implementation "io.jmix.reports:jmix-reports-ui-starter"
    implementation "io.jmix.reports:jmix-reports-rest-starter"
    widgets "io.jmix.ui:jmix-ui-widgets"
}

test {
    useJUnitPlatform()
}
compileWidgets {
    generate "contabilidad.widgets.CustomWidgetSet"
}

Many thanks in advance.

Carlos.

Hello!

To do not compile widgets delete task:

compileWidgets {
    generate "contabilidad.widgets.CustomWidgetSet"
}

In application.properties delete:

jmix.ui.widgetSet=contabilidad.widgets.CustomWidgetSet

And in the build.gradle change:

widgets "io.jmix.ui:jmix-ui-widgets"

to:

implementation 'io.jmix.ui:jmix-ui-widgets-compiled'

I’ve tried to reproduce the problem but without success. Not sure may be removing gradle cache or refreshing gradle dependencies can help.

Hi Roman,

Thanks for your answer.

However this will prevent compiling the widgetsset which is indeed causing the problem now. But what if I need to regenerate the widgetset somewhen in the future. This looks to me as avoiding a problem but not resolving the main fault behind the scene.

Is this class ClassPathCommandLine used anywhere? The build process claims that class, and doesn’t find it.

If I get a broken project, I don’t know if it better would help to recreate the whole project.

What do you think?

Regards,
Carlos.

Your solution worked.

Thanks Roman.

Let’s leave it like that. I have compared with test projects and your solution if compared to freshly started projects seems to be consistent.

Thanks for your help!

Carlos.