Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] lauching applications from another one with load-time weaving

Hello,

   I've just got this working ... I decided to post here this solution
just in case anyone needs ...

try {
URL urlList[] = {
	new File("/home/ffs/workspace/TesteAspects").toURL(),
	new File("/home/ffs/workspace/TesteAspects/aspects.jar")
		.toURL() };

ClassLoader loader = new URLClassLoader(urlList);
		
Test2 t = new Test2();
Class cls1 = Class.forName("Test1", true, loader );
String s[] = new String[] {};
Object arguments[] = new Object[] { s };
Method mainMethod = cls1.getMethod("main", new Class[] { s
	.getClass() });
Object result = mainMethod.invoke(null, arguments);

System.out.println(cls1.getClassLoader());
System.out.println(t.getClass().getClassLoader());
} catch...


Regards,
Fabio


Back to the top