Date: 2004-10-26T06:17:15 Editor: RalfBarkow <[EMAIL PROTECTED]> Wiki: Apache Geronimo Wiki Page: HowToTutorial URL: http://wiki.apache.org/geronimo/HowToTutorial
OK up to '2.1.5. Run the server' ; To-Do: Update #--- old instructions ---> Change Log: ------------------------------------------------------------------------------ @@ -4,120 +4,64 @@ [[TableOfContents]] == Dependencies Download == +Download the tutorials and examples in the same [http://java.sun.com/j2ee/download.html bundle]. -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. +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 ==== +{{{ +$ cd j2eetutorial14/examples/web/hello1 +$ ant +$ cd build/WEB-INF -cd j2eetutorial14/examples/web/hello1 - -ant - -cd build/WEB-INF +}}} ==== Create the file geronimo-jetty.xml ==== - +{{{ <?xml version="1.0" encoding="UTF-8"?> <web-app - xmlns="http://geronimo.apache.org/xml/ns/web/jetty" - configId="your/domain/name/j2eetutorialhello1" - parentId="org/apache/geronimo/Server" - > - <dependency> - <uri>junit/jars/junit-3.8.jar</uri> - </dependency> - <context-root>/j2eetutorialhello1</context-root> - <context-priority-classloader>false</context-priority-classloader> + xmlns="http://geronimo.apache.org/xml/ns/web/jetty" + configId="your/domain/name/j2eetutorialhello1" + parentId="org/apache/geronimo/Server" + > + <context-root>/j2eetutorialhello1</context-root> + <context-priority-classloader>false</context-priority-classloader> </web-app> +}}} + ==== Create the war file ==== -cd j2eetutorial14/examples/web/hello1/build +{{{ +$ cd j2eetutorial14/examples/web/hello1/build +$ jar -cf ../j2eehello1.war * -jar -cf ../j2eehello1.war * +}}} ==== Deploy the war ==== - cd ~/geronimo/modules/assembly/target/geronimo-1.0-SNAPSHOT - {{{ -$ java -jar bin/deployer.jar --install --module j2eetutorial14/examples/web/hello1/j2eehello1.war -org.apache.geronimo.deployment.DeploymentException: org.apache.xmlbeans.XmlException: -Invalid deployment descriptor: -[jar:file:/x:/cygwin/home/rgb/geronimo/modules/assembly/target/geronimo-1.0-SNAPSHOT/j2eehello1.war!/WEB-INF/geronimo-jetty.xml:0: -error: Element not allowed: [EMAIL PROTECTED]://geronimo.apache.org/xml/ns/web/jetty in -element [EMAIL PROTECTED]://geronimo.apache.org/xml/ns/web/jetty] -Descriptor: <xml-fragment configId="de/dreyeck/home/j2eetutorialhello1" -parentId="org/apache/geronimo/Server" -xmlns:jet="http://geronimo.apache.org/xml/ns/web/jetty"> - <jet:context-root>/j2eetutorialhello1</jet:context-root> - <jet:context-priority-classloader>false</jet:context-priority-classloader> - <jet:dependency> - <jet:uri>tools/jars/tools.jar</jet:uri> - </jet:dependency> -</xml-fragment> - at org.apache.geronimo.jetty.deployment.JettyModuleBuilder.getJettyWebApp(JettyModuleBuilder.java:197) - at org.apache.geronimo.jetty.deployment.JettyModuleBuilder.createModule(JettyModuleBuilder.java:133) - at org.apache.geronimo.jetty.deployment.JettyModuleBuilder.createModule(JettyModuleBuilder.java:96) - at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.getDeploymentPlan(EARConfigBuilder.java:118) - at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133) - at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:83) - at org.apache.geronimo.kernel.Kernel.invoke(Kernel.java:232) - at org.apache.geronimo.system.main.CommandLine.<init>(CommandLine.java:106) - at org.apache.geronimo.system.main.CommandLine.main(CommandLine.java:64) -Caused by: org.apache.xmlbeans.XmlException: Invalid deployment descriptor: -[jar:file:/x:/cygwin/home/rgb/geronimo/modules/assembly/target/geronimo-1.0-SNAPSHOT/j2eehello1.war!/WEB-INF/geronimo-jetty.xml:0: -error: Element not allowed: [EMAIL PROTECTED]://geronimo.apache.org/xml/ns/web/jetty in -element [EMAIL PROTECTED]://geronimo.apache.org/xml/ns/web/jetty] -Descriptor: <xml-fragment configId="de/dreyeck/home/j2eetutorialhello1" -parentId="org/apache/geronimo/Server" -xmlns:jet="http://geronimo.apache.org/xml/ns/web/jetty"> - <jet:context-root>/j2eetutorialhello1</jet:context-root> - <jet:context-priority-classloader>false</jet:context-priority-classloader> - <jet:dependency> - <jet:uri>tools/jars/tools.jar</jet:uri> - </jet:dependency> -</xml-fragment> - at org.apache.geronimo.schema.SchemaConversionUtils.validateDD(SchemaConversionUtils.java:445) - at org.apache.geronimo.jetty.deployment.JettyModuleBuilder.getJettyWebApp(JettyModuleBuilder.java:184) - ... 8 more +$ java -jar bin/deployer.jar --install --module x:\Sun\j2eetutorial14\examples\web\hello1\j2eehello1.war +Server URI: your/domain/name/j2eetutorialhello1 }}} -# Invalid deployment descriptor ! // ToDo: 2004-10-26 -I had a small problem here... - -org.apache.geronimo.deployment.Deployment Exception: Unable to parse web.xml - -Hmm... - -Modify the hello1/build/WEB-INF/web.xml - -<?xml version="1.0" encoding="ISO-8859-1"?> -<web-app xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" - version="2.4"> - - <!-- Welcome File List --> - <welcome-file-list> - <welcome-file>index.jsp</welcome-file> - </welcome-file-list> -</web-app> - -java -jar bin/deployer.jar --install --module j2eehello1.war +==== Run the server ==== -Solved the problem...Success! +{{{ +java -jar bin/server.jar your/domain/name/j2eetutorialhello1 -==== Run the server ==== +}}} +Point your browser to +http://localhost:8080/j2eetutorialhello1/index.jsp -java -jar bin/server.jar your/domain/Example/test -http://localhost:8080/j2eehello1/ +#--- old instructions ---> 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/