Login Registre-se
Biblioteca Java-NFe com JAXB - NF-e/NFC-e Simples V. 4.00.11  XML
Índice dos Fóruns » NF-e / NFS-e / CT-e / CF-e / Certificados Digitais
Autor Mensagem
resplandes

JavaC Membro
[Avatar]

Membro desde: 05/12/2012 18:01:25
Mensagens: 204
Localização: Peixoto de Azevedo - Mato Grosso
Offline

Bom dia, sim.

http://www.javac.com.br/jc/posts/list/2476-resolvido-pre-visualizacao-do-danfe.page

Willian Resplandes
[Email] [WWW] [MSN]
William Gomes

JavaC Membro

Membro desde: 09/10/2019 17:30:19
Mensagens: 4
Offline

Boa tarde, estou fazendo um webservice para envio de nfec e como estou iniciando, fiz somente um teste para validar o certificado, porém quando executo recebo um NullPointException nessa linha



Tem alguma coisa haver com Cacert

É um projeto com SpringBoot

robertop

JavaC Membro

Membro desde: 10/07/2013 20:08:36
Mensagens: 386
Offline

Bom dia!
O erro null indica que algo não foi carregado ou setado.

O caminho do certificado esta correto?
A senha esta correta?
William Gomes

JavaC Membro

Membro desde: 09/10/2019 17:30:19
Mensagens: 4
Offline

Bom dia, obrigado pelo retorno,
Foi sim, tanto que no debug eu confiro isso e na própria classe ela valida se existe o arquivo e passa na validação
robertop

JavaC Membro

Membro desde: 10/07/2013 20:08:36
Mensagens: 386
Offline

E se tu colocar um breakpoint no método setDadosCertificado.

Veja o que esta null
William Gomes

JavaC Membro

Membro desde: 09/10/2019 17:30:19
Mensagens: 4
Offline

Eu coloquei, o erro dá exatamente nessa linha
KeyStore keyStore = getKeyStore(certificado);
Simplesmente ele nem executa, porque coloquei o breakpoint
nesse método:
public static KeyStore getKeyStore(Certificado certificado) throws CertificadoException {
...

E nem entra, já dá o erro
robertop

JavaC Membro

Membro desde: 10/07/2013 20:08:36
Mensagens: 386
Offline

coloca aqui toda a mensagem que aparece no teu console.

Há alguma coisa null no objeto certificado.
Tu informou o tipo de certificado?
William Gomes

JavaC Membro

Membro desde: 09/10/2019 17:30:19
Mensagens: 4
Offline

2019-10-10 08:50:28.191 ERROR 10060 --- [nio-8383-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

java.lang.NullPointerException: null
at java.lang.String.<init>(String.java:491) ~[na:1.8.0_211]
at sun.security.pkcs12.PKCS12KeyStore.loadSafeContents(PKCS12KeyStore.java:2336) ~[na:1.8.0_211]
at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2069) ~[na:1.8.0_211]
at java.security.KeyStore.load(KeyStore.java:1445) ~[na:1.8.0_211]
at com.example.nfce.swconsultoria.certificado.CertificadoService.getKeyStore(CertificadoService.java:300) ~[classes/:na]
at com.example.nfce.swconsultoria.certificado.CertificadoService.setDadosCertificado(CertificadoService.java:74) ~[classes/:na]
at com.example.nfce.swconsultoria.certificado.CertificadoService.certificadoPfx(CertificadoService.java:102) ~[classes/:na]
at com.example.nfce.resource.NfceResource.certificado(NfceResource.java:20) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
at java.lang.reflect.Method.invoke(Method.java:49 ~[na:1.8.0_211]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:13 ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:893) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:79 ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:89 ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.26.jar:9.0.26]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at com.example.nfce.config.CorsFilterConfig.doFilter(CorsFilterConfig.java:37) ~[classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:94) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:40 [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589) [tomcat-embed-core-9.0.26.jar:9.0.26]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.26.jar:9.0.26]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_211]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_211]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.26.jar:9.0.26]
at java.lang.Thread.run(Thread.java:74 [na:1.8.0_211]

robertop

JavaC Membro

Membro desde: 10/07/2013 20:08:36
Mensagens: 386
Offline

Eu não estou conseguindo localizar o erro.
Teria que analisar todo o seu código para verificar se esta deixando de fazer alguma coisa.

Aconselho você a entrar no discord https://discord.gg/6WErfMR, la vai ter o pessoal que utiliza esta biblioteca e também o pai da criança (Samuel Oliveira).
aliadil961

JavaC Membro

Membro desde: 29/01/2020 07:53:05
Mensagens: 1
Offline

You would have to analyze all of your code to see if you're not doing anything

Esta mensagem foi editada 1 vez. Última atualização foi em 29/01/2020 08:07:26


wordpress course
graphic designing courses in Lahore
interior designing courses in Lahore
[WWW]
boxingcomponent

JavaC Membro

Membro desde: 18/02/2020 07:52:44
Mensagens: 3
Offline

Changed URL MS
Added URLS AM
Corrected error Query Registration SVRS
Special characters in XML are now accepted.
Method created for the creation of the Cancellation ProcEvent.
Fixed ProcInut
Changed QrCode to version 2

best boxing gloves
everlast boxing gloves
winning boxing gloves
best boxing shoes
Heavy Bag Gloves
[WWW]
joandavis

JavaC Membro

Membro desde: 26/06/2020 01:12:42
Mensagens: 4
Offline

Professional History Research Paper Services is very popular for students in search for history essay writing help services and history assignment writing services.
https://topessaywriting.com/history-research-paper-services-2/
 
Índice dos Fóruns » NF-e / NFS-e / CT-e / CF-e / Certificados Digitais
Ir para:   
Powered by JForum 2.1.9 © JForum Team