[jboss-as7-dev] NoClassDefFoundError
Bill Burke
bburke at redhat.com
Wed Dec 7 08:31:43 EST 2011
Weird, a user is getting NCDFE for javax/net/ssl/SSLSocketFactory, any
ideas why?
-------- Original Message --------
Subject: [Resteasy-developers] Resteasy client with https in Jboss 7
Date: Tue, 06 Dec 2011 11:23:55 -0300
From: Fabricio Lemos <fabricio.lemos at sefaz.ce.gov.br>
To: resteasy-developers at lists.sourceforge.net
Is it possible to use resteasy client with https in Jboss 7?
This code works with a standalone Java application:
System.out.println(new ClientRequest(MyHttpsURL).get().getStatus());
but fails with Jboss 7.0.1 and 7.1.0.Beta1
My certification is imported with the args:
-Djavax.net.ssl.trustStoreType=jks
-Djavax.net.ssl.trustStore=D:\java\certificados\cacert
-Djavax.net.debug=ssl -Djavax.net.ssl.trustStorePassword=myPswd
I assume the certification is being imported correctly because
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection()
works with both standalone and a deployed client
The error with resteasy client in Jboss 7 is this:
10:47:54,410 BOM
[javax.enterprise.resource.webcontainer.jsf.application]
(http--127.0.0.1-8080-2) processAction(j_idt4)
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) Java version: 1.6.0_25
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) Java vendor: Sun Microsystems Inc.
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) Java class path:
D:\java\servidores\jboss\jboss-as-7.1.0.Beta1\jboss-modules.jar
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) Operating system name: Windows XP
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) Operating system architecture: x86
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) Operating system version: 5.1
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) jboss-sasl 1.0: JBoss SASL Provider 1.0.0.Beta6
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) SUN 1.6: SUN (DSA key/parameter generation; DSA
signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS
keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection
CertStores, JavaPolicy Policy; JavaLoginConfig Configuration)
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) SunRsaSign 1.5: Sun RSA signature provider
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) SunJSSE 1.6: Sun JSSE provider(PKCS12, SunX509
key/trust factories, SSLv3, TLSv1)
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) SunJCE 1.6: SunJCE Provider (implements RSA,
DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) SunJGSS 1.0: Sun (Kerberos v5, SPNEGO)
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) SunSASL 1.5: Sun SASL provider(implements
client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5;
server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5)
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) XMLDSig 1.0: XMLDSig (DOM XMLSignatureFactory;
DOM KeyInfoFactory)
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) SunPCSC 1.6: Sun PC/SC provider
10:47:54,660 DEBUG [org.apache.commons.httpclient.HttpClient]
(http--127.0.0.1-8080-2) SunMSCAPI 1.6: Sun's Microsoft Crypto API provider
10:47:54,676 DEBUG
[org.apache.commons.httpclient.params.DefaultHttpParams]
(http--127.0.0.1-8080-2) Set parameter http.useragent = Jakarta
Commons-HttpClient/3.1
10:47:54,676 DEBUG
[org.apache.commons.httpclient.params.DefaultHttpParams]
(http--127.0.0.1-8080-2) Set parameter http.protocol.version = HTTP/1.1
10:47:54,676 DEBUG
[org.apache.commons.httpclient.params.DefaultHttpParams]
(http--127.0.0.1-8080-2) Set parameter http.connection-manager.class =
class org.apache.commons.httpclient.SimpleHttpConnectionManager
10:47:54,676 DEBUG
[org.apache.commons.httpclient.params.DefaultHttpParams]
(http--127.0.0.1-8080-2) Set parameter http.protocol.cookie-policy = default
10:47:54,676 DEBUG
[org.apache.commons.httpclient.params.DefaultHttpParams]
(http--127.0.0.1-8080-2) Set parameter http.protocol.element-charset =
US-ASCII
10:47:54,676 DEBUG
[org.apache.commons.httpclient.params.DefaultHttpParams]
(http--127.0.0.1-8080-2) Set parameter http.protocol.content-charset =
ISO-8859-1
10:47:54,676 DEBUG
[org.apache.commons.httpclient.params.DefaultHttpParams]
(http--127.0.0.1-8080-2) Set parameter http.method.retry-handler =
org.apache.commons.httpclient.DefaultHttpMethodRetryHandler at 1e8e6aa
10:47:54,676 DEBUG
[org.apache.commons.httpclient.params.DefaultHttpParams]
(http--127.0.0.1-8080-2) Set parameter http.dateparser.patterns = [EEE,
dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d
HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z,
EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy
HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd
MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z,
EEE, dd-MM-yyyy HH:mm:ss z]
10:47:55,129 INFO [br.gov.ce.sefaz.jee.intranet.RestEasyAstraWS]
(http--127.0.0.1-8080-2) URI de autenticação no Astra :
https://dese2.sefaz.ce.gov.br/sisseg-jee-ws/resource/autenticacao/?siglaSistema=testeplat&auth=208313741943058386f7b9bac1a357a10c8578088dfeb8d386f7b9bac1a3&key=070187211039071227070245078107199218194197049193157064020242196241001233243171101043040164120209
10:47:55,207 DEBUG [org.apache.commons.httpclient.HttpConnection]
(http--127.0.0.1-8080-2) Open connection to dese2.sefaz.ce.gov.br:443
10:47:55,207 DEBUG [org.apache.commons.httpclient.HttpConnection]
(http--127.0.0.1-8080-2) Releasing connection back to connection manager.
10:47:55,207 BOM
[javax.enterprise.resource.webcontainer.jsf.application]
(http--127.0.0.1-8080-2) java.lang.NoClassDefFoundError:
javax/net/ssl/SSLSocketFactory: javax.faces.el.EvaluationException:
java.lang.NoClassDefFoundError: javax/net/ssl/SSLSocketFactory
at
org.jboss.seam.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:58)
[seam-faces-3.0.0.Final.jar:]
at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
[jsf-impl-2.1.3-b02-jbossorg-2.jar:]
at
org.jboss.seam.faces.component.UIViewAction.broadcast(UIViewAction.java:365)
[seam-faces-3.0.0.Final.jar:]
at
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
[jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:]
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:]
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
[jsf-impl-2.1.3-b02-jbossorg-2.jar:]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
[jsf-impl-2.1.3-b02-jbossorg-2.jar:]
at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
[jsf-impl-2.1.3-b02-jbossorg-2.jar:]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
[jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.3.Final.jar:]
at
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
[weld-core-1.1.4.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
[jbossweb-7.0.3.Final.jar:]
at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:151)
[jboss-as-web-7.1.0.Beta1.jar:]
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
[jbossweb-7.0.3.Final.jar:]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
Caused by: java.lang.NoClassDefFoundError: javax/net/ssl/SSLSocketFactory
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:82)
[commons-httpclient-3.1.jar:]
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:127)
[commons-httpclient-3.1.jar:]
at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
[commons-httpclient-3.1.jar:]
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
[commons-httpclient-3.1.jar:]
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
[commons-httpclient-3.1.jar:]
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
[commons-httpclient-3.1.jar:]
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
[commons-httpclient-3.1.jar:]
at
org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor.execute(ApacheHttpClientExecutor.java:81)
[resteasy-jaxrs-2.2.3.GA.jar:]
at
org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:39)
[resteasy-jaxrs-2.2.3.GA.jar:]
at
org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor.execute(AcceptEncodingGZIPInterceptor.java:40)
[resteasy-jaxrs-2.2.3.GA.jar:]
at
org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:45)
[resteasy-jaxrs-2.2.3.GA.jar:]
at
org.jboss.resteasy.client.ClientRequest.execute(ClientRequest.java:473)
[resteasy-jaxrs-2.2.3.GA.jar:]
at
org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:704)
[resteasy-jaxrs-2.2.3.GA.jar:]
at
org.jboss.resteasy.client.ClientRequest.get(ClientRequest.java:509)
[resteasy-jaxrs-2.2.3.GA.jar:]
at
org.jboss.resteasy.client.ClientRequest.get(ClientRequest.java:537)
[resteasy-jaxrs-2.2.3.GA.jar:]
at
br.gov.ce.sefaz.jee.intranet.RestEasyAstraWS.autenticarUsuario(RestEasyAstraWS.java:30)
[jee-intranet-sefaz-0.0.3-SNAPSHOT.jar:]
at
br.gov.ce.sefaz.jee.intranet.AutenticadorAstra.authenticate(AutenticadorAstra.java:52)
[jee-intranet-sefaz-0.0.3-SNAPSHOT.jar:]
at
br.gov.ce.sefaz.jee.intranet.AutenticadorAstra$Proxy$_$$_WeldClientProxy.authenticate(AutenticadorAstra$Proxy$_$$_WeldClientProxy.java)
[jee-intranet-sefaz-0.0.3-SNAPSHOT.jar:]
at
org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:305)
[seam-security-3.0.0.Final.jar:]
at
org.jboss.seam.security.IdentityImpl.login(IdentityImpl.java:229)
[seam-security-3.0.0.Final.jar:]
at
org.jboss.seam.security.IdentityImpl$Proxy$_$$_WeldClientProxy.login(IdentityImpl$Proxy$_$$_WeldClientProxy.java)
[seam-security-3.0.0.Final.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[:1.6.0_25]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[:1.6.0_25]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[:1.6.0_25]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_25]
at org.apache.el.parser.AstValue.invoke(AstValue.java:196)
[jbossweb-7.0.3.Final.jar:]
at
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
[jbossweb-7.0.3.Final.jar:]
at
org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39)
[weld-core-1.1.4.Final.jar:]
at
org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
[weld-core-1.1.4.Final.jar:]
at
com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
[jsf-impl-2.1.3-b02-jbossorg-2.jar:]
at
org.jboss.seam.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:48)
[seam-faces-3.0.0.Final.jar:]
... 24 more
Caused by: java.lang.ClassNotFoundException:
javax.net.ssl.SSLSocketFactory from [Module
"org.apache.commons.httpclient:main" from local module loader @542529
(roots: D:\java\servidores\jboss\jboss-as-7.1.0.Beta1\modules)]
at
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:485)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:444)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:421)
at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:143)
... 55 more
thanks in advance,
Fabrício Lemos
------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and
point of
discussion for anyone considering optimizing the pricing and packaging
model
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Resteasy-developers mailing list
Resteasy-developers at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-developers
More information about the jboss-as7-dev
mailing list