Unresolved references exist in JBoss MetaData - jboss

I am getting following warning when starting Jboss 6.
WARN [MappedReferenceMetaDataResolverDeployer] Unresolved references exist in JBossMetaData:
[myEJB.jar#GenDriver:MessageDestinationReferenceMetaData{name=queue/generator,type=javax.jms.Queue,link=null,ignore-dependecy=false,jndi-name=null,resolvoed-jndi-name=null,usage=null}]
ejb-jar.xml entries related to this are:
<session>
<ejb-name>GeneratorBean</ejb-name>
<ejb-classgen.bean.GeneratorBean</ejb-class>
<resource-ref>
<res-ref-name>jms/JmsXA</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
</resource-ref>
<message-destination-ref>
<message-destination-ref-name>queue/generator</message-destination-ref-name>
<message-destination-type>javax.jms.Queue</message-destination-type>
</message-destination-ref>
</session>
<message-driven>
<ejb-name>GenDriver</ejb-name>
<ejb-class>gen.bean.GenDriver</ejb-class>
<transaction-type>Container</transaction-type>
<message-destination-type>javax.jms.Queue</message-destination-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>user</activation-config-property-name>
<activation-config-property-value>gen</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>password</activation-config-property-name>
<activation-config-property-value>gen</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>maxSession</activation-config-property-name>
<activation-config-property-value>1</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>dLQJNDIName</activation-config-property-name>
<activation-config-property-value>java:/queue/generatorDLQ</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>dLQUser</activation-config-property-name>
<activation-config-property-value>gen</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>dLQPassword</activation-config-property-name>
<activation-config-property-value>gen</activation-config-property-value>
</activation-config-property>
</activation-config>
<resource-ref>
<res-ref-name>jms/JmsXA</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
</resource-ref>
<message-destination-ref>
<message-destination-ref-name>queue/generator</message-destination-ref-name>
<message-destination-type>javax.jms.Queue</message-destination-type>
</message-destination-ref>
</message-driven>
Anybody please suggest what is causing this warning?

This warning occurs when a Bean is using other bean which not deployed till. for example if you are having two beans A and B and you have provided ref of Bean B in Bean A. So when Jboss try to deploy Bean A it searches for Bean B and if Bean B is not found it shows this warning.
You can Ignore this warning. As when the deployment is complete and actual call to Bean A is placed it will again search for Bean B.

Related

Wildfly 12 infinispan cache lookup is not working

I'm migration from wildfly 10 to wildfly 12. I have created local cache same as configured in wildfly 10.
standalone-full.xml configuration:
<cache-container name="DataCache" default-cache="modelcache" statistics-enabled="false">
<local-cache name="modelcache" statistics-enabled="false"/>
</cache-container>
Lookup code in singleton ejb annotated with #startup:
#Resource(lookup = "java:jboss/infinispan/container/DataCache")
private CacheContainer Container;
#PostConstruct
public void init() {
Container.start();
modelCache = Container.getCache("modelcache");
}
I'm getting the below exception while deploying file
Caused by:
org.infinispan.commons.CacheConfigurationException: ISPN000436: Cache 'modelcache' has been requested, but no cache configuration exists
with that name and no default cache has been set for this container
How to fix this?
Put
<resource-ref>
<res-ref-name>infinispan/DataCache</res-ref-name>
<lookup-name>java:jboss/infinispan/cache/DataCache/modelcache</lookup-name>
</resource-ref>
in jboss-web.xml. When requesting the cache do it like this (note that the name annotation property is used to specify the resource):
#Resource(name = "infinispan/DataCache")
private Cache<K, V> cache;
See this thread for more details: https://developer.jboss.org/thread/277425
Put the following entry in your project descriptor file (web.xml, ejb-jar.xml, etc)
<resource-ref>
<res-ref-name>infinispan/DataCache</res-ref-name>
<lookup-name>java:jboss/infinispan/container/DataCache</lookup-name>
</resource-ref>
For wildfly 10 you can lookup your infinispan cache or cache container in the following way
You need to define your cache in standalone-ha.xml(High availability) under the following subsystem
<cache-container name="myCacheContainer" default-cache="myCache" module="org.wildfly.clustering.ejb.infinispan">
<transport lock-timeout="60000"/>
<replicated-cache name="myCache">
<expiration lifespan="86400000" max-idle="3600000"/>
</replicated-cache>
</cache-container>
Once you have defined the cache you can lookup either the cache or the container.
2.a To lookup the cache you should setup a resource ref element in your project
descriptor file i.e (web.xml,jboss-web.xml etc.)
infinispan/myCache
java:jboss/infinispan/cache/myCacheContainer/myCache
2.b If you want to lookup cache container instead you also need to define configuration lookup in your project descriptor. So resource ref looks like this
<resource-ref>
infinispan/myCacheContainer
org.infinispan.manager.CacheContainer
java:jboss/infinispan/container/myCacheContainer
infinispan/myCache-config
org.infinispan.configuration.cache.Configuration
java:jboss/infinispan/configuration/myCacheContainer/default
Now if using spring you can do a JNDI lookup for cache like this
<jee:jndi-lookup id="myCache"
jndi-name="infinispan/myCache" />
3.a Or you can lookup the container like this
<jee:jndi-lookup id="myCacheContainer"
jndi-name="infinispan/myCacheContainer" />
Now you can inject the cache like the following
#Resource(name="myCache")
private Cache cache;
4.a You can inject the container like the following
#Resource(name="myCacheContainer")
private CacheContainer cacheContainer;

JBOSS Migration AS6 to EAP 7 404 Error

This question is Not Answered.(Mark as assumed answered)
Andy Gowdy
Newbie
Andy Gowdy 31-Mar-2017 06:56
HI
I am having difficulty referencing an ear file after I have deployed it in EAP 7. I have no deployment errors but when I try to access the the ear /beans through the URL I get a 404 error. In the now deprecated JBOSS.xml the URI was configured as shown. Any help would be much appreciated. Many Thanks Andy
<jboss>
<enterprise-beans>
<session>
<ejb-name>HousingFacadeEJB</ejb-name>
<jndi-name>HousingFacadeEJB</jndi-name>
<local-jndi-name>LocalHousingFacadeEJB</local-jndi-name>
<call-by-value>false</call-by-value>
<!-- <configuration-name>Facade</configuration-name> -->
<clustered>false</clustered>
<port-component>
<port-component-name>HousingFacade</port-component-name>
<port-component-uri>HousingFacade/HousingFacadeEJB
</port-component-uri>
</port-component>
</session>
</enterprise-beans>
<container-configurations>
<container-configuration extends="Standard Stateless SessionBean">
<container-name>HousingFacade</container-name>
<container-pool-conf>
<MinimumSize>50</MinimumSize>
<MaximumSize>150</MaximumSize>
</container-pool-conf>
</container-configuration>
</container-configurations>
</jboss>
----------------------------------------------------------
I have replaced this with a JBOSS-EJB3.xml
<enterprise-beans>
<session>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<home>com.comino.cxm.housingfacade.HousingFacadeHome</home>
<remote>com.comino.cxm.housingfacade.HousingFacade</remote>
<local-home>com.comino.cxm.housingfacade.LocalHousingFacadeHome</local-home>
<local>com.comino.cxm.housingfacade.LocalHousingFacade</local>
<ejb-class>com.comino.cxm.housingfacade.HousingFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>UHDSJNDINAME</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>java:/UHTLIVE_2</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
My ejb-jar.xml
<jboss:ejb-jar>
<enterprise-beans>
<session>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<home>com.comino.cxm.housingfacade.HousingFacadeHome</home>
<remote>com.comino.cxm.housingfacade.HousingFacade</remote>
<local-home>com.comino.cxm.housingfacade.LocalHousingFacadeHome</local-home>
<local>com.comino.cxm.housingfacade.LocalHousingFacade</local>
<ejb-class>com.comino.cxm.housingfacade.HousingFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>UHDSJNDINAME</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>java:/UHTLIVE_2</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</jboss:ejb-jar>
JBOSS Server log extract.. I have redacted the connection addresses.
----------------------------REQUEST---------------------------
URI=/HousingFacade2_Live/HousingFacadeEJB2_Live
characterEncoding=null
contentLength=1304
contentType=[text/xml; charset=utf-8]
header=Connection=Keep-Alive
header=SOAPAction=""
header=Cache-Control=no-cache
header=Content-Type=text/xml; charset=utf-8
header=Content-Length=1304
header=User-Agent=W2
header=Host=**************
locale=[]
method=POST
protocol=HTTP/1.1
queryString=
remoteAddr=*************
remoteHost=************
scheme=http
host=*******************
serverPort=8080
--------------------------RESPONSE--------------------------
contentLength=74
contentType=text/html
header=Connection=keep-alive
header=X-Powered-By=Undertow/1
header=Server=JBoss-EAP/7
header=Content-Length=74
header=Content-Type=text/html
header=Date=Fri, 31 Mar 2017 10:31:43 GMT
status=404
==============================================================
There are migration guide available, below are the two links where you can find the configuration how to migrate EJB application to JBoss EAP 7;
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/migration_guide/
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/developing_ejb_applications/

Error Injecting the JPA Entity Manager in WebSphere Liberty

I have inherited a legacy application that initially was built with WebSphere 6.1 and then was migrated to WebSphere 8.0 running with JPA 2.0 and openJPA without issues. We are migrating to WebSphere Liberty for strategic reasons. We first tested on WebSphere Classic 8.5.5.8 and JPA and the entity manger has no issues there. However, on Liberty 8.5.5.8 I get the following exception:
javax.ejb.EJBException: The java:comp/env/com.xxx.xxxx.service.CHServiceBean/em reference of type javax.persistence.EntityManager for the CHServiceBean component in the CHServiceEJB.jar module of the CHServiceEAR application cannot be resolved.
at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject(InjectionBinding.java:1493)
.....
[err] Caused by:
[err] javax.ejb.EJBException: The java:comp/env/com.xxxx.xxxx.service.CHServiceBean/em reference of type javax.persistence.EntityManager for the CHServiceBean component in the CHServiceEJB.jar module of the CHServiceEAR application cannot be resolved.
[err] at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject(InjectionBinding.java:1493)
[err] at [internal classes]
I had another EJB injection issue that was resolved through configuration of the binding files, however I am unable to resolve this issue. I have two applications that each have their own EAR files but both run in the same Liberty JVM. Application A runs the front end/UI logic while Application B is the back-end EJB / JPA interfaces. In the project facets the JPA application is set to 2.0 (I wanted 2.1 but based on another thread JPA 2.0 and EJB 3.1 are as high as I can go at the moment...See my other thread topic here -->Eclipse Juno and JPA 2.1 support).
Here is my server.xml file:
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>javaee-7.0</feature>
<feature>localConnector-1.0</feature>
<feature>distributedMap-1.0</feature>
<feature>adminCenter-1.0</feature>
<feature>ssl-1.0</feature>
<feature>usr:webCacheMonitor-1.0</feature>
<feature>webCache-1.0</feature>
<feature>ldapRegistry-3.0</feature>
</featureManager>
<!-- Admin Center Config Start -->
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint host="*" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
<keyStore id="defaultKeyStore" password="xxxxxx"/>
<basicRegistry id="basic">
<user name="admin" password="xxxxx"/>
<user name="nonadmin" password="xxxxxx"/>
</basicRegistry>
<administrator-role>
<user>admin</user>
</administrator-role>
<remoteFileAccess>
<writeDir>${server.config.dir}</writeDir>
</remoteFileAccess>
<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>
<applicationMonitor updateTrigger="mbean"/>
<enterpriseApplication id="CHNewCHRDMEAR" location="CHNewCHRDMEAR.ear" name="CHNewCHRDMEAR">
<application-bnd>
<security-role name="AllAuthenticated">
<special-subject type="ALL_AUTHENTICATED_USERS"/>
</security-role>
</application-bnd>
</enterpriseApplication>
<enterpriseApplication id="CHServiceEAR" location="CHServiceEAR.ear" name="CHServiceEAR"/>
<!-- JAAS Authentication Alias (Global) Config -->
<authData id="dbUser" password="{xor}MzhmJT06ajI=" user="dbUser"/>
<!-- JDBC Driver and Datasource Config -->
<library id="DB2JCC4Lib">
<fileset dir="C:\DB2\Jars" includes="db2jcc4.jar db2jcc_license_cisuz.jar"/>
</library>
<dataSource containerAuthDataRef="dbUser" id="CHTEST2" jndiName="jdbc/nextgen" type="javax.sql.XADataSource">
<jdbcDriver libraryRef="DB2JCC4Lib"/>
<properties.db2.jcc databaseName="CHTEST2" password="{xor}MzhmJT06ajI=" portNumber="60112" serverName="server.com" sslConnection="false" user="dbUser"/>
<containerAuthData password="{xor}MzhmJT06ajI=" user="dbUser"/>
</dataSource>
<dataSource id="CHTEST2_RO" jndiName="jdbc/nextgen_RO" type="javax.sql.XADataSource">
<jdbcDriver libraryRef="DB2JCC4Lib"/>
<properties.db2.jcc databaseName="CHTEST2" password="{xor}MzhmJT06ajI=" portNumber="60112" serverName="server.com" sslConnection="false" user="dbUser"/>
<containerAuthData password="{xor}MzhmJT06ajI=" user="dbUser"/>
</dataSource>
<!-- More in file, but no included...-->
</server>
Here is my persistence.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="CHService" transaction-type="JTA">
<jta-data-source>jdbc/nextgen</jta-data-source>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="openjpa.jdbc.TransactionIsolation" value="read-uncommitted" /></properties></persistence-unit>
<persistence-unit name="CHServiceRO" transaction-type="JTA">
<jta-data-source>jdbc/nextgen_RO</jta-data-source>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="openjpa.jdbc.TransactionIsolation" value="read-uncommitted" />
</properties>
</persistence-unit>
</persistence>
I *believe that we are relying solely on injection to get the context for JPA jndi lookups but that is because I don't see in our code any call to an initial context for any JPA specific JNDI names. Below are my two anotated session beans from the EJB project:
a. The CHService Bean:
#Stateless
#TransactionManagement(TransactionManagementType.CONTAINER)
#Local({ CHServiceLocal.class })
#Remote({ CHServiceRemote.class })
#Interceptors({ CHServiceLog.class })
#Resources({
#Resource(name = "jdbc/nextgen", mappedName = "jdbc/nextgen", authenticationType = AuthenticationType.APPLICATION, shareable = true, type = javax.sql.DataSource.class),
#Resource(name = "services/cache/CHBluepages", mappedName = "services/cache/CHBluepages", authenticationType = AuthenticationType.APPLICATION, shareable = true, type = com.ibm.websphere.cache.DistributedMap.class),
#Resource(name = "services/cache/CHGeneric", mappedName = "services/cache/CHGeneric", authenticationType = AuthenticationType.APPLICATION, shareable = true, type = com.ibm.websphere.cache.DistributedMap.class) })
public class CHServiceBean extends AbstractCHServiceImpl implements
CHService {
#PersistenceContext(unitName = "CHService")
private EntityManager em;
b. The CHServiceRO bean:
#Stateless
#TransactionManagement(TransactionManagementType.CONTAINER)
#Local({CHServiceLocalRO.class})
#Remote({CHServiceRemoteRO.class})
#Interceptors({CHServiceROLog.class})
#Resources({
#Resource(name="jdbc/nextgen_RO", mappedName="jdbc/nextgen_RO", authenticationType=AuthenticationType.APPLICATION, shareable=true, type=javax.sql.DataSource.class),
#Resource(name="jdbc/nextgen", mappedName="jdbc/nextgen", authenticationType=AuthenticationType.APPLICATION, shareable=true, type=javax.sql.DataSource.class),
#Resource(name="services/cache/CHBluepages", mappedName="services/cache/CHBluepages", authenticationType=AuthenticationType.APPLICATION, shareable=true, type=com.ibm.websphere.cache.DistributedMap.class),
#Resource(name="services/cache/CHGeneric", mappedName="services/cache/CHGeneric", authenticationType=AuthenticationType.APPLICATION, shareable=true, type=com.ibm.websphere.cache.DistributedMap.class)
})
public class CHServiceBeanRO implements CHServiceRO {
#PersistenceContext (unitName="CHServiceRO") private EntityManager em;
private CHServiceBase ch;
#PostConstruct
private void init() { ch = new CHServiceBase(em); }
Here is a snippet from the Web.xml of the front-end application calling the JPA application:
<resource-ref id="ResourceRef_1436377001246">
<res-ref-name>jdbc/nextgen</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref id="ResourceRef_1436377001247">
<res-ref-name>jdbc/nextgen_RO</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
Based on the post from Gas on this topic: java.lang.ClassCastException,Getting Entitymanager Via JNDI Lookup
I also tried updating the web.xml with the following entries:
<persistence-unit-ref>
<persistence-unit-ref-name>chJPA</persistence-unit-ref-name>
<persistence-unit-name>CHService</persistence-unit-name>
</persistence-unit-ref>
<persistence-unit-ref>
<persistence-unit-ref-name>chJPA_RO</persistence-unit-ref-name>
<persistence-unit-name>CHServiceRO</persistence-unit-name>
</persistence-unit-ref>
and the Bean code with:
#PersistenceContext(name = "chJPA", unitName = "CHService")
and
#PersistenceContext (name="chJPA_RO", unitName="CHServiceRO")
Got the same error just with a different jndi name, ie The java:comp/env/chJPA reference of type javax.persistence.EntityManager for the CHServiceBean com.......etc etc.
Lastly, per this post: Error while accessing EntityManager - openjpa - WAS liberty profile
It seems that maybe I can't have the full JavaEE 7 feature and run JPA 2.0? Please advise!
As in the post you are referring to - you cannot have <feature>javaee-7.0</feature> together with JPA 2.0, as it enables 2.1, thats why you have conflicts.
So you have 2 options:
either use Java EE7 and JPA 2.1
or just enable required Java EE 6 features and then use JPA 2.0
Since you are migrating from WAS 8.0, which doesn't support Java EE7 for now, easier choice might be to use the second option.
So try to remove javee-7.0 feature, and add ejbLite-3.1 and jpa-2.0 and whatever you need more.
You are correct that you cannot have javaee-7.0 and the JPA 2.0 feature, as it enables the JPA 2.1 feature. So the answer Gas gave is correct.
I just wanted to point out since you said that you do want to go to JPA 2.1 eventually, once you work out your eclipse issues, that you should use the WebSphere Application Server Migration Toolkit to identify application changes needed when migrating from JPA 2.0 to JPA 2.1. The Liberty JPA 2.0 implementation is built on OpenJPA, whereas the JPA 2.1 implemtation is built on EclipseLink. The migration toolkit is downloadable for free on wasdev: https://developer.ibm.com/wasdev/downloads/#asset/tools-WebSphere_Application_Server_Migration_Toolkit

wildfly-8.1.0.Final Failed instantiate InitialContextFactory

im getting following Error
**ERROR:**
2014-10-07 16:33:46,692 ERROR [stderr] (default task-1) javax.naming.NamingException:
JBAS011843: **Failed instantiate** **InitialContextFactory
org.jboss.naming.remote.client.InitialContextFactory** from classloader
ModuleClassLoader for Module "deployment.wildfly8.1.ear.wildfly8.1-war.war:main"
from Service Module Loader [Root exception is java.lang.ClassNotFoundException:
org.jboss.naming.remote.client.InitialContextFactory from [Module
"deployment.wildfly8.1.ear.wildfly8.1-war.war:main" from Service Module Loader]]
Code:
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "127.0.0.1");
//OR env.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "password");
context = new InitialContext(env);
Try adding a jboss-deployment-structure.xml to the META-INF of the top level .ear file. In the jboss-deployment-structure.xml add a dependency for org.jboss.remote-naming and org.jboss.ejb-client.
Here's some documentation on jboss-deployment-strucure.xml: Class Loading in WildFly
Other useful links:
EJB invocations from a remote server instance
ejb-multi-server: EJB Communication Across Servers
You'll need to include in your war/WEB-INF/lib directory all dependencies of a remote client:
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jms-client-bom</artifactId>
<version>${version.wildfly}</version>
<type>pom</type>
</dependency>

