owainlewis / clojure-mail

A Clojure library for parsing, downloading and reading email from IMAP servers.
203 stars 54 forks source link

RuntimeException: Unable to find static field: SIZE in class javax.mail.FetchProfile$Item Round 2 #69

Open vxe opened 5 years ago

vxe commented 5 years ago

as mentioned here:

https://github.com/owainlewis/clojure-mail/issues/66

the issue appears to be with javax/mail/mailapi/1.4.3 and the exception is

Caused by: java.lang.RuntimeException: Unable to find static field: SIZE in class javax.mail.FetchProfile$Item
    at clojure.lang.Util.runtimeException(Util.java:221)
    at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7196)
    at clojure.lang.Compiler.analyze(Compiler.java:6752)

called here

Exception in thread "main" java.lang.RuntimeException: Unable to find static field: SIZE in class javax.mail.FetchProfile$Item, compiling:(clojure_mail/folder.clj:64:14)
    at clojure.lang.Compiler.analyze(Compiler.java:6792)
    at clojure.lang.Compiler.analyze(Compiler.java:6729)

https://github.com/owainlewis/clojure-mail/blob/master/src/clojure_mail/folder.clj#L70

it appears SIZE is indeed non-existant

https://docs.oracle.com/javaee/6/api/javax/mail/FetchProfile.Item.html

but might instead be in CONTENT_INFO

CONTENT_INFO

This item is for fetching information about the content of the message. This includes all the attributes that describe the content of the message. Implementations >should include the following attributes: ContentType, ContentDisposition, >ContentDescription, Size and LineCount. Other items may be included as well.

Can this field be removed to get rid of the exception? I have a hard dependency on mailapi 1.4.3