Hi,
I have written the code to read messages from queue.But when i deploy this in weblogic 9.2 after creating a jar file it is showing unmarshaller failed Below is the code
MyMdb.java
package com.mdb.ejb;
import javax.ejb.EJBException; import javax.ejb.MessageDrivenBean; import javax.ejb.MessageDrivenContext; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.TextMessage;
/** * Message-Driven Bean implementation class for: MyMdb * */
public class MyMdb implements javax.ejb.MessageDrivenBean,javax.jms.MessageListener {
/** * */ private static final long serialVersionUID = 1L; /** * Default constructor. */ public MyMdb() { // TODO Auto-generated constructor stub } /** * @see MessageListener#onMessage(Message) */ public void onMessage(Message message) { // TODO Auto-generated method stub System.out.println("on two thtr "); TextMessage textMessage = (TextMessage) message; try { System.out.println("\n\n\t(mdb) MyMDB Received \n"+ textMessage.getText()); SendMail.sendMail(textMessage.getText()); } catch (JMSException e) { e.printStackTrace(); } } public void ejbRemove() throws EJBException { // TODO Auto-generated method stub } public void setMessageDrivenContext(MessageDrivenContext arg0) throws EJBException { // TODO Auto-generated method stub }
}
ejb-jar.xml
weblogic-ejb-jar.xml
It is shwoing below mentioned exception
An error occurred during activation of changes, please see the log for details. ???Exception preparing module: EJBModule(MessageDrivenBeanProject) Unable to deploy EJB: MessageDrivenBeanProject.jar from MessageDrivenBeanProject.jar: There are 2 nested errors: weblogic.ejb.container.compliance.ComplianceException: In EJB MyMdb, the message-driven bean class must implement the javax.ejb.MessageDrivenBean interface. at weblogic.ejb.container.compliance.MessageDrivenBeanClassChecker.checkMessageDrivenImplementsMDB(MessageDrivenBeanClassChecker.java:54) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at weblogic.ejb.container.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:262) at weblogic.ejb.container.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:216) at weblogic.ejb.container.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:875) at weblogic.ejb.container.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:843) at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:229) at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:497) at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:464) at weblogic.ejb.container.deployer.EJBDeployer.runEJBC(EJBDeployer.java:432) at weblogic.ejb.container.deployer.EJBDeployer.compileJar(EJBDeployer.java:754) at weblogic.ejb.container.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:657) at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1201) at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:355) at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:56) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:46) at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191) at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:147) at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:189) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:87) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:718) at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1185) at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:247) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:157) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45) at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:181) and weblogic.ejb.container.compliance.ComplianceException: In EJB MyMdb, a Message-driven EJB must define an ejbCreate method that takes no parameters. at weblogic.ejb.container.compliance.MessageDrivenBeanClassChecker.checkEjbCreateMethod(MessageDrivenBeanClassChecker.java:401) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at weblogic.ejb.container.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:262) at weblogic.ejb.container.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:216) at weblogic.ejb.container.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:875) at weblogic.ejb.container.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:843) at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:229) at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:497) at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:464) at weblogic.ejb.container.deployer.EJBDeployer.runEJBC(EJBDeployer.java:432) at weblogic.ejb.container.deployer.EJBDeployer.compileJar(EJBDeployer.java:754) at weblogic.ejb.container.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:657) at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1201) at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:355) at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:56) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:46) at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191) at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:147) at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:189) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:87) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:718) at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1185) at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:247) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:157) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45) at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:181) ??? ??? There are 2 nested errors: weblogic.ejb.container.compliance.ComplianceException: In EJB MyMdb, the message-driven bean class must implement the javax.ejb.MessageDrivenBean interface. ???
Ads