Archive for May, 2011
How to enable JMX in WebLogic?
Case
You have to enable JMX in an application deployed within WebLogic, so that to access MBeans from Java Visual VM for instance
Solution
On launching WebLogic server instance, add the following properties:
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8888 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
How to include a dependency to tools.jar in Maven?
Case
You need include tools.jar
as a dependency in a pom.xml, for instance in order to use Java 5’s annotations and APT. From a “Maven’s view point”, tools.jar
is not a regular JAR defined by a groupId
and artefactId
.
Solution
Add this block in your pom.xml
:
<dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.6.0_24</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency>
(You can also add it in your settings.xml
)
You can do the same for any other “non-regular” JAR, available in your file system.