Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] (no subject)

Yes, Alex, I think you are right. In JGits classpath we may have
multiple versions of HttpsURLConnection all subclassing
java.net.HttpURLConnection. In my java 7 there is
javax.net.ssl.HttpsURLConnection and
com.sun.net.ssl.HttpsURLConnection. And the place mentioned in the
stacktrace I am casting to  javax.net.ssl.HttpsURLConnection. That's a
bug in the place where we cast. I'll try to provide a fix.
Ciao
  Chris


On Wed, Nov 19, 2014 at 10:42 AM, Alex Blewitt <alex.blewitt@xxxxxxxxx> wrote:
> Relying on a specific handler in a private package is definitely the wrong
> thing to do as this may break in future versions. Instead the thing that is
> trying to cast it should be guarding against the possibility that the
> instance does not meet the type and warning appropriately.
>
> It's quite possible that it is an underlying symptom of something else, like
> having duplicate javax.net packages on the classpath.
>
> Alex
>
> Sent from my iPhat 6
>
> On 19 Nov 2014, at 09:14, Halstrick, Christian <christian.halstrick@xxxxxxx>
> wrote:
>
> Looks good. Do you want to contribute? See
> http://wiki.eclipse.org/EGit/Contributor_Guide
>
>
>
> Ciao
>
>   Chris
>
>
>
> From: jgit-dev-bounces@xxxxxxxxxxx [mailto:jgit-dev-bounces@xxxxxxxxxxx] On
> Behalf Of Marco Sousa
> Sent: Mittwoch, 19. November 2014 10:08
> To: jgit-dev@xxxxxxxxxxx
> Subject: [jgit-dev] (no subject)
>
>
>
>
>
> I have one error with egit >= 2.2.0 until 3.5.2 eclipse 4.4.1.
>
> egit <= 2.1.x works fine.
>
>
>
> But I think that the problem is in the jgit.
>
> Lot's of the times it give me Cast error when fetch/push with GITBLIT
> server.
>
>
>
>
>
> !ENTRY org.eclipse.egit.core 4 0 2014-11-19 09:23:04.674
>
> !MESSAGE An exception occurred during push on URI
> https://git.agbar.local/r/AquaCIS_CF/proyectos.git:
> com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl cannot
> be cast to javax.net.ssl.HttpsURLConnection
>
> !STACK 0
>
> java.lang.ClassCastException:
> com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl cannot
> be cast to javax.net.ssl.HttpsURLConnection
>
>           at
> org.eclipse.jgit.transport.http.JDKHttpConnection.configure(JDKHttpConnection.java:191)
>
>           at
> org.eclipse.jgit.transport.TransportHttp.disableSslVerify(TransportHttp.java:570)
>
>           at
> org.eclipse.jgit.transport.TransportHttp.httpOpen(TransportHttp.java:544)
>
>           at
> org.eclipse.jgit.transport.TransportHttp.httpOpen(TransportHttp.java:526)
>
>           at
> org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:468)
>
>           at
> org.eclipse.jgit.transport.TransportHttp.openPush(TransportHttp.java:399)
>
>           at
> org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:154)
>
>           at org.eclipse.jgit.transport.Transport.push(Transport.java:1173)
>
>           at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:156)
>
>           at
> org.eclipse.egit.core.op.PushOperation.run(PushOperation.java:228)
>
>           at
> org.eclipse.egit.ui.internal.push.PushOperationUI.execute(PushOperationUI.java:167)
>
>           at
> org.eclipse.egit.ui.internal.push.PushOperationUI$1.run(PushOperationUI.java:229)
>
>           at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
>
>
>
> I think that the problem is there:
>
>
>
> https://github.com/eclipse/jgit/blob/9fd1325ecbdfaa41965782166e77d0dc8dd936ec/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java#L460
>
>
>
>
>
> The URL is constructed without define any implementation.
>
> u = new URL(b.toString());
>
>
>
> This change should fix it :
>
> HTTP
>
> u = new URL(b.toString(), new sun.net.www.protocol.https.Handler());
>
>
>
> HTTPS
>
> u = new URL(b.toString(), new sun.net.www.protocol.https.Handler());
>
>
>
>
>
> Articles
>
> http://stackoverflow.com/questions/23517139/java-lang-classcastexception-com-sun-net-ssl-internal-www-protocol-https-httpsu
>
> https://community.oracle.com/thread/1536137?start=0&tstart=0
>
>
>
>
> -------------------------------------
> Marco Sousa
>
> _______________________________________________
> jgit-dev mailing list
> jgit-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/jgit-dev
>
>
> _______________________________________________
> jgit-dev mailing list
> jgit-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/jgit-dev


Back to the top