I have been using the Demoiselle-certificate (2.0.0) for some time and today I came across the following error when calling the CertificateManager class the certificateManager.load (class) method:
10:35:07,632 GRAVE [javax.enterprise.resource.webcontainer.jsf.context] (http--127.0.0.1-8080-5) org.jboss.interceptor.proxy.InterceptorException: java.lang.NoSuchMethodError: org.bouncycastle.asn1.ASN1InputStream.readObject()Lorg/bouncycastle/asn1/ASN1Primitive;: javax.faces.event.AbortProcessingException: org.jboss.interceptor.proxy.InterceptorException: java.lang.NoSuchMethodError: org.bouncycastle.asn1.ASN1InputStream.readObject()Lorg/bouncycastle/asn1/ASN1Primitive;
The error is for not finding the method org.bouncycastle.asn1.ASN1InputStream.readObject()
Caused by: org.jboss.interceptor.proxy.InterceptorException: java.lang.NoSuchMethodError: org.bouncycastle.asn1.ASN1InputStream.readObject()Lorg/bouncycastle/asn1/ASN1Primitive;
at org.jboss.interceptor.proxy.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:151) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at br.gov.frameworkdemoiselle.exception.ExceptionHandlerInterceptor.manage(ExceptionHandlerInterceptor.java:239) [demoiselle-core-2.5.0.jar:]
at sun.reflect.GeneratedMethodAccessor173.invoke(Unknown Source) [:1.7.0_79]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_79]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_79]
at org.jboss.interceptor.proxy.InterceptorInvocation$InterceptorMethodInvocation.invoke(InterceptorInvocation.java:72) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.interceptor.proxy.SimpleInterceptionChain.invokeNextInterceptor(SimpleInterceptionChain.java:82) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:133) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:112) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:53) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at br.com.djcloud.view.EmpresaManutencaoEditMB$Proxy$_$$_WeldSubclass.validarCertificado(EmpresaManutencaoEditMB$Proxy$_$$_WeldSubclass.java) [classes:]
at br.com.djcloud.view.EmpresaManutencaoEditMB$Proxy$_$$_WeldClientProxy.validarCertificado(EmpresaManutencaoEditMB$Proxy$_$$_WeldClientProxy.java) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_79]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_79]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_79]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_79]
at org.apache.el.parser.AstValue.invoke(AstValue.java:262) [jbossweb-7.0.13.Final.jar:]
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278) [jbossweb-7.0.13.Final.jar:]
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:153) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
... 36 more
Caused by: java.lang.NoSuchMethodError: org.bouncycastle.asn1.ASN1InputStream.readObject()Lorg/bouncycastle/asn1/ASN1Primitive;
at br.gov.frameworkdemoiselle.certificate.oid.OIDGeneric.getInstance(OIDGeneric.java:80) [demoiselle-certificate-core-2.0.0.jar:]
at br.gov.frameworkdemoiselle.certificate.extension.CertificateExtra.<init>(CertificateExtra.java:98) [demoiselle-certificate-core-2.0.0.jar:]
at br.gov.frameworkdemoiselle.certificate.extension.ICPBRSubjectAlternativeNames.<init>(ICPBRSubjectAlternativeNames.java:56) [demoiselle-certificate-core-2.0.0.jar:]
at br.gov.frameworkdemoiselle.certificate.extension.BasicCertificate.getICPBRSubjectAlternativeNames(BasicCertificate.java:286) [demoiselle-certificate-core-2.0.0.jar:]
at br.gov.frameworkdemoiselle.certificate.extension.BasicCertificate.hasCertificatePF(BasicCertificate.java:313) [demoiselle-certificate-core-2.0.0.jar:]
at br.gov.frameworkdemoiselle.certificate.extension.ICPBrasilExtensionLoader.load(ICPBrasilExtensionLoader.java:58) [demoiselle-certificate-core-2.0.0.jar:]
at br.gov.frameworkdemoiselle.certificate.CertificateManager.load(CertificateManager.java:110) [demoiselle-certificate-core-2.0.0.jar:]
at br.com.djsystem.seguranca.util.DJCertImpl.lerArquivo(DJCertImpl.java:195) [classes:]
at br.com.djcloud.view.EmpresaManutencaoEditMB.validarCertificado(EmpresaManutencaoEditMB.java:335) [classes:]
at br.com.djcloud.view.EmpresaManutencaoEditMB$Proxy$_$$_WeldSubclass.validarCertificado(EmpresaManutencaoEditMB$Proxy$_$$_WeldSubclass.java) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_79]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_79]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_79]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_79]
at org.jboss.interceptor.proxy.SimpleInterceptionChain.invokeNextInterceptor(SimpleInterceptionChain.java:114) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.interceptor.proxy.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:143) [jboss-interceptor-core-2.0.0.Final.jar:2.0.0.Final]
... 56 more
If someone has gone through this, is passing or have some idea of what can be, please kindly appreciate the attention.
edit: application using certificate installed:
FacesContext context = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
setCert((java.security.cert.X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate"));
CertificateManager cm = new CertificateManager(getCert()[0], isValidarCert());
setCertificadoString(getCert()[0].toString());
cm.load(this);
Application with file:
KeyStore keyStore = (new FileSystemKeyStoreLoader(file)).getKeyStore(senhaCertificado.trim());
Enumeration<?> enumeration = keyStore.aliases();
String alias = (String) enumeration.nextElement();
x509Certificate = (X509Certificate) keyStore.getCertificate(alias);
CertificateManager cm = new CertificateManager(x509Certificate , false);
cm.load(this);