Using an Mbean with Jboss 7.1
thr4sh3r Sep 11, 2012 8:38 AMGood day,
I am in the process of upgrading an old project that was running on Jboss 4.x. I am using JBoss 7.1 but I have not been able to get this to work.
First, let me show the existing configuration.
web.xml
<resource-ref>
<res-ref-name>TemplateTransport</res-ref-name>
<res-type>coza.blah.blah.blah.TransportService</res-type>
<res-auth>Container</res-auth>
</resource-ref>
jboss-web.xml
<resource-ref>
<res-ref-name>TemplateTransport</res-ref-name>
<jndi-name>java:/TemplateTransport</jndi-name>
</resource-ref>
TemplateTransport-service.xml - Deployed in JBoss deploy folder
<server>
<mbean code="coza.blah.blah.blah.TransportService" name="jboss:id=TemplateTransport">
<attribute name="Service"></attribute>
<attribute name="Network">BLAH</attribute>
<attribute name="Daemon">BLAH:7500</attribute>
<attribute name="CreateCmTransport">true</attribute>
<attribute name="CmName">blah.blah.blah</attribute>
<attribute name="LedgerFile">C:/TempWork/Blah/blah.blah</attribute>
<attribute name="JndiName">java:/TemplateTransport</attribute>
</mbean>
</server>
The MBean .jar file is located in the JBoss server/default/lib directory.
The Java call is as follows:
transport = new InitialContext().lookup("java:/TemplateTransport");
JBoss 7.1
So I have copied the resource-ref from web.xml to the new project's web.xml, and created a jboss-web.xml in the new project as well. I have deployed the TemplateTransport-service.xml to standalone/deployments. And I have copied the MBean .jar file to the standlone/lib directory, and copied it to my local repository for the Maven dependence.
I have Tibco and Mbean dependency references in my POM.xml.
I have done a lot of reading on this issue, but have not been able to resolve it.
I have also changed the Java call as follows:
@EJB(lookup="java:jboss/TemplateTransport")
private TibrvCmTransport transport;
I modified all JNDI names to be "java:jboss/TemplateTransport".
When I try deploy my WAR file, I get the following error and deployment fails:
INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015863: Replacement of deployment "support.war" by deployment "support.war" was rolled back with failure message
{"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.support.support.env.TemplateTransportjboss.naming.context.java.jboss.TemplateTransportMissing[jboss.naming.context.java.module.support.support.env.TemplateTransportjboss.naming.context.java.jboss.TemplateTransport]"]}
INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.TemplateTransport (missing) dependents: [service jboss.naming.context.java.module.support.support.env.TemplateTransport]
If someone can please point me in the right direction, or let me know what I am doing wrong, it would be much appreciated. I am still relatively new to JBoss, so I may have made a silly mistake, or I am doing it completely wrong.
Thanks in advance.