Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

WebAppJDBCAccessAnnotations.war includes a Servlet, a JSP and a JSPbasic web.xml. The following excerpt shows the annotation part the wizard has identified and will likely be prompting for additional information while deploying the application.

...

WebAppEjbAccessAnnotations.war includes a Servlet, a JSP and a JSPbasic web.xml. The following excerpt shows the annotation part the wizard has identified and will likely be prompting for additional information while deploying the application.

...

WebAppJMSAccessAnnotations.war includes the two Servlets mentioned above, a JSP and a JSPbasic web.xml. The following excerpts show the annotation part the wizard has identified and will likely be prompting for additional information while deploying the application.

...

WebAppEjbAccess.war includes a Servlet and the web.xml. In the annotations example we provided a servlet as well but for this sample all the processing is done directly by the JSP. The following sample illustrates the web.xml, in this example the Plan Creator wizard will look into the <resource<ejb-ref> section.

Code Block
xml
xml
borderStylesolid
titleweb.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5"
	xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
	<ejb-ref>
		<ejb-ref-name>ejb/Converter</ejb-ref-name>
		<ejb-ref-type>Session</ejb-ref-type>
		<remote>myPackage.Converter</remote>
	</ejb-ref>
</web-app>

...

Section
Column
width50%
Code Block
xml
xml
borderStylesolid
titleGenerated deployment plan without Annotations
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
        <dep:moduleId>
            <dep:groupId>default</dep:groupId>
            <dep:artifactId>WebAppEjbAccess</dep:artifactId>
            <dep:version>1.0</dep:version>
            <dep:type>war</dep:type>
        </dep:moduleId>
        <dep:dependencies>
            <dep:dependency>
                <dep:groupId>default</dep:groupId>
                <dep:artifactId>CurrencyConverterEJB</dep:artifactId>
                <dep:version>1199912901187</dep:version>
                <dep:type>jar</dep:type>
            </dep:dependency>
        </dep:dependencies>
    </dep:environment>
    <context-root>WebAppEjbAccess</context-root>
    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
        <nam:ref-name>ejb/Converter</nam:ref-name>
        <nam:pattern>
            <nam:groupId>default</nam:groupId>
            <nam:artifactId>CurrencyConverterEJB</nam:artifactId>
            <nam:version>1199912901187</nam:version>
            <nam:name>ConverterBean</nam:name>
        </nam:pattern>
    </nam:ejb-ref>
</web-app>
Column
width50%
Code Block
xml
xml
borderStylesolid
titleGenerated deployment plan with Annotations
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
        <dep:moduleId>
            <dep:groupId>default</dep:groupId>
            <dep:artifactId>WebAppEjbAccessAnnotations</dep:artifactId>
            <dep:version>1.0</dep:version>
            <dep:type>war</dep:type>
        </dep:moduleId>
        <dep:dependencies>
            <dep:dependency>
                <dep:groupId>default</dep:groupId>
                <dep:artifactId>CurrencyConverterEJB</dep:artifactId>
                <dep:version>1199912901187</dep:version>
                <dep:type>jar</dep:type>
            </dep:dependency>
        </dep:dependencies>
    </dep:environment>
    <context-root>WebAppEjbAccessAnnotations</context-root>
    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
        <nam:ref-name>ejb/Converter</nam:ref-name>
        <nam:pattern>
            <nam:groupId>default</nam:groupId>
            <nam:artifactId>CurrencyConverterEJB</nam:artifactId>
            <nam:version>1199912901187</nam:version>
            <nam:name>ConverterBean</nam:name>
        </nam:pattern>
    </nam:ejb-ref>
</web-app>

JMS access
Anchor
jms2
jms2

Once again we are basing this sample application from the one we used in the annotations section. There is a Producer servlet that sends 5 messages to a JMS queue and a Consumer servlet that synchronously receives messages from the same queue.

The noAnnotations-TestJMSAccess.zip file provides the WebAppJMSAccess.war which is the WAR we will be deploying and a sample of the generated deployment plan generatedPlan.xml. Download and extract the zip file to a directory of your convenience.

WebAppJMSAccess.war includes the two Servlets mentioned above, a JSP and the web.xml. The following sample illustrates the web.xml, in this example the Plan Creator wizard will look into the <resource-ref>,<message-destination-ref> and <message-destination> sections.

