WebObjects 5.2.3 Development Setup from Scratch on 10.3.7
Just replaced my 2 year old Powerbook with a new
one, alas I downgraded to 15" screen due to cost, but I really wanted the jump
from 1GHz to the 1.67GHz in the new models, plus my ADC hardware discount was
about to expire. I really like the new "Welcome" wizard for new OS X Panther
10.3.5+ installations where it allows you to copy all you files, settings, etc
from your old machine. This saves a lot of setup time. However, it DOES NOT copy
over much of my development setup so I had to go through that again and decided
to document the steps here so I don't have to think about it next
time.
Pre-installed configuration was 10.3.7. After
initial setup I ran Software Update and did NOT install 10.3.8, but of relevance
was Java 1.4.2 Update 2 which I DID
install.First, MySQL. Just download
standard binary (I choose 4.0.23 .... not yet ready to jump to 4.1), expand the
.dmg, install it and install the startup
item.Then using terminal go into the
/usr/local/mysql and rename the newly installed data folder using
'mv'.Then plug in your old machine using
firewire target mode and just copy your old data folder and do a chown -R
mysql:wheel on the copied data folder to set the correct ownerships.
While the old machine is plugged in, copy
over your old /private/etc/profile (bash terminal profile ... if you have your
classpaths setup there) AND your /private/etc/my.cnf MySQL configuration
file.Then reboot and mysql should come
up with all your old machine's settings, passwords and
databases.Your current jdbc driver in
/Library/Java/Extensions will get copied over by initial setup, however you may
want to take the opportunity to upgrade to a newer version. I went to
3.0.16.Next XCode and WebObjects.
Using apple tech note
107873 as a guide I installed my WO dev setup in the following
sequence:
Xcode 1.5 Developer tools
WebObjects 5.2 Developer
At this point, you have the basic installation
done. The rest of this stuff is ONLY necessary to get the code sense (automatic
code completion) and context sensitive documentation searches working. If you
are not interested in code sense, etc., then you can stop now and get
programming!
You can test your WO installation now by creating
an initial WebObjects application and just Build & Run to see if everything
compiles, build and runs.
Next, install Java 1.4.2 Update 1 Developer Tools
available from connect.apple.com website in the
Java downloads section.
This step seems to be not required
anymore[ Unjar Java
Docs Run this script form the command
line /Developer/Documentation/Java/scripts/unjarJavaDocumentation.sh
]Prepare Java Classes for
Code Sense (If you copied from your old Mac, you may already have this in
place)The objective is to put the
XXX.pbxindex for the appropriate "pre-cooked" project index in this
folder~/Library/Application
Support/Apple/Developer Tools/Index
TemplatesThe WebObjects HTML App index
template is named JavaWebObjectsAppIndex.pbxindex and contains the files shown
here:
With
XCode, open the
file:/Developer/Extras/Xcode\ Index\
Templates/JavaWebObjectsAppIndexNext
select Window/Activity Viewer menu. You will see indexing
progress.Check that all the jar files
in the project are NOT red font. If red, it means Xcode cannot find them. In
that case, Get Info on the file and use Choose to find it and correct the
absolute path.Leave the
JavaWebObjectsAppIndex project open until Activity Viewer indicates that
indexing is complete. When complete
close it and copy the folder JavaWebObjectsAppIndex.pbxindex inside in
./build/JavaWebObjectsAppIndex.build/
to~/Library/Application
Support/Apple/Developer Tools/Index
TemplatesRepeat this process for any
other Index Templates that you want code sense functionality
for.Finally, ENABLE codesense by
setting this user-specific default from the command
line% defaults write
com.apple.Xcode PBXCodeSenseEnableIndexTemplates
YESFix the WO documentation
support as per XCode 1.5 release
notesOpen XCode and READ the RELEASE
NOTES, especially the WebObjects related notes at the
bottom!Follow the instructions for
fixing WebObjects Help Documentation as shown in the release notes and expanded
here:
1) Create a soft
link to the WebObjects documentation in the ADC Reference Library. To do so, run
the command:
% sudo ln -s
"/Developer/Documentation/WebObjects" "/Developer/ADC Reference Library"
2) Open
/Developer/ADC Reference
Library/documentation/Help/Developer Help
Viewer/MacOSXDeveloper.pbHelpIndexerList and
add this line to the XML:
/Developer/Documentation/WebObjects
# This can be done by opening the file with
pico
% cd /Developer/ADC\ Reference\
Library/documentation/Help/Developer\ Help\ Viewer/
% sudo pico
MacOSXDeveloper.pbHelpIndexerList
# Then add the value as a string member (highlighted
below) of the XML array so that the contents of the file look like
this:
3) Re-index the documentation. To do so, run the
command:
sudo /Developer/Tools/pbhelpindexer -o
"/Developer/ADC Reference Library/documentation/Help/Developer Help
Viewer/"
This may take a a couple of minutes!
4) Restart Xcode.
Turn On CodeSense
Open XCode Preferences
Click on Navigation pane and set up desired options,
for
example:
Finally
Use CodeSense1) Start typing a
variable
name
2)
Entering a period shows all
fields/methods
3)
Typing letters filters the list (use up/down arrows and/or tab to
choose)
Troubleshooting:So
you find that CodeSense is not finding your newly created methods? ... usually
caused by syntax mistakes and an index that is not up to date. Just save your
files and Build, fixing any errors and reBuilding until you have no more java
errors. Code Sense should now find all
methods.Final
TasksYou may need to reconfigure your
apache httpd.conf file (use FileMerge to check differences and merge). Also if
you had SSL set up you may need to copy over your ssl key files and reconfigure
that.
Posted: Thursday - March 10, 2005 at 10:46 PM