nginx-clojure / nginx-clojure/nginx-clojure

IOException while loading wave configuration from class path

Open
#176 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

can-not-reproduce coroutine mode
Dominant language
Java
Stars
1.1k
Forks
113
PR merge metrics
No merged PRs in 30d

Description

I am attempting to enable Coroutine support in my nginx-clojure instance and have followed the instructions dictated in this guide. However, on start I am receiving an IO exception when it attempts to load my wave configuration file.

Stack:

java.io.IOException: can not load resource [wave_cfg.txt] from classpath at nginx.clojure.wave.MethodDatabaseUtil.load(MethodDatabaseUtil.java:35) at nginx.clojure.wave.JavaAgent.buildClassFileTransformer(JavaAgent.java:191) at nginx.clojure.wave.JavaAgent.premain(JavaAgent.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386) at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)

I have placed my wave_cfg.txt file directly under the coroutine-udfs folder and added it to the class path just as I'm adding my other library paths, and given full permissions to the directories and their subfolders.

Options depicted below...

jvm_classpath "libs/:libs/prometric/:jars/:coroutine-udfs/";
jvm_options "-javaagent:/etc/nginx-clojure/jars/nginx-clojure-0.4.5.jar=mb";
jvm_options "-Xbootclasspath/a:/etc/nginx-clojure/jars/nginx-clojure-0.4.5.jar";
jvm_options "-Dnginx.clojure.wave.udfs=wave_cfg.txt";

Any ideas?

Edit: For reference this is running in a Docker container

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked configuration guide and the stack trace, then inspect MethodDatabaseUtil.java:35 and JavaAgent.java:191 to understand how wave_cfg.txt is loaded. Reproduce the startup in the Docker setup using the shown classpath and JVM options; done means the configuration loads successfully or the expected resource-path requirement is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, java, nginx
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.