Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. ;; TO run:
  2. ;; - install clj
  3. ;; - start a clj REPL with presto: clojure -Sdeps '{:deps {com.facebook.presto/presto-jdbc {:mvn/version "0.219"}}}'
  4. ;; - copy-paste this gist content
  5.  
  6. (ns hello-presto
  7. (:import [java.util Date]
  8. [com.facebook.presto.jdbc.internal.client FailureInfo FailureInfo$FailureException]))
  9.  
  10. (println "Date bean:" (bean (Date.)))
  11. (println "Exception bean:" (bean (Exception. "something wrong")))
  12. (println "Runtime Exception" (bean (RuntimeException. "somemessage" nil)))
  13.  
  14. ;; using presto with the clojure java.jdbc driver, when a query fails, I get this
  15. ;;java.lang.IllegalAccessException: Class clojure.core$bean$fn__6906$fn__6907 can not access a member of class com.facebook.presto.jdbc.internal.client.FailureInfo$FailureException with modifiers "public"
  16. ;; Here is a short reproduction
  17. ;;
  18. (println "FailureInfo:" (bean (FailureInfo. "sometype"
  19. "somemessage"
  20. nil
  21. []
  22. []
  23. nil)))
  24.  
  25. (println "FailureInfo toException: " (bean (.toException (FailureInfo. "sometype"
  26. "somemessage"
  27. nil
  28. []
  29. []
  30. nil))))
  31. ;; Error printing return value (IllegalAccessException) at sun.reflect.Reflection/ensureMemberAccess (Reflection.java:102).
  32. ;; Class clojure.core$bean$fn__7182$fn__7183 can not access a member of class com.facebook.presto.jdbc.internal.client.FailureInfo$FailureException with modifiers "public"
  33. ;; {:cause nil, :class com.facebook.presto.jdbc.internal.client.FailureInfo$FailureException, :localizedMessage "somemessage", :message "somemessage", :stackTrace #object["[Ljava.lang.StackTraceElement;" 0x4b3a45f1 "[Ljava.lang.StackTraceElement;@4b3a45f1"], user=>
  34. ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement