I see, that's very unfortunate then. It fails even when it is not actually making the reflective call. Your last recourse is writing your own code against the Java Reflection API, using *setAccesible(true)* if necessary.
On Wednesday, March 13, 2013 11:03:50 AM UTC+1, shlomi...@gmail.com wrote: > > I fully agree with you, only it doesnt work.. ServerBootstrap does not > override that specific method, which is what causing this pain, so i dont > know what other options i have. > > here is my attempt: > > user> (.channel ^ServerBootstrap b ^Class > io.netty.channel.socket.nio.NioServerSocketChannel) > Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be resolved. > IllegalArgumentException Can't call public method of non-public class: > public io.netty.bootstrap.AbstractBootstrap > io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) > clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88) > > > > On Wednesday, March 13, 2013 11:58:06 AM UTC+2, Marko Topolnik wrote: >> >> It does have a public descendant, though. It is not acceptable for you to >> annotate with ServerBootstrap? It really is bad practice to annotate with >> non-public classes. >> >> On Wednesday, March 13, 2013 10:43:35 AM UTC+1, shlomi...@gmail.comwrote: >>> >>> hey >>> we dont need to be almost certain, we can just look at the code : >>> https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java >>> and >>> see that it is not a public ancestor. more then that, i annotated the code >>> and it didnt work. here is a repl dump, same as Sean did: >>> >>> ; nREPL 0.1.6-preview >>> user> (set! *warn-on-reflection* true) >>> true >>> user> (import '(io.netty.bootstrap AbstractBootstrap ServerBootstrap)) >>> io.netty.bootstrap.ServerBootstrap >>> user> (def b (ServerBootstrap.)) >>> #'user/b >>> user> (.channel ^AbstractBootstrap b ^Class >>> io.netty.channel.socket.nio.NioServerSocketChannel) >>> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be >>> resolved. >>> IllegalArgumentException Can't call public method of non-public class: >>> public io.netty.bootstrap.AbstractBootstrap >>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) >>> clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88) >>> user> *clojure-version* >>> {:major 1, :minor 5, :incremental 1, :qualifier nil} >>> >>> >>> >>> On Wednesday, March 13, 2013 11:34:33 AM UTC+2, Marko Topolnik wrote: >>>> >>>> It is almost certain that the method you want to call is inherited from >>>> a public ancestor. Annotate the call with that ancestor and it will work. >>>> >>>> On Wednesday, March 13, 2013 10:23:31 AM UTC+1, shlomi...@gmail.comwrote: >>>>> >>>>> here is the full exception when compiling: >>>>> >>>>> Exception in thread "main" java.lang.IllegalArgumentException: Can't >>>>> call public method of non-public class: public >>>>> io.netty.bootstrap.AbstractBootstrap >>>>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), >>>>> compiling:(netty.clj:31:1) >>>>> at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453) >>>>> at clojure.lang.Compiler.compile1(Compiler.java:7153) >>>>> at clojure.lang.Compiler.compile(Compiler.java:7219) >>>>> >>>>> Caused by: java.lang.IllegalArgumentException: Can't call public >>>>> method of non-public class: public io.netty.bootstrap.AbstractBootstrap >>>>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) >>>>> >>>>> >>>>> On Wednesday, March 13, 2013 11:21:40 AM UTC+2, shlomi...@gmail.comwrote: >>>>>> >>>>>> yes you are right, it is a compile-time error.. >>>>>> >>>>>> On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik wrote: >>>>>>> >>>>>>> When you annotate, is it a runtime or a compile-time error? I would >>>>>>> be very surprised if it happened at runtime (when the function is >>>>>>> actuall >>>>>>> called). >>>>>>> >>>>>>> On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote: >>>>>>>> >>>>>>>> hey, I have a similar problem, even when i type annotate with >>>>>>>> clojure 1.5 i still get that error.. any suggestions? >>>>>>>> >>>>>>> -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.