Changes for page Debugging WOLips

Last modified by Pascal Robert on 2012/02/11 05:22

From version 103.1
edited by mark_ritchie
on 2009/09/08 18:37
Change comment: There is no comment for this version
To version 106.1
edited by Pascal Robert
on 2012/02/11 05:22
Change comment: Migrated to Confluence 5.3

Summary

Details

Page properties
Parent
... ... @@ -1,0 +1,1 @@
1 +Building WOLips
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.mark_ritchie
1 +XWiki.probert
Tags
... ... @@ -1,0 +1,1 @@
1 +wikitodo
Content
... ... @@ -1,65 +7,194 @@
1 -{{note title="Under Construction"}}
2 -
3 -This page is currently under construction by Mark Ritchie!
4 -
5 -{{/note}}
6 -
7 7  = Debugging WOLips as the master does! =
8 8  
9 -These instructions is intended for the developer who wants to compile and run WOLips source for the purpose of debugging or other exploration. Thanks very much to Mike Schrag for the guidance to get this setup and working!
3 +These instructions is intended for the developer who wants to compile and run WOLips source for the purpose of debugging or other exploration. Thanks very much to Mike Schrag for the guidance to get this setup and working!
10 10  
11 11  == Overview of what's going on ==
12 12  
13 -We're going to check out the latest source for WOLips, build it and arrange for Eclipse to launch is a debug mode to test it out. It's very handy that Eclipse has a built in ability to launch itself in debug mode and load the local versions of the plugins. If you read the old and out dated instructions floating about that talk about building an entire release and installing them into a new copy of Eclipse then you're going to like this method a whole lot better! ;-)
7 +We're going to check out the latest source for WOLips, build it and arrange for Eclipse to launch is a debug mode to test it out. It's very handy that Eclipse has a built in ability to launch itself in debug mode and load the local versions of the plugins. If you read the old and out dated instructions floating about that talk about building an entire release and installing them into a new copy of Eclipse then you're going to like this method a whole lot better!
14 14  
15 15  == The setup ==
16 16  
17 17  When I did this and wrote these notes, I was using:
18 18  
13 +(% class="alternate" %)
19 19  * Mac OS X 10.5.7
20 -* Java 1.5.0//19//
15 +* Java 1.5.0_19
21 21  * Eclipse 3.4.2 (eclipse-SDK-3.4.2-macosx-carbon.tar.gz)
22 22  
18 +{{panel bgColor="#FFFFCE" title="Snow Leopard Update"}}
19 +I gave this a go on Snow Leopard and it worked ok however there were a few problems which I've detailed near the end of this document.
20 + Here's the setup I was using:
21 +
22 +(% class="alternate" %)
23 +* Mac OS X 10.6.2
24 +* WebObjects 5.4.3
25 +* Java 1.6.0_15
26 +* Eclipse 3.4.2 Build id: M20090211-1700 (eclipse-SDK-3.4.2-macosx-carbon.tar.gz)
27 +* woproject svn repository version 6031
28 +* Wonder svn repository version 10655
29 + YMMV!
30 +{{/panel}}
31 +
23 23  == Checking out the source code ==
24 24  
25 -**A note for the impatient - don't try to checkout the source right into Eclipse. The files aren't structured in a way that allows this to work. I know because I tried to do it that way first!** ;-)
34 +**A note for the impatient - don't try to checkout the source right into Eclipse. The files aren't structured in a way that allows this to work. I know because I tried to do it that way first!**
26 26  
27 27  === Check out the source code into a local folder ===
28 28  
29 -You're checking out a local copy of the code from the source repository. Next, we're going to selectively import (but **not** copy) parts of that code into Eclipse. I'm using command line subversion to check out the lastest version however feel free to use a different tool or different version, as you like.
38 +You're checking out a local copy of the code from the source repository. Next, we're going to selectively import (but **not** copy) parts of that code into Eclipse. I'm using command line subversion to check out the lastest version however feel free to use a different tool or different version, as you like.
30 30  
31 -svn co https:~/~/svn.objectstyle.org/repos/woproject/trunk/woproject ,,/woproject,,
40 +git clone [[git:~~/~~/github.com/wolips/wolips.git>>url:git://github.com/wolips/wolips.git||shape="rect"]] ~~/woproject
32 32  
33 -Note that I've checked out the source code into my home folder. It doesn't matter where you put the source code as long as you can find it in the steps below.
42 +Note that I've checked out the source code into my home folder. It doesn't matter where you put the source code as long as you can find it in the steps below.
34 34  
35 35  === Create a new eclipse workspace ===
36 36  
37 -Launch a clean copy of Eclipse with no plugings installed. Strictly speaking, probably not necessary however these are the steps which I took.
46 +Launch a clean copy of Eclipse with no plugings installed. Strictly speaking, probably not necessary however these are the steps which I took.
38 38  
39 39  Create a new Workspace
40 -I chose ,,/WOLipsDebugging
41 -[[image:Workspace.png]],,
49 + I chose ~~/WOLipsDebugging
50 +[[image:attach:Workspace.png]]
42 42  
43 43  === Import woenvironment ===
44 44  
45 -Start off by importing the woenvironment project. From the File menu, select Import
46 -[[image:ImportMenu.png]]
54 +Start off by importing the woenvironment project. From the File menu, select Import
55 + [[image:attach:ImportMenu.png]]
56 +Click the disclosure triangle for General and select Existing Projects into Workspace
57 + [[image:attach:ExistingProject.png]]
58 +Click Next button.
59 + Ensure that "Select root directory" is selected and click Browse
60 + Browse to the folder where you checked out the woproject source code above and select woenvironment.
61 + [[image:attach:woenvironmentCheckout.png]]
62 +Eclipse should scan the folder and notice one project in the folder called woenvironment.
63 + **It's important that you don't have 'Copy the project into your workspace' selected.**
64 + [[image:attach:woenvironmentProject.png]]
65 +Click Finish.
47 47  
67 +Once Eclipse has finished building the project, there should be no errors! If that's not the case, then you need to back up and make sure that you've followed all the steps above.
68 +
48 48  === Import wolips projects into your workspace ===
49 49  
71 +Repeat the steps above and import all the wolips projects except for 3!
72 + *EntityModler, eomodeldoc and org.objectstyle.wolips.eomodeler.factories
73 + are special projects which require special setup and caffination before touching.*
74 +
75 +The import of wolips should look like this:
76 +[[image:attach:wolipsImport.png]]
77 +
78 +And Eclipse should identify a whole bunch of projects.
79 + **Make sure that you deselect the 3 special cases noted above**
80 + The list of projects should look something like this:
81 +[[image:attach:wolipsProjects.png]]
82 +
83 +Click Finish and the projects should all be imported.
84 +
85 +{{note}}
86 +When I did this I got the following error message.
87 + I have no idea what this means...
88 +[[image:attach:ResourceErrorMessage.png]]
89 +{{/note}}
90 +
91 +Once Eclipse finishes building the projects there are going to be a whole bunch of build errors. Don't Panic. Most of them will resolve themselves after the next steps.
92 +
50 50  === Import wolips plugins ===
51 51  
95 +In the same way as above, import the core plugins from wolips/core/plugins. Something like this:
96 +[[image:attach:corePluginImport.png]]
97 +[[image:attach:corePluginProjects.png]]
98 +
52 52  === Import 3rd party plugins ===
53 53  
101 +Finally, import the third party plugins from wolips/3rdparty/plugin. Something like this:
102 +[[image:attach:thridPartyImport.png]]
103 +[[image:attach:thirdPartyProjects.png]]
104 +
54 54  === Close special projects ===
55 55  
107 +In case you missed the notices above, close these projects.
108 +
109 +(% class="alternate" %)
56 56  * EntityModeler
57 57  * eomodeldoc
58 58  * org.objectstyle.wolips.eomodeler.factories
113 + (Note: Working on these projects is beyond the scope of what I needed to do. Sorry.)
59 59  
60 60  === Close projects which require additional resources to compile ===
61 61  
117 +These projects require additional resources to compile. As I didn't need them, I just closed them.
118 +
119 +(% class="alternate" %)
62 62  * org.objectstyle.wolips.groovy.ui
63 63  * org.objectstyle.wolips.jprofiler.launching
122 +* org.objectstyle.wolips.jrebel
123 +* org.objectstyle.wolips.mechanic
64 64  
65 -== The run configuration setup ==
125 +=== Error message: Libraries not found for JavaEOAccess and other WebObjects libraries ===
126 +
127 +A couple projects have been committed to the repository with references to WebObjects libraries in /Library/WebObjects/lib. You'll need to update these to the correct location on your machine. If you've done nothing special to your WebObjects environment then this should be something like: /System/Library/Frameworks
128 + If you've done something else then you'll need to change the library locations (or perhaps update your WOLips properties file.)
129 +
130 +=== Error message: Cannot find artifact for parent POM... ===
131 +
132 +When building woenvironment, you might hit this error:
133 + Cannot find artifact for parent POM: org.objectstyle.woproject:woproject-all-parent::2.1 for project org.objectstyle.woproject.ant:woenvironment:jar:2.1-SNAPSHOT at /Users/...
134 +
135 +The simple solution is delete the pom.xml file. Full details are here: [[http:~~/~~/wiki.objectstyle.org/confluence/display/WOL/mail/6259075>>url:http://wiki.objectstyle.org/confluence/display/WOL/mail/6259075||shape="rect"]]
136 +
137 +== The configuration setup ==
138 +
139 +At this point, you should have a long list of packages which should all be compiling.
140 + If that's not the case, please document additional steps here, making special note of your setup.
141 +
142 +Getting on with the configuration to be able to test the software which is now compiling.
143 + From the Run menu, select "Debug Configurations ..."
144 +[[image:attach:debugConfiguration.png]]
145 +
146 +Select "Eclipse Application" from the list on the left
147 + and then click the "New" button at the top.
148 + [[image:attach:newLaunchConfiguration.png]]
149 +This creates a new launch configuration which you can customize as you like.
150 + By default it's called 'New_configuration'. For this session, I named it DebugEclipse
151 +
152 +My preference is to explicitly set the workspace for testing however I'm sure the default will be fine if you like it.
153 + I chose: ${workspace_loc}/../WOLipsDebuggingWorkspace
154 + My setup looked something like below however there are lots of configuration options which I didn't need to explore:
155 +[[image:attach:debugConfigured.png]]
156 +
157 +== Launch the debug version ==
158 +
159 +Click the Debug button in the debug configuration window to launch the test version.
160 + This will be a clean version of Eclipse with the workspace which you set and any other settings.
161 + By default, all of the plugins are loaded and ready for testing!
162 + And now, you should be running inside the debug version of Eclipse with all the wolips bits to play with!
163 +
164 +== Snow Leopard Update ==
165 +
166 +I was running the carbon version of Eclipse 3.4.2 Build id: M20090211-1700 on Snow Leopard 10.6.2
167 + Up to this point, I was following the instructions above however when I tried to launch Eclipse, I got this error:
168 +
169 +{{code 0="java"}}
170 +
171 +java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
172 + at org.eclipse.swt.internal.Library.loadLibrary(Library.java:177)
173 + at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
174 + ...
175 +
176 +{{/code}}
177 +
178 +This is a known problem and is documented here: [[http:~~/~~/www.eclipse.org/swt/faq.php#cocoa32launch>>url:http://www.eclipse.org/swt/faq.php#cocoa32launch||shape="rect"]]
179 + The fix is to add the -d32 parameter to the launch arguments.
180 +
181 +Original: -os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}
182 + Updated: -os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -d32
183 +
184 +A second problem which I encountered was running out of memory while running test version of Eclipse!
185 + I had to add the VM argument "-Xmx2G" and then 'Run' as opposed to 'Debug' the app. For the most part, that worked.
186 +
187 +My final setup looked like this:
188 +[[image:attach:32Bit_jvm_2GB_mem.png]]
189 +
190 +== There was more than one SQL reverse engineer factory defined. ==
191 +
192 +[[image:attach:MoreThenOneReverseEngineeringFactory.png]]
193 +This exception occurs when you've forgotten to close the org.objectstyle.wolips.eomodeler.factories project.
194 + The fix is to close the project. Thanks to Mike Schrag for putting me on the right path when I was at my wits end with this damn problem.
32Bit_jvm_2GB_mem.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +131.6 KB
Content
32Bit_jvm_arguments.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +129.7 KB
Content
ExistingProject.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +78.2 KB
Content
ImportMenu.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +63.4 KB
Content
MoreThenOneReverseEngineeringFactory.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +31.1 KB
Content
ResourceErrorMessage.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +33.3 KB
Content
Workspace.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +56.7 KB
Content
corePluginImport.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +161.7 KB
Content
corePluginProjects.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +183.1 KB
Content
debugConfiguration.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +37.5 KB
Content
debugConfigured.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +179.3 KB
Content
newLaunchConfiguration.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +48.2 KB
Content
thirdPartyProjects.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +104.9 KB
Content
thridPartyImport.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +138.3 KB
Content
woenvironmentCheckout.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +114.4 KB
Content
woenvironmentProject.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +88.8 KB
Content
wolipsImport.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +112.8 KB
Content
wolipsProjects.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.XWikiGuest
Size
... ... @@ -1,0 +1,1 @@
1 +249.1 KB
Content
XWiki.XWikiComments[0]
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.probert
Comment
... ... @@ -1,0 +1,1 @@
1 +Some steps are not working for WOLips 3.7. We have to update this page.
Date
... ... @@ -1,0 +1,1 @@
1 +2012-02-11 05:20:04.462