cancel
Showing results for 
Search instead for 
Did you mean: 

ModelException when moving Activation properties for MDB to ejb-jar.xml

Former Member
0 Kudos

Hi,

I have an MDB called BatchMdb that needs to be deployed into both JBoss and SAP NetWeaver. This means I have different activation config properties depending on the application server. So I cannot specify the properties by annotation, I have to place them in the ejb-jar.xml. It works fine in JBoss, but in the SAP IDE, I get this exception:

EJB Model Builder: Exception occurred: com.sap.engine.services.ejb3.model.impl.ModelException: There is no bean BatchMdb defined in module auth_app*annotation|src. at com.sap.engine.services.ejb3.model.impl.ModuleImpl.getBeanImpl(ModuleImpl.java:181)

For some reason, the IDE does not like the entry in ejb-jar.xml for the MDB. This looks like a bug to me. Comments, anyone?

Regards,

Johan

Accepted Solutions (0)

Answers (1)

Answers (1)

Vlado
Advisor
Advisor
0 Kudos

Please provide the complete stack trace, as well as the ejb-jar.xml and the source code of the MDB.

-- Vladimir

Former Member
0 Kudos

Hi Vladimir

I reproduced this by modifying the MDB sample in the SAP Help docs.

There is no stack trace as this is an IDE build error. Here is the full text of the error:

EJB Model Builder: Exception occurred: com.sap.engine.services.ejb3.model.impl.ModelException: There is no bean MDBBean defined in module testMdb*annotation|ejbModule. at com.sap.engine.services.ejb3.model.impl.ModuleImpl.getBeanImpl(ModuleImpl.java:181)

Here's the ejb-jar file:

<?xml version="1.0" encoding="ASCII"?>
<ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
  <display-name>testMdb</display-name>
  <enterprise-beans>
  	<message-driven>
  		<ejb-name>MDBBean</ejb-name>
  		<activation-config>
  			<activation-config-property>
  				<activation-config-property-name>destinationType</activation-config-property-name>
  				<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
  			</activation-config-property>
  		</activation-config>
  	</message-driven>
  </enterprise-beans>
</ejb-jar>

And here is the MDB source code:

/**
 * 
 */
package com.sap.jms.test;

import javax.ejb.*;
import javax.jms.*;

/**
 * @author johan
 *
 */
@MessageDriven(name="MDBBean")
public class MDBBean {

  /**
   * Receives a single JMSMessage from the specified Queue.
   * @param msg
   *            the message received from MyVeryNewQueue
   */
  public void onMessage(Message msg) {
     try {
        // expecting only TextMessages
        if (msg instanceof TextMessage) {
           TextMessage textMsg = (TextMessage) msg;
           System.out.println("MDBBean: Message received: "
                 + textMsg.getText());
        } else {
           System.out.println("MDBBean: Message of wrong type: "
                 + msg.getClass().getName());
        }
     } catch (JMSException jmsexc) {
        System.out.println("MDBBean: Message processing failed. " + jmsexc);
     }
  }
}

I can deploy this to JBoss without changes.

Regards,

Johan

Vlado
Advisor
Advisor
0 Kudos

Hi Johan,

This configuration looks fine to me.

You should be able to find the complete stack trace in the log file in the .metadata folder of your workspace.

Cheers,

-- Vladimir

Former Member
0 Kudos

Hi Vladimir

Here's the stack trace:

com.sap.engine.services.ejb3.model.impl.ModelException: There is no bean MDBBean defined in module testMdb*annotation|ejbModule.
	at com.sap.engine.services.ejb3.model.impl.ModuleImpl.getBeanImpl(ModuleImpl.java:181)
	at com.sap.engine.services.ejb3.model.builders.xml.BeanCommonBuilder.importMetadataFromEJBJarXml(BeanCommonBuilder.java:42)
	at com.sap.engine.services.ejb3.model.builders.xml.MessageBeanBuilder.importMetadataFromEJBJarXml(MessageBeanBuilder.java:41)
	at com.sap.engine.services.ejb3.model.builders.xml.BrieflyDescribedBuilder.process(BrieflyDescribedBuilder.java:44)
	at com.sap.engine.services.ejb3.model.builders.xml.ModuleBuilder.processMessageBeans(ModuleBuilder.java:201)
	at com.sap.engine.services.ejb3.model.builders.xml.ModuleBuilder.processEnterpriseBeans(ModuleBuilder.java:128)
	at com.sap.engine.services.ejb3.model.builders.xml.ModuleBuilder.importMetadataFromEJBJarXml(ModuleBuilder.java:85)
	at com.sap.engine.services.ejb3.model.builders.xml.ModuleBuilder.process(ModuleBuilder.java:73)
	at com.sap.engine.services.ejb3.model.builders.xml.XMLModelFiller.perform(XMLModelFiller.java:55)
	at com.sap.engine.services.ejb3.model.builders.CompositeModuleBuilder.getXmlModule(CompositeModuleBuilder.java:135)
	at com.sap.engine.services.ejb3.model.builders.CompositeModuleBuilder.buildModule(CompositeModuleBuilder.java:90)
	at com.sap.tc.jtools.jlinee.ejb.model.EJBModelBuilder.buildJEE5(EJBModelBuilder.java:200)
	at com.sap.tc.jtools.jlinee.ejb.model.EJBModelBuilder.build(EJBModelBuilder.java:88)
	at com.sap.tc.jtools.jlinee.lib.model.impl.AbstractModelBuilderTest.execute(AbstractModelBuilderTest.java:48)
	at com.sap.tc.jtools.jlinee.lib.AbstractJ2EETest.executeWithStatus(AbstractJ2EETest.java:149)
	at com.sap.tc.jtools.jlinee.lib.framework.dependency.Node.execute(Node.java:212)
	at com.sap.tc.jtools.jlinee.lib.framework.JLinEETestProcessor.executeAll(JLinEETestProcessor.java:153)
	at com.sap.tc.jtools.jlinee.lib.framework.JLinEETestProcessor.execute(JLinEETestProcessor.java:123)
	at com.sap.engine.jlinee.lib.impl.TestManager.executeTestsForAppComponent(TestManager.java:154)
	at com.sap.engine.jlinee.lib.impl.TestManager.executeTests(TestManager.java:89)
	at com.sap.engine.jlinee.lib.JLinEEValidatorImpl.validateApplication(JLinEEValidatorImpl.java:143)
	at com.sap.engine.jlinee.lib.JLinEEValidatorImpl.validateApplication(JLinEEValidatorImpl.java:127)
	at com.sap.tc.jtools.jlint.validation.wtp.JLinEEValidator.validate(JLinEEValidator.java:69)
	at org.eclipse.wst.validation.internal.core.ValidatorLauncher.start(ValidatorLauncher.java:98)
	at org.eclipse.wst.validation.internal.operations.ValidationOperation.launchValidator(ValidationOperation.java:1286)
	at org.eclipse.wst.validation.internal.operations.ValidationOperation.internalValidate(ValidationOperation.java:1101)
	at org.eclipse.wst.validation.internal.operations.ValidationOperation.validate(ValidationOperation.java:996)
	at org.eclipse.wst.validation.internal.operations.ValidationOperation.run(ValidationOperation.java:657)
	at org.eclipse.wst.validation.internal.operations.ValidationBuilder.build(ValidationBuilder.java:203)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:624)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:166)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:197)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:246)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:249)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:302)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:334)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:137)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

      [Error: com.sap.tc.jtools.jlinee.lib  Thread[Worker-85,5,main]]

Vlado
Advisor
Advisor
0 Kudos

Hi Johan,

I was able to reproduce this issue and already reported an internal support ticket, so it's already taken care of. But feel free if you wish to report a customer ticket on your own as well.

Cheers,

-- Vladimir

Vlado
Advisor
Advisor
0 Kudos

In the meantime, there's an easy workaround for this - just exclude the JLinEE validator from Project Properties -> Validation. This issue should not occur when you deploy your projects on the server.

Former Member
0 Kudos

Thanks Vladimir, this is useful to know.