running aspectwerkz AOP programs

I'm trying to setup a run configuration for a program using aspectwerkz
(http://aspectwerkz.sourceforge.net), but an running into classloader
issues. Aspectwerkz needs to be started using
'org.cs3.jmangler.hook.starter.CLSubstitutor' as the main program. But
idea always starts application using
'com.intellij.rt.execution.application.AppMain'. The result is I always get:

java.lang.NoClassDefFoundError: org/cs3/jmangler/cst/Clazz
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
...

Here is the full run output:

C:\j2sdk1.4.1_01\bin\java -Daspectwerkz.home=$ASPECTWERKZ_HOME
-classpath
C:\cvs.local\aspectwerkz\lib\jmangler-core.jar;C:\j2sdk1.4.1_01\lib\tools.jar;C:\cvs.local\aspectwerkz\lib\bcel.jar;C:\j2sdk1.4.1_01\jre\lib\charsets.jar;C:\j2sdk1.4.1_01\jre\lib\jaws.jar;C:\j2sdk1.4.1_01\jre\lib\jce.jar;C:\j2sdk1.4.1_01\jre\lib\jsse.jar;C:\j2sdk1.4.1_01\jre\lib\rt.jar;C:\j2sdk1.4.1_01\jre\lib\sunrsasign.jar;C:\j2sdk1.4.1_01\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.1_01\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.1_01\jre\lib\ext\localedata.jar;C:\j2sdk1.4.1_01\jre\lib\ext\sunjce_provider.jar;C:\cvs.local\aspectwerkz\_idea;C:\cvs.local\aspectwerkz\lib\ant-1.5.2.jar;C:\cvs.local\aspectwerkz\lib\concurrent-1.3.1.jar;C:\cvs.local\aspectwerkz\lib\dom4j-1.3.jar;C:\cvs.local\aspectwerkz\lib\jrexx-1.1.1.jar;C:\cvs.local\aspectwerkz\lib\prevayler-2.00.000dev1.jar;C:\cvs.local\aspectwerkz\lib\qdox-1.1.jar;C:\cvs.local\aspectwerkz\lib\trove-0.1.8.jar;C:\cvs.local\aspectwerkz\lib\jisp-2.0.1.jar;C:\cvs.local\aspectwerkz\lib\commons-collections-2.1.jar;C:\IntelliJ-IDEA-813\lib\idea_rt.
jar;C:\IntelliJ-IDEA-813\lib\JNIWrap.jar
-Didea.launcher.port=7539 -Didea.path.bin=C:\IntelliJ-IDEA-813\bin
com.intellij.rt.execution.application.AppMain
org.cs3.jmangler.hook.starter.CLSubstitutor --jh $ASPECTWERKZ_HOME --cf
$ASPECTWERKZ_HOME/config/aspectwerkz.conf --tcp
$ASPECTWERKZ_HOME/lib/aspectwerkz-$ASPECTWERKZ_VERSION.jar:$ASPECTWERKZ_LIBS
examples.logging.Target
java.lang.NoClassDefFoundError: org/cs3/jmangler/cst/Clazz
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
Exception in thread "main" Process terminated with exit code 1


Any idea on how to get past this? Is this an idea issue even?

thanks!

8 comments

please open a tracker request.

I am also interested in Aspectwerkz and I disagree with IDEA forcing the
use of a custom launcher - it certainly provides benefits (thread dump
for instance) but we should be able to skip it if necessary.

Edo

Barry Kaplan wrote:

I'm trying to setup a run configuration for a program using aspectwerkz
(http://aspectwerkz.sourceforge.net), but an running into classloader
issues. Aspectwerkz needs to be started using
'org.cs3.jmangler.hook.starter.CLSubstitutor' as the main program. But
idea always starts application using
'com.intellij.rt.execution.application.AppMain'. The result is I always
get:

java.lang.NoClassDefFoundError: org/cs3/jmangler/cst/Clazz
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
...

Here is the full run output:

C:\j2sdk1.4.1_01\bin\java -Daspectwerkz.home=$ASPECTWERKZ_HOME
-classpath
C:\cvs.local\aspectwerkz\lib\jmangler-core.jar;C:\j2sdk1.4.1_01\lib\tools.jar;C:\cvs.local\aspectwerkz\lib\bcel.jar;C:\j2sdk1.4.1_01\jre\lib\charsets.jar;C:\j2sdk1.4.1_01\jre\lib\jaws.jar;C:\j2sdk1.4.1_01\jre\lib\jce.jar;C:\j2sdk1.4.1_01\jre\lib\jsse.jar;C:\j2sdk1.4.1_01\jre\lib\rt.jar;C:\j2sdk1.4.1_01\jre\lib\sunrsasign.jar;C:\j2sdk1.4.1_01\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.1_01\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.1_01\jre\lib\ext\localedata.jar;C:\j2sdk1.4.1_01\jre\lib\ext\sunjce_provider.jar;C:\cvs.local\aspectwerkz\_idea;C:\cvs.local\aspectwerkz\lib\ant-1.5.2.jar;C:\cvs.local\aspectwerkz\lib\concurrent-1.3.1.jar;C:\cvs.local\aspectwerkz\lib\dom4j-1.3.jar;C:\cvs.local\aspectwerkz\lib\jrexx-1.1.1.jar;C:\cvs.local\aspectwerkz\lib\prevayler-2.00.000dev1.jar;C:\cvs.local\aspectwerkz\lib\qdox-1.1.jar;C:\cvs.local\aspectwerkz\lib\trove-0.1.8.jar;C:\cvs.local\aspectwerkz\lib\jisp-2.0.1.jar;C:\cvs.local\aspectwerkz\lib\commons-collections-2.1.jar;C:\IntelliJ-IDEA-813\lib\idea_r

t.


jar;C:\IntelliJ-IDEA-813\lib\JNIWrap.jar -Didea.launcher.port=7539
-Didea.path.bin=C:\IntelliJ-IDEA-813\bin
com.intellij.rt.execution.application.AppMain
org.cs3.jmangler.hook.starter.CLSubstitutor --jh $ASPECTWERKZ_HOME --cf
$ASPECTWERKZ_HOME/config/aspectwerkz.conf --tcp
$ASPECTWERKZ_HOME/lib/aspectwerkz-$ASPECTWERKZ_VERSION.jar:$ASPECTWERKZ_LIBS
examples.logging.Target
java.lang.NoClassDefFoundError: org/cs3/jmangler/cst/Clazz
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
Exception in thread "main" Process terminated with exit code 1


Any idea on how to get past this? Is this an idea issue even?

thanks!


0

BTW,

your command line seems using unix environment variables
($ASPECTWERKZ_HOME )
on a windows system, so I'd expect some sort of faliure!!

Edo


Barry Kaplan wrote:

I'm trying to setup a run configuration for a program using aspectwerkz
(http://aspectwerkz.sourceforge.net), but an running into classloader
issues. Aspectwerkz needs to be started using
'org.cs3.jmangler.hook.starter.CLSubstitutor' as the main program. But
idea always starts application using
'com.intellij.rt.execution.application.AppMain'. The result is I always
get:

java.lang.NoClassDefFoundError: org/cs3/jmangler/cst/Clazz
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
...

Here is the full run output:

C:\j2sdk1.4.1_01\bin\java -Daspectwerkz.home=$ASPECTWERKZ_HOME
-classpath
C:\cvs.local\aspectwerkz\lib\jmangler-core.jar;C:\j2sdk1.4.1_01\lib\tools.jar;C:\cvs.local\aspectwerkz\lib\bcel.jar;C:\j2sdk1.4.1_01\jre\lib\charsets.jar;C:\j2sdk1.4.1_01\jre\lib\jaws.jar;C:\j2sdk1.4.1_01\jre\lib\jce.jar;C:\j2sdk1.4.1_01\jre\lib\jsse.jar;C:\j2sdk1.4.1_01\jre\lib\rt.jar;C:\j2sdk1.4.1_01\jre\lib\sunrsasign.jar;C:\j2sdk1.4.1_01\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.1_01\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.1_01\jre\lib\ext\localedata.jar;C:\j2sdk1.4.1_01\jre\lib\ext\sunjce_provider.jar;C:\cvs.local\aspectwerkz\_idea;C:\cvs.local\aspectwerkz\lib\ant-1.5.2.jar;C:\cvs.local\aspectwerkz\lib\concurrent-1.3.1.jar;C:\cvs.local\aspectwerkz\lib\dom4j-1.3.jar;C:\cvs.local\aspectwerkz\lib\jrexx-1.1.1.jar;C:\cvs.local\aspectwerkz\lib\prevayler-2.00.000dev1.jar;C:\cvs.local\aspectwerkz\lib\qdox-1.1.jar;C:\cvs.local\aspectwerkz\lib\trove-0.1.8.jar;C:\cvs.local\aspectwerkz\lib\jisp-2.0.1.jar;C:\cvs.local\aspectwerkz\lib\commons-collections-2.1.jar;C:\IntelliJ-IDEA-813\lib\idea_r

t.


jar;C:\IntelliJ-IDEA-813\lib\JNIWrap.jar -Didea.launcher.port=7539
-Didea.path.bin=C:\IntelliJ-IDEA-813\bin
com.intellij.rt.execution.application.AppMain
org.cs3.jmangler.hook.starter.CLSubstitutor --jh $ASPECTWERKZ_HOME --cf
$ASPECTWERKZ_HOME/config/aspectwerkz.conf --tcp
$ASPECTWERKZ_HOME/lib/aspectwerkz-$ASPECTWERKZ_VERSION.jar:$ASPECTWERKZ_LIBS
examples.logging.Target
java.lang.NoClassDefFoundError: org/cs3/jmangler/cst/Clazz
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
Exception in thread "main" Process terminated with exit code 1


Any idea on how to get past this? Is this an idea issue even?

thanks


0

Yep, indeed the problem exists.
I can suggest a workaround: just place all vm parameters (such as -Daspectwerkz.home=$ASPECTWERKZ_HOME) as well as the "-classpath"
parameter also to "Program parameters" field. This should solve your problem. Meanwhile we'll try to make our launcher more
transparent to user's code.

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


"Barry Kaplan" <bkaplan@abwg.com> wrote in message news:b88qbu$2hk$1@is.intellij.net...

I'm trying to setup a run configuration for a program using aspectwerkz
(http://aspectwerkz.sourceforge.net), but an running into classloader
issues. Aspectwerkz needs to be started using
'org.cs3.jmangler.hook.starter.CLSubstitutor' as the main program. But
idea always starts application using
'com.intellij.rt.execution.application.AppMain'. The result is I always get:

>

java.lang.NoClassDefFoundError: org/cs3/jmangler/cst/Clazz
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
...

>

Here is the full run output:

>

C:\j2sdk1.4.1_01\bin\java -Daspectwerkz.home=$ASPECTWERKZ_HOME
-classpath

>
C:\cvs.local\aspectwerkz\lib\jmangler-core.jar;C:\j2sdk1.4.1_01\lib\tools.jar;C:\cvs.local\aspectwerkz\lib\bcel.jar;C:\j2sdk1.4.1_01
\jre\lib\charsets.jar;C:\j2sdk1.4.1_01\jre\lib\jaws.jar;C:\j2sdk1.4.1_01\jre\lib\jce.jar;C:\j2sdk1.4.1_01\jre\lib\jsse.jar;C:\j2sdk1
.4.1_01\jre\lib\rt.jar;C:\j2sdk1.4.1_01\jre\lib\sunrsasign.jar;C:\j2sdk1.4.1_01\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.1_01\jre\lib\ext\l
dapsec.jar;C:\j2sdk1.4.1_01\jre\lib\ext\localedata.jar;C:\j2sdk1.4.1_01\jre\lib\ext\sunjce_provider.jar;C:\cvs.local\aspectwerkz\_id
ea;C:\cvs.local\aspectwerkz\lib\ant-1.5.2.jar;C:\cvs.local\aspectwerkz\lib\concurrent-1.3.1.jar;C:\cvs.local\aspectwerkz\lib\dom4j-1
.3.jar;C:\cvs.local\aspectwerkz\lib\jrexx-1.1.1.jar;C:\cvs.local\aspectwerkz\lib\prevayler-2.00.000dev1.jar;C:\cvs.local\aspectwerkz
\lib\qdox-1.1.jar;C:\cvs.local\aspectwerkz\lib\trove-0.1.8.jar;C:\cvs.local\aspectwerkz\lib\jisp-2.0.1.jar;C:\cvs.local\aspectwerkz\
lib\commons-collections-2.1.jar;C:\IntelliJ-IDEA-813\lib\idea_rt.

jar;C:\IntelliJ-IDEA-813\lib\JNIWrap.jar
-Didea.launcher.port=7539 -Didea.path.bin=C:\IntelliJ-IDEA-813\bin
com.intellij.rt.execution.application.AppMain
org.cs3.jmangler.hook.starter.CLSubstitutor --jh $ASPECTWERKZ_HOME --cf
$ASPECTWERKZ_HOME/config/aspectwerkz.conf --tcp
$ASPECTWERKZ_HOME/lib/aspectwerkz-$ASPECTWERKZ_VERSION.jar:$ASPECTWERKZ_LIBS
examples.logging.Target
java.lang.NoClassDefFoundError: org/cs3/jmangler/cst/Clazz
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
Exception in thread "main" Process terminated with exit code 1

>
>

Any idea on how to get past this? Is this an idea issue even?

>

thanks!

>



0


Eugene Zhuravlev wrote:

Yep, indeed the problem exists.
I can suggest a workaround: just place all vm parameters (such as -Daspectwerkz.home=$ASPECTWERKZ_HOME) as well as the "-classpath"
parameter also to "Program parameters" field.


Hmm. Here's the command line that asperwerkz.bat uses:

%JAVA_COMMAND% -cp
%ASPECTWERKZ_HOME%\lib\jmangler-core.jar;%JAVA_HOME%\lib\tools.jar;%ASPECTWERKZ_HOME%\lib\bcel.jar
org.cs3.jmangler.hook.starter.CLSubstitutor -cp %CP% --jh
%ASPECTWERKZ_HOME% --cf %ASPECTWERKZ_HOME%\config\aspectwerkz.conf --tcp
%ASPECTWERKZ_HOME%\lib\aspectwerkz-%ASPECTWERKZ_VERSION%.jar;%ASPECTWERKZ_LIBS%
-Daspectwerkz.home=%ASPECTWERKZ_HOME% %*

There are two '-cp's. And also notice that position of the main. Is
there any relevance to this related to classloaders? I've never seen
this before. If there is, I don't see how I will be able to convice idea
to create such a run command; but I'll play with it.

0


Eugene Zhuravlev wrote:

Yep, indeed the problem exists.
I can suggest a workaround: just place all vm parameters (such as -Daspectwerkz.home=$ASPECTWERKZ_HOME) as well as the "-classpath"
parameter also to "Program parameters" field.


Is there an idea variable I can use to substibute the classpath in a run
configuration (like $Classpath$ in external tools)?

0

Is there an idea variable I can use to substibute the classpath in a run
configuration (like $Classpath$ in external tools)?


No, unfortunately not.

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


0

Eugene Zhuravlev wrote:
>>Is there an idea variable I can use to substibute the classpath in a run
>>configuration (like $Classpath$ in external tools)?


No, unfortunately not.

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


I've opened a SCR
http://www.intellij.net/tracker/idea/viewSCR?publicId=11780
please continue discussion using tracker.

Edo

0

Hi Barry!

Did you successfully set up a run configuration for aspectwerkz?
I am especially interested in a way to test a aspectwerkz app with
idea's junit runner.

tia
chris

0

Please sign in to leave a comment.