Changes for page Java Client-WebStart Incremental Build
Last modified by David Avendasora on 2009/02/05 17:10
From version 29.1
edited by David Avendasora
on 2008/01/14 10:46
on 2008/01/14 10:46
Change comment:
There is no comment for this version
To version 26.1
edited by David Avendasora
on 2008/06/25 10:16
on 2008/06/25 10:16
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -Java Client-Incremental Build 1 +Java Client-WebStart Incremental Build - Content
-
... ... @@ -1,15 +1,89 @@ 1 - WOLips incrementalbuilderwill not automaticallycreatethe required jar ofyourclient-side classes andplaceit in theproject.woa/Contents/WebServerResources/Java/ directory asis required by aJavaWithouttheclient classesplacedhere,thebuilt-inRun...command willnot work properlyastheclient applicationwill nothave access to it's classes andWebObjectswill silentlyfailback toEOGenericRecord.This causesthe confusing conditionoftheapplicationlaunchingand likely notgeneratingany errors,but notworking correctly.1 +There are many ways you can deploy WebObjects JavaClient applications. One of the ways to do it is through WebStart. You could manually create a WebStart app, but WebObjects can also do it for you, taking care of JNLP creation, jar organization, and many WebStart nasty bits. 2 2 3 - Belowis awork-around untilthe incremental builder canbemodifiedtocreate the neededdirectory and jarfile.3 +There is a problem however. The WOLips incremental builder will not automatically create the required jar of your client-side classes and place it in the project.woa/Contents/WebServerResources/Java/ directory as is required by a WebObjects WebStart Java Client application. 4 4 5 -1. Add a "Java" directory to the "WebServerResources" directory in your Eclipse project. 6 -1. Right-click on the new directory and select: "WOLips Tools -> Include as WebServerResource" 7 -1. Add the following code to the "javaclient" target (See the [[Ant Build>>Java Client-Build]] instructions). 5 +Without the client classes placed in WebServerResources, Eclipse's built-in Run... command will not work properly as the client application will not have access to its classes and WebObjects will silently fall-back to EOGenericRecord. This causes the confusing condition of the application launching and likely not generating any errors, but not working correctly either. 8 8 9 - {{code}}7 +Below are the steps for adding an additional "Ant Builder" to your project to generate and place the required jar in the right location. 10 10 9 +1. Create a "javaclientbuild.xml" file in the root of your project, with the following as its contents: 11 11 11 +{{code value="xml"}} 12 12 13 +<project name="javaclient" default="javaclient" basedir="."> 14 + <target name="setProps"> 15 + <property file="${user.home}${file.separator}build.properties"/> 16 + <property file="build.properties"/> 17 + <property file="${user.home}${file.separator}Library${file.separator}wobuild.properties"/> 18 + <condition property="wo.properties.check.failed"> 19 + <not> 20 + <and> 21 + <isset property="wo.wosystemroot"/> 22 + <isset property="wo.wolocalroot"/> 23 + </and> 24 + </not> 25 + </condition> 26 + <fail message="Could not find ${user.home}${file.separator}Library${file.separator}wobuild.properties." if="wo.properties.check.failed"/> 27 + </target> 28 + <target name="javaclient" depends="setProps"> 29 + <mkdir dir="build/${project.name}.woa/Contents/WebServerResources/Java"/> 30 + 31 + <!-- project client-side classes --> 32 + <copy todir="build/${project.name}.woa/Contents/WebServerResources/Java/"> 33 + <fileset dir="${classes.dir}"> 34 + <include name="**/client/**/*.class,**/common/**/*.class,**/BMGenericRecord.class"/> 35 + <exclude name="**/server/**/*.class"/> 36 + </fileset> 37 + </copy> 38 + 39 + <jar basedir="${classes.dir}" 40 + includes="**/client/**/*.class,**/common/**/*.class,**/BMGenericRecord.class" 41 + excludes="**/server/**/*.class" 42 + jarfile="build/${project.name}.woa/Contents/WebServerResources/Java/${project.name}.jar"> 43 + </jar> 44 + 45 + <!-- Launch Scripts and WOBootstrap.jar--> 46 + <mkdir dir="build/${project.name}.woa/Contents/MacOS"/> 47 + <mkdir dir="build/${project.name}.woa/Contents/UNIX"/> 48 + <mkdir dir="build/${project.name}.woa/Contents/Windows"/> 49 + 50 + <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunch.sh" 51 + tofile="build/${project.name}.woa/Contents/${project.name}"/> 52 + <chmod file="build/${project.name}.woa/Contents/${project.name}" perm="ugo+rx"/> 53 + <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD" 54 + tofile="build/${project.name}.woa/Contents/${project.name}.CMD"/> 55 + <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WOBootstrap.jar" 56 + tofile="build/${project.name}.woa/Contents/WOBootstrap.jar"/> 57 + 58 + <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunchClient.sh" 59 + tofile="build/${project.name}.woa/Contents/MacOS/${project.name}_Client"/> 60 + <chmod file="build/${project.name}.woa/Contents/MacOS/${project.name}_Client" perm="ugo+rx"/> 61 + <copy file="ClasspathClient.txt" tofile="build/${project.name}.woa/Contents/MacOS/ClasspathClient.txt"/> 62 + 63 + <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD" 64 + tofile="build/${project.name}.woa/Contents/Windows/${project.name}.CMD"/> 65 + 66 + </target> 67 +</project> 13 13 {{/code}} 14 14 15 -This code will cause the "WOLips Ant Tools -> Install" function to put the required file in the project's WebServerResources directory, which the incremental builder will then pick-up and place in the build directory. 70 +1. Right-Click on your project, and select Properties. 71 +1. Click on "Builders" on the left side. 72 +[[image:Picture 2.png]] 73 +1. Click the "New" button. 74 +1. Select "Ant Build" and click "Okay". 75 +1. Name it "Java Client Incremental Builder" 76 +1. Under the "Main" tab, click "Browse Workspace". 77 +1. Click on your Project, and select the javaclientbuild.xml file you created in step 1, click "Okay". 78 +[[image:Picture 3.png]] 79 +1. Under the "Refresh" tab, check "Refresh resources upon completion." and select "The project containing the selected resource" 80 +[[image:Picture 4.png]] 81 +1. Under the "Targets" tab, set "javaclient" for "After a 'Clean'", "Manual Build" and "Auto Build". 82 +[[image:Picture 5.png]] 83 +It will show up as "<Default Target Selected>" 84 +[[image:Picture 7.png]] 85 +1. Click okay to close the Builder Properties window. 86 +1. Make sure your new Builder is checked and executes AFTER the WOLips Incremental Builder, otherwise it will error. 87 +1. Click "Okay" to exit Project Properties. 88 + 89 +Done. You can now use the Eclipse "Run..." command just as you would for any other WOLips project.