Section |
---|
|
Column |
---|
| Include Page |
---|
| SCA Java Subproject Menu |
---|
| SCA Java Subproject Menu |
---|
|
Include Page |
---|
| Java SCA Menu New |
---|
| Java SCA Menu New |
---|
|
|
Column |
---|
|
Panel |
---|
borderColor | #C3CDA1 |
---|
bgColor | #ECF4D1 |
---|
titleBGColor | #C3CDA1 |
---|
title | Apache Tuscany Geronimo As Host Environment Guide |
---|
borderStyle | solid |
---|
| |
Note |
---|
The Tuscany Plugin for Geronimo is being developed and tested on Geronimo v2.1.4. |
Background Color |
---|
| What this guide is about |
TBD Anchor |
---|
| Why use SCA in Geronimo? |
---|
| Why use SCA in Geronimo? |
---|
|
Background Color |
---|
| Why use SCA in Geronimo? |
TBD Anchor |
---|
| Setup Environment |
---|
| Setup Environment |
---|
|
Background Color |
---|
| Setup Environment |
Installing on Geronimo Tomcat serverFollow the steps below to install the plugin on Geronimo v2.1.4 with Tomcat as the web container. - Edit <GERONIMO_HOME>\var\config\config.xml
- Add the gbean xml-fragment given in Listing-1 under "org.apache.geronimo.configs/tomcat6-deployer/2.1.4/car" module.
- Add the gbean xml-fragment given in Listing-2 under "org.apache.geronimo.configs/openejb-deployer/2.1.4/car" module.
Note |
---|
If you are starting with a fresh Geronimo Tomcat 2.1.4 server, you can replace <GERONIMO_HOME>\var\config\config.xml with config.xml available at this link. |
- Start Geronimo.
- Download tuscany-tomcat-1.0-SNAPSHOT.car from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/tuscany-tomcat/1.0-SNAPSHOT/
- Deploy the plugin using the command "<GERONIMO_HOME>\bin\deploy install-plugin tuscany-tomcat-1.0-SNAPSHOT.car". The default username/password to perform the deployment is system/manager.
Listing-1: Code Block |
---|
<gbean name="TomcatWebBuilder">
<reference name="ModuleBuilderExtensions">
<pattern>
|
|
|
Note |
---|
The Tuscany Plugin for Geronimo is being developed and tested on Geronimo v2.1.3. |
Setup the environment
Installing on Geronimo Tomcat server
Follow the steps below to install the plugin on Geronimo v2.1.3 with Tomcat as the web container.
- Edit <GERONIMO_HOME>\var\config\config.xml
- Add the gbean xml-fragment given in Listing-1 under "org.apache.geronimo.configs/tomcat6-deployer/2.1.3/car" module.
- Add the gbean xml-fragment given in Listing-2 under "org.apache.geronimo.configs/openejb-deployer/2.1.3/car" module.
Note |
---|
If you are starting with a fresh Geronimo Tomcat 2.1.3 server, you can replace <GERONIMO_HOME>\var\config\config.xml with config.xml available at this link |
- Start Geronimo.
- Download tuscany-tomcat-1.0-SNAPSHOT.car from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/tuscany-tomcat/1.0-SNAPSHOT/
- Deploy the plugin using the command "<GERONIMO_HOME>\bin\deploy install-plugin tuscany-tomcat-1.0-SNAPSHOT.car"
Listing-1:
Code Block |
---|
<gbean name="TomcatWebBuilder">
<reference name="ModuleBuilderExtensions">
<pattern>
<name>TuscanyModuleBuilderExtension</name>
</pattern>
<pattern>
<name>PersistenceUnitBuilder</name>
</pattern>
<pattern>
<name>JspModuleBuilderExtension</name>
</pattern>
<pattern>
<name>MyFacesModuleBuilderExtension</name>
</pattern>
</reference>
</gbean>
|
Listing-2:
Code Block |
---|
<gbean name="EJBBuilder">
<reference name="ModuleBuilderExtensions">
<pattern>
<name>Axis2ModuleBuilderExtension</name>
</pattern>
<pattern>
<name>AxisModuleBuilderExtension</name>
</pattern>
<pattern>
<name>CorbaModuleBuilderExtension</name>
</pattern>
<pattern>
<name>TuscanyModuleBuilderExtension</name>
</pattern>
<pattern>
<name>PersistenceUnitBuilder<<name>TuscanyModuleBuilderExtension</name>
</pattern>
<pattern>
|
| <name>CXFModuleBuilderExtension<<name>PersistenceUnitBuilder</name>
</pattern>
|
| </reference>
</gbean>
|
Installing on Geronimo Jetty server
Follow the steps below to install the plugin on Geronimo v2.1.3 with Jetty as the web container.
- Edit <GERONIMO_HOME>\var\config\config.xml
- Add the gbean xml-fragment given in Listing-3 under "org.apache.geronimo.configs/jetty6-deployer/2.1.3/car" module.
- Add the gbean xml-fragment given in Listing-2 under "org.apache.geronimo.configs/openejb-deployer/2.1.3/car" module.
Note |
---|
If you are starting with a fresh Geronimo Jetty 2.1.3 server, you can replace <GERONIMO_HOME>\var\config\config.xml with config.xml available at this link |
- Start Geronimo.
- Download tuscany-jetty-1.0-SNAPSHOT.car from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/tuscany-jetty/1.0-SNAPSHOT/
- Deploy the plugin using the command "<GERONIMO_HOME>\bin\deploy install-plugin tuscany-jetty-1.0-SNAPSHOT.car"
Listing-3:
<pattern>
<name>JspModuleBuilderExtension</name>
</pattern>
<pattern>
<name>MyFacesModuleBuilderExtension</name>
</pattern>
</reference>
</gbean>
| Listing-2: Code Block |
---|
<gbean name="EJBBuilder">
<reference name="ModuleBuilderExtensions">
<pattern>
<name>Axis2ModuleBuilderExtension</name>
</pattern>
<pattern>
<name>AxisModuleBuilderExtension</name>
</pattern>
<pattern>
<name>CorbaModuleBuilderExtension</name>
</pattern>
<pattern>
<name>TuscanyModuleBuilderExtension</name>
</pattern>
<pattern>
<name>PersistenceUnitBuilder</name>
</pattern> |
|
|
Code Block |
---|
<gbean name="JettyWebBuilder">
<reference name="ModuleBuilderExtensions"><name>TuscanyModuleBuilderExtension<<name>CXFModuleBuilderExtension</name>
</pattern>
|
| <pattern>
<name>PersistenceUnitBuilder</name>
</pattern>
<pattern>
<name>JspModuleBuilderExtension</name>
</pattern>
<pattern>
<name>MyFacesModuleBuilderExtension</name>
</pattern>
</reference>
</gbean>
- Download xbean-finder-3.6.jar from http://repo1.maven.org/maven2/org/apache/xbean/xbean-finder/3.6/xbean-finder-3.6.jar and save to <GERONIMO_HOME>\repository\org\apache\xbean\xbean-finder\3.6\ (not needed for Geronimo 2.1.5)
- Add the text in Listing-2B to <GERONIMO_HOME>\var\config\artifact-aliases.properties
Listing-2B: Code Block |
---|
org.apache.xbean/xbean-finder/3.5/jar=org.apache.xbean/xbean-finder/3.6/jar
org.apache.xbean/xbean-finder//jar=org.apache.xbean/xbean-finder/3.6/jar
|
- Download openejb-core-3.0.1.jar from this link and replace <GERONIMO_HOME>\repository\org\apache\openejb\openejb-core\3.0.1\openejb-core-3.0.1.jar. Note: This jar is patched to account for OPENEJB-1005. (not needed for Geronimo 2.1.5)
Installing on Geronimo Jetty serverFollow the steps below to install the plugin on Geronimo v2.1.4 with Jetty as the web container. - Edit <GERONIMO_HOME>\var\config\config.xml
- Add the gbean xml-fragment given in Listing-3 under "org.apache.geronimo.configs/jetty6-deployer/2.1.4/car" module.
- Add the gbean xml-fragment given in Listing-2 under "org.apache.geronimo.configs/openejb-deployer/2.1.4/car" module.
Note |
---|
If you are starting with a fresh Geronimo Jetty 2.1.4 server, you can replace <GERONIMO_HOME>\var\config\config.xml with config.xml available at this link. NEED TO UPDATE THE FILE AND LINK |
- Start Geronimo.
- Download tuscany-jetty-1.0-SNAPSHOT.car from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/tuscany-jetty/1.0-SNAPSHOT/
- Deploy the plugin using the command "<GERONIMO_HOME>\bin\deploy install-plugin tuscany-jetty-1.0-SNAPSHOT.car". The default username/password to perform the deployment is system/manager.
Listing-3: Code Block |
---|
<gbean name="JettyWebBuilder">
<reference name="ModuleBuilderExtensions">
<pattern>
<name>TuscanyModuleBuilderExtension</name>
</pattern>
<pattern>
<name>PersistenceUnitBuilder</name>
</pattern>
<pattern>
<name>JspModuleBuilderExtension</name>
</pattern>
<pattern>
<name>MyFacesModuleBuilderExtension</name>
</pattern>
</reference>
</gbean>
|
- Download xbean-finder-3.6.jar from http://repo1.maven.org/maven2/org/apache/xbean/xbean-finder/3.6/xbean-finder-3.6.jar and save to <GERONIMO_HOME>\repository\org\apache\xbean\xbean-finder\3.6\
- Add the text in Listing-2B to <GERONIMO_HOME>\var\config\artifact-aliases.properties
- Download openejb-core-3.0.1.jar from this link and replace <GERONIMO_HOME>\repository\org\apache\openejb\openejb-core\3.0.1\openejb-core-3.0.1.jar. Note: This jar is patched to account for OPENEJB-1005.
Building the plugin from source and installing the plugin Note |
---|
This section assumes that you have Subversion and Maven2 installed. |
If you want to build the plugin from source and then install the plugin in Geronimo server, follow the steps below. - Checkout the plugin source from http://svn.apache.org/repos/asf/geronimo/plugins/tuscany/trunk/
|
|
...
- Open a command window and change to the directory to which source is checked out.
- Build the plugin using the command "mvn install"
- Edit <GERONIMO_HOME>\var\config\config.xml
|
|
...
- 4 server
- Add the gbean xml-fragment given in Listing-1 under "org.apache.geronimo.configs/tomcat6-deployer/2.1.
|
|
...
- 4/car" module.
- Add the gbean xml-fragment given in Listing-2 under "org.apache.geronimo.configs/openejb-deployer/2.1.
|
|
...
...
- 4 server
- Add the gbean xml-fragment given in Listing-3 under "org.apache.geronimo.configs/jetty6-deployer/2.1.
|
|
...
- 4/car" module.
- Add the gbean xml-fragment given in Listing-2 under "org.apache.geronimo.configs/openejb-deployer/2.1.
|
|
...
- Start the Geronimo server.
- Access http://localhost:8080/console and navigate to "Plugins" portlet.
- Click "Add Repository" link under Install Geronimo Plugins section.
- Enter the URL of your local maven2 repository and click "Add Repository" button.
- For example, if your local maven2 repository directory is D:\m2repo use the URL file:/D:/m2repo
- In the "Repository" dropdown list, select your local maven2 repository added in the previous step and click "Show Plugins in selected repository" button.
- Select "Geronimo :: Tuscany Plugin for Geronimo Tomcat" ("Geronimo :: Tuscany Plugin for Geronimo Jetty" in case of Geronimo Jetty server) and click Install.
- In the plugin information page, click Install to complete the plugin installation.
Note |
---|
If your plugin installation failed in an earlier attempt, make sure that "System Modules" portlet does not list "org.apache.geronimo.plugins/tuscany-tomcat/1.0-SNAPSHOT/car" or "org.apache.geronimo.plugins/tuscany-jetty/1.0-SNAPSHOT/car" configuration. If there is one such entry, uninstall it by clicking on "Uninstall" link. |
Note |
---|
If you want latest plugin and tuscany dependency jars to be installed during plugin installation, make sure you delete <GERONIMO_HOME>/repository/org/apache/geronimo/plugins/geronimo-tuscany* folders and <GERONIMO_HOME>/repository/org/apache/tuscany/sca folder are deleted before you proceed with the installation. |
|
|
Running sample applications
...
Anchor |
---|
| Sample Applications |
---|
| Sample Applications |
---|
|
Background Color |
---|
| Sample Applications |
Anchor |
---|
| Deploy helloworld Application |
---|
| Deploy helloworld Application |
---|
|
Background Color |
---|
| Deploy helloworld Application |
We have a sample sca contribution (helloworld-service) that has three Helloworld service components. The JSP, Servlet and EJB samples access the services provided by this contribution. Follow the steps below to deploy the helloworld-service. - Download helloworld-service-1.0-SNAPSHOT.jar from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-service/1.0-SNAPSHOT/
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- In the Archive field, select helloworld-service-1.0-SNAPSHOT.jar downloaded above.
- Click Install to install the sca contribution.
|
|
...
...
...
Anchor |
---|
| Access helloworld From Servlet |
---|
| Access helloworld From Servlet |
---|
|
Background Color |
---|
| Access helloworld From |
|
|
...
...
...
...
...
- -web.war downloaded above.
- Click Install to install the web application.
- Access http://localhost:8080/helloworld-web/
Access an SCA service from an MDBThe sample EJB application helloworld-mdb-ejb has a message-driven-bean HelloworldMDB that listens on a JMS queue named NamesQueue. HelloworldMDB has @Reference, @Property, @Context and @ComponentName annotations. The references are wired in ejb-jar.composite. The annotated fields are injected at runtime. The sample web application helloworld-mdb-web has a HelloworldMdbServlet that sends the name entered in the webpage as a message to the NamesQueue. Output from HelloworldMDB can be seen in Geronimo console window. Follow the steps below to run the sample application. - Download jms-resources.xml
- Download helloworld-mdb-ejb-1.0-SNAPSHOT.jar from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-mdb-ejb/1.0-SNAPSHOT/
|
|
...
...
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- In the Archive field, select <GERONIMO_HOME>\repository\org\apache\geronimo\modules\geronimo-activemq-ra\2.1.
|
|
...
- 4\geronimo-activemq-ra-2.1.
|
|
...
- 4.rar
- In the Plan field, select jms-resources.xml downloaded above.
- Click Install to complete creating JMS resources.
- In the Archive field, select helloworld-mdb-ejb-1.0-SNAPSHOT.jar downloaded above.
- Click Install to install the ejb application.
- In the Archive field, select helloworld-mdb-web-1.0-SNAPSHOT.war downloaded above.
- Click Install to install the web application.
- Access http://localhost:8080/helloworld-mdb-web/
Access an SCA service from a Filter*Note: explain why this is useful from user's prespective. Would users do this? The sample web application helloworld-filter has a filter HelloworldFilter with @Reference, @Property, @Context and @ComponentName annotations. The references are wired in web.composite. The annotated fields are injected at runtime. Follow the steps below to run the sample application. - Download helloworld-filter-1.0-SNAPSHOT.war from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-filter/1.0-SNAPSHOT/
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- In the Archive field, select helloworld-filter-1.0-SNAPSHOT.war downloaded above.
- Click Install to install the web application.
- Access http://localhost:8080/helloworld-filter/
Access an SCA service from an Event Listener*Note: explain why users would od this?* The sample web application helloworld-listener has a ServletContextListener, a ServletContextAttributeListener, a ServletRequestListener, a ServletRequestAttributeListener, an HttpSessionListener, and an HttpSessionAttributeListener with @Reference, @Property, @Context and @ComponentName annotations. The references are wired in web.composite. The annotated fields are injected at runtime. Follow the steps below to run the sample application. - Download helloworld-listener-1.0-SNAPSHOT.war from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-listener/1.0-SNAPSHOT/
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- In the Archive field, select helloworld-listener-1.0-SNAPSHOT.war downloaded above.
- Click Install to install the web application.
- Access http://localhost:8080/helloworld-listener/
Access an SCA service from a JSF managed beanThe sample JSF application helloworld-jsf has a controller class HelloWorldController with @Reference, @Property, @Context and @ComponentName annotations. The references are wired in web.composite. The annotated fields are injected at runtime. Follow the steps below to run the sample application. - Download helloworld-jsf-1.0-SNAPSHOT.war from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo
|
|
...
...
...
- .war downloaded above.
- Click Install to install the web application.
- Access http
|
|
...
- ://localhost:8080/helloworld-jsf/
A sample that demonstrates a mix of the above features – IN PROGRESSThis sample demonstrates the following features: - An SCA reference in a JSP is wired to an (external) webservice using binding.ws
- An SCA reference in a servlet is injected with proxy to a service provided by a regular SCA component which is within the web application.
- References in the regular SCA component are wired to other components in the SCA domain and to external webservice using binding.ws
- SCA references injected into a session bean.
|
|
...