|
Summary: Installing WSAD; using correct JDK and JRE; ReplicatedSessionBean object; configuring server for an application; GigaSpaces WebSphere demo.
OverviewThis section describes required steps for building J2EE Web applications with IBM WebSphere 5 and GigaSpaces. WebSphere will be used as part of WebSphere Studio Application Developer (WSAD 5.1.2). WSAD 5 DownloadWebSphere Studio Application Developer for Windows (WSAD 5.1.2) Download: JDKMake sure to use the WebSphere 5 JDK and not the default one comes with eclipse. This is required when building Java clients that access WebSphere. Select from main menu Window->Preferences:
The Preferences window will open. Select the Java->Installed JREs.
Select the WebSphere JRE to be your default JRE. Importing ReplicatedSessionBean into WSAD 5 workspaceYou will need to introduce GigaSpaces ReplicatedSessionBean EAR to your WSAD workspace.
Running the ear.bat/sh script should display the following output: JAVA_HOME environment variable is set to D:\JDK\j2sdk1.4.2_08 in "<GigaSpaces Root>\bin\setenv.bat" Environment set successfully from D:\GigaSpacesEE5.0\bin\\.. ------------------------------------------------------------------------------------------ ensuring that we are working on the latest jar and config files from product distribution ------------------------------------------------------------------------------------------ Could Not Find D:\GigaSpacesEE5.0\j2ee\examples\ReplicatedSessionBean\lib 1 file(s) copied. D:\GigaSpacesEE5.0\bin\\..\lib\jini\browser-dl.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\browser.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\jsk-dl.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\jsk-lib.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\jsk-platform.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\jsk-policy.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\jsk-resources.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\mahalo-dl.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\mahalo.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\reggie-dl.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\reggie.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\start.jar D:\GigaSpacesEE5.0\bin\\..\lib\jini\tools.jar 13 file(s) copied. Deleted file - D:\GigaSpacesEE5.0\j2ee\examples\ReplicatedSessionBean\lib\jini\browser.jar Deleted file - D:\GigaSpacesEE5.0\j2ee\examples\ReplicatedSessionBean\lib\jini\browser-dl.jar Deleted file - D:\GigaSpacesEE5.0\j2ee\examples\ReplicatedSessionBean\lib\jini\tools.jar D:\GigaSpacesEE5.0\bin\\..\lib\rio\boot.jar D:\GigaSpacesEE5.0\bin\\..\lib\rio\webster.jar 2 file(s) copied. 1 file(s) copied. 1 file(s) copied. ------------------------------------- Creating ReplicatedSessionBean.jar .. ------------------------------------- Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. added manifest ignoring entry META-INF/ adding: META-INF/application.xml(in = 528) (out= 292)(deflated 44%) adding: META-INF/ejb-jar.xml(in = 917) (out= 409)(deflated 55%) adding: META-INF/ibm-ejb-jar-bnd.xmi(in = 576) (out= 316)(deflated 45%) adding: META-INF/ibm-ejb-jar-ext.xmi(in = 490) (out= 256)(deflated 47%) adding: META-INF/jboss.xml(in = 187) (out= 106)(deflated 43%) ignoring entry META-INF/MANIFEST.MF adding: META-INF/orion-ejb-jar.xml(in = 352) (out= 216)(deflated 38%) adding: META-INF/sun-ejb-jar.xml(in = 553) (out= 328)(deflated 40%) adding: META-INF/sun-j2ee-ri.project(in = 241) (out= 139)(deflated 42%) adding: META-INF/weblogic-ejb-jar.xml(in = 452) (out= 251)(deflated 44%) adding: com/(in = 0) (out= 0)(stored 0%) adding: com/j_spaces/(in = 0) (out= 0)(stored 0%) adding: com/j_spaces/examples/(in = 0) (out= 0)(stored 0%) adding: com/j_spaces/examples/ModelClass.class(in = 1624) (out= 863)(deflated 46%) adding: com/j_spaces/examples/ReplicatedSession.class(in = 740) (out= 357)(deflated 51%) adding: com/j_spaces/examples/ReplicatedSessionBean$MyListener.class(in = 1084) (out= 551)(deflated 49%) adding: com/j_spaces/examples/ReplicatedSessionBean.class(in = 10429) (out= 4472)(deflated 57%) adding: com/j_spaces/examples/ReplicatedSessionHome.class(in = 319) (out= 213)(deflated 33%) adding: model/(in = 0) (out= 0)(stored 0%) adding: model/ModelClass.class(in = 1608) (out= 832)(deflated 48%) adding: model/SubClass1.class(in = 579) (out= 352)(deflated 39%) adding: config/(in = 0) (out= 0)(stored 0%) adding: config/gs.properties(in = 6239) (out= 2194)(deflated 64%) adding: gslicense.xml(in = 257) (out= 181)(deflated 29%) ReplicatedSessionBean.jar 1 file(s) copied. ------------------------------------ Creating ReplicatedSessionWeb.war .. ------------------------------------ adding: ejbwar.bat(in = 52) (out= 48)(deflated 7%) adding: ejbwar.sh(in = 60) (out= 56)(deflated 6%) adding: HelloWorldFormHandler.jsp(in = 3638) (out= 1080)(deflated 70%) adding: index.html(in = 2459) (out= 537)(deflated 78%) adding: META-INF/(in = 0) (out= 0)(stored 0%) adding: META-INF/MANIFEST.MF(in = 35) (out= 37)(deflated -5%) adding: WEB-INF/(in = 0) (out= 0)(stored 0%) adding: WEB-INF/classes/(in = 0) (out= 0)(stored 0%) adding: WEB-INF/classes/com/(in = 0) (out= 0)(stored 0%) adding: WEB-INF/classes/com/j_spaces/(in = 0) (out= 0)(stored 0%) adding: WEB-INF/classes/com/j_spaces/web/(in = 0) (out= 0)(stored 0%) adding: WEB-INF/classes/com/j_spaces/web/TestServlet.class(in = 6223) (out= 3021)(deflated 51%) adding: WEB-INF/classes/com/j_spaces/web/TestServlet.java(in = 6696) (out= 1653)(deflated 75%) adding: WEB-INF/ibm-web-bnd.xmi(in = 316) (out= 194)(deflated 38%) adding: WEB-INF/ibm-web-ext.xmi(in = 456) (out= 260)(deflated 42%) adding: WEB-INF/sun-web.xml(in = 334) (out= 233)(deflated 30%) adding: WEB-INF/web.xml(in = 916) (out= 360)(deflated 60%) ReplicatedSessionWeb.war 1 file(s) copied. ------------------------------------------- Creating final ReplicatedSessionBean.ear .. ------------------------------------------- ReplicatedSessionBean : no such file or directory adding: META-INF/(in = 0) (out= 0)(stored 0%) adding: META-INF/application.xml(in = 528) (out= 292)(deflated 44%) adding: META-INF/ibm-application-ext.xmi(in = 343) (out= 173)(deflated 49%) adding: META-INF/ibm-ejb-jar-bnd.xmi(in = 485) (out= 267)(deflated 44%) adding: META-INF/sun-j2ee-ri.project(in = 135) (out= 126)(deflated 6%) adding: META-INF/sun-j2ee-ri.xml(in = 788) (out= 376)(deflated 52%) adding: ReplicatedSessionBean.jar(in = 15928) (out= 13579)(deflated 14%) adding: ReplicatedSessionWeb.war(in = 9713) (out= 8184)(deflated 15%) adding: lib/(in = 0) (out= 0)(stored 0%) adding: lib/common/(in = 0) (out= 0)(stored 0%) adding: lib/common/backport-util-concurrent.jar(in = 326319) (out= 284557)(deflated 12%) adding: lib/jini/(in = 0) (out= 0)(stored 0%) adding: lib/jini/jsk-dl.jar(in = 61563) (out= 51927)(deflated 15%) adding: lib/jini/jsk-lib.jar(in = 291877) (out= 264368)(deflated 9%) adding: lib/jini/jsk-platform.jar(in = 995179) (out= 903709)(deflated 9%) adding: lib/jini/jsk-policy.jar(in = 31055) (out= 27339)(deflated 11%) adding: lib/jini/jsk-resources.jar(in = 1722) (out= 880)(deflated 48%) adding: lib/jini/mahalo-dl.jar(in = 16470) (out= 14518)(deflated 11%) adding: lib/jini/mahalo.jar(in = 107261) (out= 98672)(deflated 8%) adding: lib/jini/reggie-dl.jar(in = 58054) (out= 54033)(deflated 6%) adding: lib/jini/reggie.jar(in = 141059) (out= 131432)(deflated 6%) adding: lib/jini/start.jar(in = 63029) (out= 56851)(deflated 9%) adding: lib/JSpaces.jar(in = 5644925) (out= 5234941)(deflated 7%) adding: lib/rio/(in = 0) (out= 0)(stored 0%) adding: lib/rio/boot.jar(in = 23629) (out= 22356)(deflated 5%) adding: lib/rio/webster.jar(in = 27750) (out= 26183)(deflated 5%) After a successful build the ReplicatedSessionBean.ear will be found at <GigaSpaces ROOT>\J2EE\examples\ReplicatedSessionBean\ReplicatedSessionBean. Start WSAD. Right-click the Enterprise Applications leaf in the J2EE Hierarchy view, and select import->Import Ear...
You will then need to tell WSAD where the EAR file is located.
Browse to the location of the EAR file. Please click Yes for all messages asking for permission to override existing files. Verifying the Import ActionYou can now see your project in the J2EE Hierarchy view:
Creating a new Server runtimeIn WSAD, you may configure a runtime environment for applications. This runtime is not a full-fledged application server, but it is enough for our purposes.
In the window that you'll get, enter a name for the server, and make sure that you create a WebSphere version 5.1 Test Environment (as shown in the screen shot).
Click Next, accept the default port suggestion, and click Finish. You now have a new runtime server created, and you can see it under Servers leaf. Server ConfigurationYou need the server to be able to start GigaSpaces server. This is a configuration that must be done manually. Server Java VM ArgumentsFor this example, you need to modify the security settings of Websphere.
Enter the following into the System Properties Arguments text box:
GigaSpaces & WebSphere 5 DemoThis demo allows you to perform all space basic operations using simple web client GUI interface having a session bean methods calling space operations through both IJSpace and IMap interfaces. The session bean includes several methods. These in general call space basic operations such as write, read, take, notify, update and batch operations. It also contains basic Map operations (put, get etc.). The web interface JSP file provides GUI for these methods.
The session bean source code can be modified and compiled using the <GigaSpaces ROOT>\j2ee\examples\ReplicatedSessionBean\ear.bat file. ReplicatedSessionBean EAR file structureThe example is delivered inside the
Files inside this folder-structure include:
Deploy ReplicatedSessionBean ApplicationBefore deploying the application, you should perform two steps:
Run the ApplicationOpen a browser window and enter the following at the address bar: You should see the application's entry page:
Select any action and press the Go! Button.
For example, suppose you selected to write 1000 Entries to the space.
Using this link you may test the application one method call at a time. GigaSpaces Space BrowserYou can view class instance count for every class type stored at the space using the GigaSpaces Browser Runtime Module.
|
Wiki Content Tree
Your Feedback Needed!
We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.


















Add Comment