Code Block
xml
xml
borderStylesolid
titleweb.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" 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">
	<display-name>
	WebAppJMSAccess</display-name>
	<servlet>
		<description>
		</description>
		<display-name>
		ProducerServlet</display-name>
		<servlet-name>ProducerServlet</servlet-name>
		<servlet-class>
		com.apache.geronimo.samples.webAppJMSacess.ProducerServlet</servlet-class>
	</servlet>
	<servlet>
		<description>
		</description>
		<display-name>
		ConsumerServlet</display-name>
		<servlet-name>ConsumerServlet</servlet-name>
		<servlet-class>
		com.apache.geronimo.samples.webAppJMSacess.ConsumerServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>ProducerServlet</servlet-name>
		<url-pattern>/producer</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>ConsumerServlet</servlet-name>
		<url-pattern>/consumer</url-pattern>
	</servlet-mapping>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>
	<resource-ref>
		<res-ref-name>jms/TestConnectionFactory</res-ref-name>
		<res-type>javax.jms.ConnectionFactory</res-type>
		<res-auth>Container</res-auth>
		<res-sharing-scope>Shareable</res-sharing-scope>
	</resource-ref>
	<message-destination-ref>
		<message-destination-ref-name>jms/TestQueue</message-destination-ref-name>
		<message-destination-type>javax.jms.Queue</message-destination-type>
		<message-destination-usage>ConsumesProduces</message-destination-usage>
		<message-destination-link>TestQueue</message-destination-link>
	</message-destination-ref>
	<message-destination>
		<message-destination-name>TestQueue</message-destination-name>
	</message-destination>
</web-app>

With the server up and running access the Geronimo Administration Console with a web browser and click on Plan Creator on the left menu. Browse to the WebAppJMSAccess.war you just extracted and click on Configure. The subsequent configuration pages are nearly identical to what we described in the Sample with annotations section so we will skip the step-by-steps details. The end result is the same, the Plan Creator wizard has generated the deployment plan directly from the provided web.xml.

Once again we are providing both generated deployment plans side-by-side to facilitate comparison. These two sample applications are slightly different so you can see some additional variations in the generated deployment plan.

Section
Column
width50%
Code Block
xml
xml
borderStylesolid
titleGenerated deployment plan without Annotations

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
        <dep:moduleId>
            <dep:groupId>default</dep:groupId>
            <dep:artifactId>WebAppJMSAccess</dep:artifactId>
            <dep:version>1.0</dep:version>
            <dep:type>war</dep:type>
        </dep:moduleId>
        <dep:dependencies>
            <dep:dependency>
                <dep:groupId>org.apache.geronimo.configs</dep:groupId>
                <dep:artifactId>activemq-ra</dep:artifactId>
                <dep:version>2.1-SNAPSHOT</dep:version>
                <dep:type>car</dep:type>
            </dep:dependency>
        </dep:dependencies>
    </dep:environment>
    <context-root>WebAppJMSAccess</context-root>
    <nam:resource-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
        <nam:ref-name>jms/TestConnectionFactory</nam:ref-name>
        <nam:pattern>
            <nam:groupId>org.apache.geronimo.configs</nam:groupId>
            <nam:artifactId>activemq-ra</nam:artifactId>
            <nam:version>2.1-SNAPSHOT</nam:version>
            <nam:name>DefaultActiveMQConnectionFactory</nam:name>
        </nam:pattern>
    </nam:resource-ref>
    <nam:message-destination xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
        <nam:message-destination-name>TestQueue</nam:message-destination-name>
        <nam:admin-object-link>MDBTransferBeanOutQueue</nam:admin-object-link>
    </nam:message-destination>
</web-app>
Column
width50%
Code Block
xml
xml
borderStylesolid
titleGenerated deployment plan with Annotations

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
        <dep:moduleId>
            <dep:groupId>default</dep:groupId>
            <dep:artifactId>WebAppJMSAccessAnnotations</dep:artifactId>
            <dep:version>1.0</dep:version>
            <dep:type>war</dep:type>
        </dep:moduleId>
        <dep:dependencies>
            <dep:dependency>
                <dep:groupId>org.apache.geronimo.configs</dep:groupId>
                <dep:artifactId>activemq-ra</dep:artifactId>
                <dep:version>2.1-SNAPSHOT</dep:version>
                <dep:type>car</dep:type>
            </dep:dependency>
        </dep:dependencies>
    </dep:environment>
    <context-root>WebAppJMSAccessAnnotations</context-root>
    <nam:resource-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
        <nam:ref-name>jms/TestConnectionFactory</nam:ref-name>
        <nam:pattern>
            <nam:groupId>org.apache.geronimo.configs</nam:groupId>
            <nam:artifactId>activemq-ra</nam:artifactId>
            <nam:version>2.1-SNAPSHOT</nam:version>
            <nam:name>DefaultActiveMQConnectionFactory</nam:name>
        </nam:pattern>
    </nam:resource-ref>
    <nam:resource-env-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
        <nam:ref-name>jms/TestQueue</nam:ref-name>
        <nam:pattern>
            <nam:groupId>org.apache.geronimo.configs</nam:groupId>
            <nam:artifactId>activemq-ra</nam:artifactId>
            <nam:version>2.1-SNAPSHOT</nam:version>
            <nam:name>MDBTransferBeanOutQueue</nam:name>
        </nam:pattern>
    </nam:resource-env-ref>
</web-app>

Security configuration
Anchor
security2
security2

...