darlan_machado 16 de abr. de 2018
Você tem as seguintes possibilidades para o NPE:
jasperReport é nulo
parametros é nulo
dataSource é nulo
A pergunta que não quer calar é: por que não muda o relatório e envia os dados já prontos? Isso evita este tipo de problema, deixando a consulta ao banco a cargo da aplicação java.
Robsonndumbledore 16 de abr. de 2018
Não entendi o que quis dizer com enviar os dados já prontos, quais dados ? os parametros ?
outra coisa que não entendo é porque localmente funciona sem esses problemas mas online não
se puder dar mais explicações ia ajudar muito
darlan_machado 16 de abr. de 2018
Não.
Você, provavelmente, criou o relatório a partir de uma query no mesmo, não? Selecionou as colunas (fields) e por isso envia a conexão (dataSource.getConnection()) para o fillReport.
Se você optar pelo beans data source, você evita de colocar SQL diretamente no relatório (o que é uma quebra do modelo MVC) e só envia os dados prontos.
Exemplo
Robsonndumbledore 16 de abr. de 2018
exatamente darlan_machado, a query está no relatório , tem alguma outra forma de resolver esse problema ?
eu tinha que colocar isso online ainda hoje , se não houver jeito vou ter de atrasar tudo pois assim como esse relatório há outros com o mesmo problema são vários relatórios pra falar bem
darlan_machado 16 de abr. de 2018
Seguiu o link que sugeri ali em cima?
Por ora, sugiro que você envolva o código em um try/catch e trate a exceção que está ocorrendo.
Mais rápido para esta questão.
Robsonndumbledore 16 de abr. de 2018
sim segui o link, vou tentar o try catch se não resolver faço como no tutorial , se der certo posto a resposta aqui
valeu…
campelo.m 17 de abr. de 2018
Coloca a stack completa aqui por favor.
Uma possibilidade sem olhar a stack, pode ser que no servidor nao possui os fonts.
Quais as libs que voce ta usando no jasper?
Robsonndumbledore 17 de abr. de 2018
java . lang . NullPointerException : null
at net . sf . jasperreports . engine . fill . JRVerticalFiller . fillReport ( JRVerticalFiller . java : 135 ) ~[ jasperreports - 6.2.0 . jar : 6.2.0 ]
at net . sf . jasperreports . engine . fill . JRBaseFiller . fill ( JRBaseFiller . java : 558 ) ~[ jasperreports - 6.2.0 . jar : 6.2.0 ]
at net . sf . jasperreports . engine . fill . BaseReportFiller . fill ( BaseReportFiller . java : 396 ) ~[ jasperreports - 6.2.0 . jar : 6.2.0 ]
at net . sf . jasperreports . engine . fill . JRFiller . fill ( JRFiller . java : 91 ) ~[ jasperreports - 6.2.0 . jar : 6.2.0 ]
at net . sf . jasperreports . engine . JasperFillManager . fill ( JasperFillManager . java : 456 ) ~[ jasperreports - 6.2.0 . jar : 6.2.0 ]
at net . sf . jasperreports . engine . JasperFillManager . fillReport ( JasperFillManager . java : 863 ) ~[ jasperreports - 6.2.0 . jar : 6.2.0 ]
at com . system . controller . ValidaController . imprimir ( ValidaController . java : 78 ) ~[ classes / : na ]
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method ) ~[ na : 1.8.0_162 ]
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl . java : 62 ) ~[ na : 1.8.0_162 ]
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 43 ) ~[ na : 1.8.0_162 ]
at java . lang . reflect . Method . invoke ( Method . java : 498 ) ~[ na : 1.8.0_162 ]
at org . springframework . web . method . support . InvocableHandlerMethod . doInvoke ( InvocableHandlerMethod . java : 205 ) ~[ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . method . support . InvocableHandlerMethod . invokeForRequest ( InvocableHandlerMethod . java : 133 ) ~[ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . servlet . mvc . method . annotation . ServletInvocableHandlerMethod . invokeAndHandle ( ServletInvocableHandlerMethod . java : 97 ) ~[ spring - webmvc - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . servlet . mvc . method . annotation . RequestMappingHandlerAdapter . invokeHandlerMethod ( RequestMappingHandlerAdapter . java : 827 ) ~[ spring - webmvc - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . servlet . mvc . method . annotation . RequestMappingHandlerAdapter . handleInternal ( RequestMappingHandlerAdapter . java : 738 ) ~[ spring - webmvc - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . servlet . mvc . method . AbstractHandlerMethodAdapter . handle ( AbstractHandlerMethodAdapter . java : 85 ) ~[ spring - webmvc - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . servlet . DispatcherServlet . doDispatch ( DispatcherServlet . java : 967 ) ~[ spring - webmvc - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . servlet . DispatcherServlet . doService ( DispatcherServlet . java : 901 ) ~[ spring - webmvc - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . servlet . FrameworkServlet . processRequest ( FrameworkServlet . java : 970 ) ~[ spring - webmvc - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . servlet . FrameworkServlet . doPost ( FrameworkServlet . java : 872 ) ~[ spring - webmvc - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 648 ) ~[ servlet - api . jar : na ]
at org . springframework . web . servlet . FrameworkServlet . service ( FrameworkServlet . java : 846 ) ~[ spring - webmvc - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 729 ) ~[ servlet - api . jar : na ]
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 291 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 ) [ catalina . jar : 8.0.27 ]
at org . apache . tomcat . websocket . server . WsFilter . doFilter ( WsFilter . java : 52 ) ~[ tomcat - websocket . jar : 8.0.27 ]
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 239 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 ) [ catalina . jar : 8.0.27 ]
at org . netbeans . modules . web . monitor . server . MonitorFilter . doFilter ( MonitorFilter . java : 393 ) ~[ org - netbeans - modules - web - httpmonitor . jar : na ]
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 239 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 ) [ catalina . jar : 8.0.27 ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 317 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . access . intercept . FilterSecurityInterceptor . invoke ( FilterSecurityInterceptor . java : 127 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . access . intercept . FilterSecurityInterceptor . doFilter ( FilterSecurityInterceptor . java : 91 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . access . ExceptionTranslationFilter . doFilter ( ExceptionTranslationFilter . java : 114 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . session . SessionManagementFilter . doFilter ( SessionManagementFilter . java : 137 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . authentication . AnonymousAuthenticationFilter . doFilter ( AnonymousAuthenticationFilter . java : 111 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . servletapi . SecurityContextHolderAwareRequestFilter . doFilter ( SecurityContextHolderAwareRequestFilter . java : 170 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . savedrequest . RequestCacheAwareFilter . doFilter ( RequestCacheAwareFilter . java : 63 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . authentication . AbstractAuthenticationProcessingFilter . doFilter ( AbstractAuthenticationProcessingFilter . java : 200 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . authentication . logout . LogoutFilter . doFilter ( LogoutFilter . java : 116 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . header . HeaderWriterFilter . doFilterInternal ( HeaderWriterFilter . java : 64 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . web . filter . OncePerRequestFilter . doFilter ( OncePerRequestFilter . java : 107 ) [ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . context . SecurityContextPersistenceFilter . doFilter ( SecurityContextPersistenceFilter . java : 105 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . context . request . async . WebAsyncManagerIntegrationFilter . doFilterInternal ( WebAsyncManagerIntegrationFilter . java : 56 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . web . filter . OncePerRequestFilter . doFilter ( OncePerRequestFilter . java : 107 ) [ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . security . web . FilterChainProxy$VirtualFilterChain . doFilter ( FilterChainProxy . java : 331 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy . doFilterInternal ( FilterChainProxy . java : 214 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . security . web . FilterChainProxy . doFilter ( FilterChainProxy . java : 177 ) ~[ spring - security - web - 4.2.3 . RELEASE . jar : 4.2.3 . RELEASE ]
at org . springframework . web . filter . DelegatingFilterProxy . invokeDelegate ( DelegatingFilterProxy . java : 347 ) ~[ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . filter . DelegatingFilterProxy . doFilter ( DelegatingFilterProxy . java : 263 ) ~[ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 239 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 ) [ catalina . jar : 8.0.27 ]
at org . springframework . web . filter . RequestContextFilter . doFilterInternal ( RequestContextFilter . java : 99 ) ~[ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . filter . OncePerRequestFilter . doFilter ( OncePerRequestFilter . java : 107 ) [ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 239 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 ) [ catalina . jar : 8.0.27 ]
at org . springframework . web . filter . HttpPutFormContentFilter . doFilterInternal ( HttpPutFormContentFilter . java : 108 ) ~[ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . filter . OncePerRequestFilter . doFilter ( OncePerRequestFilter . java : 107 ) [ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 239 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 ) [ catalina . jar : 8.0.27 ]
at org . springframework . web . filter . HiddenHttpMethodFilter . doFilterInternal ( HiddenHttpMethodFilter . java : 81 ) ~[ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . filter . OncePerRequestFilter . doFilter ( OncePerRequestFilter . java : 107 ) [ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 239 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 ) [ catalina . jar : 8.0.27 ]
at org . springframework . web . filter . CharacterEncodingFilter . doFilterInternal ( CharacterEncodingFilter . java : 197 ) ~[ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . web . filter . OncePerRequestFilter . doFilter ( OncePerRequestFilter . java : 107 ) [ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 239 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 ) [ catalina . jar : 8.0.27 ]
at org . springframework . boot . web . support . ErrorPageFilter . doFilter ( ErrorPageFilter . java : 115 ) [ spring - boot - 1.5.8 . RELEASE . jar : 1.5.8 . RELEASE ]
at org . springframework . boot . web . support . ErrorPageFilter . access$000 ( ErrorPageFilter . java : 59 ) [ spring - boot - 1.5.8 . RELEASE . jar : 1.5.8 . RELEASE ]
at org . springframework . boot . web . support . ErrorPageFilter$1 . doFilterInternal ( ErrorPageFilter . java : 90 ) [ spring - boot - 1.5.8 . RELEASE . jar : 1.5.8 . RELEASE ]
at org . springframework . web . filter . OncePerRequestFilter . doFilter ( OncePerRequestFilter . java : 107 ) [ spring - web - 4.3.12 . RELEASE . jar : 4.3.12 . RELEASE ]
at org . springframework . boot . web . support . ErrorPageFilter . doFilter ( ErrorPageFilter . java : 108 ) [ spring - boot - 1.5.8 . RELEASE . jar : 1.5.8 . RELEASE ]
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 239 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . StandardWrapperValve . invoke ( StandardWrapperValve . java : 217 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . StandardContextValve . invoke ( StandardContextValve . java : 106 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . authenticator . AuthenticatorBase . invoke ( AuthenticatorBase . java : 502 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . StandardHostValve . invoke ( StandardHostValve . java : 142 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . valves . ErrorReportValve . invoke ( ErrorReportValve . java : 79 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . valves . AbstractAccessLogValve . invoke ( AbstractAccessLogValve . java : 616 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . core . StandardEngineValve . invoke ( StandardEngineValve . java : 88 ) [ catalina . jar : 8.0.27 ]
at org . apache . catalina . connector . CoyoteAdapter . service ( CoyoteAdapter . java : 518 ) [ catalina . jar : 8.0.27 ]
at org . apache . coyote . http11 . AbstractHttp11Processor . process ( AbstractHttp11Processor . java : 1091 ) [ tomcat - coyote . jar : 8.0.27 ]
at org . apache . coyote . AbstractProtocol$AbstractConnectionHandler . process ( AbstractProtocol . java : 673 ) [ tomcat - coyote . jar : 8.0.27 ]
at org . apache . tomcat . util . net . NioEndpoint$SocketProcessor . doRun ( NioEndpoint . java : 1500 ) [ tomcat - coyote . jar : 8.0.27 ]
at org . apache . tomcat . util . net . NioEndpoint$SocketProcessor . run ( NioEndpoint . java : 1456 ) [ tomcat - coyote . jar : 8.0.27 ]
at java . util . concurrent . ThreadPoolExecutor . runWorker ( ThreadPoolExecutor . java : 1149 ) [ na : 1.8.0_162 ]
at java . util . concurrent . ThreadPoolExecutor$Worker . run ( ThreadPoolExecutor . java : 624 ) [ na : 1.8.0_162 ]
at org . apache . tomcat . util . threads . TaskThread$WrappingRunnable . run ( TaskThread . java : 61 ) [ tomcat - util . jar : 8.0.27 ]
at java . lang . Thread . run ( Thread . java : 748 ) [ na : 1.8.0_162 ]
Robsonndumbledore 17 de abr. de 2018
O que seria essas libs que você fala ?
no java eu estou usando isso
net.sf.jasperreports
jasperreports
6.2.0
campelo.m 17 de abr. de 2018
Robsonndumbledore 17 de abr. de 2018
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
<groupId> com.7system</groupId>
<artifactId> ROOT</artifactId>
<version> 0.0.1-SNAPSHOT</version>
<packaging> war</packaging>
<name> ROOT</name>
<description> Demo project for Spring Boot</description>
<parent>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-starter-parent</artifactId>
<version> 1.5.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding> UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding> UTF-8</project.reporting.outputEncoding>
<java.version> 1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId> net.sf.jasperreports</groupId>
<artifactId> jasperreports</artifactId>
<version> 6.2.0</version>
</dependency>
<dependency>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-starter-tomcat</artifactId>
<scope> provided</scope>
</dependency>
<dependency>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-starter-test</artifactId>
<scope> test</scope>
</dependency>
<dependency>
<groupId> org.hibernate.javax.persistence</groupId>
<artifactId> hibernate-jpa-2.1-api</artifactId>
<version> 1.0.0.Final</version>
<type> jar</type>
</dependency>
<dependency>
<groupId> org.firebirdsql.jdbc</groupId>
<artifactId> jaybird-jdk18</artifactId>
</dependency>
<dependency>
<groupId> org.thymeleaf.extras</groupId>
<artifactId> thymeleaf-extras-springsecurity4</artifactId>
</dependency>
</dependencies>
<build>
<finalName> ${ project . artifactId } </finalName>
<plugins>
<plugin>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
campelo.m 17 de abr. de 2018
De acordo com os seus posts aqui coloque aqui tbm o seu application.properties e a class de config do jasper
Robsonndumbledore 17 de abr. de 2018
eu mandei inspecionar na linha que da nullpointer e encontrei isso como variável null
campelo.m 17 de abr. de 2018
Add essa dependency no seu pom tbm.
<!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports-fonts -->
<dependency>
<groupId> net.sf.jasperreports</groupId>
<artifactId> jasperreports-fonts</artifactId>
<version> 6.0.0</version>
</dependency>
tente gerar o relatorio depois de add
campelo.m 17 de abr. de 2018
Pra esse caso ai, a solução esta aqui
Robsonndumbledore 17 de abr. de 2018
eu fiz assim…
mas ainda vem null , porque ? vou ter de apagar e criar classes como as do tutorial ? como ficaria isso ?
darlan_machado 17 de abr. de 2018
Cara, o erro não é com relação a fontes.
Como eu disse ontem, uma das coisas que ele passa como parâmetro está nulo, neste caso, dataSource.
darlan_machado 17 de abr. de 2018
Está fazendo isso seguindo qual orientação? Livro? Tutorial? Vídeo?
Robsonndumbledore 17 de abr. de 2018
de um outro projeto tambem em spring
darlan_machado 17 de abr. de 2018
Isso não ajuda muito. O ideal é você seguir algum vídeo/livro/apostila, senão, você pode se perder.
Robsonndumbledore 17 de abr. de 2018
mas é aquilo que te falei… se for em um banco local , esse dataSource continua null mas funciona , gera o relatorio se o banco estiver online já não funciona
darlan_machado 17 de abr. de 2018
Coloca os teus códigos ai, por favor. Incluindo o jrxml.
Robsonndumbledore 17 de abr. de 2018
no projeto tenho apenas o .jasper
quer toda a classe ou só os metodos em questão ?
campelo.m 17 de abr. de 2018
Temos que observar todas as possibilidades.
Robsonndumbledore 17 de abr. de 2018
campelo.m a dependência que me mandaste gera o relatório mas ele vem em branco
darlan_machado 17 de abr. de 2018
Temos que observar os erros. O log e a mensagem de erro aponta para NPE e você quer focar nas fontes?
campelo.m 17 de abr. de 2018
Nao estou focando nos fonts, falei que poderia ser, se olhar atentamente solicitei para colocar o application.properties e coloquei qual a solucao do data source estar null bem aqui
Robsonndumbledore 17 de abr. de 2018
tive de mudar a senha e o nome do banco por não ser meu o projeto
campelo.m 17 de abr. de 2018
Gerou em branco mais ainda continua tendo o erro?
Robsonndumbledore 17 de abr. de 2018
não… dessa vez não mostrou erro campelo.m , falta vir os dados
Robsonndumbledore 17 de abr. de 2018
bom… no mínimo mudou alguma coisa…
só desse erro não aparecer já me da esperança de resolver isso
campelo.m 17 de abr. de 2018
Blz,
É mesmo necessario que voce conect pelo jasper para gerar o relatorio?
Voce nao pode mandar os dados pelo back e so montar o relatorio?
Robsonndumbledore 17 de abr. de 2018
eu tambem gostaria de fazer isso, mas acho que eu teria de mapear quase todo o banco para minha aplicação ele é bem grande, se não tiver que fazer isso fica mais fácil
campelo.m 17 de abr. de 2018
Na verdade nao precisa disso.
Voce passa um obj pro jasper de acordo com oque voce precisa.
Esta usando hibernate ou jdbc?
Robsonndumbledore 17 de abr. de 2018
Jpa
<dependency>
<groupId> org.springframework.boot</groupId>
<artifactId> spring-boot-starter-data-jpa</artifactId>
</dependency>
Robsonndumbledore 17 de abr. de 2018
por exemplo tenho procedures no firebird que faz todas as contas existente no relatorio e me retorna tudo pronto
mas não sei como ficaria isso direto no back, outra coisa que fico em dúvida é por exemplo tem uns campos no firebird em que ele compacta a informação em um hash para economizar espaço , não sei se isso é um empecilho
campelo.m 17 de abr. de 2018
Na verdade nao, fica ate mais facil, basta voce mapear a view, fazer o select de acordo com oque voce precisa e passar o objeto pro relatorio.
Robsonndumbledore 17 de abr. de 2018
mas não é uma view é uma procedure , uso ela penas para um relátorio os outros é feito "manualmente"
para fazer essas alteraçoes eu teria de tirar as queries de dentro do relatório… como ficaria mais ou menos isso
campelo.m 17 de abr. de 2018
do jeito que esta entao, deve ser melhor.
Tenta olhar agora:
Caminho do banco online esta correto no application.properties?
Como é feita uma conexao pelo relatorio, existe permissão pra ta conexão
Robsonndumbledore 17 de abr. de 2018
existe permissão, pois quando faço um select normal , desse banco online vem os dados certos, outros pontos na aplicação que necessitam do banco funcionam normalmente , tudo muda quando chega na hora de gerar o relatório, fora isso tudo normal
Robsonndumbledore 17 de abr. de 2018
vou ter de mudar tudo e fazer pelo backend mesmo , pois estou atrasado com isso