java.lang.NoSuchFieldError: INSTANCE

10,514 views
Skip to first unread message

SatyaDeep Maheshwari

unread,
May 14, 2015, 7:28:48 AM5/14/15
to sardi...@googlegroups.com
Getting this error:

java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144)
at com.github.sardine.impl.SardineImpl.createDefaultSecureSocketFactory(SardineImpl.java:1002)
at com.github.sardine.impl.SardineImpl.createDefaultSchemeRegistry(SardineImpl.java:983)
at com.github.sardine.impl.SardineImpl.configure(SardineImpl.java:950)
at com.github.sardine.impl.SardineImpl.<init>(SardineImpl.java:192)
at com.github.sardine.SardineFactory.begin(SardineFactory.java:44)
at com.github.sardine.SardineFactory.begin(SardineFactory.java:34)

I think this is some dependency issue with httpcompnents.

Here are the dependencies I am using:

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.4.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>4.4.1</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.9</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>

Please help.

Fernando W

unread,
Nov 2, 2015, 4:12:26 PM11/2/15
to sardine
I have same issue. Could you solve it?

George Wang

unread,
Nov 17, 2015, 2:55:14 AM11/17/15
to sardine

I have the same problem at exactly the same location (see the logs below) 

My guess was that it could be a problem on the depending httpclient( 4.4.1).  please downgrade it to a previous level, 


Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144)
at com.github.sardine.impl.SardineImpl.createDefaultSecureSocketFactory(SardineImpl.java:1069)
at com.github.sardine.impl.SardineImpl.createDefaultSchemeRegistry(SardineImpl.java:1052)
at com.github.sardine.impl.SardineImpl.configure(SardineImpl.java:1017)
at com.github.sardine.impl.SardineImpl.<init>(SardineImpl.java:195)
at com.github.sardine.SardineFactory.begin(SardineFactory.java:44)
at com.github.sardine.SardineFactory.begin(SardineFactory.java:34)

George Wang

unread,
Nov 18, 2015, 1:23:46 AM11/18/15
to sardine
Hello, I got this problems fixed thanks to a post in StackoverFlow 



basically, it was due to a conflict caused by two different versions of the same package (httpclient and httpcore in my case), you may follow the instructions in that post, identify the conflicting package, and then remove it. 

Jon Stevens

unread,
Nov 18, 2015, 1:22:53 PM11/18/15
to sardi...@googlegroups.com
Glad you got it all sorted and thanks for following up here. You've done the internet a good deed for the day. =)

--
You received this message because you are subscribed to the Google Groups "sardine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sardine-dav...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages