Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Code for my Code Injection presentation on JavaZone 2011
branch: master


Code for my presentation of code injection at JavaZone 2011

Get the code, run it and look for 'THE INJECTED CODE SAYS:' in its output.

= Getting the code =
Point your browser to
and a ZIP archive download should start.

= Running the examples with Maven =
I've been using Maven 2.2.1.
	cd /path/into/the/downloaded/folder/where/pom.xml/is
1. Java Proxy:
	mvn -P javaproxy test
2. Javassist:
	mvn -P javassist test
3. AspectJ:
	mvn -P aspectj   test

= Running the examples manually =
* Get the dependencies described in pom.xml and their transitive dependencies
* Compile the sources
* Run them:
*# Java Proxy:
*##	java -classpath <the dependencies listed below:/path/to/classes> iterate.jz2011.codeinjection.javaproxy.Main
*# Javassist:
*##	java -classpath /path/to/javassist-3.14.0-GA.jar:/path/to/classes iterate.jz2011.codeinjection.javassist.JavassistInstrumenter
*##	java -classpath target/javassist:/path/to/classes iterate.jz2011.codeinjection.javassist.Main
*# AspectJ:
*## In aspectj-inject-build.xml define maven.plugin.classpath as described
*## ant -f aspectj-inject-build.xml
*##	java -classpath "/path/to/classes:/path/to/aspectjrt-1.6.10.jar" iterate.jz2011.codeinjection.aspectj.Main

Dependencies for the Java Proxy example:
 +- net.jakubholy.testing:dbunit-embeddedderby-parenttest:jar:1.2.0:compile
 |  +- org.apache.derby:derby:jar:
 |  +- org.dbunit:dbunit:jar:2.4.7:compile
 |  |  \- commons-collections:commons-collections:jar:3.2.1:compile
 |  +- junit:junit:jar:3.8.2:compile
 |  \- org.slf4j:slf4j-api:jar:1.5.6:compile
 \- org.slf4j:slf4j-simple:jar:1.5.6:runtime

= License =
The code is in the public domain and fully available for any use, i.e. no licensing issues.

= Copyleft =
Jakub Holy of Iterate AS, 2011
Something went wrong with that request. Please try again.