Changes for page WO 5.4 Getting Started

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

From version 52.1
edited by Pascal Robert
on 2007/11/27 22:25
Change comment: There is no comment for this version
To version 33.1
edited by Pascal Robert
on 2011/03/20 03:06
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,34 +1,156 @@
1 -Apple has converted their WebObjects examples in the Eclipse format, but no documentation is provided on how to import them into Eclipse.
1 +{{toc}}{{/toc}}
2 2  
3 -The examples are in /Developer/Examples/JavaWebObjects
3 += Installing WebObjects and WOLips =
4 4  
5 -Some examples needs Apache Derby, an embedded Java database (OpenBase is not included with WO anymore). To install the databases, you have to do:
5 +Download Xcode from ADC. Not useful for WebObjects deployment, but it will install tools like gcc and debugging tools that you might want useful.
6 6  
7 +Install [[Golipse>>https://github.com/rebeld/Golipse]]. Golipse will fetch the needed version of Eclipse, WOLips and other tools for WebObjects development.
8 +
9 +Install the WebObjects frameworks according to [[those instructions>>WOL:Using WOLips With Multiple Versions of WebObjects]].
10 +
11 +Start Eclipse and switch to the WOLips perspective. To achieve this, open the //Window// menu, select //Open Perspective// and select //Other...//.
12 +
13 +[[image:PerpectiveMenu.png]]
14 +
15 +In the perspective choices, select //WOLips// and click //Ok//.
16 +
17 +[[image:PerspectiveChoices.png]]
18 +
19 +If you don't switch to the WOLips perspective, you won't be able to create new WebObjects projects.
20 +
21 +You are now ready to create projects or importing the examples. 
22 +
23 +{{id value="javamonitor"}}{{/id}}
24 +
25 += Running Monitor and wotaskd on Mac OS X =
26 +
27 +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.
28 +
29 +Make sure //Web Sharing// is enabled in the //Sharing// panel in //System Preferences// (note: 10.5 comes with Apache 2.2 as the default).
30 +
31 +Edit ///etc/apache2/httpd.conf// (if you did a fresh install, you may already have these - search httpd.conf first)
32 +
33 +Search for rewrite//module, and above it, add this line~://
34 +
7 7  {{code}}
8 8  
9 -cd /Developer/Examples/JavaWebObjects/
10 -sudo sh installDatabases.sh <yourusername>
37 +LoadModule WebObjects_module /System/Library/WebObjects/Adaptors/Apache2.2/mod_WebObjects.so
11 11  
12 12  {{/code}}
13 13  
14 -Now, you can import the examples into Eclipse. Start Eclipse, select File -> Import, and select General -> Existing Projects into Workplace.
41 +Go to the very end and add:
15 15  
16 -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. Deselect the second javaeoutil project, or else you won't be able to import the projects.
43 +{{code}}
17 17  
18 -You should see the projects in the WO Package Explorer. If you see the projects in Package Explorer (without the WO), that means that you are using the Java perpective instead of the WOLips perpective.
45 +Include /System/Library/WebObjects/Adaptors/Apache2.2/apache.conf
19 19  
20 -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 :-)
47 +{{/code}}
21 21  
22 -For each project, right-click on each project, select Build Path -> Configure Build Path...
49 +Search for "Directory /" and comment out the Order and Deny lines:
23 23  
24 -Click on the Projects tab, select the references to the WO frameworks and click Remove
51 +{{code}}
25 25  
26 -Click on the Libraries tab, click the Add Library button
53 +<Directory />
54 + Options FollowSymLinks
55 + AllowOverride None
56 + #Order deny,allow
57 + #Deny from all
58 +</Directory>
27 27  
28 -Select WebObjects Frameworks and click Next
60 +{{/code}}
29 29  
30 -Click System, open the triangle next to System and make sure that JavaEOAccess, JavaEOControl, JavaFoundation, JavaWebObjects, JavaWOExtensions and JavaXML are selected. For the SchoolToolsClient, you also need to add the JavaWebServicesSupport and JavaWebServicesClient. For the SchoolToolsServer, you also need to add the JavaWebServicesSupport.
62 +Restart apache
31 31  
32 -After you corrected the build path, the project will rebuild itself and the errors shoud dissapear
64 +{{code}}
33 33  
34 -You also have to fix the build path for JavaBusinessLogic and RelatedLinks because the Derby path is incorrect.
66 +sudo apachectl graceful
67 +
68 +{{/code}}
69 +
70 +If you run //ps auxw grep httpd// you should see apache now running
71 +
72 +Create ///Library/LaunchDaemons/com.apple.webobjects.wotaskd.plist// with:
73 +(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)
74 +
75 +{{code}}
76 +
77 +<?xml version="1.0" encoding="UTF-8"?>
78 +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
79 +<plist version="1.0">
80 +<dict>
81 + <key>Disabled</key>
82 + <false/>
83 + <key>GroupName</key>
84 + <string>appserverusr</string>
85 + <key>Label</key>
86 + <string>com.apple.webobjects.wotaskd</string>
87 + <key>OnDemand</key>
88 + <false/>
89 + <key>Program</key>
90 + <string>/System/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd</string>
91 + <key>ProgramArguments</key>
92 + <array>
93 + <string>wotaskd</string>
94 + <string>-WOPort</string>
95 + <string>1085</string>
96 + </array>
97 + <key>ServiceIPC</key>
98 + <false/>
99 + <key>UserName</key>
100 + <string>appserver</string>
101 +</dict>
102 +</plist>
103 +
104 +{{/code}}
105 +
106 +Create ///Library/LaunchDaemons/com.apple.webobjects.womonitor.plist// with:
107 +(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)
108 +
109 +{{code}}
110 +
111 +<?xml version="1.0" encoding="UTF-8"?>
112 +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
113 +<plist version="1.0">
114 +<dict>
115 + <key>Disabled</key>
116 + <false/>
117 + <key>GroupName</key>
118 + <string>appserverusr</string>
119 + <key>Label</key>
120 + <string>com.apple.webobjects.womonitor</string>
121 + <key>OnDemand</key>
122 + <false/>
123 + <key>Program</key>
124 + <string>/System/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor</string>
125 + <key>ProgramArguments</key>
126 + <array>
127 + <string>JavaMonitor</string>
128 + <string>-WOPort</string>
129 + <string>56789</string>
130 + </array>
131 + <key>ServiceIPC</key>
132 + <false/>
133 + <key>UserName</key>
134 + <string>appserver</string>
135 +</dict>
136 +</plist>
137 +
138 +{{/code}}
139 +
140 +Start the launchd daemons :
141 +(you may need to sudo here)
142 +
143 +{{code}}
144 +
145 +launchctl load /Library/LaunchDaemons/com.apple.webobjects.wotaskd.plist
146 +launchctl load /Library/LaunchDaemons/com.apple.webobjects.womonitor.plist
147 +
148 +{{/code}}
149 +
150 +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:
151 +
152 +{{code}}
153 +
154 +http://localhost:56789
155 +
156 +{{/code}}