Open Nenadst023 opened 1 year ago
On Windows, we need to handle spaces in the path or try to provide a directory without spaces. If there are spaces, inform it like this: C:\"My Folder"\project
. Please check this and try again, then let us know the outcome.
Same here with ubuntu :
def processing():
input_file = os.path.join(REPORTS_DIR, 'Blank_A4_1.jrxml')
output_file = os.path.join(REPORTS_DIR, 'csv')
conn = {
'driver': 'json',
'data_file': os.path.join(RESOURCES_DIR, 'resources/restaurants.json'),
'json_query': 'restaurants'
}
pyreportjasper = PyReportJasper()
pyreportjasper.config(
input_file,
output_file,
output_formats=["pdf"],
db_connection=conn,
resource="/home/roman/JaspersoftWorkspace/restaurant_card/resources/libs/"
)
# pyreportjasper.list_report_params()
pyreportjasper.process_report()
print('Result is the file below.')
print(output_file + '.pdf')
Output:
NameError: Error fill report: It was not possible to add the path /home/roman/JaspersoftWorkspace/restaurant_card/resources/libs/ to the Class Path: ERROR: java.io.IOException: Error, could not add URL to system classloader!
Python ver: 3.10.12 pyreportjasper: 2.1.3 Java: open jdk-18.0.2 OS: Ubuntu 22.04
I have a same error:
NameError: Error fill report: It was not possible to add the path /home/evol/jasperreports/app/report_evol/reports/adapters to the Class Path: ERROR: java.io.IOException: Error, could not add URL to system classloader!
Python ver: 3.9 pyreportjasper: 2.1.3 Java: openjdk21 OS: FreeBSD 14.0-RELEASE
Happens to me with the image example.
Placed logo-pyreportjasper.png
, main.py
and with_image.jrxml
in a fresh env, installed pyreportjasper (master) then ran python3 main.py
Output:
OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "org.update4j.DynamicClassLoader"). To use archived non-system classes, this property must not be set
Traceback (most recent call last):
File "/workspace/development/test-pyreportjasper-images/main.py", line 23, in <module>
contains_image()
File "/workspace/development/test-pyreportjasper-images/main.py", line 18, in contains_image
pyreportjasper.process_report()
File "/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/site-packages/pyreportjasper/pyreportjasper.py", line 169, in process_report
raise error
NameError: Error fill report: It was not possible to add the path /workspace/development/test-pyreportjasper-images to the Class Path: ERROR: java.io.IOException: Error, could not add URL to system classloader!
Versions:
pyreportjasper @ git+https://github.com/acesseonline/pyreportjasper@3082ff5a0e5d9e730b689c4e06c9948d33ddfc3e
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.10+7-Debian-1deb12u1, mixed mode, sharing)
Python 3.11.6
Debian GNU/Linux 12 (bookworm)
Unsupported Java version.
Hi,
I have same problem. My code..
Output: NameError: Error fill report: It was not possible to add the path x:\nenad_ws-- PY RAZVOJ\StampaCena\oracle\ to the Class Path: ERROR: java.io.IOException: Error, could not add URL to system classloader!
Project path..![image](https://user-images.githubusercontent.com/41395730/222932690-56032c21-d5a2-48f5-a811-dd60c5fa44d5.png)
Python ver: 3.10.7 Lib installed with pip3 install git+https://github.com/acesseonline/pyreportjasper.git - Version: 2.1.2 Java: open jdk-19.0.2 Jvm: Oracle OS: windows 11
Jaspersoft Studio: 6.20.0