How do specify clientId and subscriptionName for EJB3 message driven bean durable subscription without hard coding the values?

I have a server running JBoss4.2.1 containing a JMS Topic. I also have multiple terminals, each running their own JBoss with an EJB3 message driven bean that need to subscribe to the topic using durable subscriptions. Since each subscription needs to specify a unique clientId and subscriptionName I can't hard code the values in the ActivationConfigProperty annotations and I can't specify the values in the deployment descriptor files.
So, the question is how do I specify these values? Do I do it in JBoss configuration files?
Please provide a complete sample configuration if possible.
Thanks.
This can be done by using a combination of entries in the ejb-jar.xml configuration file and supplying the values as parameters to the JBoss startup command.
META-INF/ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
version="3.0"
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/ejb-jar_3_0.xsd">
<enterprise-beans>
<message-driven>
<ejb-name>MyMsgDrivenBeanMDB</ejb-name>
<ejb-class>com.mdb.MyMsgDrivenBeanMDB</ejb-class>
<activation-config>
<activation-config-property>
<activation-config-property-name>clientId</activation-config-property-name>
<activation-config-property-value>${client.id}</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>subscriptionName</activation-config-property-name>
<activation-config-property-value>${subscription.name}</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>reconnectInterval</activation-config-property-name>
<activation-config-property-value>60</activation-config-property-value>
</activation-config-property>
</activation-config>
</message-driven>
</enterprise-beans>
</ejb-jar>
By specifying the values using the ${variable} notation in the ejb-jar.xml file they can then be picked up from the JBoss start command as server options.
-Dclient.id=client-01 -Dsubscription.name=subscription-01