研究Quarkus出现的各种错误集锦

Quarkus很酷,但这些错误一点不酷 :(

 学习内容参考

https://developer.ibm.com/zh/articles/j-use-quarkus-to-develop-kubernetes-native-java-application/

https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/setup.html

 时隔多年又开始研究程序......

贴几个架构图,支持各种插件,看上去很强大。

 

 

 

 

0.一些基本操作

  • 生成应用
mvn "io.quarkus:quarkus-maven-plugin:0.27.0.Final:create" \
     -DprojectGroupId=io.vividcode \
    -DprojectArtifactId=quarkus-demo \
    -DclassName="io.vividcode.quarkus.ExampleResource" \
    -Dpath="/example"

不同的版本会报错误,1.4.2的发现不行,建立出来的pom.xml有问题
因为要尝试部署到kubernetes,所以需要用新一点的版本。

mvn io.quarkus:quarkus-maven-plugin:1.6.0.Final:create  -DprojectGroupId=io.vividcode     -DprojectArtifactId=quarkus-sample  -DclassName="io.vividcode.quarkus.ExampleResource"   -Dpath="/example"

 

  • list extension
mvnw quarkus:list-extensions
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< io.vividcode:quarkus-starter >--------------------
[INFO] Building quarkus-starter 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- quarkus-maven-plugin:0.27.0:list-extensions (default-cli) @ quarkus-starter ---
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-bom/0.27.0/quarkus-bom-0.27.0.json

Current Quarkus extensions available:
Quarkus - Core                                     quarkus-core
ArC                                                quarkus-arc
Quarkus - Caffeine - Runtime                       quarkus-caffeine
JAXB                                               quarkus-jaxb
Jackson                                            quarkus-jackson
....

 

  • 添加extension
mvnw quarkus:add-extension -Dextensions=quarkus-spring-web,quarkus-spring-data-jpa
mvnw quarkus:add-extension -Dextensions=quarkus-kubernetes,quarkus-container-image-jib

 

1.mysql在windows上的安装以及找回密码

在官网下载并解压64位版本,然后在根目录下加入my.ini文件

[mysqld]
basedir=D:\\mysql-8.0.21-winx64\\
datadir=D:\\mysql-8.0.21-winx64\\data

然后

mysqld --initialize

mysqld --install mysql8.0

net start mysql8.0

mysql -u root -p

通过mysql一连,发现没密码了,接着做下一步

net stop mysql8.0

mysqld --shared-memory --skip-grant-tables

mysql
mysql>FLUSH PRIVILEGES

mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'welcome1'

mysql>quit

把密码刷成 welcome1,然后登录

mysql> create database quarkus;

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| quarkus            |
| sys                |
+--------------------+
5 rows in set (0.00 sec)

 

2.通过JPA连接数据库时的报错

mvn compile quarkus:dev
.......

mysql The server time zone value '?й???????' is unrecognized or represents more than one time zone.
........

需要修改application.properties文件,在url后面添加一串东西

quarkus.datasource.url = jdbc:mysql://localhost:3306/quarkus?serverTimezone=UTC&characterEncoding=utf-8
quarkus.datasource.driver = com.mysql.cj.jdbc.Driver
quarkus.datasource.username = root
quarkus.datasource.password = welcome1
quarkus.hibernate-orm.dialect = org.hibernate.dialect.MySQL8Dialect
quarkus.hibernate-orm.dialect.storage-engine = InnoDB
quarkus.hibernate-orm.database.generation = drop-and-create

 

3.基于CURL命令POST数据插入数据库

按照官方文档,无耐怎么搞都是出错。

curl -H "Content-Type:application/json"  -X POST --data '{"name":"Banana","price":2}' http://localhost:8080/product

在postman上倒是成功了,目前没发现为啥命令行不行

 

 4.windows 10上的native build

按照文档,装完vs_BuildTools.exe,vc++ 2017, windows kit

装完Graalvm,修改完JAVA_HOME等环境变量,然后进入项目目录

call "d:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" && mvn package -Pnative

然后

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on OpenJDK 64-Bit Server VM GraalVM CE 20.1.0
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] D:\graalvm-ce-java8-20.1.0\bin\native-image.cmd -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -jar quarkus-starter-1.0-SNAPSHOT-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:+AddAllCharsets -H:EnableURLProtocols=http,https --enable-all-security-services -H:+JNI -H:-UseServiceLoaderFeature -H:+StackTrace quarkus-starter-1.0-SNAPSHOT-runner
[quarkus-starter-1.0-SNAPSHOT-runner:17844]    classlist:  14,115.85 ms,  2.46 GB
[quarkus-starter-1.0-SNAPSHOT-runner:17844]        setup:   1,704.89 ms,  2.46 GB
Error: Unable to detect supported WINDOWS native software development toolchain.
com.oracle.svm.core.util.UserError$UserException: Unable to detect supported WINDOWS native software development toolchain.
        at com.oracle.svm.core.util.UserError.abort(UserError.java:68)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.<init>(CCompilerInvoker.java:72)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker$WindowsCCompilerInvoker.<init>(CCompilerInvoker.java:93)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.create(CCompilerInvoker.java:84)
        at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:851)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:536)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:451)
        at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error: Image build request failed with exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  43.576 s
