Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transit+msgpack only works on the JVM #13

Closed
bclark-videra opened this issue Aug 17, 2022 · 2 comments · Fixed by #14
Closed

transit+msgpack only works on the JVM #13

bclark-videra opened this issue Aug 17, 2022 · 2 comments · Fixed by #14
Labels
bug Something isn't working

Comments

@bclark-videra
Copy link

Version: 2022.01.26-15.35.00
Platform: macOS 12.5

Encoding to or decoding from transit+msgpack fails on the GraalVM binary but works on the JVM.

JVM

❯ echo '{"something": 42}' | java -jar ~/Downloads/cq.jar -i json -o transit --transit-format-out msgpack | xxd
00000000: 81ab 7e3a 736f 6d65 7468 696e 672a       ..~:something*

GraalVM binary

❯ echo '{"something": 42}' | ~/Downloads/cq-native-macos -i json -o transit --transit-format-out msgpack
Aug 17, 2022 4:15:01 PM org.msgpack.template.builder.TemplateBuilderChain createForceTemplateBuilder
WARNING: Failed to create a TemplateBuilder reflectively
java.lang.ClassNotFoundException: org.msgpack.template.builder.JavassistTemplateBuilder
	at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:60)
	at java.lang.Class.forName(DynamicHub.java:1247)
	at org.msgpack.template.builder.TemplateBuilderChain.createForceTemplateBuilder(TemplateBuilderChain.java:84)
	at org.msgpack.template.builder.TemplateBuilderChain.reset(TemplateBuilderChain.java:73)
	at org.msgpack.template.builder.TemplateBuilderChain.<init>(TemplateBuilderChain.java:54)
	at org.msgpack.template.builder.TemplateBuilderChain.<init>(TemplateBuilderChain.java:49)
	at org.msgpack.template.TemplateRegistry.createTemplateBuilderChain(TemplateRegistry.java:102)
	at org.msgpack.template.TemplateRegistry.<init>(TemplateRegistry.java:78)
	at org.msgpack.template.TemplateRegistry.<init>(TemplateRegistry.java:93)
	at org.msgpack.MessagePack.<init>(MessagePack.java:60)
	at com.cognitect.transit.impl.WriterFactory.getMsgpackInstance(WriterFactory.java:77)
	at com.cognitect.transit.TransitFactory.writer(TransitFactory.java:95)
	at cognitect.transit$writer.invokeStatic(transit.clj:161)
	at cognitect.transit$writer.invoke(transit.clj:139)
	at cognitect.transit$writer.invokeStatic(transit.clj:155)
	at cognitect.transit$writer.invoke(transit.clj:139)
	at cq.formats$__GT_transit_writer$fn__14686.invoke(formats.clj:154)
	at cq.formats$format__GT_writer$fn__14701.invoke(formats.clj:199)
	at cq.core$run.invokeStatic(core.clj:97)
	at cq.core$run.invoke(core.clj:93)
	at cq.main$main.invokeStatic(main.clj:109)
	at cq.main$main.invoke(main.clj:99)
	at cq.main$_main.invokeStatic(main.clj:114)
	at cq.main$_main.doInvoke(main.clj:111)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at cq.main.main(Unknown Source)

#error {
 :cause org.msgpack.template.ListTemplate.<init>(org.msgpack.template.Template)
 :via
 [{:type java.lang.RuntimeException
   :message java.lang.IllegalArgumentException: java.lang.NoSuchMethodException: org.msgpack.template.ListTemplate.<init>(org.msgpack.template.Template)
   :at [com.cognitect.transit.TransitFactory writer TransitFactory.java 104]}
  {:type java.lang.IllegalArgumentException
   :message java.lang.NoSuchMethodException: org.msgpack.template.ListTemplate.<init>(org.msgpack.template.Template)
   :at [org.msgpack.template.GenericCollectionTemplate <init> GenericCollectionTemplate.java 33]}
  {:type java.lang.NoSuchMethodException
   :message org.msgpack.template.ListTemplate.<init>(org.msgpack.template.Template)
   :at [java.lang.Class getConstructor0 DynamicHub.java 3349]}]
 :trace
 [[java.lang.Class getConstructor0 DynamicHub.java 3349]
  [java.lang.Class getConstructor DynamicHub.java 2151]
  [org.msgpack.template.GenericCollectionTemplate <init> GenericCollectionTemplate.java 30]
  [org.msgpack.template.TemplateRegistry registerTemplatesWhichRefersRegistry TemplateRegistry.java 151]
  [org.msgpack.template.TemplateRegistry registerTemplates TemplateRegistry.java 140]
  [org.msgpack.template.TemplateRegistry <init> TemplateRegistry.java 81]
  [org.msgpack.template.TemplateRegistry <init> TemplateRegistry.java 93]
  [org.msgpack.MessagePack <init> MessagePack.java 60]
  [com.cognitect.transit.impl.WriterFactory getMsgpackInstance WriterFactory.java 77]
  [com.cognitect.transit.TransitFactory writer TransitFactory.java 95]
  [cognitect.transit$writer invokeStatic transit.clj 161]
  [cognitect.transit$writer invoke transit.clj 139]
  [cognitect.transit$writer invokeStatic transit.clj 155]
  [cognitect.transit$writer invoke transit.clj 139]
  [cq.formats$__GT_transit_writer$fn__14686 invoke formats.clj 154]
  [cq.formats$format__GT_writer$fn__14701 invoke formats.clj 199]
  [cq.core$run invokeStatic core.clj 97]
  [cq.core$run invoke core.clj 93]
  [cq.main$main invokeStatic main.clj 109]
  [cq.main$main invoke main.clj 99]
  [cq.main$_main invokeStatic main.clj 114]
  [cq.main$_main doInvoke main.clj 111]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [cq.main main nil -1]]}
@markus-wa
Copy link
Owner

I think we'll need to bundle a few more classes 😅 will try to fix this soon

@markus-wa markus-wa added the bug Something isn't working label Aug 26, 2022
byronclark added a commit to byronclark/cq that referenced this issue Aug 27, 2022
@markus-wa
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants