Child pages
  • Java Client-WebStart Incremental Build
Skip to end of metadata
Go to start of metadata

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.

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.

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.

Below are the steps for adding an additional "Ant Builder" to your project to generate and place the required jar in the right location.

  1. Create a "javaclientbuild.xml" file in the root of your project, with the following as its contents:
    <project name="javaclient" default="javaclient" basedir=".">
    	<target name="setProps">
    		<property file="${user.home}${file.separator}build.properties" />
    		<property file="build.properties" />
    		<property file="${user.home}${file.separator}Library${file.separator}wobuild.properties" />
    		<condition property="wo.properties.check.failed">
    			<not>
    				<and>
    					<isset property="wo.wosystemroot" />
    					<isset property="wo.wolocalroot" />
    				</and>
    			</not>
    		</condition>
    		<fail message="Could not find ${user.home}${file.separator}Library${file.separator}wobuild.properties." if="wo.properties.check.failed" />
    	</target>
    	<target name="javaclient" depends="setProps">
    
    		<!-- project client-side classes -->
    		<mkdir dir="build/${project.name}.woa/Contents/WebServerResources/Java" />
    		<jar basedir="${classes.dir}" includes="**/client/**/*.class,**/common/**/*.class" jarfile="build/${project.name}.woa/Contents/WebServerResources/Java/${project.name}.jar">
    		</jar>
    
    		<!-- Launch Scripts and WOBootstrap.jar -->
    		<mkdir dir="build/${project.name}.woa/Contents/MacOS" />
    		<mkdir dir="build/${project.name}.woa/Contents/UNIX" />
    		<mkdir dir="build/${project.name}.woa/Contents/Windows" />
    
    		<copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunch.sh" tofile="build/${project.name}.woa/Contents/${project.name}" />
    		<chmod file="build/${project.name}.woa/Contents/${project.name}" perm="ugo+rx" />
    		<copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD" tofile="build/${project.name}.woa/Contents/${project.name}.CMD" />
    		<copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD" tofile="build/${project.name}.woa/Contents/Windows/${project.name}.CMD" />
    		<copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WOBootstrap.jar" tofile="build/${project.name}.woa/Contents/WOBootstrap.jar" />
    
    		<copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunchClient.sh" tofile="build/${project.name}.woa/Contents/MacOS/${project.name}_Client" />
    		<chmod file="build/${project.name}.woa/Contents/MacOS/${project.name}_Client" perm="ugo+rx" />
    		<copy file="ClasspathClient.txt" tofile="build/${project.name}.woa/Contents/MacOS/ClasspathClient.txt" />
    
    		<!-- D2JC only -->
    		<copy file="user.d2wmodel" tofile="build/${project.name}.woa/Contents/Resources/user.d2wmodel" />
    
    	</target>
    </project>
  2. Right-Click on your project, and select Properties.
  3. Click on "Builders" on the left side.
  4. Click the "New" button.
  5. Select "Ant Build" and click "Okay".
  6. Name it "Java Client Incremental Builder"
  7. Under the "Main" tab, click "Browse Workspace".
  8. Click on your Project, and select the javaclientbuild.xml file you created in step 1, click "Okay".
  9. Under the "Refresh" tab, check "Refresh resources upon completion." and select "The project containing the selected resource"
  10. Under the "Targets" tab, set "javaclient" for "After a 'Clean'", "Manual Build" and "Auto Build".

    It will show up as "<Default Target Selected>"
  11. Click okay to close the Builder Properties window.
  12. Make sure your new Builder is checked and executes AFTER the WOLips Incremental Builder, otherwise it will error.
  13. Click "Okay" to exit Project Properties.

Done. You can now use the Eclipse "Run..." command just as you would for any other WOLips project.

  • No labels