![]() |
|||||||||||||||||||
|
Practical Deployment on JBoss Application ServerIn this section you will see how the previous steps can be applied to a real world application server. You will learn how to deploy and run your openMDX EJBs in practice. To do this the JBoss Application Server was chosen because it is an open source yet production quality application server that is available to everyone for free. PrerequisitesThe lab has been deployed and verified on JBoss Application Server 3.2.2 and 3.2.3. However this does not mean that it does not run on newer or older versions of JBoss Application Server. In the following sections we will use the default configuration of JBoss Application Server to deploy and run the lab example. Simply adapt the described steps to deploy and run using the minimal, all or any other configuration if required. For convenience we have used the open source JBoss IDE plugin for EclipseT to start/stop JBoss Application Server and to deploy Enterprise JavaBeans applications on it. However this is no requirement at all. For more information on JBoss Application Server and JBoss IDE plugin for Eclipse please refer to http://www.jboss.org.
What needs to be done to run my openMDX EJBs on JBoss?This sections gives a brief overview what needs to be done to deploy and run openMDX EJBs on JBoss Application Server .
How to modify the JBoss installation to enable the execution of openMDX EJBs?
How to deploy your EAR that contains the gateways and provider EJBs?
How to write an openMDX client?
How to create a deployment configuration for your openMDX client to access the deployed gateways and provider EJBs?Basically you need to define how to access the initial JNDI context factory (protocol, host and port) and the JNDI name of the initial gateway gateway_NoOrNew. This can be done by specifying a DataproviderConnector as ResourceAdapter which uses a Dataprovider_1RemoteConnectionFactory to connect to a remote provider. By specifying the URI jnp://localhost:1099/org/openmdx/example/lab/gateway/NoOrNew you tell JBoss where to find the initial JNDI context factory (host localhost and port 1099), which protocol to use (jnp) and which JNDI entry has to be resolved (org/openmdx/example/lab/gateway/NoOrNew) to access gateway_NoOrNew. This entry name has to match the JNDI name that was specified in jboss.xml for gateway_NoOrNew (please refer to How to deploy your EAR that contains the gateways and provider EJBs? for more details).
This DataproviderConnector has references to three different ResourceAdapterStringProperty instances. They configure the values for the container-specific initial JNDI context factory class (JNDI:InitialContextFactory), the user name (BasicPassword:UserName) and the password (BasicPassword:Password) to access the context factory. JBoss uses the class org.jnp.interfaces.NamingContextFactory as initial JNDI context factory. User name and password do not have to be provided at all. Example 7-6. deployment.configuration.xml <?xml version="1.0" encoding="ISO-8859-1"?>
<org.openmdx.base.Authority name="org:openmdx:deployment1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="resource:org/openmdx/deployment1/xmi/deployment1_edit.xsd">
<_object/>
<_content>
<provider>
<org.openmdx.base.Provider qualifiedName="org:openmdx">
<_object/>
<_content>
<segment>
<org.openmdx.deployment1.Segment qualifiedName="org:openmdx:example:lab">
<_object/>
<_content>
<configuration>
<org.openmdx.deployment1.Configuration name="memory">
<_object/>
<_content>
<domain>
<org.openmdx.deployment1.Domain name="apps">
<_object/>
<_content>
<deploymentUnit>
<org.openmdx.deployment1.DeploymentUnit name="connectors">
<_object/>
<_content>
<module>
<org.openmdx.deployment1.Module name="labmodel">
<_object/>
<_content>
<resourceAdapter>
<org.openmdx.deployment1.DataproviderConnector name="connector">
<_object>
<connectionFactoryImplementation>
org.openmdx.compatibility.application.dataprovider.transport.ejb.cci.Dataprovider_1RemoteConnectionFactory
</connectionFactoryImplementation>
<uri>
<!-- define protocol, host, port and jndi name (take jndi name from jboss.xml of gateway_NoOrNew) -->
<_item>jnp://localhost:1099/org/openmdx/example/lab/gateway/NoOrNew</_item>
</uri>
<registrationId>org/openmdx/example/lab/noornew/labmodel</registrationId>
</_object>
<_content>
<property>
<org.openmdx.deployment1.ResourceAdapterStringProperty qualifiedName="JNDI:InitialContextFactory">
<_object>
<value>
<!-- class name of InitialContextFactory -->
<_item>org.jnp.interfaces.NamingContextFactory</_item>
</value>
</_object>
<_content/>
</org.openmdx.deployment1.ResourceAdapterStringProperty>
<!-- this InitialContextFactory ignores SECURITY.Principal and SECURITY.Credentials -->
<org.openmdx.deployment1.ResourceAdapterStringProperty qualifiedName="BasicPassword:UserName">
<_object>
<value>
<_item>anonymous</_item>
</value>
</_object>
<_content/>
</org.openmdx.deployment1.ResourceAdapterStringProperty>
<org.openmdx.deployment1.ResourceAdapterStringProperty qualifiedName="BasicPassword:Password">
<_object>
<value>
<_item>anonymous</_item>
</value>
</_object>
<_content/>
</org.openmdx.deployment1.ResourceAdapterStringProperty>
</property>
</_content>
</org.openmdx.deployment1.DataproviderConnector>
</resourceAdapter>
</_content>
</org.openmdx.deployment1.Module>
</module>
</_content>
</org.openmdx.deployment1.DeploymentUnit>
</deploymentUnit>
</_content>
</org.openmdx.deployment1.Domain>
</domain>
</_content>
</org.openmdx.deployment1.Configuration>
</configuration>
</_content>
</org.openmdx.deployment1.Segment>
</segment>
</_content>
</org.openmdx.base.Provider>
</provider>
</_content>
</org.openmdx.base.Authority>You can find this deployment.configuration.xml in the openmdx-example-lab/etc/org.openmdx.example.lab1.appserver.jboss/ directory. How to run the openMDX client?To run the openMDX/JBoss client using the provided ant file run.xml, follow these steps:
If you want to start an openMDX/JBoss client somewhere else, please make sure that you include the following JBoss jar files on the classpath:
How to troubleshoot openMDX EJBs?In case you have problems running your EJB, you have the following possibilities to gather information to help you:
|
||||||||||||||||||