[INFO] Finished at: 2020-08-10T23:26:43+08:00
Unable to detect supported WINDOWS native software development toolchain.

尝试切换字符集chcp 437等步骤,没有生效,暂时没有解决。

 

 5.生成镜像部署

要用docker了,因为之前在windows上用docker遇到的各种坑,果断切换成rhel,又是一段狂装机。

按照文档,需要在application.properties里面加入

quarkus.container-image.registry=quay.io
quarkus.container-image.group=jnie
quarkus.container-image.name=quarkus-sample
quarkus.container-image.tag=1.0-SNAPSHOT
quarkus.kubernetes.service-type=load-balancer

然后运行

 mvn clean package -DskipTests -Dquarkus.container-image.push=true
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] Base image 'fabric8/java-alpine-openjdk11-jre' does not use a specific image digest - build may not be reproducible
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] LogEvent [level=INFO, message=Docker config auths section defines credentials for quay.io]
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] LogEvent [level=LIFECYCLE, message=Using credentials from Docker config (/root/.docker/config.json) for quay.io/jnie/quarkus-sample:1.0-SNAPSHOT]
[INFO] [io.quarkus.kubernetes.deployment.KubernetesProcessor] Generated the Kubernetes manifests: 'kubernetes.json,kubernetes.yml' in '/root/lab/quarkus-sample/target/kubernetes'
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] The base image requires auth. Trying again for fabric8/java-alpine-openjdk11-jre...
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Using base image with digest: sha256:b459cc59d6c7ddc9fd52f981fc4c187f44a401f2433a1b4110810d2dd9e98a07
[ERROR] [io.quarkus.container.image.jib.deployment.JibProcessor] I/O error for image [quay.io/jnie/quarkus-sample]:
[ERROR] [io.quarkus.container.image.jib.deployment.JibProcessor]     java.net.SocketTimeoutException
[ERROR] [io.quarkus.container.image.jib.deployment.JibProcessor]     Read timed out
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Container entrypoint set to [java, -Dquarkus.http.host=0.0.0.0, -Djava.util.logging.manager=org.jboss.logmanager.LogManager, -cp, /app/resources:/app/classes:/app/libs/*, io.quarkus.runner.GeneratedMain]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  06:07 min
[INFO] Finished at: 2020-08-11T16:45:49+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.6.1.Final:build (default) on project quarkus-sample: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]     [error]: Build step io.quarkus.container.image.jib.deployment.JibProcessor#buildFromJar threw an exception: java.lang.RuntimeException: Unable to create container image
[ERROR]     at io.quarkus.container.image.jib.deployment.JibProcessor.containerize(JibProcessor.java:153)
[ERROR]     at io.quarkus.container.image.jib.deployment.JibProcessor.buildFromJar(JibProcessor.java:102)
[ERROR]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]     at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:932)
[ERROR]     at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR]     at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR]     at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR]     at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] Caused by: java.util.concurrent.ExecutionException: java.net.SocketTimeoutException: Read timed out
[ERROR]     at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:552)
[ERROR]     at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:513)
[ERROR]     at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:82)
[ERROR]     at com.google.cloud.tools.jib.builder.steps.StepsRunner.realizeFutures(StepsRunner.java:94)
[ERROR]     at com.google.cloud.tools.jib.builder.steps.StepsRunner.lambda$pushImages$11(StepsRunner.java:387)
[ERROR]     at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
[ERROR]     at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
[ERROR]     at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
[ERROR]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[ERROR]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[ERROR]     at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] Caused by: java.net.SocketTimeoutException: Read timed out
[ERROR]     at java.base/java.net.SocketInputStream.socketRead0(Native Method)
[ERROR]     at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
[ERROR]     at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
[ERROR]     at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
[ERROR]     at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:448)
[ERROR]     at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:68)

里面调用了fabric类,发现问题是连接不上,

然后换一种模式构建镜像,Dockerfile.jvm是在安装的时候自动生成的。

docker build -f src/main/docker/Dockerfile.jvm  -t  quay.io/jnie/vividcode/quarkus-sample  .

构建完成看一下

[root@registry quarkus-sample]# docker images
REPOSITORY                                    TAG                 IMAGE ID            CREATED             SIZE
quay.io/jnie/vividcode/quarkus-sample         latest              5a6fb08704cf        10 seconds ago      549 MB
registry.access.redhat.com/ubi8/ubi-minimal   8.1                 91d23a64fdf2        4 months ago        107 MB

 

然后运行

[root@registry docker]# docker run -i --rm -p 8080:8080 quay.io/jnie/vividcode/quarkus-sample:latest
exec java -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/app.jar
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2020-08-11 09:14:13,165 INFO  [io.quarkus] (main) quarkus-sample 1.0-SNAPSHOT on JVM (powered by Quarkus 1.6.1.Final) started in 1.704s. Listening on: http://0.0.0.0:8080
2020-08-11 09:14:13,242 INFO  [io.quarkus] (main) Profile prod activated. 
2020-08-11 09:14:13,246 INFO  [io.quarkus] (main) Installed features: [cdi, kubernetes, resteasy]

测试成功。

 

 6.kafka消息队列操作

docker-compose对于一些简单得环境还是挺好用的,先装一个

curl -L https://github.com/docker/compose/releases/download/1.17.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

docker-compose version

建立docker-compose.yml

version: '3'
services:
  zookeeper:
    image: strimzi/kafka:0.11.3-kafka-2.1.0
    command: [
      "sh", "-c",
      "bin/zookeeper-server-start.sh config/zookeeper.properties"
    ]
    ports:
      - "2181:2181"
    environment:
      LOG_DIR: /tmp/logs
  kafka:
    image: strimzi/kafka:0.11.3-kafka-2.1.0
    command: [
      "sh", "-c",
      "bin/kafka-server-start.sh config/server.properties --override listeners=$${KAFKA_LISTENERS} --override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS} --override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT}"
    ]
    depends_on:
      - zookeeper
    ports:
      - "9092:9092"
    environment:
      LOG_DIR: "/tmp/logs"
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
      KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
  price-generator:
    image: quay.io/rhdevelopers/quarkus-tutorial-price-generator:1.0
    network_mode: host
    depends_on:
      - kafka

先下载镜像,然后启动

docker-compose up

因为我是在另外一台windows环境去连接,然后修改application.properties

kafka.bootstrap.servers=192.168.56.110:9092

mp.messaging.incoming.priced-wine.connector=smallrye-kafka
mp.messaging.incoming.priced-wine.topic=priced-wine
mp.messaging.incoming.priced-wine.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer


mp.messaging.outgoing.wine.connector=smallrye-kafka
mp.messaging.outgoing.wine.topic=wine
mp.messaging.outgoing.wine.value.serializer=org.apache.kafka.common.serialization.StringSerializer

在windows环境中启动quarkus,然后发现product和consume都连接不上

2020-08-12 11:53:35,910 WARN  [org.apa.kaf.cli.NetworkClient] (kafka-producer-network-thread | producer-1) [Producer clientId=producer-1] Connection to node 0 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
2020-08-12 11:53:36,854 WARN  [org.apa.kaf.cli.NetworkClient] (vert.x-kafka-consumer-thread-0) [Consumer clientId=consumer-f61b984a-2a19-4538-924b-77d87ad886df-1, groupId=f61b984a-2a19-4538-924b-77d87ad886df] Connection to node 0 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.

发现已经自己修改成本地的9092 bootstrap server地址了。应该是还有一些参数可以指定到远端,放下以后再查。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

问题解决,需要修改docker-compose.yml文件。

      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://192.168.56.110:9092

然后重新启动kakfa server.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

换到rhel环境中(和kafka一台机器)再尝试,成了。

进入kafka的容器,然后查看topic

[kafka@ae9f7e3defe3 bin]$ ./kafka-topics.sh --zookeeper 192.168.56.110:2181 --list                        
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
__consumer_offsets
priced-wine
wine

 

describe一下这些topic

[kafka@ae9f7e3defe3 bin]$ ./kafka-topics.sh --zookeeper 192.168.56.110:2181 --describe --topic priced-wine
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
Topic:priced-wine    PartitionCount:1    ReplicationFactor:1    Configs:
    Topic: priced-wine    Partition: 0    Leader: 0    Replicas: 0    Isr: 0
[kafka@ae9f7e3defe3 bin]$ ./kafka-topics.sh --zookeeper 192.168.56.110:2181 --describe --topic wine       
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
Topic:wine    PartitionCount:1    ReplicationFactor:1    Configs:
    Topic: wine    Partition: 0    Leader: 0    Replicas: 0    Isr: 0

查看消费的数据

# 先需要找出groups

[kafka@ae9f7e3defe3 bin]$ ./kafka-consumer-groups.sh  --bootstrap-server 192.168.56.110:9092 --list
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
f9783020-b27c-4fdd-945a-8b26d850e818
1db9894c-8991-4024-ade1-d10b8da1781a

#然后分别列出每个groups的信息

[kafka@ae9f7e3defe3 bin]$ ./kafka-consumer-groups.sh  --bootstrap-server 192.168.56.110:9092 --group f9783020-b27c-4fdd-945a-8b26d850e818 --describe
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N

TOPIC           PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                                                          HOST            CLIENT-ID
wine            0          1705            1705            0               consumer-f9783020-b27c-4fdd-945a-8b26d850e818-1-3c349379-6426-4738-a508-9176e3c3c3a7 /172.18.0.1     consumer-f9783020-b27c-4fdd-945a-8b26d850e818-1
[kafka@ae9f7e3defe3 bin]$ ./kafka-consumer-groups.sh  --bootstrap-server 192.168.56.110:9092 --group 1db9894c-8991-4024-ade1-d10b8da1781a --describe
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N

TOPIC           PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                                                          HOST            CLIENT-ID
priced-wine     0          1709            1713            4               consumer-1db9894c-8991-4024-ade1-d10b8da1781a-1-927d0482-ef69-4444-8637-339890662ee3 /172.18.0.1     consumer-1db9894c-8991-4024-ade1-d10b8da1781a-1

 

每个字段含义如下

 

 

 7.编译成 Native模式

windows环境中折腾了一堆,失败,找了个rhel的环境编译。

yum install -y dnf

dnf install gcc glibc-devel zlib-devel 

然后安装graalvm,和设置路径

# User specific environment and startup programs
GRAALVM_HOME=/root/graalvm-ce-java11-20.1.0


#JAVA_HOME=/root/jdk-11
JAVA_HOME=/root/graalvm-ce-java11-20.1.0

PATH=$PATH:$HOME/bin:/root:/root/graalvm-ce-java11-20.1.0/bin:/root/jdk-11/bin:/root/apache-maven-3.6.3/bin


export PATH JAVA_HOME GRAALVM_HOME

安装native-image

gu install native-image

然后构建native包,目前停在这一步做不下去了。。。。等等。。。这一步停了1个种头以上,万幸没有关掉虚机!

mvnw package -Pnative

........

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM Version 20.1.0 (Java Version 11.0.7)
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] /root/graalvm-ce-java11-20.1.0/bin/native-image -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Duser.language=en -J-Dfile.encoding=UTF-8 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -H:+JNI -jar quarkus-sample-1.0-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:-IncludeAllTimeZones -H:EnableURLProtocols=http --no-server -H:-UseServiceLoaderFeature -H:+StackTrace quarkus-sample-1.0-SNAPSHOT-runner
[INFO] [io.quarkus.kubernetes.deployment.KubernetesProcessor] Generated the Kubernetes manifests: 'kubernetes.json,kubernetes.yml' in '/root/lab/quarkus-sample/target/kubernetes'
-H:IncludeAllTimeZones and -H:IncludeTimeZones are now deprecated. Native-image includes all timezonesby default.

[quarkus-sample-1.0-SNAPSHOT-runner:22328] classlist: 23,432.66 ms, 1.20 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] (cap): 3,608.07 ms, 1.20 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] setup: 9,225.74 ms, 1.20 GB
15:02:34,987 INFO [org.hib.Version] HHH000412: Hibernate ORM core version 5.4.18.Final
15:02:43,957 INFO [org.jbo.threads] JBoss Threads version 3.1.1.Final

#我是虚拟机环境,此处等待1个种头。。。。。


[quarkus-sample-1.0-SNAPSHOT-runner:22328] (clinit): 35,703.42 ms, 2.79 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] (typeflow): 263,474.35 ms, 2.79 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] (objects): 696,260.48 ms, 2.79 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] (features): 12,515.34 ms, 2.79 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] analysis: 1,079,391.92 ms, 2.79 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] universe: 88,514.06 ms, 2.77 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] (parse): 138,875.94 ms, 2.48 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] (inline): 34,349.69 ms, 2.34 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] (compile): 151,359.46 ms, 2.46 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] compile: 360,229.51 ms, 2.40 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] image: 101,163.79 ms, 2.32 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] write: 43,839.40 ms, 2.32 GB
[quarkus-sample-1.0-SNAPSHOT-runner:22328] [total]: 1,711,048.50 ms, 2.32 GB
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Execute [objcopy, --strip-debug, /root/lab/quarkus-sample/target/quarkus-sample-1.0-SNAPSHOT-runner]
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 1780310ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30:28 min
[INFO] Finished at: 2020-08-12T15:29:09+08:00
[INFO] ------------------------------------------------------------------------

 

 运行完后在target目录下生成了一个54m的quarkus-sample-1.0-SNAPSHOT-runner

编译完成能够快速启动,但测试的时候因为不具备json啥类没有发送成功。 :(

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

还有各种大坑稍后逐步奉上...

posted @ 2020-08-10 23:10  ericnie  阅读(4767)  评论(0编辑  收藏  举报