Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

NoSuchMethodError on CharsetUtil.getCharset() #7

abilascram opened this Issue Dec 5, 2012 · 6 comments


None yet
4 participants

The Request.buildRequest() method makes a call to CharsetUtil.getCharset() (from the org.apache.james.mime4j.util.CharsetUtil class) which throws a NoSuchMethodError because the method doesn't exist.

I looked through some older mime4j releases thinking that the getCharset() method was deprecated but I still couldn't find it. Shouldn't the project be using the CharsetUtil lookup() method instead?

Kekec852 commented Dec 5, 2012

Replacing CharsetUtil.getCharset("UTF-8") with CharsetUtil.UTF_8 for newer versions of mime4j?

Or just drop the mime4j dependecy all together. The java.nio.charset.Charset class has a static Charset.forName(String charsetName) method which will replace it just fine.


jberkel commented Dec 11, 2012

i think the mime4j dependency is currently used for file uploads. could be replaced with some custom code though.

Hmm... The only reference to it that I found was in the Request class and it's only used for its character set utilities.

Having the same problem, which keeps me from getting logged in.
I'm using mime4j 0.7.2 and currently fixing it by following Kekec852's advice

java.lang.NoSuchMethodError: org.apache.james.mime4j.util.CharsetUtil.getCharset(Ljava/lang/String;)Ljava/nio/charset/Charset;
at com.soundcloud.api.Request.buildRequest(Request.java:373)

@jberkel jberkel closed this in 462d4e2 Jan 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment