Using work managers to process WorkItems in a message driven bean

Hi, I'm trying to get to grips with using a work manager (in 10.3) to process WorkItems concurrently, with the whole process being triggered by a JMS message. I've got everything working using the default work manager but I'm having problems switching over to using a work manager that I've created myself, using annotations to provide the resource ref.
My current setup, using the default work manager, is (roughly) this:
@MessageDriven(mappedName = "jms/tsrd.DependencyWorker", activationConfig = {
        @ActivationConfigProperty(propertyName = "connectionFactoryJndiName", propertyValue = "jms/connectionFactory"),
        @ActivationConfigProperty(propertyName = "ejbName", propertyValue = "tsrd.DependencyWorker"),
        @ActivationConfigProperty(propertyName = "destinationJndiName", propertyValue = "jms/tsrd.DependencyWorker"),
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") })
@Interceptors(SpringBeanAutowiringInterceptor.class)
public class DependencyWorker implements MessageListener {
    private WorkManager workManager;
    @Required
    @Resource(name = "taskExecutor")
    public void setWorkManager(final WorkManager workManager) {
        this.workManager = workManager;
    public void doOperation(final WorkflowControlMessage msg) throws Exception {
         Work myWork = new ...
         workManager.schedule(myWork, listener);
}With my spring config including this bean:
<bean id="taskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor">
    <property name="workManagerName" value="wm/default"/>
    <property name="resourceRef" value="true"/>
</bean>And this works fine: when the JMS message is received I send a load of WorkItems to the default work manager and they get processed.
Now what I'd like to do is change the spring config to this:
<bean id="taskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor">
    <property name="workManagerName" value="wm/MyWorkManager"/>
    <property name="resourceRef" value="true"/>
</bean>Where I've already created MyWorkManager as a global work manager for the server, and it's visible on the admin server for the deployment.
From the examples I've seen I know I need to add a resource ref for the MDB so that it can lookup the work manager using JNDI. We mainly use annotations, so I'd like to just be able to add this line to the MDB:
@Resource(name = "MyWorkManager", type = commonj.work.WorkManager.class, authenticationType = Resource.AuthenticationType.CONTAINER, shareable = true)But when I try that my server refuses to start:
Unable to deploy EJB: DependencyWorker from tsrd-mdb.jar:
[EJB:011026]The EJB container failed while creating the java:/comp/env namespace for this EJB deployment.
weblogic.deployment.EnvironmentException: [EJB:010176]The resource-env-ref 'MyWorkManager' declared in the ejb-jar.xml descriptor or annotation has no JNDI name mapped to it. The resource-ref must be mapped to a JNDI name using the resource-description element of the weblogic-ejb-jar.xml descriptor or corresponding annotation.So is there a way to fully configure my work manager just using the @Resource annotation, or do I need to add a weblogic-ejb.jar.xml file and put some specific config in there? Presumably if I do need to add an xml file then I'd need to put something like this in it?
<wls:weblogic-enterprise-bean>
    <wls:ejb-name>DependencyWorker</wls:ejb-name>
    <wls:resource-description>
        <wls:res-ref-name>MyWorkManager</wls:res-ref-name>
        <wls:jndi-name>wm/MyWorkManager</wls:jndi-name>
    </wls:resource-description>
</wls:weblogic-enterprise-bean>Am I also right in thinking that I don't need to add a dispatch policy to the MDB specifying MyWorkManager, because I don't actually want to dispatch the MDB to that manager, I just want the manager to be available to the MDB.
Thanks.

Hi, so I've added a weblogic-ejb.jar.xml file with a reference to the JNDI name of the work manager:
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-ejb-jar xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd">
    <wls:weblogic-enterprise-bean>
        <wls:ejb-name>DependencyWorker</wls:ejb-name>
        <wls:resource-description>
            <wls:res-ref-name>MyWorkManager</wls:res-ref-name>
            <wls:jndi-name>wm/MyWorkManager</wls:jndi-name>
        </wls:resource-description>
    </wls:weblogic-enterprise-bean>
</wls:weblogic-ejb-jar>But I still get exactly the same error when I try to start my server. The example you referred to kind of cryptically suggests that adding a plan.xml suddenly fixed everything, but what am I missing here that actually hooks the work manager up to JNDI? am I getting these problems because I'm using annotations, or are people not supposed to access work managers in this way?
Thanks,
Edited by: 806682 on 05-Nov-2010 08:57

Similar Messages

  • WebLogic hangs around after shutdown process appears to complete - Message Driven Bean related

    On my current project we have some Ant scripts that automatically
    start and stop WebLogic. The stop script equates to (not exactly but
    close enough):
    java weblogic.Admin -url localhost:8001 -password password -username
    username SHUTDOWN
    WebLogic is start and shutdown for each system module. All modules
    use the exact same script for these two actions. Some of the modules
    use Message Driven Beans and consequently, since these use JMS, a
    JMSxxx.dat file is generated in the jms_store directory. As part of
    the cleanup process the jms_store directory and all files in it are to
    be deleted AFTER WebLogic shuts down.
    The shutdown process works fine in all cases where JMS is not used and
    in all cases where JMS IS used but there are NO message driven beans.
    However, when there is a message driven bean the server does not shut
    down in a timely manner, sometimes not at all (no error messages are
    produced), and the JMSxx.dat file
    remains locked. Consequently, all of the tests run via the ant script
    for modules come to a grinding halt (i.e. environment could not be
    cleaned so further tests would be skewed).
    Can anyone shed some light on a definitive order of events during
    WebLogic's shutdown process? What is the best way to test for the
    server being up? I know there is a ping utility for weblogic - should
    this be used or should a connection to a JNDI or JMS listening port do
    the trick? Any other ideas would be welcome.
    Thanks in advance,
    Mark

    On my current project we have some Ant scripts that automatically
    start and stop WebLogic. The stop script equates to (not exactly but
    close enough):
    java weblogic.Admin -url localhost:8001 -password password -username
    username SHUTDOWN
    WebLogic is start and shutdown for each system module. All modules
    use the exact same script for these two actions. Some of the modules
    use Message Driven Beans and consequently, since these use JMS, a
    JMSxxx.dat file is generated in the jms_store directory. As part of
    the cleanup process the jms_store directory and all files in it are to
    be deleted AFTER WebLogic shuts down.
    The shutdown process works fine in all cases where JMS is not used and
    in all cases where JMS IS used but there are NO message driven beans.
    However, when there is a message driven bean the server does not shut
    down in a timely manner, sometimes not at all (no error messages are
    produced), and the JMSxx.dat file
    remains locked. Consequently, all of the tests run via the ant script
    for modules come to a grinding halt (i.e. environment could not be
    cleaned so further tests would be skewed).
    Can anyone shed some light on a definitive order of events during
    WebLogic's shutdown process? What is the best way to test for the
    server being up? I know there is a ping utility for weblogic - should
    this be used or should a connection to a JNDI or JMS listening port do
    the trick? Any other ideas would be welcome.
    Thanks in advance,
    Mark

  • B2B using JMS and Processing Messages with Message Driven Beans

    We want to be able to use B2B to send messages to a JMS queue and then process messages from B2B using a Message Driven Bean. Is this supported.
    We are using B2B 10.2.0.2 with Patchset 4.

    Hello,
    In 10.1.2.0.2 B2B , as part of the internal Delivery channel B2B can only send and receive messages from JMS queues.
    Rgds,Ramesh

  • Message driven bean example is not working

    Hi,
    i tried message driven bean example on J2ee 6.20. I am able to make connection factory, but when i tried to deploy ear file a get an exception:
    Error occurred
    com.inqmy.services.deploy.container.DeploymentException: java.lang.NullPointerEx
    ception
            at com.inqmy.services.ejb20.EJBAdmin.commitDeploy(EJBAdmin.java:604)
            at com.inqmy.services.deploy.server.DeployServiceImpl.commit(DeployServi
    ceImpl.java:2897)
            at com.inqmy.services.deploy.server.DeployServiceImpl.deploy1(DeployServ
    iceImpl.java:524)
            at com.inqmy.services.deploy.server.DeployServiceImpl.deploy(DeployServi
    ceImpl.java:139)
            at com.inqmy.services.deploy.command.DeployCommand.exec(DeployCommand.ja
    va:142)
            at com.inqmy.services.shell.processor.environment.CommandBase.exec(Comma
    ndBase.java:124)
            at com.inqmy.services.shell.processor.Interpreter.applyLineCommand(Inter
    preter.java:391)
            at com.inqmy.services.shell.processor.Interpreter.apply(Interpreter.java
    :150)
            at com.inqmy.services.shell.processor.Shell.work(Shell.java:150)
            at com.inqmy.services.shell.processor.managers.ScriptProcessThread.run(S
    criptProcessThread.java:128)
    in visual administrator I can see the right queue and for few seconds this queue have one consumer.
    thank
    JJ

    Hi,
    but this example was in guide to this version.
    Ok, in case it is not possible to use MDB, how should i handle long time consumpting functions in EP enviroment?
    (customer has only EP6SP2 and he need to send a lot of mails after user request and i dont want to leave user waiting till that function ends. - should i start new thread in portal?)
    JJ

  • Problem deploying message driven bean using Log4j

    Hello all.
    Using JDeveloper 11.1.1.0.2, I'm having a problem with a message driven bean I've created and associated with a JMS queue.
    I've created an EJB Module project in my application (in which some other projects exist), and created the bean. A simple test of the bean, sending a message through the jms queue and printing it on system.out in the mdb onMessage() worked just fine.
    However, when I add apache commons logging to my mdb, things start to go wrong. Running the project on the integrated weblogic 10.3 server just fails during deployment, due to a NoClassDefFoundError on org/apache/log4j/Logger.
    In project properties -> libraries and classpath, I've added a log4j library (Log4j-1.2.14.jar) next to Commons Logging 1.0.4 but it doesn't seem to matter anything.
    The code of my message bean:
    @MessageDriven(mappedName = "weblogic.wsee.DefaultQueue")
    public class MyMessageBean implements MessageListener {
        // logger
        private static Log sLog = LogFactory.getLog(MyMessageBean.class);
        public void ejbCreate() {
        public void ejbRemove() {
        public void onMessage(Message message) {
            MapMessage mapmsg = null;
            try {
                if (message instanceof MapMessage) {
                    mapmsg = (MapMessage)message;
                    boolean msgRedelivered = mapmsg.getJMSRedelivered();
                    String msgId = mapmsg.getJMSMessageID();
                    if (!msgRedelivered) {
                        sLog.debug("****** Successfully received message " + msgId);
                    } else {
                        sLog.debug("****** Successfully received redelivered message " + msgId);
                    // Haal de inhoud op:
                    int testInt = mapmsg.getInt("TestInt");
                    sLog.debug("TestInt:" + testInt);
                } else {
                    sLog.debug("Message of wrong type: " +
                                       message.getClass().getName());
            } catch (Exception e) {
                sLog.error("Fout in verwerken",e);           
    }Does anybody have any clue as to what I might be doing wrong or missing out here?
    The complete stacktrace:
    5-aug-2009 12:54:44 oracle.adf.share.config.ADFConfigFactory cleanUpApplicationState
    INFO: Cleaning up application state
    java.lang.ExceptionInInitializerError
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:247)
         at weblogic.ejb.container.dd.xml.EjbAnnotationProcessor.processWLSAnnotations(EjbAnnotationProcessor.java:1705)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.processWLSAnnotations(EjbDescriptorReaderImpl.java:346)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:192)
         at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)
         at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1198)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:380)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
         at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
         at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
         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.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@51b296 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@51b296 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger))
         at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
         at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
         at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
         at nl.justid.dolores.mdb.MyMessageBean.<clinit>(MyMessageBean.java:19)
         ... 32 more
    Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@51b296 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger)
         at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
         at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
         ... 36 more
    Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
         at java.lang.Class.getConstructor0(Class.java:2699)
         at java.lang.Class.getConstructor(Class.java:1657)
         at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
         ... 37 more
    Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         ... 42 more
    <5-aug-2009 12:54:44 uur CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1249469684085' for task '14'. Error is: 'weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    null.'
    weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    null.
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: org.apache.log4j.Logger
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
         Truncated. see log file for complete stacktrace
    >
    5-aug-2009 12:54:44 oracle.adf.share.config.ADFConfigFactory cleanUpApplicationState
    INFO: Cleaning up application state
    <5-aug-2009 12:54:44 uur CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'Dolores'.>
    <5-aug-2009 12:54:44 uur CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    null.
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: org.apache.log4j.Logger
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
         Truncated. see log file for complete stacktrace
    >
    [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application Dolores on DefaultServer.: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    null..
    weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    null.
    ####  Deployment incomplete.  ####    Aug 5, 2009 12:54:44 PM
    oracle.jdeveloper.deploy.DeployException
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:247)
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.deployImpl(Jsr88RemoteDeployer.java:157)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:436)
         at oracle.jdeveloper.deploy.DeploymentManager.deploy(DeploymentManager.java:209)
         at oracle.jdevimpl.runner.adrs.AdrsStarter$5$1.run(AdrsStarter.java:1365)
    Caused by: oracle.jdeveloper.deploy.DeployException
         at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:413)
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:238)
         ... 11 more
    Caused by: oracle.jdeveloper.deploy.DeployException: Deployment Failed
         at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:395)
         ... 12 more
    #### Cannot run application Dolores due to error deploying to DefaultServer.
    [Application Dolores stopped and undeployed from Server Instance DefaultServer]Thanks in advance!
    Greetings,
    Eelse
    Edited by: Eelse on Aug 5, 2009 1:57 PM
    Edited by: Eelse on Aug 5, 2009 5:39 PM

    Creating a new deployment profile (EAR) and including the original deployment (JAR) and the needed libraries (in a lib-directory) solved the problem.

  • Message-Driven Bean using @Resource annotation

    I am trying to run a Message-Driven Bean very simple example in https://glassfish.dev.java.net/javaee5/ejb/examples/MDB.html
    I configured MDBQueueConnectionFactory and MDBQueue properly on glassfish admin console.
    I cannot run the example using @Resource annotation. I don't understand why.
    @Resource(mappedName="MDBQueueConnectionFactory")
    private static QueueConnectionFactory queueCF;
    @Resource(mappedName="MDBQueue")
    private static Queue mdbQueue;But I can run this example modifying the source code using InitialContext instance and looking up for JMS Resources.
    InitialContext ctx = new InitialContext();
    QueueConnectionFactory queueCF=(QueueConnectionFactory)ctx.lookup("MDBQueueConnectionFactory");
    QueueConnection queueCon = queueCF.createQueueConnection();
    Queue mdbQueue=(Queue)ctx.lookup("MDB");
    queueSender.send(mdbQueue, msg);
    ...I want to figure out why @Resource annotation do not work well. Any help?
    Thanks in advanced any help.

    Thanks for your reply.
    The error that I get is a simple NullPointerException. Nothing else.
    Like you said, I develop a servlet and I can use @Resource annotation without static reference, and it works.
    public class TestMDB extends HttpServlet {
         private static final long serialVersionUID = 1L;
         @Resource(mappedName="MDBQueueConnectionFactory")
         private QueueConnectionFactory queueCF;
         @Resource(mappedName="MDB")
         private Queue mdbQueue;
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              PrintWriter out = response.getWriter();
              out.println("TEST MDB "+queueCF);
              QueueConnection queueCon;
              try {
                   queueCon = queueCF.createQueueConnection();
                   QueueSession queueSession = queueCon.createQueueSession
                   (false, Session.AUTO_ACKNOWLEDGE);
                   QueueSender queueSender = queueSession.createSender(null);
                   TextMessage msg = queueSession.createTextMessage("hello");
                   queueSender.send(mdbQueue, msg);
                   out.println("Sent message to MDB");
                   queueCon.close();
              } catch (JMSException e) {
                   e.printStackTrace();
    }But my question were about using @Resource annotation on a standalone client. I always get NullPointerException.
    public class MDBClient {
        @Resource(mappedName="MDBQueueConnectionFactory")
        private static QueueConnectionFactory queueCF;
        @Resource(mappedName="MDB")
        private static Queue mdbQueue;
        public static void main(String args[]) {
         try {
                QueueConnection queueCon = queueCF.createQueueConnection();
                QueueSession queueSession = queueCon.createQueueSession
                    (false, Session.AUTO_ACKNOWLEDGE);
                QueueSender queueSender = queueSession.createSender(null);
                TextMessage msg = queueSession.createTextMessage("hello");
                queueSender.send(mdbQueue, msg);
                System.out.println("Sent message to MDB");
                queueCon.close();
            } catch(Exception e) {
                e.printStackTrace();
    }

  • "Message Driven Bean" doesn't work with Sun App Server

    Hello all,
    i have a little bit problems, running a simple "Message Driven Bean" under the Sun App Server. The deployment of it works fine, but after starting the SUN App Server i get the following error message:
    An error occurred during the message-driven beancontainer initialization at runtime. The most common cause for this is that the physical resource(e.g. Queue) from which the message-driven bean is consuming either does not exist or has been configured incorrectly. Another common error is that the message-driven bean implementation class does not correctly implement the required javax.ejb.MessageBean or MessageListener interfaces.
    Has anybody a workaround for this problem?
    The queue seems to be correctly installed. A simple client programm from the Sun Tutorial (Consumer & Producer) works fine without any Errors or Exceptions.
    I am a little bit confused, because the queue seems to work with the client programms but not with a MDB running on the SUN App Server.
    Thanks for you help!
    Greetings
    Manuel

    Hello Mr Manuel!
    could you plz help me with the steps for creating a message driven bean using netbeans ver 5.0(with Sun Java� System Application Server Platform Edition 8.2 )
    I just know how to work with Session beans & Entity Bean, and am try to learn to work on Message Driven Beans too. there are no proper tutorials where i can find steps for creating these..
    I need the steps from the scratch.,like creating QueueConnection Factory & Destination etc..
    It will be gr8 if you can help me with this at the earliest .
    Thank you
    Bye

  • Message driven beans practical use

    Hi,
    I wanted to know,where Message driven beans are used in actual commercial projects???
    Thanks in advance.

    Hi,
    Without naming any particular projects, i can asure you that MessageDriven Beans are used in commercially deployed systems.
    Most important is to recognise the goal of MDBs. Everything inside a J2EE server is Request-Response like. Session and Entity beans react on requests. Because of the life cycle of these types of EJBs waiting for incoming messages is not realy a good idea.
    In all cases were asynchronous middleware solutions are used, like MQ series for example, MDBs are used to listen for and react on incoming messages.
    Furthermore, MDBs are used to decouple web tier from business tier where processing times of incoming data is too long to wait for by the clients.
    Robert

  • Messenger service using message driven beans

    I need to implement a implement a messenger service. (using Messaging server, Message Queue, Message Clients and Message Driven Beans)
    using netbeans 5.5
    it should develop using EJB 3.0 architeture.
    Can pls tell...how should i start this.(Basic steps of doing this)
    Where should we write the Messaging server.(in a EJB 3.0 application...Is it?)
    Any tutorial regrading this....!

    EJBs and Message Driven Part.
    what should i develop first. Messaging server OR Message Queue
    How can i develop the Messaging Server. Do i need to use Message driven beans there?
    Message was edited by:
    jugp

  • JMS / Message Driven Bean not processing message

    I am having a problem getting an MDB to work on Weblogic Server 7x.
              Basically I have written a simple Bean which simply prints a message.
              I have a JMS client which creates a message (javax.jms.TextMessage)
              and successfully adds it to the queue (javax.jms.Queue). The code
              looks as follows:
              public void sendText(String message) throws Exception
              TextMessage textMessage = getQueueSession().createTextMessage();
              System.out.println("Created Message: "+message);
              textMessage.clearBody();
              textMessage.setText(message);
              System.out.println("Sending Message");
              getQueueSender().send(textMessage);
              System.out.println("Sent Message");
              The message is getting onto the queue as we can monitor this from the
              weblogic console, everytime we run the JMS Test client the number of
              messages on the queue increases however these message never seem to be
              processed. Here is a sample of the ejb-jar.xml
              <message-driven>
              <display-name>JMSBatchReceiver</display-name>
              <ejb-name>JMSBatchReceiver</ejb-name>
              <ejb-class>com.batch.JMSBatchReceiverBean</ejb-class>
              <transaction-type>Container</transaction-type>
              <message-driven-destination>
              <destination-type>javax.jms.Queue</destination-type>
              </message-driven-destination>
              </message-driven>
              Here is a sample from the weblogic-ejb-jar.xml
              <weblogic-enterprise-bean>
              <ejb-name>JMSBatchReceiver</ejb-name>
              <message-driven-descriptor>
              <pool>
              <max-beans-in-free-pool>5</max-beans-in-free-pool>
              </pool>
              <destination-jndi-name>jms/BatchQueue</destination-jndi-name>
              <connection-factory-jndi-name>jms/BatchQueueConnectionFactory</connection-factory-jndi-name>
              </message-driven-descriptor>
              </weblogic-enterprise-bean>
              And here is an excerpt from the config.xml;
              <JMSConnectionFactory JNDIName="jms/BatchQueueConnectionFactory"
              Name="jms/BatchQueueConnectionFactory" Targets="myserver"/>
              <JMSServer Name="JMSBatchServer" Targets="myserver">
              <JMSQueue DeliveryModeOverride="Persistent"
              JNDIName="jms/BatchQueue" Name="jms/BatchQueue"/>
              </JMSServer>
              Any ideas.....
              Best Regards
              Brian
              

    Check the UserTransactions and XATransactions checkbox for your custom connection factory.
              Tom Barnes wrote:
              > Confirm that the bean is deployed by checking the server's
              > deployments on the console.
              >
              > Check your server log for messages. If the MDB is failing to
              > attach, it will log errors and warnings.
              >
              > I wonder if the "/" in your descriptor jars is messing things
              > up as a special character? Try naming your JNDI resources
              > without slashes.
              >
              > Note that there is no need to specify a connection factory for
              > MDBs - the default one is usually fine.
              >
              > Tom
              >
              > Brian Seery wrote:
              > > I am having a problem getting an MDB to work on Weblogic Server 7x.
              > > Basically I have written a simple Bean which simply prints a message.
              > > I have a JMS client which creates a message (javax.jms.TextMessage)
              > > and successfully adds it to the queue (javax.jms.Queue). The code
              > > looks as follows:
              > >
              > > public void sendText(String message) throws Exception
              > > {
              > > TextMessage textMessage = getQueueSession().createTextMessage();
              > > System.out.println("Created Message: "+message);
              > > textMessage.clearBody();
              > > textMessage.setText(message);
              > > System.out.println("Sending Message");
              > > getQueueSender().send(textMessage);
              > > System.out.println("Sent Message");
              > > }
              > >
              > > The message is getting onto the queue as we can monitor this from the
              > > weblogic console, everytime we run the JMS Test client the number of
              > > messages on the queue increases however these message never seem to be
              > > processed. Here is a sample of the ejb-jar.xml
              > >
              > > <message-driven>
              > > <display-name>JMSBatchReceiver</display-name>
              > > <ejb-name>JMSBatchReceiver</ejb-name>
              > > <ejb-class>com.batch.JMSBatchReceiverBean</ejb-class>
              > > <transaction-type>Container</transaction-type>
              > > <message-driven-destination>
              > > <destination-type>javax.jms.Queue</destination-type>
              > > </message-driven-destination>
              > > </message-driven>
              > >
              > > Here is a sample from the weblogic-ejb-jar.xml
              > >
              > > <weblogic-enterprise-bean>
              > > <ejb-name>JMSBatchReceiver</ejb-name>
              > > <message-driven-descriptor>
              > > <pool>
              > > <max-beans-in-free-pool>5</max-beans-in-free-pool>
              > > </pool>
              > > <destination-jndi-name>jms/BatchQueue</destination-jndi-name>
              > > <connection-factory-jndi-name>jms/BatchQueueConnectionFactory</connection-factory-jndi-name>
              > > </message-driven-descriptor>
              > > </weblogic-enterprise-bean>
              > >
              > > And here is an excerpt from the config.xml;
              > > <JMSConnectionFactory JNDIName="jms/BatchQueueConnectionFactory"
              > > Name="jms/BatchQueueConnectionFactory" Targets="myserver"/>
              > > <JMSServer Name="JMSBatchServer" Targets="myserver">
              > > <JMSQueue DeliveryModeOverride="Persistent"
              > > JNDIName="jms/BatchQueue" Name="jms/BatchQueue"/>
              > > </JMSServer>
              > >
              > > Any ideas.....
              > >
              > > Best Regards
              > >
              > > Brian
              Rajesh Mirchandani
              Developer Relations Engineer
              BEA Support
              

  • Just a primitive Message Driven Bean doen not work!

              I have a simple Message EJB and can't make it recive messages. For two days I can't
              get what's wrong - I've read already three tutorials, but... still nothing. No
              exceptions... but no messages.
              Here is it.
              all files are in attach too...
              Thank you!!!
              The bean:
              package JMSTest;
              import javax.ejb.*;
              import javax.jms.*;
              import weblogic.ejb.*;
              import EntityTest.TestEntHome;
              import EntityTest.TestEntLocal;
              import javax.naming.InitialContext;
              import javax.naming.NamingException;
              * @ejbgen:message-driven initial-beans-in-free-pool="1" transaction-type="Container"
              clients-on-same-server="false"
              * ejb-name = TestJMS
              * destination-jndi-name = jmstest
              * destination-type = javax.jms.Queue
              * @ejbgen:ejb-local-ref
              * name="ejb/testlink" local="EntityTest.TestEntLocal" link="testentlink"
              * home="EntityTest.TestEntLocalHome"
              * type="Entity"
              * jndi-name="ent.TestEntLocalHome"
              public class TestJMS
              extends GenericMessageDrivenBean
              implements MessageDrivenBean, MessageListener
              private TestEntHome teh;
              public void ejbCreate() {
              try {
              System.out.println("in create");
              javax.naming.Context ic = new InitialContext();
              teh = (TestEntHome)ic.lookup("ejb.TestEntLocalHome");
              catch(NamingException ne) {
              System.out.println("Encountered the following naming exception: "
              + ne.getMessage());
              public void onMessage(Message msg) {
              System.out.println("in onMessage");
              MapMessage tmsg = (MapMessage)msg;
              try{           
              TestEntLocal tel = teh.create(tmsg.getString("message"));
              } catch(JMSException e){
              e.printStackTrace();
              } catch(CreateException e){
              e.printStackTrace();
              // Your code here
              And The Client. I run client in Idea - not in workshop...:
              import javax.naming.*;
              import javax.ejb.CreateException;
              import javax.ejb.EJBException;
              import javax.ejb.FinderException;
              import javax.naming.InitialContext;
              import javax.naming.NamingException;
              import javax.jms.*;
              import java.util.Hashtable;
              import weblogic.jms.client.JMSConnectionFactory;
              import weblogic.jms.client.JMSSession;
              import weblogic.jms.client.JMSConnection;
              public class Main
              private static QueueConnectionFactory factory;
              private static Queue queue;
              private static Context getInitialContext() throws NamingException {
              Hashtable environment = new Hashtable();
              environment.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              // environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
              environment.put(Context.PROVIDER_URL, "t3://localhost:7001");
              return new InitialContext(environment);
              public static void main(String argsp[]){
              try {
              javax.naming.Context ic = getInitialContext();
              factory = (JMSConnectionFactory) ic.lookup("QueueFactory");
              queue = (Queue) ic.lookup("jmstest");
              catch (NamingException ne) {
              throw new EJBException(ne);
              try {
              //send a message
              QueueConnection connect = factory.createQueueConnection();
              QueueSession session = connect.createQueueSession(true,Session.AUTO_ACKNOWLEDGE);
              QueueSender sender = session.createSender(queue);
              MapMessage recordingMsg = session.createMapMessage();
              recordingMsg.setString("message", "Im here");
              connect.start();
              sender.send(recordingMsg);
              connect.close();
              catch(JMSException ne) {
              throw new EJBException(ne);
              /* catch(CreateException ce) {
              throw new EJBException(ce);
              catch(FinderException fe) {
              throw new EJBException(fe);
              With classpath:
              <root type="composite">
              <root type="output" />
              <root type="jdk" rootType="classPath" name="BEA java version "1.4.1_05""
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/avalon-framework.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/batik.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/certificate.war!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/debugging.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/EccpressoAsn1.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/EccpressoCore.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/EccpressoJcae.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/ejbgen.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/fop.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/jconn2.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/jConnect.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/JDIProxy.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/knex.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/mssqlserver4v65.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/ojdbc14.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/QueueTransportEJB.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/uddi.war!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/uddiexplorer.war!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/webserviceclient+ssl.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/webserviceclient+ssl_pj.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/webserviceclient.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wl-j2ee-client.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlai-control.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlcipher.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlclient.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wldb2.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wleorb.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlepool.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wli.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlinformix.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wljmsclient.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wljtaclient.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wloracle.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlspy.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlsqlserver.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlsybase.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlutil.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlw-lang.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlxbean.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wsclient81.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wsse.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/xbean.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/xbeansrc.zip!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/xmlstream.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/xmlx.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/xqrl.jar!/"
              />
              <root type="simple" url="jar://D:/bea/weblogic81/server/lib/weblogic.jar!/"
              />
              <root type="simple" url="jar://D:/bea/user_projects/applications/Test4JMS/JMSandEntity.jar!/"
              />
              </root>
              </classPath>
              [tests.rar]
              

    Hi,
              Your sender is transacted!
              But the sender client never calls
              "session.commit()" - which is required
              to commit the work for transacted sessions.
              So the sender message never gets sent.
              If you don't want a transacted session,
              pass "false" to "createQueueSession()" rather
              than "true" and the send
              will occur immediately.
              Tom
              P.S. For more info on transacted
              sessions see the JMS FAQ and the
              JMS Programmer's Guide.
              Mikler wrote:
              > I have a simple Message EJB and can't make it recive messages. For two days I can't
              > get what's wrong - I've read already three tutorials, but... still nothing. No
              > exceptions... but no messages.
              > Here is it.
              >
              >
              >
              > all files are in attach too...
              >
              > Thank you!!!
              >
              > The bean:
              >
              > package JMSTest;
              >
              > import javax.ejb.*;
              > import javax.jms.*;
              > import weblogic.ejb.*;
              >
              > import EntityTest.TestEntHome;
              > import EntityTest.TestEntLocal;
              > import javax.naming.InitialContext;
              > import javax.naming.NamingException;
              >
              > /**
              > * @ejbgen:message-driven initial-beans-in-free-pool="1" transaction-type="Container"
              > clients-on-same-server="false"
              > * ejb-name = TestJMS
              > * destination-jndi-name = jmstest
              > * destination-type = javax.jms.Queue
              > *
              > * @ejbgen:ejb-local-ref
              > * name="ejb/testlink" local="EntityTest.TestEntLocal" link="testentlink"
              > * home="EntityTest.TestEntLocalHome"
              > * type="Entity"
              > * jndi-name="ent.TestEntLocalHome"
              > *
              > *
              > */
              > public class TestJMS
              > extends GenericMessageDrivenBean
              > implements MessageDrivenBean, MessageListener
              > {
              >
              > private TestEntHome teh;
              >
              > public void ejbCreate() {
              > try {
              > System.out.println("in create");
              > javax.naming.Context ic = new InitialContext();
              > teh = (TestEntHome)ic.lookup("ejb.TestEntLocalHome");
              >
              > }
              > catch(NamingException ne) {
              > System.out.println("Encountered the following naming exception: "
              > + ne.getMessage());
              > }
              > }
              >
              > public void onMessage(Message msg) {
              > System.out.println("in onMessage");
              > MapMessage tmsg = (MapMessage)msg;
              > try{           
              > TestEntLocal tel = teh.create(tmsg.getString("message"));
              > } catch(JMSException e){
              > e.printStackTrace();
              > } catch(CreateException e){
              > e.printStackTrace();
              > }
              > // Your code here
              > }
              > }
              >
              >
              > And The Client. I run client in Idea - not in workshop...:
              >
              >
              > import javax.naming.*;
              > import javax.ejb.CreateException;
              > import javax.ejb.EJBException;
              > import javax.ejb.FinderException;
              > import javax.naming.InitialContext;
              > import javax.naming.NamingException;
              > import javax.jms.*;
              > import java.util.Hashtable;
              >
              > import weblogic.jms.client.JMSConnectionFactory;
              > import weblogic.jms.client.JMSSession;
              > import weblogic.jms.client.JMSConnection;
              >
              > public class Main
              > {
              > private static QueueConnectionFactory factory;
              > private static Queue queue;
              >
              > private static Context getInitialContext() throws NamingException {
              > Hashtable environment = new Hashtable();
              >
              > environment.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              > // environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
              > environment.put(Context.PROVIDER_URL, "t3://localhost:7001");
              >
              > return new InitialContext(environment);
              > }
              >
              > public static void main(String argsp[]){
              > try {
              > javax.naming.Context ic = getInitialContext();
              > factory = (JMSConnectionFactory) ic.lookup("QueueFactory");
              > queue = (Queue) ic.lookup("jmstest");
              > }
              > catch (NamingException ne) {
              > throw new EJBException(ne);
              > }
              > try {
              > //send a message
              > QueueConnection connect = factory.createQueueConnection();
              > QueueSession session = connect.createQueueSession(true,Session.AUTO_ACKNOWLEDGE);
              > QueueSender sender = session.createSender(queue);
              > MapMessage recordingMsg = session.createMapMessage();
              > recordingMsg.setString("message", "Im here");
              > connect.start();
              > sender.send(recordingMsg);
              > connect.close();
              > }
              > catch(JMSException ne) {
              > throw new EJBException(ne);
              > }
              > /* catch(CreateException ce) {
              > throw new EJBException(ce);
              > }
              > catch(FinderException fe) {
              > throw new EJBException(fe);
              > }
              > */
              >
              > }
              > }
              > /*
              > With classpath:
              > <root type="composite">
              > <root type="output" />
              > <root type="jdk" rootType="classPath" name="BEA java version "1.4.1_05""
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/avalon-framework.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/batik.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/certificate.war!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/debugging.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/EccpressoAsn1.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/EccpressoCore.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/EccpressoJcae.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/ejbgen.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/fop.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/jconn2.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/jConnect.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/JDIProxy.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/knex.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/mssqlserver4v65.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/ojdbc14.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/QueueTransportEJB.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/uddi.war!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/uddiexplorer.war!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/webserviceclient+ssl.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/webserviceclient+ssl_pj.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/webserviceclient.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wl-j2ee-client.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlai-control.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlcipher.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlclient.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wldb2.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wleorb.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlepool.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wli.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlinformix.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wljmsclient.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wljtaclient.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wloracle.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlspy.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlsqlserver.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlsybase.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlutil.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlw-lang.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wlxbean.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wsclient81.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/wsse.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/xbean.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/xbeansrc.zip!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/xmlstream.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/xmlx.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/xqrl.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/weblogic81/server/lib/weblogic.jar!/"
              > />
              > <root type="simple" url="jar://D:/bea/user_projects/applications/Test4JMS/JMSandEntity.jar!/"
              > />
              > </root>
              > </classPath>
              > */
              

  • Using Message Driven bean in JDev 9.0.3.2

    Hi all,
    I'm trying to create a Message bean in JDeveloper 9.0.3.2. I've used the wizard which has (very nicely) created me the bean files, i have also set up OC4J server and deployed to it and it seems to run fine.
    Now, i'm trying to create a class (in the same project) that sends a message to the bean but i'm having problems. Session beans in JDev have a very nice option to create a Sample Java Client but there is no equivalent "Sample Message Creator" for message beans.
    Anyway, my code is as follows...
    Context ctx = new InitialContext();
    TopicConnectionFactory factory = (TopicConnectionFactory)ctx.lookup("javax.jms.TopicConnectionFactory");
    ....more code to create and send message
    However, i don't know where to lookup the factory from, this line gives me an error presumably because javax.jms.TopicConnectionFactory is incorrect. What is the Oracle lookup for this ? Where do i find it out from ?
    Any advice would be appreciated, sorry this is not a posting on 10g which i haven't had chance to look at yet (though i hear it's very nice).
    Alistair

    You might find the sample code which is part of OC4J-howto's useful.
    http://otn.oracle.com/tech/java/oc4j/904/index.html
    http://otn.oracle.com/tech/java/oc4j/904/how_to/how-to-ejb-mdb.zip
    raghu
    JDev Team

  • MDB(Message Driven Bean) is not working in MDM2.0.1

    Hi,
    I am trying to use MDB for importing files.I followed the Weblogic_jms_Integration(1308181.1) document and i created all the xml files CM_config.xmCM_ejb-jar.xml.wls.jms_1.includel.win.exit_4.include,CM_config.xml.win.jms.include,CM_ejb-jar.xml.wls.mdb.include,CM_weblogic-ejb-jar.xml.jms.include and put these files in respective directory as mentioned in the document.I have created one XAI inbound service ,XAI JNDI Servers,JMS Connection,Jms Queue and i am putting my msgs in queue in web logic server.But it is nt picking files from queues.It is showing some errors like:
    Error:
    Table CI_XAI_JNDI_SVR has a maintenance program entry CIPXJSVR that is not found in the program components table
    I think here MDB is nt enabling thats why it is not picking the files from queue.
    But we are able to pick that files from queue by MPL.
    Please help me in this regards.
    Thanks.
    SUNIL

    Hi,
    I am trying to use MDB for importing files.I followed the Weblogic_jms_Integration(1308181.1) document and i created all the xml files CM_config.xmCM_ejb-jar.xml.wls.jms_1.includel.win.exit_4.include,CM_config.xml.win.jms.include,CM_ejb-jar.xml.wls.mdb.include,CM_weblogic-ejb-jar.xml.jms.include and put these files in respective directory as mentioned in the document.I have created one XAI inbound service ,XAI JNDI Servers,JMS Connection,Jms Queue and i am putting my msgs in queue in web logic server.But it is nt picking files from queues.It is showing some errors like:
    Error:
    Table CI_XAI_JNDI_SVR has a maintenance program entry CIPXJSVR that is not found in the program components table
    I think here MDB is nt enabling thats why it is not picking the files from queue.
    But we are able to pick that files from queue by MPL.
    Please help me in this regards.
    Thanks.
    SUNIL

  • Message Driven Bean Not Working

    I'm trying to make run in WebLogic 7 an MDB,
    it seems well configured,
    in the XML descriptor ,JNDI names of the destination and the ConnectionFactory
    correspond respectively to a destination wich I have created after having created a JMS server in WBL7 and to a ConnectionFactory
    in the client ,
    I have
    -first obtain an InitialContext
    -then a look-up on the QueueConnectionFactory
    -then createQueueConnectionFactory
    -after createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    -after a look-up on the Queue
    -and then .createSender(queue)
    - and finally createTextMessage();
    to have a simple Textmessagen
    in the administration console of Weblogic
    in "monitor all MDB du .jar"
    for this MDB there 0 bean in Pool,0bean in use
    and the JmsConnectionAlive indicate False,
    it seems curious
    and then in the doc they says something about permission
    an "run as principal" wich need to be put to "receive"
    but I didn't exactly understand where
    because the doc isn't completle up-to-date
    and refer to 6,it seems
    because int the WBL7 the ACL are suppressed
    somebody could help me,
    thanks in advance

    Arman & bzoler,
    Make that three of us. I, am using Weblogic 7 (patch 2) and JBuilder Weblogic edition 7.01. I have configured my JMS topic and can successfully send and receive messages with BEA's sample topic sender and receiver (found in
    C:\bea\weblogic700\samples\server\src\examples\jms\topic, but modified for my factory and topic).
    However, when I try to deploy my MDB and send messages to the topic via their client, no messages are received by the MDB. I know it is deploying OK, because I added a println to the ejbCreate method and it is getting displayed when the server is started.
    Any ideas from anyone out there of where we may be going wrong? Is it possible that you are forced to use Security when using MDB?
    -David

  • Distributed Garbage Collector (DGC)  messages in cluster when using Message Driven Beans

    Version: Weblogic 6.1 SP2
              I'm seeing a lot of messages output on the node ** hosting my JMS
              server/destination ** in the cluster
              <Jun 4, 2002 5:35:03 PM EDT> <Info> <DGCserver> <Tried to renew lease on
              lost reference: '448'>
              Unfortunately, this message coincides with my MDB's ** on other nodes ** not
              being able to lookup the JMS destination that they are configured for.
              MDB's on the same node as the JMS server/destination are able to do lookups
              fine.
              Checking the JNDI tree on all nodes, I see the destinations replicated to
              all nodes. The MDB's use the default (i.e WebLogic's) connection factory
              (weblogic.jms.MessageDrivenBeanConnectionFactory) and I've bumped up the
              polling interval to 5 minutes from the default of 10 seconds.
              Any guidance on this would be greatly appreciated.
              I see that there is a patch available to fix the DCC info messages (April
              ,2002) on dev2dev. Anyone know if this addresses the MDB problem?
              Thanks in advance
              

    FYI - in case anyone else sees this problem - it has been fixed in WLS 6.1
              SP3.
              If you are seeing this problem then you will see a log of
              NoSuchObjectException's in your console.
              Regards
              "Prashant Nayak" <[email protected]> wrote in message
              news:[email protected]...
              > Version: Weblogic 6.1 SP2
              >
              > I'm seeing a lot of messages output on the node ** hosting my JMS
              > server/destination ** in the cluster
              >
              > <Jun 4, 2002 5:35:03 PM EDT> <Info> <DGCserver> <Tried to renew lease on
              > lost reference: '448'>
              >
              > Unfortunately, this message coincides with my MDB's ** on other nodes **
              not
              > being able to lookup the JMS destination that they are configured for.
              > MDB's on the same node as the JMS server/destination are able to do
              lookups
              > fine.
              >
              > Checking the JNDI tree on all nodes, I see the destinations replicated to
              > all nodes. The MDB's use the default (i.e WebLogic's) connection factory
              > (weblogic.jms.MessageDrivenBeanConnectionFactory) and I've bumped up the
              > polling interval to 5 minutes from the default of 10 seconds.
              >
              > Any guidance on this would be greatly appreciated.
              >
              > I see that there is a patch available to fix the DCC info messages (April
              > ,2002) on dev2dev. Anyone know if this addresses the MDB problem?
              >
              > Thanks in advance
              >
              >
              >
              >
              >
              

Maybe you are looking for