aop configurable MailListener
fenris_uy Apr 26, 2012 10:16 AMHi, I have the following MailListener in JBoss 5.1
{code}@MessageDriven(activationConfig={
@ActivationConfigProperty(propertyName="mailServer", propertyValue="serverurl"),
@ActivationConfigProperty(propertyName="mailFolder", propertyValue="INBOX"),
@ActivationConfigProperty(propertyName="storeProtocol", propertyValue="imaps"),
@ActivationConfigProperty(propertyName="userName", propertyValue="userName"),
@ActivationConfigProperty(propertyName="password", propertyValue="password")
})
@ResourceAdapter("mail-ra.rar")
public class MailListenerMDB implements MailListener {{code}
That listens correctly for incoming email. Now I need to have the MDB configurable for deployment in development and/or production.
Acording to the tutorials I have seen online I should be able to configure it doing this.
{code}@MessageDriven
@ResourceAdapter("mail-ra.rar")
@AspectDomain("MailDrivenBean")
public class MailListenerMDB implements MailListener {{code:xml}
With a file MailDB-aop.xml on my deploy folder that reads like this
<?xml version="1.0" encoding="UTF-8"?>
<aop xmlns="urn:jboss:aop-beans:1.0">
<domain name="MailDrivenBean" extends="Message Driven Bean" inheritBindings="true">
<annotation expr="!class(@org.jboss.ejb3.annotation.DefaultActivationSpecs)">
@org.jboss.ejb3.annotation.DefaultActivationSpecs (value={@javax.ejb.ActivationConfigProperty(propertyName="mailServer", propertyValue="serverUrl"), @javax.ejb.ActivationConfigProperty(propertyName="mailFolder", propertyValue="INBOX"), @javax.ejb.ActivationConfigProperty(propertyName="storeProtocol", propertyValue="imaps"),@javax.ejb.ActivationConfigProperty(propertyName="userName", propertyValue="userName"), @javax.ejb.ActivationConfigProperty(propertyName="password", propertyValue="password")})
</annotation>
</domain>
</aop>
But when I deploy my modified MailListener I get this error
DEPLOYMENTS IN ERROR:
Deployment "jboss.j2ee:jar=FactElect_External.jar,name=MailListenerMDB,service=EJB3" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: Required config property RequiredConfigPropertyMetaData@72cff6b[name=mailFolder descriptions=[DescriptionMetaData@d1c5bb0[language=en]]] for messagingType 'org.jboss.resource.adapter.mail.inflow.MailListener' not found in activation config [] ra=jboss.jca:service=RARDeployment,name='mail-ra.rar'
Any idea of what I'm doing wrong?
Thanks.
Message was edited by: Fabricio González
Solved some markup problems