matyb / java-koans

A framework and lessons to learn java syntax and idioms in a logical sequence.
Apache License 2.0
733 stars 494 forks source link

Test AboutObjects.toStringConcatenates() fails #12

Closed Bringer128 closed 12 years ago

Bringer128 commented 12 years ago

The test beginner.AboutObjects.toStringContatenates() fails when run. The error is:

What went wrong: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sandwich.koan.runner.KoanMethodRunner.run(KoanMethodRunner.java:49) at com.sandwich.koan.runner.RunKoans.runKoans(RunKoans.java:67) at com.sandwich.koan.runner.RunKoans.run(RunKoans.java:40) at com.sandwich.koan.constant.ArgumentType.run(ArgumentType.java:74) at com.sandwich.koan.cmdline.CommandLineArgument.run(CommandLineArgument.java:36) at com.sandwich.koan.cmdline.CommandLineArgumentRunner.run(CommandLineArgumentRunner.java:26) at com.sandwich.koan.runner.AppLauncher.main(AppLauncher.java:19) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: java.lang.IllegalAccessError: tried to access class beginner.AboutObjects$1 from class beginner.AboutObjects at beginner.AboutObjects.toStringConcatenates(AboutObjects.java:64) ... 16 more

I haven't seen an error like this before - an inner class being inaccessible from the outer class. Perhaps it's a classpath issue?

matyb commented 12 years ago

sorry guys, looks like i introduced a regression, ill fix that this evening.

Bringer128 commented 12 years ago

Hey, don't worry about it. Good to see you're on top of it! On Nov 1, 2011 9:11 PM, "Mat Bentley" < reply@reply.github.com> wrote:

sorry guys, looks like i introduced a regression, ill fix that this evening.

Reply to this email directly or view it on GitHub: https://github.com/matyb/java-koans/issues/12#issuecomment-2590025

matyb commented 12 years ago

You're awfully close Bringer128, turns out - I changed the method signature of the DynamicClassLoader loadClass method when I made some changes recently. I had forgotten to delegate the actual method definition in ClassLoader to my version, so it was hitting a parent class loader looking for a class it knew nothing about.

I've got a fix ready and will have it checked in, in say - 30 minutes. If you would, please retest with the new code (just update the koans/lib/koans.jar file and optionally koans-lib/*) and let me know if it works for you.

Thanks again for bringing this to my attention! I appreciate it.

ansyeow commented 12 years ago

Hi matyb,

The new jar works for me. :)

Andrew

matyb commented 12 years ago

Thanks Andrew - I very much appreciate it! Bringer128 - let me know if that didn't work

Bringer128 commented 12 years ago

It works for me. Good work ^_^