spring boot java9_使用jigsaw模块使用jdk9运行spring boot

这个应用程序出了什么问题.我认为classpath jar和模块jar的混合是有效的.对于没有明确模块信息的所有罐子成为自动模块?当我删除我的module-info.

java时,它可以工作.因为IDEA在这种情况下使用了类路径.

Java(TM)SE运行时环境(版本9 176)

IntelliJ IDEA 2017.1.4

module-info.java

module test {

requires spring.boot.autoconfigure;

requires spring.boot;

}

App.java

package com.foo.test;

import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication

public class App {

public static void main(String[] args) {

SpringApplication.run(App.class,args);

}

}

的pom.xml

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

com.foo.test

test

1.0-SNAPSHOT

jar

org.springframework.boot

spring-boot-starter-parent

2.0.0.M2

test

http://maven.apache.org

UTF-8

1.9

1.9

org.springframework.boot

spring-boot-starter-web

junit

junit

3.8.1

test

spring-milestones

Spring Milestones

https://repo.spring.io/libs-milestone

false

Exception in thread “main” java.lang.IllegalArgumentException: Cannot

instantiate interface

org.springframework.context.ApplicationContextInitializer :

org.springframework.boot.context.ConfigurationWarningsApplicationContextInitializer

at

spring.boot@2.0.0.M2/org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:439)

at

spring.boot@2.0.0.M2/org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:418)

at

spring.boot@2.0.0.M2/org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:409)

at

spring.boot@2.0.0.M2/org.springframework.boot.SpringApplication.(SpringApplication.java:266)

at

spring.boot@2.0.0.M2/org.springframework.boot.SpringApplication.(SpringApplication.java:247)

at

spring.boot@2.0.0.M2/org.springframework.boot.SpringApplication.run(SpringApplication.java:1245)

at

spring.boot@2.0.0.M2/org.springframework.boot.SpringApplication.run(SpringApplication.java:1233)

at test/com.foo.test.App.main(App.java:10) Caused by:

java.lang.NoClassDefFoundError: java/sql/sqlException at

spring.beans@5.0.0.RC2/org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:145)

at

spring.boot@2.0.0.M2/org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:435)

… 7 more Caused by: java.lang.ClassNotFoundException:

java.sql.sqlException at

java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)

at

java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)

… 9 more

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值