Summary: An example showing how to deploy spring applications using the Service Grid Admin UI.
Overview
This section explains how to deploy a Spring application using the Service Grid, by means of an example – the Bean example located at <Service Grid>/examples/bean.
Starting the Infastructure Services
Using GigaSpaces 5.2:
Start a Grid Service Manager and Container using the gsm and gsc commands:
<GigaSpaces ROOT>\ServiceGrid\bin\gsm
<GigaSpaces ROOT>\ServiceGrid\bin\gsc
Or use the gs-all command which starts one Service Grid Manager and one Grid Service Container at once:
<GigaSpaces ROOT>\ServiceGrid\bin\gs-all
Using GigaSpaces 5.1:
Start the Grid Service Manager and Container using:
<GigaSpaces ROOT>\ServiceGrid\bin\spring-gsc
<GigaSpaces ROOT>\ServiceGrid\bin\gsm
 | The spring-gsc uses the spring-platform.xml override file when starting the GSC, that includes the relevant resources the spring framework requires as container platform capability. For more details, refer to the Service Grid Configuration Overrides section.
In GigaSpaces 5.2, you don't need to use the spring-gsc command, simply run gsc and gsm as detailed above. |
To make the example more interesting (both in version 5.1 and in version 5.2), run two or more GSCs (for details on the GSM and GSC, see Deploying Infrastructure Services).
Deploying the Sample Spring Application
To deploy the sample application using the Service Grid Admin UI:
- Build the example using the ant build.xml file located in the <GigaSpaces ROOT>\ServiceGrid\examples\bean folder:
D:\GigaSpacesEE5.1\ServiceGrid\examples\bean>ant
Buildfile: build.xml
prepare:
compile:
hello.jar:
[jar] Building jar: D:\GigaSpacesEE5.1\ServiceGrid\examples\bean\lib\hello.jar
hello-dl.jar:
[jar] Building jar: D:\GigaSpacesEE5.1\ServiceGrid\examples\bean\lib\hello-dl.jar
jars:
install:
[copy] Copying 2 files to D:\GigaSpacesEE5.1\ServiceGrid\deploy\examples\bean
all:
BUILD SUCCESSFUL
Total time: 1 second
 | Due to a known issue, you must copy the two created jars, hello.jar and hello-dl.jar to the
<GigaSpaces ROOT>\ServiceGrid\deploy folder |
- Start the infastructure services – differs in GigaSpaces 5.2 and in GigaSpaces 5.1, see above.
- Start the Service Grid Admin UI, using the gs-ui utility, found under <Service Grid>/bin.
- Start the Deployment Wizard by clicking the Deploy button (see screenshot below), and select Spring Application as the deployment type.
- Click Next.
- Click the Browse... button and select the context file provided with the example: <GigaSpaces Root>/ServiceGrid/examples/bean/config/hello-spring.xml
 | Due to a known issue, you must copy hello-spring.xml to the <GigaSpaces ROOT>\ServiceGrid\deploy folder |
- In the Bean to Export box, click the bean Hello.
- The Bean Type to Export box should automatically show the name of the example class, example.Hello, and the Bean Implementation box should automatically show the name of the implementation class, example.HelloImpl.
 |
- If the name example.HelloImpl appears in the first text box and in the second text box, remove the Impl from the Bean to Export box, leaving only Hello.example.
- If no text shows in the text boxes, type in example.Hello and example.HelloImpl manually.
|
- Click the Browse... button next to Client Jars, and select the file hello-dl.jar in the lib folder of the example.
- Click the Browse... button next to Service Jars, and select the file hello.jar in the lib folder of the example.
- If you want to view and edit the Service Deployment Descriptor attributes, click the Advanced button. An SDD editor opens:
 | To overcome a known issue, you will need to manually change the Codebase value to $[com.gigaspaces.system.codeserver] then click Edit. |
When finished editing SDD properties, click Accept to save your changes on the current SDD, Save As... to save the changes as a different SDD, or Cancel to discard.
- Click Next.
- In this step you determine the location of the code of the GigaSpaces service, by selecting a codebase server. This enables the Service Grid to dynamically deploy GigaSpaces instances on machines that do not have GigaSpaces installed. The server location is provided as a URL.
Select one of the GSM instances from the list.
- Click Verify. This verifies that the location provided by the deployment descriptor is available. If not, another GSM instance, which maintains a reference to the service, is suggested.
 | The verification step is required only if the codebase server provided in the deployment descriptor is unavailable. |
 | If you clicked Verify and the server is not verified successfully, this indicates that your HTTP port is not set correctly in the Service Deployment Descriptor. Open the descriptor file, and edit the tag <Parameter Name="httpPort" Value="9010" />, under <Component Name="com.gigaspaces.start">. Set the Value attribute to the current port set on your codebase server. |
Once the verification finishes successfully, the Deploy button becomes enabled.
- Click the Deploy button to start the deployment process. Current deployment status is shown; wait for deployment to finish or press Dismiss to abort the process.
Viewing the Deployment

RELATED TOPICS
Add Comment