Jimy-Guo opened a new issue, #218:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/218

   ### Issue description
   
   ### Environment
   
   * your apisix-java-plugin-runner version
   private void initServerBootstrap(ServerBootstrap bootstrap) {
           logger.debug("start init bootstrap");
           System.err.println("start init bootstrap");
           bootstrap.childHandler(new ChannelInitializer<DomainSocketChannel>() 
{
               @Override
               protected void initChannel(DomainSocketChannel channel) {
                   channel.pipeline().addFirst("logger", new LoggingHandler())
                           .addAfter("logger", "payloadEncoder", new 
PayloadEncoder())
                           .addAfter("payloadEncoder", "delayedDecoder", new 
BinaryProtocolDecoder())
                           .addLast("payloadDecoder", new PayloadDecoder())
                           .addAfter("payloadDecoder", "prepareConfHandler", 
createConfigReqHandler(cache, beanProvider))
                           .addAfter("prepareConfHandler", 
"hTTPReqCallHandler", createA6HttpHandler(cache))
                           .addLast("exceptionCaughtHandler", new 
ExceptionCaughtHandler());
   
               }
           });
           System.err.println("start bootstrap success");
       }
   
   
       public PrepareConfHandler createConfigReqHandler(Cache<Long, A6Conf> 
cache, ObjectProvider<PluginFilter> beanProvider) {
           List<PluginFilter> pluginFilterList = 
beanProvider.orderedStream().collect(Collectors.toList());
           Map<String, PluginFilter> filterMap = new HashMap<>();
           logger.debug("get plugins List:{}",pluginFilterList);
           System.err.println("get plugins List:"+pluginFilterList);
           for (PluginFilter filter : pluginFilterList) {
               System.err.println(filter.name());
               filterMap.put(filter.name(), filter);
           }
           return new PrepareConfHandler(cache, filterMap);
       }
   
   
   2022/12/05 12:58:18 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:18.927 DEBUG 56 --- [ main] o.a.a.p.r.s.ApplicationRunner : start init 
bootstrap
   
   start init bootstrap
   
   , context: ngx.timer
   
   2022/12/05 12:58:18 [warn] 55#55: *218 [lua] init.lua:913: start bootstrap 
success
   
   , context: ngx.timer
   
   2022/12/05 12:58:18 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:18.936 DEBUG 56 --- [ main] i.n.c.DefaultChannelId : 
-Dio.netty.processId: 56 (auto-detected)
   
   , context: ngx.timer
   
   2022/12/05 12:58:18 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:18.938 DEBUG 56 --- [ main] i.n.c.DefaultChannelId : 
-Dio.netty.machineId: 6a:b1:89:ff:fe:19:44:6f (auto-detected)
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.009 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.numHeapArenas: 2
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.009 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.numDirectArenas: 2
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.009 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.pageSize: 8192
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.010 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.maxOrder: 9
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.010 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.chunkSize: 4194304
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.010 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.smallCacheSize: 256
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.010 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.normalCacheSize: 64
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.010 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.maxCachedBufferCapacity: 32768
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.010 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.cacheTrimInterval: 8192
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.010 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.cacheTrimIntervalMillis: 0
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.010 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.useCacheForAllThreads: false
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.010 DEBUG 56 --- [ main] i.n.b.PooledByteBufAllocator : 
-Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.045 DEBUG 56 --- [ main] i.n.b.ByteBufUtil : 
-Dio.netty.allocator.type: pooled
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.045 DEBUG 56 --- [ main] i.n.b.ByteBufUtil : 
-Dio.netty.threadLocalDirectBufferSize: 0
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.046 DEBUG 56 --- [ main] i.n.b.ByteBufUtil : 
-Dio.netty.maxThreadLocalCharBufferSize: 16384
   
   , context: ngx.timer
   
   2022/12/05 12:58:19 [warn] 55#55: *218 [lua] init.lua:913: 2022-12-05 
12:58:19.171 WARN 56 --- [ main] o.a.a.p.r.s.ApplicationRunner : java runner is 
listening on the socket file: /usr/local/apisix/conf/apisix-1.sock
   
   , context: ngx.timer
   ### Minimal test code / Steps to reproduce the issue
   
   the apisix-java-plugin-runner is
    <parent>
           <groupId>org.apache.apisix</groupId>
           <artifactId>apisix-plugin-runner</artifactId>
           <version>0.3.1-SNAPSHOT</version>
       </parent>
   
   1.i find System.getProperty("user.dir") is /usr/local/apisix ,it makes the 
application reuned failed, so i change the path  
           String userDir = System.getProperty("user.dir");
           System.err.println(userDir);
           userDir=userDir.replace("apisix","apisix-java-plugin-runner");
           logger.warn("The filter userDir  {} ", userDir);
           userDir = userDir.substring(0, 
userDir.lastIndexOf("apisix-java-plugin-runner") + 25);
           String workDir = userDir + loadPath;
   
           System.err.println(userDir);
           System.err.println(userDir);
           Path path = Paths.get(workDir);
           boolean exists = Files.exists(path);
   2.find the  workDir is not exit,so i add the jar into the path by dockerfile
   FROM apache/apisix:2.15.1-centos
   #指定镜像创建者信息
   MAINTAINER jimyguo
   #将宿主机的文件拷贝到容器的具体目录中。这里使用ADD,拷贝后自动解压,如果不需要解压,可以使用COPY
   ADD jdk-11.0.16.1_linux-x64_bin.tar.gz /jdk
   ADD apache-apisix-java-plugin-runner-0.3.1-SNAPSHOT-bin.tar.gz /opt
   ADD apisix-java-plugin-runner-0.3.1-SNAPSHOT-src.tgz /usr/local
   ## 配置jdk环境
   ENV JAVA_HOME /jdk/jdk-11.0.16.1
   ENV PATH ${JAVA_HOME}/bin:$PATH
   3.it seems that all are successful,but the plugins are not working
   
   ### What's the actual result? (including assertion message & call stack if 
applicable)
   
   ### What's the expected result?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to