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

not support java 10 #1500

Closed
hank-whu opened this issue Mar 22, 2018 · 17 comments
Closed

not support java 10 #1500

hank-whu opened this issue Mar 22, 2018 · 17 comments

Comments

@hank-whu
Copy link

Can't start the dubbo server.

VM version: JDK 10, VM 10+46
OS version: Ubuntu 16.04 x64

@ralf0131
Copy link
Contributor

Hi, Welcome!

Can you provide more details, e.g. do you have stack trace?

@hank-whu
Copy link
Author

hank-whu commented Mar 22, 2018

@ralf0131
Copy link
Contributor

What JMH version are you using, is it Java 10 compatible?

@hank-whu
Copy link
Author

jmh 1.20, it's no problem

@diecui1202
Copy link

I run the two test cases under Java 10, they're all ok.

And I also build dubbo under Java 10, there is a NullPointerException which is thrown by maven-javadoc-plugin. More details can be obtained from https://stackoverflow.com/questions/49460751/execution-attach-javadocs-of-goal-org-apache-maven-pluginsmaven-javadoc-plugin

After upgrade maven-javadoc-plugin to 3.0.1-SNAPSHOT, the build process and all test cases pass.

@hank-whu So I can't repeat your problem. You can review it again and tell us if getting the same problem.

@hank-whu
Copy link
Author

hank-whu commented Apr 8, 2018

嗯,搞明白了,不是dubbo 跟 java 10 的兼容性问题。
是 dubbo-2.6.1 跟 maven-assembly-plugin 的兼容性问题,退回到 dubbo-2.6.0 就没问题了。

@diecui1202
Copy link

@hank-whu What's the detail compatible problem about Dubbo 2.6.1 and maven-assembly-plugin? Could you paste the exception stack trace here?

@hank-whu
Copy link
Author

hank-whu commented Apr 9, 2018

>java -jar dubbo-server-round-2-jar-with-dependencies.jar

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/support/ClassPathXmlApplicationContext
        at benchmark.rpc.Server.main(Server.java:8)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.support.ClassPathXmlApplicationContext
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        ... 1 more

@hank-whu
Copy link
Author

hank-whu commented Apr 9, 2018

eclipse 中启动是没问题的,打包成 dubbo-server-round-2-jar-with-dependencies.jar 就会抛错。

@diecui1202
Copy link

diecui1202 commented Apr 10, 2018

@hank-whu I run this two server/client demo with Dubbo 2.6.1 on my mac, and it's all ok.

image

image

image

And my maven version is 3.3.9, my java version is:

➜  ~ java -version
java version "10" 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)

So please check your maven and jdk10 env.

@ralf0131
Copy link
Contributor

@diecui1202 Please use text instead of pic as much as possible. Text is more search engine friendly.

@ralf0131
Copy link
Contributor

Looks like this issue is not reproducible, I am closing this issue now. Feel free to reopen it if you can reproduce it later.

@hank-whu
Copy link
Author

@diecui1202
现在那两个项目 pom.xml 里的 dubbo 版本是 2.6.0,你把里面的版本修改为 2.6.1 了吗?

@diecui1202
Copy link

@hank-whu Yeah, I've changed it to 2.6.1 yet.

@ralf0131 Ok, I got it.

@hank-whu
Copy link
Author

@diecui1202
我试了很多次,还是不行,你的 pom 文件可以贴上来吗?

@diecui1202
Copy link

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>benchmark.rpc</groupId>
	<artifactId>dubbo-server</artifactId>
	<version>round-2</version>
	<packaging>jar</packaging>

	<name>dubbo-server</name>
	<url>http://maven.apache.org</url>

	<properties>
		<maven.compiler.source>1.9</maven.compiler.source>
		<maven.compiler.target>1.9</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<version.benchmark-base>round-2</version.benchmark-base>
		<version.dubbo>2.6.1</version.dubbo>
		<version.javakaffee>0.42</version.javakaffee>
	</properties>

	<dependencies>
		<dependency>
			<groupId>benchmark.rpc</groupId>
			<artifactId>benchmark-base</artifactId>
			<version>${version.benchmark-base}</version>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>dubbo</artifactId>
			<version>${version.dubbo}</version>
		</dependency>
		<dependency>
			<groupId>de.javakaffee</groupId>
			<artifactId>kryo-serializers</artifactId>
			<version>${version.javakaffee}</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>

	</dependencies>


	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.7.0</version>
				<configuration>
					<defaultLibBundleDir>lib</defaultLibBundleDir>
					<source>9</source>
					<target>9</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.0.0</version>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<archive>
						<manifest>
							<mainClass>benchmark.rpc.Server</mainClass>
						</manifest>
					</archive>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id> <!-- this is used for inheritance merges -->
						<phase>package</phase> <!-- bind to the packaging phase -->
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
	</build>
</project>

I just change version.dubbo to 2.6.1

@hank-whu
Copy link
Author

应该是我电脑 maven 的问题,删掉 maven 的 repository 后问题解决。
浪费大家时间了,多谢各位。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants