PyReportJasper初始化VM报错的解决求助
PyReportJasper初始化VM报错的解决求助
我最近在用PyReportJasper做打印功能,一点击打印就遇到了VM初始化失败的错误,具体错误信息如下:
Error occurred during initialization of VM Could not find agent library instrument on the library path, with error: La procédure spécifiée est introuvable Module java.instrument may be missing from runtime image.
我当前的环境配置是:安装了JDK 23,使用Django 4.1框架开发,PyReportJasper版本为2.1.4。
下面是我在views.py中编写的打印函数代码:
def Demande_Intervention(request): REPORTS_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)),) input_file = os.path.join(REPORTS_DIR, 'Demande_Intervention.jasper') output_file = os.path.join(REPORTS_DIR, 'Demande_Intervention') print(input_file) print(output_file) jasper = PyReportJasper() con = { 'driver': 'postgres', 'username': settings.DATABASES['default']['USER'], 'password': settings.DATABASES['default']['PASSWORD'], 'host': settings.DATABASES['default']['HOST'], 'database': settings.DATABASES['default']['NAME'], 'port': settings.DATABASES['default']['PORT'], 'jdbc_driver': 'org.postgresql.Driver' } pyreportjasper = PyReportJasper() pyreportjasper.config( input_file, output_file, output_formats=["pdf", "rtf"] ) pyreportjasper.process_report() return FileResponse(open(output_file +'.pdf', 'rb'), as_attachment=True)
有没有大佬能帮我解决这个问题呀?
备注:内容来源于stack exchange,提问作者Med azizi
相关产品推荐
相关产品推荐

