interop

Alex Miller (Clojure team) 2019-07-01T13:50:33.004800Z

@alexmiller has joined the channel

Alex Miller (Clojure team) 2019-07-01T13:52:48.005300Z

could you drop the first 10 lines or so of the stack trace? (pst)

Alex Miller (Clojure team) 2019-07-01T13:53:17.005600Z

what jvm were the protobuff objects compiled with?

dharrigan 2019-07-01T13:53:48.005800Z

I shall, and JVM 1.8

Alex Miller (Clojure team) 2019-07-01T13:54:29.006400Z

so java modules were added in Java 1.9, not sure if that's involved here (doesn't really look like it from the message)

ghadi 2019-07-01T13:54:42.006800Z

@ghadi has joined the channel

dharrigan 2019-07-01T13:55:42.007900Z

IllegalAccessError tried to access field com.google.protobuf.AbstractMessage.memoizedSize from class com.foo.Foo$Bar
        com.foo.Foo$Bar.getSerializedSize (DQAProto.java:7881)
        com.google.protobuf.AbstractMessageLite.toByteArray (AbstractMessageLite.java:62)
        message_window_enricher.interop.Interop.messageWindowToBytes (Interop.kt:12)
        user/eval32140 (NO_SOURCE_FILE:1)
        user/eval32140 (NO_SOURCE_FILE:1)
        clojure.lang.Compiler.eval (Compiler.java:7177)
        clojure.lang.Compiler.eval (Compiler.java:7132)
        clojure.core/eval (core.clj:3214)
        clojure.core/eval (core.clj:3210)
        clojure.main/repl/read-eval-print--9086/fn--9089 (main.clj:437)
        clojure.main/repl/read-eval-print--9086 (main.clj:437)
        clojure.main/repl/fn--9095 (main.clj:458)

Alex Miller (Clojure team) 2019-07-01T13:55:43.008Z

I'm kind of wondering if you'd have same result if you had compiled the protobuf object w/Java 12

dharrigan 2019-07-01T13:56:06.008500Z

Thing is, I have a project, in pure java 1.8, does the same thing, works fine. Even when I switch the project to java 12, works fine

kszabo 2019-07-01T13:56:14.008800Z

@thenonameguy has joined the channel

dharrigan 2019-07-01T13:56:16.009Z

only in Clojure am I seeing this issue.

dharrigan 2019-07-01T13:56:30.009500Z

kotlin both when compiling to java 1.6 and 1.8 bytecode, works fine.

Alex Miller (Clojure team) 2019-07-01T13:56:53.010Z

well those symptoms sound like a reflection issue - if you (set! *warn-on-reflection* true), do you see any reflection warnings?

dharrigan 2019-07-01T13:57:02.010200Z

No, and I have that on

Alex Miller (Clojure team) 2019-07-01T14:02:18.012300Z

reading the error, it sounds like messages can cache the computed size in the private memoizedSize field in the parent abstract class and the child class is unable to access the abstract parent field?

Alex Miller (Clojure team) 2019-07-01T14:02:41.012700Z

it's possible this is module related

dharrigan 2019-07-01T14:02:55.013Z

when I switch to java 8, same issue with clojure

2019-07-01T14:03:02.013300Z

@sogaiu has joined the channel

dharrigan 2019-07-01T14:03:04.013400Z

java 8, kotlin/java == no issue

Alex Miller (Clojure team) 2019-07-01T14:08:46.014Z

the confusing thing here is that the access error seems to be in calls from one external thing to another external thing, not in the Clojure call itself

dharrigan 2019-07-01T14:09:05.014500Z

Do you mind if I ping you privately, i.e., company data in error 🙂

souenzzo 2019-07-01T14:10:14.014700Z

@souenzzo has joined the channel

Alex Miller (Clojure team) 2019-07-01T14:10:41.015Z

sure, although not sure how much time I have to look at it

dharrigan 2019-07-01T14:11:15.015400Z

I appreciate it - I hope it's something trivial and not a compiler bug

dharrigan 2019-07-01T15:32:31.016Z

So, a huge thank you to Alex who helped me to get a solution to my problem by pointing the finger!

dharrigan 2019-07-01T15:33:16.017Z

I had a rogue import of a protobuf library all the way from rebel readline which included the cljs libraries which included the closure compiler which included a version of protobuf that I am not using!

dharrigan 2019-07-01T15:33:51.017200Z

this solved the problem

dharrigan 2019-07-01T15:33:53.017400Z

:rebel {:extra-deps {com.bhauman/rebel-readline {:mvn/version "RELEASE" :exclusions [org.clojure/google-closure-library
                                                                                       rewrite-cljs/rewrite-cljs]}}

dharrigan 2019-07-01T15:34:05.017700Z

May your fame increase a million fold Alex!

Alex Miller (Clojure team) 2019-07-01T15:35:57.018100Z

btw, it's a bad idea to use RELEASE versions, much better to set a fixed version

dharrigan 2019-07-01T15:36:17.018300Z

yes, thank you. Learning as I go 🙂

dharrigan 2019-07-01T15:36:29.018600Z

Your recommendation of using jhades helped tremendously

dharrigan 2019-07-01T15:36:39.018800Z

Alex Miller (Clojure team) 2019-07-01T15:38:33.019300Z

cool. I think there's some clojure lein plugin that does something similar too, but can't remember what it's called

dharrigan 2019-07-01T15:39:05.019600Z

I'll keep it in mind if I come across similar issues

dharrigan 2019-07-01T15:39:23.020Z

(I'm getting a few use cases together for the adoption of clojure at work)

ghadi 2019-07-01T15:39:29.020400Z

JHades seems useful

dharrigan 2019-07-01T15:39:32.020500Z

so translating one kotlin project to clojure will help 🙂

2019-07-01T15:57:27.020700Z

@andy.fingerhut has joined the channel

seancorfield 2019-07-01T16:41:13.020900Z

@seancorfield has joined the channel

2019-07-01T16:41:25.021100Z

@zulip-mirror-bot has joined the channel

seancorfield 2019-07-01T16:41:59.021900Z

(I just added the Zulip mirror bot so future discussions here will be archived and searchable within Zulip -- I didn't even know this channel existed!)

aisamu 2019-07-02T09:09:59.022400Z

Came here to do precisely that, thank you!

lread 2019-07-01T17:52:56.022100Z

@lee has joined the channel