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

[Bug] 3.2.13 has compatibility issues with Spring boot 3.2+. #14295

Open
4 tasks done
maiyuanrdt opened this issue Jun 7, 2024 · 5 comments
Open
4 tasks done

[Bug] 3.2.13 has compatibility issues with Spring boot 3.2+. #14295

maiyuanrdt opened this issue Jun 7, 2024 · 5 comments
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@maiyuanrdt
Copy link

maiyuanrdt commented Jun 7, 2024

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo Java 3.2.13, Java Corretto 17/21, Windows 11

Steps to reproduce this issue

plugins {
    id 'java'
    id 'org.springframework.boot' version '3.3.0'
    id 'io.spring.dependency-management' version '1.1.5'
}

group = 'com.xxx.xxx'
version = '0.0.1-SNAPSHOT'

repositories {
    mavenCentral()
}

ext {
    dubboVersion = "3.2.13"
}

dependencyManagement {
    imports {
        mavenBom "org.apache.dubbo:dubbo-bom:${dubboVersion}"
    }
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-graphql'
    implementation 'org.springframework.boot:spring-boot-starter-webflux'

    implementation "org.apache.dubbo:dubbo"
}

After executing the build task, the following error is reported through java -jar build/libs/*-0.0.1-SNAPSHOT.jar

C:\Users\DELL\.jdks\corretto-17.0.11\bin\java.exe -Dfile.encoding=UTF-8 -jar D:\Projects\demo\build\libs\demo-0.0.1-SNAPSHOT.jar
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91)
	at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53)
	at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58)
Caused by: java.lang.StringIndexOutOfBoundsException: begin 18, end -1, length 28
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4606)
	at java.base/java.lang.String.substring(String.java:2709)
	at org.springframework.boot.loader.jar.MetaInfVersionsInfo.get(MetaInfVersionsInfo.java:85)
	at org.springframework.boot.loader.jar.MetaInfVersionsInfo.get(MetaInfVersionsInfo.java:69)
	at org.springframework.boot.loader.zip.ZipContent.lambda$getInfo$0(ZipContent.java:326)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
	at org.springframework.boot.loader.zip.ZipContent.getInfo(ZipContent.java:324)
	at org.springframework.boot.loader.jar.NestedJarFile.getMetaInfVersionsInfo(NestedJarFile.java:337)
	at org.springframework.boot.loader.jar.NestedJarFile.getVersionedContentEntry(NestedJarFile.java:279)
	at org.springframework.boot.loader.jar.NestedJarFile.hasEntry(NestedJarFile.java:247)
	at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.hasEntry(JarUrlClassLoader.java:170)
	at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.definePackage(JarUrlClassLoader.java:144)
	at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.definePackageIfNecessary(JarUrlClassLoader.java:125)
	at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.loadClass(JarUrlClassLoader.java:98)
	at org.springframework.boot.loader.launch.LaunchedClassLoader.loadClass(LaunchedClassLoader.java:91)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at com.example.demo.DemoApplication.main(DemoApplication.java:10)
	... 7 more

What you expected to happen

3.2.13 has compatibility issues with Spring boot 3.2+.
After downgrading to 3.2.12, it can be normal

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@maiyuanrdt maiyuanrdt added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Jun 7, 2024
@wcy666103
Copy link
Contributor

Was it successful to run the case in the ide without running the jar directly? In addition, if you want to package it into a runnable jar package, you need to use the dubbo-maven-plugin plugin. For details, see this example:

https://github.com/apache/dubbo-samples/tree/master/2-advanced/dubbo-samples-native-image

@guyangxizhao
Copy link

guyangxizhao commented Jun 11, 2024

我也出现了同样的问题,
idea 或者使用 mvn spring-boot:run 都能正常运行,
mvn clean package 能成功,运行时报上面的错误

Uploading 屏幕截图 2024-06-11 123521.png…

@MrLiuFang
Copy link

确实存在这个问题 打包后无法运行

1 similar comment
@MrLiuFang
Copy link

确实存在这个问题 打包后无法运行

@wcy666103
Copy link
Contributor

It's because of this:

spring-projects/spring-boot#41001

#14247

Wait for the new release to solve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Status: Todo
Development

No branches or pull requests

4 participants