TopLink Wiki

Main
About
Javadoc
Forum
Resources

RecentChanges
About Wiki
Find Pages
Page Index

Set your name in
UserPreferences

Edit this page


Referenced by
DebugTopLink
DecompileTopLink
TopLinkSourceCode




JSPWiki v2.0.52


RecompileTopLinkFromSource


1. Expand the TopLinkSourceCode to a temporary directory, say source for example.

2. Recompile with full debugging info. The classpath should list the TopLinkJars, to include classes that you don't have the source for. The TopLink source has dependencies on multiple application servers and J2EE technologies, eg. JDO. You will have to either find these libraries, or exclude the offending classes from compilation.

A quick Ant script makes this step a lot easier. Notice how the JDO and Corba stuff is excluded.

<?xml version="1.0"?>

<project name="TopLink" default="compile">

	<path id="toplink.classpath">
		<fileset dir="xxx">
			<include name="toplink.jar" />
			<include name="xerces.jar" />
			<include name="antlr.jar" />
		</fileset>
		<fileset dir="yyy">
			<include name="classes12.zip" /> <!-- Oracle -->
			<include name="weblogic.jar" /> <!-- WebLogic -->
		</fileset>
	</path>

	<target name="compile">
		<mkdir dir="classes" />
		<javac debug="on" 
			srcdir="source"	destdir="classes" 
			classpathref="toplink.classpath">
			<exclude name="**/jdo/**" />
			<exclude name="**/jts/**" />
			<exclude name="**/remote/corba/**" />
		</javac>
	</target>

</project>

3. Make a backup copy of the TopLinkJar before we mess with it.

4. Update the TopLinkJar with the recompiled classes. By updating the JAR we preserve resource files and classes that we didn't recompile.

$ cd classes
$ jar uvf ../toplink.jar .

You now have in hand the source code, and a JAR with full debugging info. This JAR can now be used for debugging TopLink, stepping into method calls, inspecting variables, etc.

Caveat Emptor

This procedure is not endorsed by OracleCorp and may in fact violate your license agreement. The author(s) of this site do not accept any responsibility for consequences due to following these instructions.


Edit this page   More info...   Attach file...
This page last changed on 04-Apr-2005 13:45:48 PDT by 64.168.145.189.