Date: 2004-11-13T07:24:24 Editor: RalfBarkow <[EMAIL PROTECTED]> Wiki: Apache Geronimo Wiki Page: HowToTutorial URL: http://wiki.apache.org/geronimo/HowToTutorial
Section "Hello1 Example" reflects new deployer syntax Change Log: ------------------------------------------------------------------------------ @@ -4,25 +4,21 @@ [[TableOfContents]] == Dependencies Download == -Download the tutorials and examples in the same [http://java.sun.com/j2ee/download.html bundle]. -The file name should be j2ee-1_4-doc-tutorial_3.zip. -Extract the zip file somewhere. +Download the tutorials and examples in the same [http://java.sun.com/j2ee/download.html bundle]. The file name should be {{{j2ee-1_4-doc-tutorial_3.zip}}}. Extract the zip file somewhere. == J2EE Tutorial Examples == - === Hello1 Example === - -==== Build the example ==== -{{{ + * Build the example + {{{ $ cd j2eetutorial14/examples/web/hello1 $ ant $ cd build/WEB-INF }}} -==== Create the file geronimo-jetty.xml ==== -{{{ + * Create the file geronimo-jetty.xml + {{{ <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://geronimo.apache.org/xml/ns/web/jetty" @@ -35,36 +31,44 @@ }}} -==== Create the war file ==== -{{{ + * Create the war file + {{{ $ cd j2eetutorial14/examples/web/hello1/build $ jar -cf ../j2eehello1.war * }}} -==== Deploy the war ==== -cd ~/geronimo/modules/assembly/target/geronimo-1.0-SNAPSHOT -{{{ -$ java -jar bin/deployer.jar --install --module x:\Sun\j2eetutorial14\examples\web\hello1\j2eehello1.war + * Deploy the war + {{{ +$ cd ~/geronimo/modules/assembly/target/geronimo-1.0-SNAPSHOT +$ java -jar bin/deployer.jar distribute "x:\Sun\j2eetutorial14\examples\web\hello1\j2eehello1.war" +Distributed your/domain/name/j2eetutorialhello1 -Server URI: your/domain/name/j2eetutorialhello1 }}} -==== Run the server ==== - -{{{ -java -jar bin/server.jar your/domain/name/j2eetutorialhello1 + * Run the server + {{{ +$ java -jar bin/server.jar your/domain/name/j2eetutorialhello1 }}} + Point your browser to -http://localhost:8080/j2eetutorialhello1/index.jsp +http://localhost:8080/j2eetutorialhello1/ +[[BR]] +You will get an '''HTTP ERROR: 500''' : + {{{ +HTTP ERROR: 500 +The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application -#--- old instructions ---> +RequestURI=/j2eetutorialhello1/ -HTTP ERROR: 500 The+absolute+uri%3A+http%3A%2F%2Fjava%2Esun%2Ecom%2Fjsp%2Fjstl%2Fcore+cannot+be+resolved+in+either+web%2Exml+or+the+jar+files+deployed+with+this+application -RequestURI=/j2eehello1/ +Powered by Jetty:// + +}}} + +# Old instructions (before 2004-11-13) ---> Hmm... @@ -89,19 +93,21 @@ Try the helloservice example but be aware that Sun's application server supports web services using an entirely different deployment process. See HowToAxisGeronimo for more on web services. -==== Build the Example ==== + * Build the Example + {{{ +$ cd j2eetutorial14/examples/jaxrpc/helloservice +$ ant -cd j2eetutorial14/examples/jaxrpc/helloservice -ant +}}} Ant reports that the BUILD FAILED but if the compile-service task passed we will be ok -==== Create a Web Application ==== + * Create a Web Application Use the web application created in HowToAxisGeronimo but name the directory MyHelloService. cp -R build/helloservice MyHelloService/WEB-INF/classes/ -==== Create the geronimo-jetty.xml ==== + * Create the geronimo-jetty.xml <?xml version="1.0" encoding="UTF-8"?> <web-app @@ -113,25 +119,25 @@ <context-priority-classloader>false</context-priority-classloader> </web-app> -==== Create the WAR File ==== + * Create the WAR File cd MyHelloService jar -cf ../MyHelloService.war * -==== Deploy the WAR File ==== + * Deploy the WAR File cd incubator-geronimo/target java -jar bin/deployer.jar --install --module MyHelloService.war -==== Start the Server ==== + * Start the Server java -jar bin/server.jar your/domain/name/j2eetutorialhelloservice -==== Test the Web Application ==== + * Test the Web Application http://localhost:8080/hello-jaxrpc gives you some links to check out. -==== Create the file MyHelloService/WEB-INF/deploy.wsdd ==== + * Create the file MyHelloService/WEB-INF/deploy.wsdd <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <service name="hello" provider="java:RPC"> @@ -139,7 +145,7 @@ </service> </deployment> -==== Deploy the Web Service ==== + * Deploy the Web Service Executing the Axis client as shown here. @@ -148,35 +154,35 @@ Processing file deploy.wsdd <Admin>Done processing</Admin> -==== Repackage the WAR File ==== + * Repackage the WAR File The WEB-INF directory now includes the file server-config.xml which requires redeployment. cd .. jar -cf ../MyHelloService.war * -==== Stop the Server ==== + * Stop the Server Ctrl-C -==== Redeploy the WAR File ==== + * Redeploy the WAR File cd incubator-geronimo/target java -jar bin/deployer.jar --install --module MyHelloService.war -==== Restart the Server ==== + * Restart the Server java -jar bin/server.jar your/domain/name/j2eetutorialhelloservice -==== Test the Web Service Endpoint ==== + * Test the Web Service Endpoint http://gisig.com:8080/hello-jaxrpc/servlet/AxisServlet should now show the hello web service. http://localhost:8080/hello-jaxrpc/services/hello?WSDL shows you the WSDL for the hello service. -==== Use the Tutorial Clients ==== + * Use the Tutorial Clients The J2EE Tutorial comes with a number of clients that use this web service. -==== Use Axis WSDL2Java to Generate a Client === + * Use Axis WSDL2Java to Generate a Client Stay tuned.