To get Java, go to http://java.sun.com/ and select Downloads. You want 'Java 2 platform, standar edition tools (J2SE)'. This documentation was produced using version 1.4.2; version 1.5 is likely to have bugs and is not yet recommended. Follow the Java install instructions, and make sure (as explained below) that JAVA_HOME and PATH are set correctly. By default, it installs into
/usr/java/{version}I usually create a symlink, so that I have
/usr/java/currentas JAVA_HOME. You can do this with
ln -s /usr/java/{version} /usr/java/current
Apache Ant is a Java build tool, more or less equivalent to Make. You can download it from http://ant.apache.org/bindownload.cgi. It usually installs into
/usr/local/apache-ant-{version}You will need to set the ANT_HOME variable to match this, and add ANT_HOME/bin to your path. Make sure that
ant -versionworks before proceeding.
tar xzvf ../gt3.2-core-bin.tar.gzThis will produce
$HOME/code/ogsa-3.2
setenv OGSA_ROOT $HOME/code/ogsa-3.2
echo $JAVA_HOME
On Mac OSX 10.3.2, JAVA_HOME is automatically set to/Library/Java/HomeIf you get
tcsh: JAVA_HOME: Undefined variable.
setenv JAVA_HOME /usr/java/j2sdk1.4.1_03in my .cshrc.
/sw/lib/ant/
which ant
which javac
Both should be found. If not, add something like this to your .cshrc:setenv PATH $ANT_HOME/bin:$JAVA_HOME/bin:$PATH
You can verify the ant version by runningant -versionand verify that you have at least version 1.6.1. For example:
Apache Ant version 1.6.1 compiled on February 12 2004You can check the Java version by running
java -versionVerify that it's at least version 1.4.2, e.g.
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-117.1)
Java HotSpot(TM) Client VM (build 1.4.2-34, mixed mode)
setenv CVSROOT :pserver:anonymous@neescvs.mcs.anl.gov:/disks/cvs/neesgrid
setenv CVS_RSH ssh
to point to the CVS server.cvs checkout NTCP ntcp_plugins nclient
This will create a directory tree like this:$HOME/code -> ogsa-3.2/
NTCP/
ntcp_plugins/
nclient/
ogsa.root=/Users/hubbard/code/ogsa-3.2which leads us into step two, deploying NTCP. If you use method one, just run
ant deployGar
If you prefer method two, runant -Dogsa.root=$OGSA_ROOT deployGarNo, that's not a typo, it's gar and not jar. A GAR file is a JAR file with the WSDD and WSDL files added. See this GT3 tutorial page for more information.
BUILD SUCCESSFUL
Total time: 28 seconds
<?xml version="1.0" encoding="UTF-8"?>The line of interest is near the end:
<deployment name="defaultServerConfig" xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:gsdl="http://www.gridforum.org/namespaces/2002/10/gridServices"
xmlns:globus-properties="http://types.ogsa.globus.org/properties_detail"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<service name="nees/ntcp/NTCPServer" provider="Handler" style="wrapped">
<parameter name="name" value="NTCP Server"/>
<parameter name="schemaPath" value="schema/nees/ntcp/ntcp_server_service.wsdl"/>
<parameter name="className" value="org.nees.ntcp.ntcpServer.NtcpServer"/>
<parameter name="baseClassName" value="org.nees.ntcp.server.impl.NtcpServerImpl"/>
<parameter name="operationProviders" value="org.globus.ogsa.impl.ogsi.NotificationSourceProvider"/>
<parameter name="handlerClass" value="org.globus.ogsa.handlers.RPCURIProvider"/>
<parameter name="persistent" value="true"/>
<parameter name="allowedMethods" value="*"/>
<parameter name="isSecure" value="false"/>
<parameter name="authorization" value="none"/>
<parameter name="isProfiling" value="false"/>
<parameter name="ntcpBackendFactory" value="org.nees.ntcp.server.backend.test.DummyControlFactory"/>
<parameter name="localPolicyPlugin" value="org.nees.ntcp.server.backend.test.DummyLocalPolicyPlugin"/>
</service>
</deployment>
<parameter name="ntcpBackendFactory" value="org.nees.ntcp.server.backend.test.DummyControlFactory"/>This defines which NTCP plugin gets called when NTCP runs. The default as shown uses the dummy control plugin. When we want to change to another plugin, we have to
cd $OGSA_ROOT
and then
ant startContainer -Dservice.port=8090Of course, you'll need to be logged int the machine with NTCP installed! You should see something like the following:
Buildfile: build.xmlNote that an interrupt signal (usually Control-C) will stop the container.
startContainer:
startContainer:
[java] [07/30/2004 12:38:13:092 ] org.globus.ogsa.server.ServiceContainer [run:582] INFO: Starting SOAP server at: http://127.0.0.1:8090/ogsa/services/
[java] With the following services:
[java]
[java] http://127.0.0.1:8090/ogsa/services/nees/ntcp/NTCPServer
[java] http://127.0.0.1:8090/ogsa/services/core/admin/AdminService
[java] http://127.0.0.1:8090/ogsa/services/core/management/OgsiManagementService
[java] http://127.0.0.1:8090/ogsa/services/core/registry/ContainerRegistryService
[java] http://127.0.0.1:8090/ogsa/services/core/jmsadapter/JMSAdapterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/core/logging/OgsiLoggingManagementService
[java] http://127.0.0.1:8090/ogsa/services/core/notification/httpg/NotificationSubscriptionFactoryService
[java] http://127.0.0.1:8090/ogsa/services/core/ping/PingService
[java] http://127.0.0.1:8090/ogsa/services/samples/registry/VORegistryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/notification/CounterService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/notification/CounterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/encoded/CounterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/persistent/CounterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/basic/CounterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/basic/CounterFactoryFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/delegation/CounterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/routable/MasterRedirectedCounter
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/routable/LocalCounterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/generate/CounterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/deactivation/CounterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/soap-secure/CounterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/counter/logging/CounterFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/notification/SinkListenerFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/exception/ExceptionFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/weather/WeatherFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/google/GoogleSearchFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/any/AnyFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/servicedata/ServiceDataService
[java] http://127.0.0.1:8090/ogsa/services/samples/array/ArraySampleFactoryService
[java] http://127.0.0.1:8090/ogsa/services/samples/chat/ChatFactoryService
[java] http://127.0.0.1:8090/ogsa/services/ogsi/NotificationSubscriptionFactoryService
[java] http://127.0.0.1:8090/ogsa/services/ogsi/HandleResolverService
[java] http://127.0.0.1:8090/ogsa/services/gsi/AuthenticationService
[java] http://127.0.0.1:8090/ogsa/services/gsi/SecureNotificationSubscriptionFactoryService
nohup ant startContainer -Dservice.port=8090 >& ntcp-logfile.txt &
org.nees.ntcp.server.backend.test.DummyControlPlugin=console,debugThis will print brief messages upon receipt of NTCP commands. Here's an example:
[java] [07/30/2004 12:40:32:615 ] org.nees.ntcp.server.backend.test.DummyControlPlugin [openSession:34] DEBUG: openSession
[java] [07/30/2004 12:40:35:329 ] org.nees.ntcp.server.backend.test.DummyControlPlugin [propose:56] DEBUG: propose
[java] [07/30/2004 12:40:37:335 ] org.nees.ntcp.server.backend.test.DummyControlPlugin [propose:66] DEBUG: accepting transaction TR-393531744
[java] [07/30/2004 12:40:37:413 ] org.nees.ntcp.server.backend.test.DummyControlPlugin [execute:74] DEBUG: execute
[java] [07/30/2004 12:40:39:563 ] org.nees.ntcp.server.backend.test.DummyControlPlugin [getControlPoint:113] DEBUG: getControlPoint
[java] [07/30/2004 12:40:39:611 ] org.nees.ntcp.server.backend.test.DummyControlPlugin [closeSession:45] DEBUG: closeSession
cd $HOME/code/nclient
ant run
Buildfile: build.xmlYou are now ready to proceed to the next page, a walk through the nclient source code.
checkOGSA:
prepare:
compile:
[javac] Compiling 1 source file to /Users/hubbard/code/nclient/build/classes
jar:
[jar] Building jar: /Users/hubbard/code/nclient/build/lib/nclient.jar
run:
[java] Opening connection to NTCP server at http://localhost:8090/ogsa/services/nees/ntcp/ in non-secure mode
[java] Connection opened OK, now sending openSession
[java] - Logging is working
[java] - Date: Fri Jul 30 12:40:34 PDT 2004
[java] - Version: Apache-XML-Security-J 1.0.4
[java] Proposing transaction #15437 id: TR-393531744
[java] Transaction proposal accepted. Excellent.
[java] Executing move, may take 60-90 seconds
[java] Execute completed; looping until transaction completes
[java] Move complete; transaction terminated
[java] Querying the control point
[java] Control point name: dummy
[java] Control point param1: 1.0
[java] Control point param2: 2.0
[java] Closing NTCP session
[java] Done.
BUILD SUCCESSFUL
Total time: 22 seconds