提交 8ab9aef0 编写于 作者: Z ziyilin 提交者: dinglei

[graal] Successfully run with main method (#1158)

上级 9de6cb78
[
{
"name":"[B"
},
{
"name":"[J"
},
{
"name":"[Ljava.lang.Object;"
},
{
"name":"io.netty.channel.socket.nio.NioSocketChannel",
"methods":[{ "name":"<init>", "parameterTypes":[] }]
},
{
"name":"java.beans.Transient"
},
{
"name":"java.lang.Byte"
},
{
"name":"java.lang.Class"
},
{
"name":"java.lang.Comparable",
"allPublicMethods":true
},
{
"name":"java.lang.Float"
},
{
"name":"java.lang.Integer"
},
{
"name":"java.lang.Long"
},
{
"name":"java.lang.Object"
},
{
"name":"java.lang.String",
"fields":[{"name":"value"}]
},
{
"name":"java.lang.System"
},
{
"name":"java.nio.Bits",
"methods":[{ "name":"unaligned", "parameterTypes":[] }]
},
{
"name":"java.nio.Buffer",
"fields":[{"name":"address"}]
},
{
"name":"java.nio.DirectByteBuffer",
"fields":[{"name":"cleaner"}],
"methods":[{ "name":"<init>", "parameterTypes":["long", "int"] }]
},
{
"name":"java.nio.file.Path"
},
{
"name":"org.apache.rocketmq.common.protocol.header.SendMessageRequestHeaderV2",
"allDeclaredFields":true
},
{
"name":"org.apache.rocketmq.common.protocol.header.SendMessageResponseHeader",
"allDeclaredFields":true,
"methods":[{ "name":"<init>", "parameterTypes":[] }]
},
{
"name":"org.apache.rocketmq.common.protocol.header.UnregisterClientRequestHeader",
"allDeclaredFields":true
},
{
"name":"org.apache.rocketmq.common.protocol.header.namesrv.GetRouteInfoRequestHeader",
"allDeclaredFields":true
},
{
"name":"org.apache.rocketmq.common.protocol.heartbeat.HeartbeatData",
"allDeclaredFields":true,
"allPublicFields":true,
"allPublicMethods":true
},
{
"name":"org.apache.rocketmq.common.protocol.heartbeat.ProducerData",
"allDeclaredFields":true,
"allPublicFields":true,
"allPublicMethods":true
},
{
"name":"org.apache.rocketmq.common.protocol.route.BrokerData",
"allDeclaredFields":true,
"allDeclaredConstructors":true,
"allPublicFields":true,
"allPublicMethods":true
},
{
"name":"org.apache.rocketmq.common.protocol.route.QueueData",
"allDeclaredFields":true,
"allDeclaredConstructors":true,
"allPublicFields":true,
"allPublicMethods":true
},
{
"name":"org.apache.rocketmq.common.protocol.route.TopicRouteData",
"allDeclaredFields":true,
"allDeclaredConstructors":true,
"allPublicFields":true,
"allPublicMethods":true
},
{
"name":"org.apache.rocketmq.remoting.protocol.LanguageCode",
"fields":[
{"name":"CPP"},
{"name":"DELPHI"},
{"name":"DOTNET"},
{"name":"ERLANG"},
{"name":"GO"},
{"name":"HTTP"},
{"name":"JAVA"},
{"name":"OMS"},
{"name":"OTHER"},
{"name":"PHP"},
{"name":"PYTHON"},
{"name":"RUBY"}
]
},
{
"name":"org.apache.rocketmq.remoting.protocol.RemotingCommand",
"allDeclaredFields":true,
"allDeclaredConstructors":true,
"allPublicFields":true,
"allPublicMethods":true
},
{
"name":"org.apache.rocketmq.remoting.protocol.RemotingSerializable",
"allDeclaredFields":true,
"allPublicMethods":true
},
{
"name":"org.apache.rocketmq.remoting.protocol.SerializeType",
"fields":[
{"name":"JSON"},
{"name":"ROCKETMQ"}
]
},
{
"name":"sun.misc.Cleaner",
"methods":[{ "name":"clean", "parameterTypes":[] }]
},
{
"name":"sun.misc.Unsafe",
"fields":[{"name":"theUnsafe"}],
"methods":[{ "name":"copyMemory", "parameterTypes":["java.lang.Object", "long", "java.lang.Object", "long", "long"] }]
},
{
"name":"sun.misc.VM",
"methods":[{ "name":"maxDirectMemory", "parameterTypes":[] }]
},
{
"name":"sun.nio.ch.SelectorImpl",
"fields":[
{"name":"publicSelectedKeys"},
{"name":"selectedKeys"}
]
}
]
......@@ -8,13 +8,16 @@ import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.remoting.common.RemotingHelper;
import com.alibaba.fastjson.parser.ParserConfig;
import io.netty.handler.logging.LoggingHandler;
import io.netty.handler.logging.LogLevel;
public class Producer {
private static final LoggingHandler log = new LoggingHandler(LogLevel.DEBUG);
public static void main(String[] args) throws MQClientException, InterruptedException {
ParserConfig.global.setAsmEnable(false);
DefaultMQProducer producer = new DefaultMQProducer("ProducerGroupName");
producer.start();
......
#!/bin/bash
SVM_OPT="--allow-incomplete-classpath --report-unsupported-elements-at-runtime"
SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=com.alibaba.fastjson.serializer.JodaCodec"
SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator"
SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator"
SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkNpnApplicationProtocolNegotiator"
SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkNpnSslEngine"
SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkAlpnSslEngine"
SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.util.internal.JavassistTypeParameterMatcherGenerator"
SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=com.alibaba.fastjson.serializer.JodaCodec"
# testing
#SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.util.SelfSignedCertificate"
#SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.util.ThreadLocalInsecureRandom"
SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=io.netty.handler.ssl.util.SelfSignedCertificate"
SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=io.netty.handler.ssl.util.ThreadLocalInsecureRandom"
SVM_OPT="${SVM_OPT} --enable-url-protocols=http"
SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=com.alibaba.fastjson.serializer.SerializeConfig"
SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=com.alibaba.fastjson.parser.ParserConfig"
SVM_OPT="${SVM_OPT} --enable-url-protocols=http"
WORKDIR=`pwd`
CONFIG_OPT=" -Dio.netty.noUnsafe=true -H:+ReportExceptionStackTraces --allow-incomplete-classpath"
#native_image=/home/cengfeng.lzy/GraalDev/graal/vm/mxbuild/linux-amd64/GRAALVM_LIBGRAAL/graalvm-libgraal-1.0.0-rc15-dev/bin/native-image
native_image=~/tools/graalvm-ce-1.0.0-rc14/bin/native-image
$native_image $CONFIG_OPT $SVM_OPT -jar target/rocketmq-client-4.4.1-SNAPSHOT-jar-with-dependencies.jar
CONFIG_OPT="-H:ConfigurationFileDirectories=${WORKDIR}/config -Dio.netty.noUnsafe=true -H:+ReportExceptionStackTraces --allow-incomplete-classpath"
native_image=/home/cengfeng.lzy/GraalDev/graal/vm/mxbuild/linux-amd64/GRAALVM_LIBGRAAL/graalvm-libgraal-1.0.0-rc16-dev/bin/native-image
#native_image=~/tools/graalvm-ce-1.0.0-rc14/bin/native-image
$native_image $CONFIG_OPT $SVM_OPT -jar target/rocketmq-client-4.5.1-SNAPSHOT-jar-with-dependencies.jar
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册