For some of our modules (as well as some patch-release fixes) rely on Spring Instrument to transform the byte code of certain classes at runtime. Specifically, this allows us to modify existing Broadleaf Hibernate entities to add more fields and relationships without hindering custom extensions. For instance, the multi-tenant module adds a
catalog_id column to the
The demo site referenced from Getting Started has Spring instrument hooked up on the
jetty-demo ant task. When you deploy Broadleaf to an external system you will need to have the Spring instrument jar included in your deployment. This is referenced as a -javaagent flag to the JVM. How this flag is passed depends on the startup arguments of your application server.
setenv.sh, include the following:
export CATALINA_OPTS="-Xmx1024m -javaagent:/full/path/to/spring-instrument.jar"
For all other application servers, consult the server documentation for how to pass custom JVM arguments to the instance.
Note: the recommended version for Spring instrument might change as the version of Spring that Broadleaf targets changes
There have been known issues with instrumentation when the Spring Instrument JAR is located either in the Tomcat lib directory or inside of the WAR of the application.
It is strongly recommended to keep the spring-instrument JAR in a separate directory from Tomcat.