Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] robocode and AspectJ

I built a demo of aspectj working with robocode that was used at an IBM keynote for JavaOne last year.  (Aspects were used to add sound effects, and to implement additional capabilites for our robot, making it incrementally more successful in battle). The code for that I left behind when I left IBM, but I do remember that I had to do some classloading hackery to get around the issues you are encountering - I think I changed their classloader in the end, but your solution will clearly work too.

Regards, Adrian.

On 04/07/06, Oliver Böhm <boehm@xxxxxxxxxx> wrote:
Hi,

thanks for the hint. I tried a lot of things to get the missing classes
loaded. At last I unpack the aspectjrt.jar into the classes directory of
my robots. Not nice but it seems to work.

regards
Oliver


Wes Isberg wrote:
> Hi -
>
> I looked at this briefly.  It looks like you have to put
> all classes in the robot jar, including any library classes
> like aspectjrt.jar.  (It doesn't have anything to do with
> aspects per se, just external libraries.)
>
> robocode.security.RobocodeClassLoader is responsible for
> loading robots, and does not delegate upwards (in violation
> of Java's classloader rules).  Further, it limits robot
> classpaths to a single entry.
>
> As a result, one has to include all the classes required by
> any robot in the robot jar.  It is not enough to refer to
> them in the jar manifest or to include them on the robot
> classpath or the system class path when loading
> robocode.Robocode.
>
> I didn't find this answer in the robocode faq or wiki or
> api, but you can find RobocodeClassLoader.java in CVS if
> you want.
>
> Wes
>
>
> On Sun, 02 Jul 2006 23:03:24 +0200
>  Oliver Böhm <boehm@xxxxxxxxxx> wrote:
>> Hi,
>>
>> I want to use robocode ( http://robocode.sourceforge.net/)
>> for some
>> examples with AspectJ in my lecture. When I build a robot
>> with some
>> aspects I got some errors from robocode that some classes
>> from
>> apsectjrt.jar are missing. Unfortunately robocode seems
>> to use its own
>> classloader to load my robot - I guess this is the reason
>> for the
>> ClassNotFoundException.
>>
>> Question: has anybody used robocode together with
>> AspectJ?
>>
>> kind regards
>> Oliver
>> --
>> Oliver Böhm
>> http://www.javatux.de
>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


--
Oliver Böhm
http://www.javatux.de

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



--
-- Adrian
adrian.colyer@xxxxxxxxx

Back to the top