apache / apisix-java-plugin-runner

APISIX Plugin Runner in Java
https://apisix.apache.org/
Apache License 2.0
126 stars 95 forks source link

request help: java plugin Jar deployment keeps restarting #263

Closed adairll closed 11 months ago

adairll commented 11 months ago

Issue description

hello, I deployed to Apisix according to the https://github.com/tzssangglass/java-plugin-runner-demo-1 tutorial Error log keeps restarting the jar service Could you please help me see what caused it

apisix config.yaml: `deployment: role: traditional role_traditional: config_provider: etcd admin: admin_key:

ext-plugin: cmd: ['java', '-jar', '-Xmx1g', '-Xms1g', '/path/to/apisix-runner-bin/demo-0.0.1-SNAPSHOT.jar']`

error.log . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _ | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.7.1)

, context: ngx.timer 2023/08/23 14:55:02 [warn] 17365#17365: 17 [lua] init.lua:953: 2023-08-23 14:55:02.117 INFO 17413 --- [ main] c.e.d.DemoApplication : Starting DemoApplication v0.0.1-SNAPSHOT using Java 11.0.18 on ubuntu20-test with PID 17413 (/opt/apisix/plugin/demo-0.0.1-SNAPSHOT.jar started by root in /usr/local/apisix/logs) , context: ngx.timer 2023/08/23 14:55:02 [warn] 17365#17365: 17 [lua] init.lua:953: 2023-08-23 14:55:02.132 INFO 17413 --- [ main] c.e.d.DemoApplication : No active profile set, falling back to 1 default profile: "default" , context: ngx.timer 2023/08/23 14:55:03 [warn] 17365#17365: 17 [lua] init.lua:953: 2023-08-23 14:55:03.026 INFO 17413 --- [ main] c.e.d.DemoApplication : Started DemoApplication in 1.717 seconds (JVM running for 3.056) , context: ngx.timer 2023/08/23 14:55:05 [warn] 17365#17365: 17 [lua] init.lua:953: 2023-08-23 14:55:05.263 INFO 17413 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. , context: ngx.timer 2023/08/23 14:55:05 [warn] 17365#17365: *17 [lua] init.lua:953: 2023-08-23 14:55:05.296 ERROR 17413 --- [ main] o.s.b.SpringApplication : Application run failed

java.lang.IllegalStateException: Failed to execute CommandLineRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:774) ~[spring-boot-2.7.1.jar!/:2.7.1] at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:755) ~[spring-boot-2.7.1.jar!/:2.7.1] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.7.1.jar!/:2.7.1] at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164) ~[spring-boot-2.7.1.jar!/:2.7.1] at com.example.demo.DemoApplication.main(DemoApplication.java:14) ~[classes!/:0.0.1-SNAPSHOT] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[demo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[demo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[demo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) ~[demo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] Caused by: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: No such file or directory`

Environment

adairll commented 11 months ago

I refer to 【https://github.com/apache/apisix-java-plugin-runner/issues/137】 【https://github.com/apache/apisix-java-plugin-runner/issues/137】 But still reporting the same error There is no APISIX in env_ Home, do you need to add it?

adairll commented 11 months ago

resolved: step1:[/usr/local/apisix/conf]Create a [conf] folder under the directory-->[/usr/local/apisix/conf/conf] step2:/usr/local/apisix/conf execute apisix start