-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jars in manifest file not loaded and causes ModuleNotFoundError'>: No module named 'org.apache' #323
Comments
Embedded manifest zipped below: |
Jep has the concept of a ClassEnquirer which tells the python envionment which classes are available in python. I suspect your problem lies with the default implementation. I am not very familiar with this code but it appears to be reading the manifest of every jar in the classpath and processing every library specified int he manifest so it seems like your case should work. I recommend debugging into the ClassList to try to determine if it is processing your manifest and finding the referenced libraries. |
@bsteffensmeier thank you for the answer, will try to debug when some time is available and report back here. |
I had the exact same issue when your application with all the dependencies was set up in a Linux environment using a regular user account. When the application and all the dependencies were set up using the root account the application could be launched from any directory without an error. Hope this info will be of some help in case you haven't solved this issue yet. |
@bsteffensmeier sorry for late reply, just had time to debug it. The issue is in this line https://github.com/ninia/jep/blob/dev_3.9/src/main/java/jep/ClassList.java#L120
|
Unfortunately, this issue appears to have been missed and forgotten about. I think the fix would be a good fix in case others encounter this problem. @lfcnassif, are you still interested in submitting a pull request? |
First, thank you all for this great project!
My app has the following structure:
./app.jar
./lib/lib1.jar
./lib/lib2.jar
...
My python script (called by java app) imports some classes from jars in lib folder. When executing
java -jar app.jar
, it throws jep.JepException: <class 'ModuleNotFoundError'>: No module named 'org.apache' for example. But all libraries are listed in app.jar manifest file and are used fine from app.jar embedded classes.If I change current dir to lib folder and executes
java -jar ../app.jar
no error is thrown and the python script can access the java libraries. Default java classpath uses . directory.Using jep-3.9.1 on Windows 10 with Oracle java 8 x64 and on Ubuntu 20.04 with Liberica OpenJDK 8 full.
The text was updated successfully, but these errors were encountered: