I am experiencing issue when migrating from WAS 7.0 to WAS Liberty Base. I have deployed EAR file in WAS Liberty Base. When I add the mdb-3.2 to server.xml for JMS Messaging, I get the following run-time error on EJB MDB Bean.
[ERROR ] CNTR5007E: The com.companyname.appname.AdminMDBBean bean class for the AppEAR#AppEJB.jar#AdminMDBBean bean does not have a public constructor that does not take parameters.
[ERROR ] CNTR4002E: The AppEJB.jar EJB module in the AppEAR application failed to start. Exception: com.ibm.ws.exception.RuntimeError: com.ibm.ejs.container.EJBConfigurationException: EJB class com.companyname.appname.AdminMDBBean must have a public constructor that takes no parameters : AppEAR#AppEJB.jar#AdminMDBBean
at com.ibm.ws.ejbcontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRuntime.java:641)
at [internal classes]
Caused by: com.ibm.ejs.container.EJBConfigurationException: EJB class com.companyname.appname.AdminMDBBean must have a public constructor that takes no parameters : AppEAR#AppEJB.jar#AdminMDBBean
at com.ibm.ws.ejbcontainer.jitdeploy.EJBUtils.validateEjbClass(EJBUtils.java:350)
... 1 more
Caused by: java.lang.NoClassDefFoundError: com.companyname.appname.domain.HealthMonitorMessage
at java.lang.J9VMInternals.prepareClassImpl(Native Method)
at java.lang.J9VMInternals.prepare(J9VMInternals.java:291)
at java.lang.Class.getConstructor(Class.java:531)
at com.ibm.ws.ejbcontainer.jitdeploy.EJBUtils.validateEjbClass(EJBUtils.java:341)
... 1 more
Server.xml
<server description="new server">
<featureManager>
<feature>jsp-2.3</feature>
<feature>adminCenter-1.0</feature>
<feature>jdbc-4.1</feature>
<feature>jndi-1.0</feature>
<feature>wasJmsServer-1.0</feature>
<feature>wasJmsClient-2.0</feature>
<feature>mdb-3.2</feature>
</featureManager>
AdminMDBBean.Java
@MessageDriven(name = "AdminMDBBean", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") })
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class AdminMDBBean implements MessageListener {
private Logger logger;
public AdminMDBBean()
{
logger = Logger.getLogger(this.getClass().getName());
}
/**
* Method to receive and process the messages from the queue.
*/
public void onMessage(Message message) {....}