Changes for page WO 5.4 Getting Started

Last modified by D Tim Cummings on 2013/06/14 16:27

From version 55.1
edited by Pascal Robert
on 2007/11/29 13:44
Change comment: There is no comment for this version
To version 38.1
edited by David Avendasora
on 2011/05/06 13:50
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.probert
1 +XWiki.avendasora
Content
... ... @@ -1,39 +1,160 @@
1 -= Running the examples =
1 +{{toc maxLevel="1"}}{{/toc}}
2 2  
3 -Apple has converted their WebObjects examples in the Eclipse format, but no documentation is provided on how to import them into Eclipse.  The examples are in ///Developer/Examples/JavaWebObjects//.
3 += Installing WebObjects and WOLips =
4 4  
5 -The first step is: install Eclipse and WOLips :-) 
5 +1. h6. Download Golipse
6 +[[Golipse>>https://github.com/rebeld/Golipse]] will fetch the needed version of Eclipse, WOLips and other tools for WebObjects development.
7 +1. h6. Install the WebObjects
8 +The best way to install the WebObjects frameworks is according to [[these instructions>>WOL:Using WOLips With Multiple Versions of WebObjects]].
9 +1. h6. Start Eclipse and switch to the WOLips perspective.
10 +1*. Under the //Window// menu, select //Open Perspective > Other...//.
11 +[[image:PerpectiveMenu.png]]
12 +1*. h6. Select //WOLips// and click //Ok//.
13 +[[image:PerspectiveChoices.png]]
6 6  
7 -Some examples needs Derby, an embedded Java database (OpenBase is not included with WO anymore). To install the databases, you have to do:
15 +{{note title="WOLips Perspective"}}
16 +If you don't switch to the WOLips perspective, you won't be able to create new WebObjects projects.
17 +{{/note}}
8 8  
19 +{{info title="Xcode & WebObjects"}}
20 +
21 +Xcode is no longer the supported IDE for WebObjects development or deployment. However, downloading it and installing it will install tools debugging tools that you might find useful.
22 +* Apple Developer Site (Free): [http://developer.apple.com/xcode/]
23 +* Mac OS X App Store ($4.99): [http://itunes.apple.com/us/app/xcode/id422352214]
24 +
25 +{{/info}}
26 +
27 +{{id value="javamonitor"}}{{/id}}
28 +
29 += Running Monitor and wotaskd on Mac OS X =
30 +
31 +Monitor and wotaskd are installed, but the launchd scripts to start them are not installed. You can grab them from a 10.5 Server installation, or follow those instructions.
32 +
33 +Make sure //Web Sharing// is enabled in the //Sharing// panel in //System Preferences// (note: 10.5 comes with Apache 2.2 as the default).
34 +
35 +Edit ///etc/apache2/httpd.conf// (if you did a fresh install, you may already have these - search httpd.conf first)
36 +
37 +Search for rewrite//module, and above it, add this line~://
38 +
9 9  {{code}}
10 10  
11 -cd /Developer/Examples/JavaWebObjects/
12 -sudo sh installDatabases.sh <yourusername>
41 +LoadModule WebObjects_module /System/Library/WebObjects/Adaptors/Apache2.2/mod_WebObjects.so
13 13  
14 14  {{/code}}
15 15  
16 -Now, you can import the examples into Eclipse. Start Eclipse, select //File// > //Import//,
17 -&nbsp; [[image:ImportMenu.png]]
18 -&nbsp;
19 -and select //General// > //Existing Projects// into Workplace.
45 +Go to the very end and add:
20 20  
21 -[[image:ImportGeneral.png]]
22 -&nbsp;
23 -On the next page, select //Select root directory// and browse your disk to ///Developer/Examples/JavaWebObjects//. You should see a list of projects to import.&nbsp; Deselect the second //javaeoutil// project, or else you won't be able to import the projects. [[image:ImportProjectsList.png]]
47 +{{code}}
24 24  
25 -After the importation is done, you should see the projects in the WO Package Explorer. If you see the projects in Package Explorer (without "WO" in the name), that means that you are using the Java perpective instead of the WOLips perpective.&nbsp; Switch the perpective to WOLips. [[image:PackageExplorer.png]]
26 -&nbsp;
27 -Now, you need to fix the examples, because the build path is pointing to the source projects of the WO frameworks, source that nobody outside Apple has access to :-)For each project, right-click on each project, select //Build Path// > //Configure Build Path...// [[image:BuildPathMenu.png]]
28 -&nbsp;
29 -Click on the //Projects// tab, select the references to the WO frameworks that have the Warning icon and click //Remove//. [[image:ConfigureBuildPath.png]]
30 -Click on the //Libraries// tab, click the //Add Library// button.&nbsp; Select //WebObjects Frameworks// and click //Next//. [[image:AddLibrary.png]]
31 -&nbsp;
32 -Click //System//, open the triangle next to //System// and make sure that //JavaEOAccess//, //JavaEOControl//, //JavaFoundation//, //JavaWebObjects//, //JavaWOExtensions// and //JavaXML// are selected. For //SchoolToolsClient//, you also need to add //JavaWebServicesSupport// and //JavaWebServicesClient// to the build path. For the //SchoolToolsServer//, you need to add //JavaWebServicesSupport//.
49 +Include /System/Library/WebObjects/Adaptors/Apache2.2/apache.conf
33 33  
34 -After you corrected the build path on a project, the project will rebuild itself and the errors shoud dissapear.
51 +{{/code}}
35 35  
36 -//JavaBusinessLogic// and //RelatedLinks// requires Apache Derby, but the path to Derby's JAR is wrong. Remove the JAR from the build path, click //Add External JARs...//, browse your disk up to ///Developer/Examples/JavaWebObjects/Databases/db-derby-10.2.2.0-bin/lib// and select //derby.jar//.&nbsp; The build path should look like this:
37 -[[image:GoodDerbyPath.png]]
38 -&nbsp;
39 -VoilĂ &nbsp; You finally can run the examples.&nbsp;
53 +Search for "Directory /" and comment out the Order and Deny lines:
54 +
55 +{{code}}
56 +
57 +<Directory />
58 + Options FollowSymLinks
59 + AllowOverride None
60 + #Order deny,allow
61 + #Deny from all
62 +</Directory>
63 +
64 +{{/code}}
65 +
66 +Restart apache
67 +
68 +{{code}}
69 +
70 +sudo apachectl graceful
71 +
72 +{{/code}}
73 +
74 +If you run //ps auxw grep httpd// you should see apache now running
75 +
76 +Create ///Library/LaunchDaemons/com.apple.webobjects.wotaskd.plist// with:
77 +(for OSX 10.5 make sure the permissions of this file are 644 system/wheel/everyone otherwise launchctl will throw a "dubious permissions" error when you try to load the plist with the commands that follow)
78 +
79 +{{code}}
80 +
81 +<?xml version="1.0" encoding="UTF-8"?>
82 +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
83 +<plist version="1.0">
84 +<dict>
85 + <key>Disabled</key>
86 + <false/>
87 + <key>GroupName</key>
88 + <string>appserverusr</string>
89 + <key>Label</key>
90 + <string>com.apple.webobjects.wotaskd</string>
91 + <key>OnDemand</key>
92 + <false/>
93 + <key>Program</key>
94 + <string>/System/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd</string>
95 + <key>ProgramArguments</key>
96 + <array>
97 + <string>wotaskd</string>
98 + <string>-WOPort</string>
99 + <string>1085</string>
100 + </array>
101 + <key>ServiceIPC</key>
102 + <false/>
103 + <key>UserName</key>
104 + <string>appserver</string>
105 +</dict>
106 +</plist>
107 +
108 +{{/code}}
109 +
110 +Create ///Library/LaunchDaemons/com.apple.webobjects.womonitor.plist// with:
111 +(for OSX 10.5 make sure the permissions of this file are 644 system/wheel/everyone otherwise launchctl will throw a "dubious permissions" error when you try to load the plist with the commands that follow)
112 +
113 +{{code}}
114 +
115 +<?xml version="1.0" encoding="UTF-8"?>
116 +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
117 +<plist version="1.0">
118 +<dict>
119 + <key>Disabled</key>
120 + <false/>
121 + <key>GroupName</key>
122 + <string>appserverusr</string>
123 + <key>Label</key>
124 + <string>com.apple.webobjects.womonitor</string>
125 + <key>OnDemand</key>
126 + <false/>
127 + <key>Program</key>
128 + <string>/System/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor</string>
129 + <key>ProgramArguments</key>
130 + <array>
131 + <string>JavaMonitor</string>
132 + <string>-WOPort</string>
133 + <string>56789</string>
134 + </array>
135 + <key>ServiceIPC</key>
136 + <false/>
137 + <key>UserName</key>
138 + <string>appserver</string>
139 +</dict>
140 +</plist>
141 +
142 +{{/code}}
143 +
144 +Start the launchd daemons :
145 +(you may need to sudo here)
146 +
147 +{{code}}
148 +
149 +launchctl load /Library/LaunchDaemons/com.apple.webobjects.wotaskd.plist
150 +launchctl load /Library/LaunchDaemons/com.apple.webobjects.womonitor.plist
151 +
152 +{{/code}}
153 +
154 +If you run "ps auxw grep java" you should see wotaskd and java monitor now running. You should be able to connect to Monitor by this URL:
155 +
156 +{{code}}
157 +
158 +http://localhost:56789
159 +
160 +{{/code}}