rodriguesabner 13 de mai. de 2019
Boa noite Guedes, seja bem vindo ao Fórum! Em qual linha exatamente da o NullPointer?
D_Guedes 13 de mai. de 2019
Bom Dia Abner. Eis a questão. Esta parando nesta linha:
JasperPrint jasperPrint = JasperFillManager.fillReport(“C:/RELATORIO/PlacaComum.jrxml”, new HashMap(), jrRS);
O caminho esta correto. Este e o caminho da pasa onde estão os relatorios.
No run, tenho este seguinte erro:
log4j : WARN No appenders could be found for logger ( net . sf . jasperreports . extensions . ExtensionsEnvironment ).
log4j : WARN Please initialize the log4j system properly .
Exception in thread "AWT-EventQueue-0" java . lang . ExceptionInInitializerError
at net . sf . jasperreports . engine . DefaultJasperReportsContext . getExtensions ( DefaultJasperReportsContext . java : 277 )
at net . sf . jasperreports . engine . util . MessageUtil . getMessageProvider ( MessageUtil . java : 70 )
at net . sf . jasperreports . engine . JRException . resolveMessage ( JRException . java : 167 )
at net . sf . jasperreports . engine . JRException . getMessage ( JRException . java : 148 )
at net . sf . jasperreports . engine . JRException . getMessage ( JRException . java : 139 )
at java . lang . Throwable . getLocalizedMessage ( Throwable . java : 391 )
at java . lang . Throwable . toString ( Throwable . java : 480 )
at java . lang . String . valueOf ( String . java : 2994 )
at java . lang . StringBuilder . append ( StringBuilder . java : 131 )
at Visao . TelaPrincipal . TesteNovaPlaca ( TelaPrincipal . java : 2278 )
at Visao . TelaPrincipal . jButtonSalvarPlacaActionPerformed ( TelaPrincipal . java : 1336 )
at Visao . TelaPrincipal . access $300 ( TelaPrincipal . java : 28 )
at Visao . TelaPrincipal $6 . actionPerformed ( TelaPrincipal . java : 286 )
at javax . swing . AbstractButton . fireActionPerformed ( AbstractButton . java : 2022 )
at javax . swing . AbstractButton $Handler . actionPerformed ( AbstractButton . java : 2348 )
at javax . swing . DefaultButtonModel . fireActionPerformed ( DefaultButtonModel . java : 402 )
at javax . swing . DefaultButtonModel . setPressed ( DefaultButtonModel . java : 259 )
at javax . swing . plaf . basic . BasicButtonListener . mouseReleased ( BasicButtonListener . java : 252 )
at java . awt . Component . processMouseEvent ( Component . java : 6539 )
at javax . swing . JComponent . processMouseEvent ( JComponent . java : 3324 )
at java . awt . Component . processEvent ( Component . java : 6304 )
at java . awt . Container . processEvent ( Container . java : 2239 )
at java . awt . Component . dispatchEventImpl ( Component . java : 4889 )
at java . awt . Container . dispatchEventImpl ( Container . java : 2297 )
at java . awt . Component . dispatchEvent ( Component . java : 4711 )
at java . awt . LightweightDispatcher . retargetMouseEvent ( Container . java : 4904 )
at java . awt . LightweightDispatcher . processMouseEvent ( Container . java : 4535 )
at java . awt . LightweightDispatcher . dispatchEvent ( Container . java : 4476 )
at java . awt . Container . dispatchEventImpl ( Container . java : 2283 )
at java . awt . Window . dispatchEventImpl ( Window . java : 2746 )
at java . awt . Component . dispatchEvent ( Component . java : 4711 )
at java . awt . EventQueue . dispatchEventImpl ( EventQueue . java : 760 )
at java . awt . EventQueue . access $500 ( EventQueue . java : 97 )
at java . awt . EventQueue $3 . run ( EventQueue . java : 709 )
at java . awt . EventQueue $3 . run ( EventQueue . java : 703 )
at java . security . AccessController . doPrivileged ( Native Method )
at java . security . ProtectionDomain $JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 74 )
at java . security . ProtectionDomain $JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 84 )
at java . awt . EventQueue $4 . run ( EventQueue . java : 733 )
at java . awt . EventQueue $4 . run ( EventQueue . java : 731 )
at java . security . AccessController . doPrivileged ( Native Method )
at java . security . ProtectionDomain $JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 74 )
at java . awt . EventQueue . dispatchEvent ( EventQueue . java : 730 )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( EventDispatchThread . java : 205 )
at java . awt . EventDispatchThread . pumpEventsForFilter ( EventDispatchThread . java : 116 )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( EventDispatchThread . java : 105 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 101 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 93 )
at java . awt . EventDispatchThread . run ( EventDispatchThread . java : 82 )
Exception in thread "AWT-EventQueue-0" java . lang . NoClassDefFoundError : Could not initialize class net . sf . jasperreports . extensions . ExtensionsEnvironment
at net . sf . jasperreports . engine . DefaultJasperReportsContext . getExtensions ( DefaultJasperReportsContext . java : 277 )
at net . sf . jasperreports . engine . util . MessageUtil . getMessageProvider ( MessageUtil . java : 70 )
at net . sf . jasperreports . engine . JRRuntimeException . resolveMessage ( JRRuntimeException . java : 166 )
at net . sf . jasperreports . engine . JRRuntimeException . getMessage ( JRRuntimeException . java : 147 )
at net . sf . jasperreports . engine . JRRuntimeException . getMessage ( JRRuntimeException . java : 138 )
at java . lang . Throwable . getLocalizedMessage ( Throwable . java : 391 )
at java . lang . Throwable . toString ( Throwable . java : 480 )
at java . lang . String . valueOf ( String . java : 2994 )
at java . lang . StringBuilder . append ( StringBuilder . java : 131 )
at java . lang . Throwable . printEnclosedStackTrace ( Throwable . java : 695 )
at java . lang . Throwable . printStackTrace ( Throwable . java : 667 )
at java . lang . Throwable . printStackTrace ( Throwable . java : 643 )
at java . lang . ThreadGroup . uncaughtException ( ThreadGroup . java : 1061 )
at java . lang . ThreadGroup . uncaughtException ( ThreadGroup . java : 1052 )
at java . awt . EventDispatchThread . processException ( EventDispatchThread . java : 227 )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( EventDispatchThread . java : 219 )
at java . awt . EventDispatchThread . pumpEventsForFilter ( EventDispatchThread . java : 116 )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( EventDispatchThread . java : 105 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 101 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 93 )
at java . awt . EventDispatchThread . run ( EventDispatchThread . java : 82 )
D_Guedes 14 de mai. de 2019
Boa Noite Galera. Mais alguem pode ajudar?
rodriguesabner 14 de mai. de 2019
Opa, agora que vi que vc respondeu, só um detalhe, vc tá usando Windows?
D_Guedes 14 de mai. de 2019
E sim cara. Infelizmente o windows 10.
rodriguesabner 14 de mai. de 2019
Troca o isso “/” por isso \\
JasperFillManager.fillReport(“C:\\RELATORIO\\PlacaComum.jrxml
D_Guedes 14 de mai. de 2019
Colocando desta forma C:\RELATORIO\PlacaComum.jasper eu tive:
log4j : WARN No appenders could be found for logger ( net . sf . jasperreports . engine . fill . BaseReportFiller ) .
log4j : WARN Please initialize the log4j system properly .
Exception in thread "AWT-EventQueue-0" java . lang . NoClassDefFoundError : org / apache / commons / collections4 / map / ReferenceMap
at net . sf . jasperreports . engine . design . JRAbstractJavaCompiler .< clinit > ( JRAbstractJavaCompiler . java : 84 )
at sun . reflect . NativeConstructorAccessorImpl . newInstance0 ( Native Method )
at sun . reflect . NativeConstructorAccessorImpl . newInstance ( NativeConstructorAccessorImpl . java : 62 )
at sun . reflect . DelegatingConstructorAccessorImpl . newInstance ( DelegatingConstructorAccessorImpl . java : 45 )
at java . lang . reflect . Constructor . newInstance ( Constructor . java : 423 )
at net . sf . jasperreports . engine . JasperCompileManager . getCompiler ( JasperCompileManager . java : 824 )
at net . sf . jasperreports . engine . JasperCompileManager . getEvaluator ( JasperCompileManager . java : 381 )
at net . sf . jasperreports . engine . fill . JRFillDataset . createCalculator ( JRFillDataset . java : 487 )
at net . sf . jasperreports . engine . fill . BaseReportFiller .< init > ( BaseReportFiller . java : 168 )
at net . sf . jasperreports . engine . fill . JRBaseFiller .< init > ( JRBaseFiller . java : 273 )
at net . sf . jasperreports . engine . fill . JRVerticalFiller .< init > ( JRVerticalFiller . java : 79 )
at net . sf . jasperreports . engine . fill . JRFiller . createBandReportFiller ( JRFiller . java : 251 )
at net . sf . jasperreports . engine . fill . JRFiller . createReportFiller ( JRFiller . java : 272 )
at net . sf . jasperreports . engine . fill . JRFiller . fill ( JRFiller . java : 156 )
at net . sf . jasperreports . engine . JasperFillManager . fill ( JasperFillManager . java : 651 )
at net . sf . jasperreports . engine . JasperFillManager . fillReport ( JasperFillManager . java : 1020 )
at Visao . TelaPrincipal . TesteNovaPlaca ( TelaPrincipal . java : 2273 )
at Visao . TelaPrincipal . jButtonSalvarPlacaActionPerformed ( TelaPrincipal . java : 1336 )
at Visao . TelaPrincipal . access $ 300 ( TelaPrincipal . java : 28 )
at Visao . TelaPrincipal $ 6. actionPerformed ( TelaPrincipal . java : 286 )
at javax . swing . AbstractButton . fireActionPerformed ( AbstractButton . java : 2022 )
at javax . swing . AbstractButton $ Handler . actionPerformed ( AbstractButton . java : 2348 )
at javax . swing . DefaultButtonModel . fireActionPerformed ( DefaultButtonModel . java : 402 )
at javax . swing . DefaultButtonModel . setPressed ( DefaultButtonModel . java : 259 )
at javax . swing . plaf . basic . BasicButtonListener . mouseReleased ( BasicButtonListener . java : 252 )
at java . awt . Component . processMouseEvent ( Component . java : 6539 )
at javax . swing . JComponent . processMouseEvent ( JComponent . java : 3324 )
at java . awt . Component . processEvent ( Component . java : 6304 )
at java . awt . Container . processEvent ( Container . java : 2239 )
at java . awt . Component . dispatchEventImpl ( Component . java : 4889 )
at java . awt . Container . dispatchEventImpl ( Container . java : 2297 )
at java . awt . Component . dispatchEvent ( Component . java : 4711 )
at java . awt . LightweightDispatcher . retargetMouseEvent ( Container . java : 4904 )
at java . awt . LightweightDispatcher . processMouseEvent ( Container . java : 4535 )
at java . awt . LightweightDispatcher . dispatchEvent ( Container . java : 4476 )
at java . awt . Container . dispatchEventImpl ( Container . java : 2283 )
at java . awt . Window . dispatchEventImpl ( Window . java : 2746 )
at java . awt . Component . dispatchEvent ( Component . java : 4711 )
at java . awt . EventQueue . dispatchEventImpl ( EventQueue . java : 760 )
at java . awt . EventQueue . access $ 500 ( EventQueue . java : 97 )
at java . awt . EventQueue $ 3. run ( EventQueue . java : 709 )
at java . awt . EventQueue $ 3. run ( EventQueue . java : 703 )
at java . security . AccessController . doPrivileged ( Native Method )
at java . security . ProtectionDomain $ JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 74 )
at java . security . ProtectionDomain $ JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 84 )
at java . awt . EventQueue $ 4. run ( EventQueue . java : 733 )
at java . awt . EventQueue $ 4. run ( EventQueue . java : 731 )
at java . security . AccessController . doPrivileged ( Native Method )
at java . security . ProtectionDomain $ JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 74 )
at java . awt . EventQueue . dispatchEvent ( EventQueue . java : 730 )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( EventDispatchThread . java : 205 )
at java . awt . EventDispatchThread . pumpEventsForFilter ( EventDispatchThread . java : 116 )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( EventDispatchThread . java : 105 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 101 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 93 )
at java . awt . EventDispatchThread . run ( EventDispatchThread . java : 82 )
Caused by : java . lang . ClassNotFoundException : org . apache . commons . collections4 . map . ReferenceMap
at java . net . URLClassLoader . findClass ( URLClassLoader . java : 382 )
at java . lang . ClassLoader . loadClass ( ClassLoader . java : 424 )
at sun . misc . Launcher $ AppClassLoader . loadClass ( Launcher . java : 349 )
at java . lang . ClassLoader . loadClass ( ClassLoader . java : 357 )
... 56 more
colocando desta forma C:\RELATORIO\PlacaComum.jrxml eu tive:
log4j : WARN No appenders could be found for logger ( net . sf . jasperreports . extensions . ExtensionsEnvironment ).
log4j : WARN Please initialize the log4j system properly .
Exception in thread "AWT-EventQueue-0" java . lang . ExceptionInInitializerError
at net . sf . jasperreports . engine . DefaultJasperReportsContext . getExtensions ( DefaultJasperReportsContext . java : 277 )
at net . sf . jasperreports . engine . util . MessageUtil . getMessageProvider ( MessageUtil . java : 70 )
at net . sf . jasperreports . engine . JRException . resolveMessage ( JRException . java : 167 )
at net . sf . jasperreports . engine . JRException . getMessage ( JRException . java : 148 )
at net . sf . jasperreports . engine . JRException . getMessage ( JRException . java : 139 )
at java . lang . Throwable . getLocalizedMessage ( Throwable . java : 391 )
at java . lang . Throwable . toString ( Throwable . java : 480 )
at java . lang . String . valueOf ( String . java : 2994 )
at java . lang . StringBuilder . append ( StringBuilder . java : 131 )
at Visao . TelaPrincipal . TesteNovaPlaca ( TelaPrincipal . java : 2278 )
at Visao . TelaPrincipal . jButtonSalvarPlacaActionPerformed ( TelaPrincipal . java : 1336 )
at Visao . TelaPrincipal . access $300 ( TelaPrincipal . java : 28 )
at Visao . TelaPrincipal $6 . actionPerformed ( TelaPrincipal . java : 286 )
at javax . swing . AbstractButton . fireActionPerformed ( AbstractButton . java : 2022 )
at javax . swing . AbstractButton $Handler . actionPerformed ( AbstractButton . java : 2348 )
at javax . swing . DefaultButtonModel . fireActionPerformed ( DefaultButtonModel . java : 402 )
at javax . swing . DefaultButtonModel . setPressed ( DefaultButtonModel . java : 259 )
at javax . swing . plaf . basic . BasicButtonListener . mouseReleased ( BasicButtonListener . java : 252 )
at java . awt . Component . processMouseEvent ( Component . java : 6539 )
at javax . swing . JComponent . processMouseEvent ( JComponent . java : 3324 )
at java . awt . Component . processEvent ( Component . java : 6304 )
at java . awt . Container . processEvent ( Container . java : 2239 )
at java . awt . Component . dispatchEventImpl ( Component . java : 4889 )
at java . awt . Container . dispatchEventImpl ( Container . java : 2297 )
at java . awt . Component . dispatchEvent ( Component . java : 4711 )
at java . awt . LightweightDispatcher . retargetMouseEvent ( Container . java : 4904 )
at java . awt . LightweightDispatcher . processMouseEvent ( Container . java : 4535 )
at java . awt . LightweightDispatcher . dispatchEvent ( Container . java : 4476 )
at java . awt . Container . dispatchEventImpl ( Container . java : 2283 )
at java . awt . Window . dispatchEventImpl ( Window . java : 2746 )
at java . awt . Component . dispatchEvent ( Component . java : 4711 )
at java . awt . EventQueue . dispatchEventImpl ( EventQueue . java : 760 )
at java . awt . EventQueue . access $500 ( EventQueue . java : 97 )
at java . awt . EventQueue $3 . run ( EventQueue . java : 709 )
at java . awt . EventQueue $3 . run ( EventQueue . java : 703 )
at java . security . AccessController . doPrivileged ( Native Method )
at java . security . ProtectionDomain $JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 74 )
at java . security . ProtectionDomain $JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 84 )
at java . awt . EventQueue $4 . run ( EventQueue . java : 733 )
at java . awt . EventQueue $4 . run ( EventQueue . java : 731 )
at java . security . AccessController . doPrivileged ( Native Method )
at java . security . ProtectionDomain $JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 74 )
at java . awt . EventQueue . dispatchEvent ( EventQueue . java : 730 )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( EventDispatchThread . java : 205 )
at java . awt . EventDispatchThread . pumpEventsForFilter ( EventDispatchThread . java : 116 )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( EventDispatchThread . java : 105 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 101 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 93 )
at java . awt . EventDispatchThread . run ( EventDispatchThread . java : 82 )
Exception in thread "AWT-EventQueue-0" java . lang . NoClassDefFoundError : Could not initialize class net . sf . jasperreports . extensions . ExtensionsEnvironment
at net . sf . jasperreports . engine . DefaultJasperReportsContext . getExtensions ( DefaultJasperReportsContext . java : 277 )
at net . sf . jasperreports . engine . util . MessageUtil . getMessageProvider ( MessageUtil . java : 70 )
at net . sf . jasperreports . engine . JRRuntimeException . resolveMessage ( JRRuntimeException . java : 166 )
at net . sf . jasperreports . engine . JRRuntimeException . getMessage ( JRRuntimeException . java : 147 )
at net . sf . jasperreports . engine . JRRuntimeException . getMessage ( JRRuntimeException . java : 138 )
at java . lang . Throwable . getLocalizedMessage ( Throwable . java : 391 )
at java . lang . Throwable . toString ( Throwable . java : 480 )
at java . lang . String . valueOf ( String . java : 2994 )
at java . lang . StringBuilder . append ( StringBuilder . java : 131 )
at java . lang . Throwable . printEnclosedStackTrace ( Throwable . java : 695 )
at java . lang . Throwable . printStackTrace ( Throwable . java : 667 )
at java . lang . Throwable . printStackTrace ( Throwable . java : 643 )
at java . lang . ThreadGroup . uncaughtException ( ThreadGroup . java : 1061 )
at java . lang . ThreadGroup . uncaughtException ( ThreadGroup . java : 1052 )
at java . awt . EventDispatchThread . processException ( EventDispatchThread . java : 227 )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( EventDispatchThread . java : 219 )
at java . awt . EventDispatchThread . pumpEventsForFilter ( EventDispatchThread . java : 116 )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( EventDispatchThread . java : 105 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 101 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 93 )
at java . awt . EventDispatchThread . run ( EventDispatchThread . java : 82 )
Eis a duvida tambem. Alguns exemplos, vejo os profissionais usando .jasper e em outros exemplos vejo o uso do .jrxlm
D_Guedes 14 de mai. de 2019
Desculpe. O Primeiro exemplo foi usando o C:\RELATORIO\PlacaComum.jasper e o segundo foi usando o C:\RELATORIO\PlacaComum.jrxml com as duas barras como aconselhado.
rodriguesabner 14 de mai. de 2019
Quando for enviar um código ou erro, clica no </> pra formatar, ou seleciona o que vc escreveu (sendo código ou erro) e aperta CTRL+Shift+C.
Usa o .jasper mesmo, o errou que deu foi:
java . lang . NoClassDefFoundError : org / apache / commons / collections4 / map / Reference ....
Ou seja: não achou essa classe, vc precisa colocar essa dependência no projeto através do .jar ou via maven (se for o caso)
D_Guedes 14 de mai. de 2019
Desculpe aqui os erros cometidos pois sou novo aqui na comunidade e agradeço muito as dicas e ajuda. Tentarei consertar aqui a formatação na proxima, mas não faço noçao do que seja esta dependecia, pois se forem os .jars do jasper que todos aconselham a ter e colocar na biblioteca eu ja coloquei e sinceramente não sei mais o que fazer …rs
rodriguesabner 14 de mai. de 2019
Esse link aqui explica um pouco sobre: https://community.jaspersoft.com/questions/849170/difference-between-jrxml-and-jasper-files
Sobre a dependência, joga isso no Google e baixa o .jar
org/apache/commons/collections4/map/ReferenceMap
D_Guedes 14 de mai. de 2019
Apos baixado, instalo ele na biblioteca ou como um plugin?
rodriguesabner 14 de mai. de 2019
Adiciona como um .jar na biblioteca
D_Guedes 14 de mai. de 2019
baixei pelo site do commons.apache, extrai e coloquei la nas bibliotecas os .jars e eis outro novo erro
log4j : WARN No appenders could be found for logger ( net . sf . jasperreports . extensions . ExtensionsEnvironment ) .
log4j : WARN Please initialize the log4j system properly .
Exception in thread "AWT-EventQueue-0" java . lang . NoClassDefFoundError : org / joda / time / ReadablePartial
at java . lang . Class . forName0 ( Native Method )
at java . lang . Class . forName ( Class . java : 348 )
at net . sf . jasperreports . engine . util . JRClassLoader . loadClassForRealName ( JRClassLoader . java : 173 )
at net . sf . jasperreports . engine . util . JRClassLoader . loadClassForName ( JRClassLoader . java : 131 )
at net . sf . jasperreports . functions . FunctionsBundle . addFunctionClass ( FunctionsBundle . java : 83 )
at net . sf . jasperreports . functions . FunctionsBundle .< init > ( FunctionsBundle . java : 53 )
at net . sf . jasperreports . functions . FunctionsRegistryFactory . createRegistry ( FunctionsRegistryFactory . java : 73 )
at net . sf . jasperreports . extensions . DefaultExtensionsRegistry . instantiateRegistry ( DefaultExtensionsRegistry . java : 299 )
at net . sf . jasperreports . extensions . DefaultExtensionsRegistry . loadRegistries ( DefaultExtensionsRegistry . java : 274 )
at net . sf . jasperreports . extensions . DefaultExtensionsRegistry . loadRegistries ( DefaultExtensionsRegistry . java : 194 )
at net . sf . jasperreports . extensions . DefaultExtensionsRegistry . getRegistries ( DefaultExtensionsRegistry . java : 157 )
at net . sf . jasperreports . extensions . DefaultExtensionsRegistry . getExtensions ( DefaultExtensionsRegistry . java : 129 )
at net . sf . jasperreports . engine . DefaultJasperReportsContext . getExtensions ( DefaultJasperReportsContext . java : 277 )
at net . sf . jasperreports . engine . util . MessageUtil . getMessageProvider ( MessageUtil . java : 70 )
at net . sf . jasperreports . engine . JRException . resolveMessage ( JRException . java : 167 )
at net . sf . jasperreports . engine . JRException . getMessage ( JRException . java : 148 )
at net . sf . jasperreports . engine . JRException . getMessage ( JRException . java : 139 )
at java . lang . Throwable . getLocalizedMessage ( Throwable . java : 391 )
at java . lang . Throwable . toString ( Throwable . java : 480 )
at java . lang . String . valueOf ( String . java : 2994 )
at java . lang . StringBuilder . append ( StringBuilder . java : 131 )
at Visao . TelaPrincipal . TesteNovaPlaca ( TelaPrincipal . java : 2278 )
at Visao . TelaPrincipal . jButtonSalvarPlacaActionPerformed ( TelaPrincipal . java : 1336 )
at Visao . TelaPrincipal . access $ 300 ( TelaPrincipal . java : 28 )
at Visao . TelaPrincipal $ 6. actionPerformed ( TelaPrincipal . java : 286 )
at javax . swing . AbstractButton . fireActionPerformed ( AbstractButton . java : 2022 )
at javax . swing . AbstractButton $ Handler . actionPerformed ( AbstractButton . java : 2348 )
at javax . swing . DefaultButtonModel . fireActionPerformed ( DefaultButtonModel . java : 402 )
at javax . swing . DefaultButtonModel . setPressed ( DefaultButtonModel . java : 259 )
at javax . swing . plaf . basic . BasicButtonListener . mouseReleased ( BasicButtonListener . java : 252 )
at java . awt . Component . processMouseEvent ( Component . java : 6539 )
at javax . swing . JComponent . processMouseEvent ( JComponent . java : 3324 )
at java . awt . Component . processEvent ( Component . java : 6304 )
at java . awt . Container . processEvent ( Container . java : 2239 )
at java . awt . Component . dispatchEventImpl ( Component . java : 4889 )
at java . awt . Container . dispatchEventImpl ( Container . java : 2297 )
at java . awt . Component . dispatchEvent ( Component . java : 4711 )
at java . awt . LightweightDispatcher . retargetMouseEvent ( Container . java : 4904 )
at java . awt . LightweightDispatcher . processMouseEvent ( Container . java : 4535 )
at java . awt . LightweightDispatcher . dispatchEvent ( Container . java : 4476 )
at java . awt . Container . dispatchEventImpl ( Container . java : 2283 )
at java . awt . Window . dispatchEventImpl ( Window . java : 2746 )
at java . awt . Component . dispatchEvent ( Component . java : 4711 )
at java . awt . EventQueue . dispatchEventImpl ( EventQueue . java : 760 )
at java . awt . EventQueue . access $ 500 ( EventQueue . java : 97 )
at java . awt . EventQueue $ 3. run ( EventQueue . java : 709 )
at java . awt . EventQueue $ 3. run ( EventQueue . java : 703 )
at java . security . AccessController . doPrivileged ( Native Method )
at java . security . ProtectionDomain $ JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 74 )
at java . security . ProtectionDomain $ JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 84 )
at java . awt . EventQueue $ 4. run ( EventQueue . java : 733 )
at java . awt . EventQueue $ 4. run ( EventQueue . java : 731 )
at java . security . AccessController . doPrivileged ( Native Method )
at java . security . ProtectionDomain $ JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 74 )
at java . awt . EventQueue . dispatchEvent ( EventQueue . java : 730 )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( EventDispatchThread . java : 205 )
at java . awt . EventDispatchThread . pumpEventsForFilter ( EventDispatchThread . java : 116 )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( EventDispatchThread . java : 105 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 101 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 93 )
at java . awt . EventDispatchThread . run ( EventDispatchThread . java : 82 )
Caused by : java . lang . ClassNotFoundException : org . joda . time . ReadablePartial
at java . net . URLClassLoader . findClass ( URLClassLoader . java : 382 )
at java . lang . ClassLoader . loadClass ( ClassLoader . java : 424 )
at sun . misc . Launcher $ AppClassLoader . loadClass ( Launcher . java : 349 )
at java . lang . ClassLoader . loadClass ( ClassLoader . java : 357 )
... 61 more
rodriguesabner 14 de mai. de 2019
Agora não achou essa classe. Não esquece de selecionar o seu código/erro e apertar no </> ou CTRL+SHIFT+C, isso facilita na leitura do erro.
Falando em leitura de erro, dá uma olhada no erro e tenta entender o que ele quer dizer. O seu erro quer dizer que não encontrou a Classe: (org/joda/time/ReadablePartia ) Erro: (NoClassDefFoundError ), :
Exception in thread “ AWT - EventQueue - 0 ” java . lang . NoClassDefFoundError : org / joda / time / ReadablePartial
D_Guedes 14 de mai. de 2019
Acho que estou agora com um erro em uma fonte. Qual o processo de adiciona - la?
log4j : WARN No appenders could be found for logger ( net . sf . jasperreports . engine . fill . BaseReportFiller ) .
log4j : WARN Please initialize the log4j system properly .
Exception in thread "AWT-EventQueue-0" net . sf . jasperreports . engine . util . JRFontNotFoundException : Font "MarkingPenHeavy" is not available to the JVM . See the Javadoc for more details .
at net . sf . jasperreports . engine . fonts . FontUtil . checkAwtFont ( FontUtil . java : 604 )
at net . sf . jasperreports . engine . fill . SimpleTextLineWrapper . loadFont ( SimpleTextLineWrapper . java : 384 )
at net . sf . jasperreports . engine . fill . SimpleTextLineWrapper . getGeneralFontInfo ( SimpleTextLineWrapper . java : 354 )
at net . sf . jasperreports . engine . fonts . FontUtil . checkAwtFont ( FontUtil . java : 604 ) at net . sf . jasperreports . engine . fill . SimpleTextLineWrapper . createFontInfo ( SimpleTextLineWrapper . java : 294 )
at net . sf . jasperreports . engine . fill . SimpleTextLineWrapper . start ( SimpleTextLineWrapper . java : 256 )
at net . sf . jasperreports . engine . fill . TextMeasurer . measure ( TextMeasurer . java : 543 )
at net . sf . jasperreports . engine . fill . JRFillTextElement . chopTextElement ( JRFillTextElement . java : 604 )
at net . sf . jasperreports . engine . fill . JRFillTextField . prepare ( JRFillTextField . java : 784 )
at net . sf . jasperreports . engine . fill . JRFillElementContainer . prepareElements ( JRFillElementContainer . java : 542 )
at net . sf . jasperreports . engine . fill . JRFillBand . fill ( JRFillBand . java : 453 )
at net . sf . jasperreports . engine . fill . JRFillBand . fill ( JRFillBand . java : 428 )
at net . sf . jasperreports . engine . fill . JRVerticalFiller . fillColumnBand ( JRVerticalFiller . java : 2585 )
at net . sf . jasperreports . engine . fill . JRVerticalFiller . fillDetail ( JRVerticalFiller . java : 813 )
at net . sf . jasperreports . engine . fill . JRVerticalFiller . fillReportStart ( JRVerticalFiller . java : 264 )
at net . sf . jasperreports . engine . fill . JRVerticalFiller . fillReport ( JRVerticalFiller . java : 110 )
at net . sf . jasperreports . engine . fill . JRBaseFiller . fill ( JRBaseFiller . java : 615 )
at net . sf . jasperreports . engine . fill . BaseReportFiller . fill ( BaseReportFiller . java : 433 )
at net . sf . jasperreports . engine . fill . JRFiller . fill ( JRFiller . java : 162 )
at net . sf . jasperreports . engine . JasperFillManager . fill ( JasperFillManager . java : 651 )
at net . sf . jasperreports . engine . JasperFillManager . fillReport ( JasperFillManager . java : 1020 )
at Visao . TelaPrincipal . TesteNovaPlaca ( TelaPrincipal . java : 2273 )
at Visao . TelaPrincipal . jButtonSalvarPlacaActionPerformed ( TelaPrincipal . java : 1336 )
at Visao . TelaPrincipal . access $ 300 ( TelaPrincipal . java : 28 )
at Visao . TelaPrincipal $ 6. actionPerformed ( TelaPrincipal . java : 286 )
at javax . swing . AbstractButton . fireActionPerformed ( AbstractButton . java : 2022 )
at javax . swing . AbstractButton $ Handler . actionPerformed ( AbstractButton . java : 2348 )
at javax . swing . DefaultButtonModel . fireActionPerformed ( DefaultButtonModel . java : 402 )
at javax . swing . DefaultButtonModel . setPressed ( DefaultButtonModel . java : 259 )
at javax . swing . plaf . basic . BasicButtonListener . mouseReleased ( BasicButtonListener . java : 252 )
at java . awt . Component . processMouseEvent ( Component . java : 6539 )
at javax . swing . JComponent . processMouseEvent ( JComponent . java : 3324 )
at java . awt . Component . processEvent ( Component . java : 6304 )
at java . awt . Container . processEvent ( Container . java : 2239 )
at java . awt . Component . dispatchEventImpl ( Component . java : 4889 )
at java . awt . Container . dispatchEventImpl ( Container . java : 2297 )
at java . awt . Component . dispatchEvent ( Component . java : 4711 )
at java . awt . LightweightDispatcher . retargetMouseEvent ( Container . java : 4904 )
at java . awt . LightweightDispatcher . processMouseEvent ( Container . java : 4535 )
at java . awt . LightweightDispatcher . dispatchEvent ( Container . java : 4476 )
at java . awt . Container . dispatchEventImpl ( Container . java : 2283 )
at java . awt . Window . dispatchEventImpl ( Window . java : 2746 )
at java . awt . Component . dispatchEvent ( Component . java : 4711 )
at java . awt . EventQueue . dispatchEventImpl ( EventQueue . java : 760 )
at java . awt . EventQueue . access $ 500 ( EventQueue . java : 97 )
at java . awt . EventQueue $ 3. run ( EventQueue . java : 709 )
at java . awt . EventQueue $ 3. run ( EventQueue . java : 703 )
at java . security . AccessController . doPrivileged ( Native Method )
at java . security . ProtectionDomain $ JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 74 )
at java . security . ProtectionDomain $ JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 84 )
at java . awt . EventQueue $ 4. run ( EventQueue . java : 733 )
at java . awt . EventQueue $ 4. run ( EventQueue . java : 731 )
at java . security . AccessController . doPrivileged ( Native Method )
at java . security . ProtectionDomain $ JavaSecurityAccessImpl . doIntersectionPrivilege ( ProtectionDomain . java : 74 )
at java . awt . EventQueue . dispatchEvent ( EventQueue . java : 730 )
at java . awt . EventDispatchThread . pumpOneEventForFilters ( EventDispatchThread . java : 205 )
at java . awt . EventDispatchThread . pumpEventsForFilter ( EventDispatchThread . java : 116 )
at java . awt . EventDispatchThread . pumpEventsForHierarchy ( EventDispatchThread . java : 105 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 101 )
at java . awt . EventDispatchThread . pumpEvents ( EventDispatchThread . java : 93 )
at java . awt . EventDispatchThread . run ( EventDispatchThread . java : 82 )
D_Guedes 14 de mai. de 2019
kkkkk… to aprendendo. So nestas suas aulas aqui ja aprendi a formatar o texto para o forum, a diferenciar .jasper de .jrxml, analisar no stack trace ne isso? e tambem um pouco sobre bibliotecas
rodriguesabner 14 de mai. de 2019
Boa!! Agora pra adicionar uma fonte:
Coloca a fonte no Jasper (tools -> options -> fonts -> ‘Install Font’’).
Cria uma extensão .JAR da sua fonte (tools -> options -> fonts -> ‘Export as extension’)
Adiciona o .JAR no seu projeto!
Kkkkkkkk boa! Vivendo e aprendendo.
D_Guedes 14 de mai. de 2019
Eu acho que este deve ser o topico com respostas mais simples faceis pra vocês…rs, mas pra mim e outro mundo que to chegando agora.
A pasta que tenho algumas fontes especiais a qual usei em meu relatorio, estão todos os arquivos de fontes dentro dela. Como faria então para criar o .jar para adicionar? Eu apenas as jogaria dentro de uma pasta .zip e renomearia para .jar?
Este e mais um novo processo.
rodriguesabner 14 de mai. de 2019
Pra criar o .jar seria assim /.
Tudo pelo Jasper
D_Guedes 14 de mai. de 2019
O seu Netbeans esta em ingles o meu esta em portugues, e indo pela sua descrição, cheguei a esta tela:
rodriguesabner 14 de mai. de 2019
Eu acabei não especificando corretamente. Tudo aquilo vc faria pelo JasperReports.
D_Guedes 14 de mai. de 2019
Criar os jars das fontes para o Netbeans pelo JasperSoft?
rodriguesabner 14 de mai. de 2019
D_Guedes 14 de mai. de 2019
Abner, outra duvida e mais um vez, desculpe ai o encomodo, mas eu ja procurei nesta versao do JasperSoft Studio este caminho que você passou sobre a criação do .jar das minhas fontes e não achei. Os menus que tem são estes marcados na imagem.
rodriguesabner 14 de mai. de 2019
Opa, eu acho que te passei a versão do iReport. Perdão!
Esse link aqui tá atualizado, dá uma olhada: https://community.jaspersoft.com/wiki/custom-font-font-extension
D_Guedes 14 de mai. de 2019
Abner, foi um processo complexo mas consegui gerar os .jars.
Na execução ele ainda me mostra apenas isso. Seria um erro?
log4j : WARN No appenders could be found for logger ( net . sf . jasperreports . engine . fill . BaseReportFiller ).
log4j : WARN Please initialize the log4j system properly .
rodriguesabner 14 de mai. de 2019
Boa!!! Isso é só um aviso, o relatório consegue ser gerado normalmente agora
D_Guedes 14 de mai. de 2019 1 like
Cara, eu gostaria de lhe agradecer muito mesmo aqui e dizer que você me salvou de noites acordado ate tarde tentando resolver isso aqui. eu ja não sabia mais o que fazer. Se houvesse uma avaliação ao termino deste forum por ajuda, lhe daria a maxima. Ajudo no que posso e conheço e assim deixo aqui o mesmo voto de que muitos o façam, pois ajudar um colega de profissão não gera concorrencia e sim admiração. Muito obrigado.
Vou agora tentar entender o porque quando gerado o relatorio do Jasper ao visualizar ele ta fechando a minha aplicação mesmo o Form estando com dispose.
Valeu. Muito obrigado.
D_Guedes 14 de mai. de 2019 1 like
Ja achei aqui…kkkkk.
Muito Obrigado de novo Abner.
Aos que procuram este topico com a mesma duvida, no seu JasperSoft Studio, com o relatorio aberto, va na opção: PREFERENCES > JASPERSOFTSTUDIO > FONTS > ADD > FAMILY NAME (e o nome da sua fonte que você desejar).
Configurar de acordo com a dica deste site:
Overview When using a textual element inside Jaspersoft Studio, users can select the font used for it. Although this seems simple, there are a lot of problems when using the fonts. The main problem is that the available fonts are provided by the...
rodriguesabner 14 de mai. de 2019
Boa cara, parabéns pelo esforço e por ter conseguido, precisando pode contar com a gente!
D_Guedes 14 de mai. de 2019 1 like
Eu que mais uma vez agradeço a ajuda e a boa vontade.