You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Sica, David (David)" <ds...@avaya.com> on 2008/10/16 15:46:45 UTC

HttpsURLConnection ClassCastException

I'm trying to connect to a secure web service using CXF but am getting
the following stacktrace.  It seems like something is returning
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
instead of javax.net.ssl.HttpsURLConnection but I can't figure out
exactly where it is or how to change it:
[[DWS]] 

java.lang.ClassCastException:
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
cannot be cast to javax.net.ssl.HttpsURLConnection
	at
org.apache.cxf.transport.https.HttpsURLConnectionFactory.createConnectio
n(HttpsURLConnectionFactory.java:129)
	at
org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:480)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Messag
eSenderInterceptor.java:46)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
hain.java:220)
	at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
	at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
	at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
	at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
	at $Proxy45.getUserProfile(Unknown Source)
	at
com.avaya.srd.safe.core.ws.client.CXPServiceClient.startService(CXPServi
ceClient.java:50)
	at
com.avaya.srd.safe.core.ws.client.CXPServiceClient.getUserRelationship(C
XPServiceClient.java:92)
	at
com.avaya.srd.safe.core.persistence.HibernateEntitlementDao.getDownloadE
ntitlement(HibernateEntitlementDao.java:85)
	at
com.avaya.srd.safe.core.AbstractEntitlementService.getDownloadEntitlemen
t(AbstractEntitlementService.java:416)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(
AopUtils.java:310)
	at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinp
oint(ReflectiveMethodInvocation.java:182)
	at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref
lectiveMethodInvocation.java:149)
	at
org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke
(ThrowsAdviceInterceptor.java:126)
	at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref
lectiveMethodInvocation.java:171)
	at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAo
pProxy.java:204)
	at $Proxy3.getDownloadEntitlement(Unknown Source)

Re: HttpsURLConnection ClassCastException

Posted by Daniel Kulp <dk...@apache.org>.
If you google HttpsURLConnectionOldImpl, you'll find some information.   

One good blog:
http://weblogs.java.net/blog/garysweaver/archive/2008/08/javaprotocolhan_1.html

Dan

On Thursday 16 October 2008 9:46:45 am Sica, David (David) wrote:
> I'm trying to connect to a secure web service using CXF but am getting
> the following stacktrace.  It seems like something is returning
> com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
> instead of javax.net.ssl.HttpsURLConnection but I can't figure out
> exactly where it is or how to change it:
> [[DWS]]
>
> java.lang.ClassCastException:
> com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
> cannot be cast to javax.net.ssl.HttpsURLConnection
> 	at
> org.apache.cxf.transport.https.HttpsURLConnectionFactory.createConnectio
> n(HttpsURLConnectionFactory.java:129)
> 	at
> org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:480)
> 	at
> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Messag
> eSenderInterceptor.java:46)
> 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> hain.java:220)
> 	at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> 	at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> 	at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> 	at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> 	at $Proxy45.getUserProfile(Unknown Source)
> 	at
> com.avaya.srd.safe.core.ws.client.CXPServiceClient.startService(CXPServi
> ceClient.java:50)
> 	at
> com.avaya.srd.safe.core.ws.client.CXPServiceClient.getUserRelationship(C
> XPServiceClient.java:92)
> 	at
> com.avaya.srd.safe.core.persistence.HibernateEntitlementDao.getDownloadE
> ntitlement(HibernateEntitlementDao.java:85)
> 	at
> com.avaya.srd.safe.core.AbstractEntitlementService.getDownloadEntitlemen
> t(AbstractEntitlementService.java:416)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(
> AopUtils.java:310)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinp
> oint(ReflectiveMethodInvocation.java:182)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref
> lectiveMethodInvocation.java:149)
> 	at
> org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke
> (ThrowsAdviceInterceptor.java:126)
> 	at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref
> lectiveMethodInvocation.java:171)
> 	at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAo
> pProxy.java:204)
> 	at $Proxy3.getDownloadEntitlement(Unknown Source)



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog