Estou tentando gerar um relatório mas está dando isso java.lang.reflect.InaccessibleObjectException
12 respostas
javaireport
G
Garcia2
publicvoidgerarRelatoriosInfoPedidos(VendaVOvendaVO){try{StringcurrentPath="";try{currentPath=newjava.io.File(".").getCanonicalPath();}catch(IOExceptionex){System.out.println(ex.toString());}System.out.println(currentPath);HashMap<String,Object>parameters=newHashMap<String,Object>();parameters.put("IDVENDA",vendaVO.getIdVenda());JasperRunManager.runReportToPdfFile(currentPath+"/REL02.jasper",currentPath+"/REL02.pdf",null,Banco.getConnection());System.out.println("Relatorio gerado em "+currentPath+"/REL02.pdf");}catch(JRExceptionex){System.out.println("Não foi possivel imprimir, por favor verifique o modelo de impressão");}}
java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not “opens java.lang” to unnamed module @4b4523f8
java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not “opens java.lang” to unnamed module @4b4523f8
S
staroski
Executa sua máquina virtual com esse parâmetro:
--add-opensjava.base/java.lang=ALL-UNNAMED
J
Jasoni
Estou com o mesmo problema, mas só acontece quando adiciono uma imagem ao relatório.
J
Jasoni
No meu caso, na opção preview o relatório aparece OK, mas quando executo a aplicação, só gera o relatório se não tiver nenhuma imagem, se eu adicionar qualquer imagem jpg,gif ou png ele apresenta esse erro.