WebLogic 10 and spring Message Driven Beans

Hello

I know there's a similar thread on the use of spring mdb in Weblogic 9 (Re: WebLogic 9.2 and spring Message Driven Beans but I just wanted to check was recommended for use in WebLogic 10?)

An answer in the above thread stated: -.

PS. FYI, we hope to improve the AMD spring at some point, but, for various reasons, we generally recommend using WebLogic BMD rather - even when you use the spring for any other purposes. WebLogic BMD include a number of value add capabilities, are very widely tested and adopted and include the ability of transparent works seamlessly with distributed WebLogic destinations.

Is this still applicable for WebLogic 10?

FYI, we were planning to use in a cluster environment that mapped MQ Sonic as a foreign JMS provider.

Thank you very much

Mandy

Is this still applicable for WebLogic 10?

Yes.

Note that WL now supports EJB 3 annotations, so there is now a standard way of BMD as POJO configuration.

For most use cases, I recommend using the [EJB 3.0 Wrapper without Injection | http://download.oracle.com/docs/cd/E15523_01/web.1111/e13727/j2ee.htm#CHDIAICD] as a starting point.

Tags: Fusion Middleware

Similar Questions

  • Message-Driven beans and the order of the messages in the JMS queues.

    Hi all

    We use Weblogic 10.3.6 and we have a cluster with 2 JMS servers. In our project, it is important to process messages in the order when they arrive in the queues.

    Our question is simple enough, the fact that Message-Driven Beans (of the sort that take up messages in parallel) follow the order of the messages? Or do we need to configure something to do this.

    Thank you!

    According to the oracle documentation:

    With the help of unit-of-Order with Destinations spread

    As already mentioned in the Message of treatment according to the specification of JMS, Service of Message in Java specifications (to http://www.oracle.com/technetwork/java/jms/index.html ) doesn't guarantee no message ordered delivery when applications use distributed queues. WebLogic JMS redirects messages with the same disorder unit and have a target distributed to the same distributed destination member. The Member is chosen by unit of the order of the destination configuration:

    You can also

    If you distribute, you can use control unit andmax-beans-in-free-pool:

    http://docs.Oracle.com/CD/E23943_01/Web.1111/e13814/mdbtuning.htm#BABBEFCA

    More information here:

    Using Message unit-of-Order - 11g Release 1 (10.3.6)

    Tuning Message-Driven Beans - 11g Release 1 (10.3.6)

    WebLogic Server (WLS) JMS mapping control unit works with uniform distribution Destinations (Doc ID 1310795.1)

    Best regards

    Luz

  • WebSphere Message Driven Bean pool lack of warning

    I receive after alarm frequently to an application running on WAS v7.

    Subject: JVMNAME_c1: WebSphere Message Driven Bean pool lack of warning

    Message Driven Bean 'JVMNAME_MDB' in the 'APPLICATIONEAR' application server 'JVM1' has a high percentage of pool narrowly with a percentage of 33% Miss. This exceeds the threshold of 25% warning. Please use the following URL for details of the alarm: https://xxxxxxxxxxx.

    According to the Foglight documents:

    If you experience performance problems, check the following:

    The minimum value of the pool size is set too low, so the container must keep naming new swimming entity bean

    ·         Try increasing the minimum size of pool on your application.

    The maximum value of the pool size is set too low, so any thread tries to get an entity bean from the pool to wait in the queue

    ·         Try to increase the number of maximum pool size on your application. For example, assign something exceeds the maximum number of concurrent users.

    I tried to increase the minimum values and maximum pool one at a time, but it did not help. The pool, I changed values to is the Thread Pool found here:

    Application servers--> "server_name"--> service listening for Message--> thread pool.

    Is this the correct pool, I should be hilarious? OR should I change the found here - QCF connection/session pool resources--> JMS--> factories of connection of the queue--> "QCF_NAME"--> Session/connection pools?

    Thanks in advance.

    You have access to the developer or the person who developed the archive application?

    In general as part of an ear or application jar file there are definitions of the minimum number of Maximum number of EJB and EJB in the pool, I think they are in WebSphere ejb - jar.xml and should look something like this.

    2000

    1000

    I see this in the IBM site on weblogic for websphere migration which can give more info

    http://www.IBM.com/developerWorks/WebSphere/library/techarticles/0706_vines/0706_vines.html#sec4c

    C. max-beans-in-free-pool and initial-beans-in-free-pool

    The element of max-beans-in free-pool sets the maximum size of the EJB free pool for a specific entity bean, bean session without State or message-driven bean. Each bean class can define the size of its own pool for free using this element.

    The element initial-beans on free-pool sets the initial number of instances of bean that will fill the free pool for a specific startup bean class. Filling the free pool with bodies improves initial response times, as initial applications for the bean can be met without generating a new instance.

    In WebLogic, every bean in the application can specify that its initial and maximum pool size and pool size may vary considerably from one Bean to another class.  To determine the specific pool size, see the weblogic-ejb - jar.xml for one of these items:


    To specify the size of the EJB pool in WebSphere Application Server, you can add an argument of the system to the JVM:

    1. In the administration console, select application-online-online Process Definition servername server => Java Virtual Machine.
    2. Add com.ibm.websphere.ejbcontainer.poolSize to the area of Generic JVM arguments, after all the existing JVM arguments. Here is an example that sets the size of the pool maximum and minimum of 1-5 for a bean called RuleEngineEJB:
    -Dcom.ibm.websphere.ejbcontainer.poolSize = myapp #RulesEngine.jar #example. RulesEngineEJB = 1, 5

    For more details, see WebSphere Tuning EJB container .

    Hope this helps

    Golan

  • Problem message driven bean deployment use Log4j

    Hi all.

    Using JDeveloper 11.1.1.0.2, I'm having a problem with a message driven bean, I created and associated to a JMS queue.

    I created a project of EJB Module in my application (in which other projects exist) and created the bean. A simple test of the bean, sending a message through the jms queue and printing on system.out in the mdb onMessage() works beautifully.

    However, when I add a Commons of apache logging to my mdb, things start to go wrong. The project running on the integrated weblogic server 10.3 fails just during the deployment, due to a NoClassDefFoundError on org/apache/log4j/Logger.

    Properties of the project-> libraries and classpath, I added a log4j library (Log4j - 1.2.14.jar) next to Commons Logging 1.0.4 but it does not matter whatever it is.

    My grain of message code:
    @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 anyone have an idea as to what I could do wrong or missing here?

    The full 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 August 5, 2009 13:57

    Edited by: Eelse August 5, 2009 17:39

    Create a new profile of deployment (EAR), including the original deployment (POT) and the libraries needed (in a lib directory) solved the problem.

  • Only 1 thread processes messages from abroad CMT Message Driven Beans?

    Hello

    I have an MDB configured to use CMT with a transaction REQUIRED attribute. When I deploy this bean, I get this warning: -.
    <24-Nov-2010 23:29:18 o'clock GMT> <Warning> <EJB> <BEA-010081> <The message-driven bean 
    WLPooledSonicJmsTransactionRequiredMessageDrivenBean was configured to use a JMS Topic, requires container-managed transactions, and uses a foreign JMS provider. Only one thread will be used to receive and process all messages.>
    This 1 only average MDB will never be active reading the posts off topic, even if I'm max-beans-in-pool built to a larger number?

    All links to documentation on this warning would be much appreciated.

    Thank you

    Mandy

    Published by: MandyWarren on December 1st, 2010 15:18 - fixed tags

    Published by: MandyWarren on December 1st, 2010 15:18

    Is this a reasonable sentence summary?

    Yep!

  • Message-driven bean 'loses' status and icon MDB

    He helps JDev v11.1.1.5.0, when I create an MDB in my project using the wizard, initially is displayed with MDB icon next to it (a small envelope with a trombone). However, about one second later, the icon becomes a normal icon 'Java' (coffee cup). I also noticed that the MDB class does NOT appear in the project properties | EJB module. List of EJB 3.0 Classes annotated. The net result is that when the application is deployed, the MDB is not register to listen to, so it will never receive JMS messages.

    I tried to create a new application from scratch and created the exact same MDB. In this application, the l' icone icon "sticks" and the class is displayed in the list box "Annotated EJB 3.0 Classes" in the project properties dialog box. (And it will record correctly to receive JMS message on deployment).

    So obviously something is different/wrong with my real application that it prevents to recognize that the MDB class is an MDB. But, I don't know what. I have looked at all the settings in the project properties, looked at the real project .jpr file, etc and you don't see anything that would cause an application to fail to recognize the multilateral development banks.

    Anyone have any suggestions on how to understand why my MDB classes are not recognized as such in the Application?

    Here's the class that I am using:

    package com.acme;
    import javax.ejb.MessageDriven;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    
    @MessageDriven(mappedName = "acme.DefaultQueue")
    public class MessageEJB implements MessageListener {
        public void onMessage(Message message) {
             // ... code here ...
        }
    }

    Thank you

    Karl

    For those who have this problem on the road, here's what I found... It seems that there is a corrupt file "cache" or something in the project. Specifically, I had to delete the files in the -\classes\.data\00000000 folder. Once I deleted these files (especially .jdb) and restart JDeveloper, the correct icon displayed next to my MDB classes, AND they also came properly in the project properties | The Console of the EJB component.

    I'm not sure what are these files, but I guess they are the cache files and automatically get recreated by JDeveloper when necessary. I hope this helps someone else who has the same problem!

  • EJB3 Message-Driven Bean

    I'm developing a simple MDB using ejb3. When I deploy, I get an error to the effect that
    My MDB does not have a configured message destination. This must be defined by using a message-destination-link,
    jndi-destination, destination-resources-link name or a resource-adapter-jndi-name.

    First of all, there are examples of a compatable weblogic EJB3 MDB there? I use the popular
    EJB3 in Action as a reference, but they have nothing in there that seems to work.

    Then, this can be done by dependency injection? I wrote a file of weblogic-ejb - jar.xml and in this, I have included a
    destination-JNDI-name tag. Somehow, it doesn't get picked up?

    Any help would be appreciated!

    Thank you

    John

    BMD is created lazily. Check the status of deployment of MDB in console WLS (deployments-> your mdb-> monitoring). If the State says connected, you can test the mdb with your customer. If not, see the console output or newspapers for what has gone wrong.

    The client that I used for the test looks like this. I built using JDeveloper and modified it a bit:

    package mdb;
    
    import java.util.Date;
    import java.util.Properties;
    
    import javax.jms.JMSException;
    import javax.jms.Queue;
    import javax.jms.QueueConnection;
    import javax.jms.QueueConnectionFactory;
    import javax.jms.QueueSender;
    import javax.jms.QueueSession;
    import javax.jms.TextMessage;
    
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    
    public class MessageDrivenEJBBeanClient {
        public static void main(String [] args) {
            final Properties env = new Properties();
            env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
            env.put(Context.PROVIDER_URL, "t3://localhost:7001");
            env.put(Context.SECURITY_PRINCIPAL, "user");
            env.put(Context.SECURITY_CREDENTIALS, "password");
            final Context ic;
            try {
                ic = new InitialContext(env);
            } catch (NamingException e) {
                throw new RuntimeException("No initial context", e);
            }
    
            final QueueConnectionFactory qcf;
            final Queue destQueue;
            try {
                qcf = (QueueConnectionFactory)ic.lookup("weblogic.jms.ConnectionFactory");
    
                // Lookup should specify the queue name that is mentioned as "mappedName" in MessageDriven Bean.
                destQueue = (Queue)ic.lookup("mdbQueue");
            } catch (NamingException e) {
                throw new RuntimeException("No jms object", e);
            } finally {
                try{
                    ic.close();
                } catch (NamingException ignored) {}
            }
    
            final QueueConnection connection;
            try {
                connection = qcf.createQueueConnection();
            } catch (JMSException e) {
                throw new RuntimeException("No jms connection", e);
            }
    
            try {
                final QueueSession session = connection.createQueueSession(false, 0);
                final QueueSender sender = session.createSender(destQueue);
                final TextMessage msg = session.createTextMessage("Hello World at " + new Date());
                sender.send(msg);
            } catch (JMSException e) {
                throw new RuntimeException("jms send failed", e);
            } finally {
                try {
                    connection.close();
                } catch (JMSException ignored) {}
            }
        }
    }
    
  • JSF and Spring view scope

    Hi all

    I am new to JSF and Spring.

    We are implementing our project.

    We must apply within sight JSF using spring.

    On the net I found the code to implement the scope of the display custom next spring

    public Object get (String name, ObjectFactory objectFactory) {}
    If (FacesContext.getCurrentInstance () .getViewRoot ()! = null) {}
    UIViewRoot UIViewRoot is FacesContext.getCurrentInstance () .getViewRoot ();.
    Card < String, Object > viewMap = UIViewRoot.getViewMap ();

    If (viewMap.containsKey (name)) {}
    Return viewMap.get (name);
    } else {}
    Object object = objectFactory.getObject ();
    viewMap.put (name, object);
    Returns the object;
    }
    } else {}
    Returns a null value.
    }
    }


    I've implemented view scope in backing bean like this

    @Component ("ManageOwnShares")
    @Scope ("view")
    But in or Dev Environment, he started to say error compilation cannot find the symbol getViewMap() in the javax.faces.component.UIViewRoot class.

    We use Jboss4.3, JSF 2.0 and 2.5 spring. Since Jboss4.3 is having an older version of JSF pots, we have new version of JSF 2.0 in pots inside the web-inf/lib path. We have the sequel to reference in the web.xml file entry

    < context-param >
    org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL < param-name > < / param-name >
    < param-value > true < / param-value >
    < / context-param >

    We cannot change the build path to solve the server build.xml compile error. Sinus that the same server is also used for other applications.

    Y at - it another way to implement viewscope.

    I think you have a classpath confrontation. JSF 1.2 pots and pots of JSF 2.0 are probably get mixed. JBoss 4.2 is an eccentric server at first - half between 1.4 JEE and JEE5. If you want to use JSF 2 then I would consider moving to JBoss 6 or 7 (both of which work perfectly well; I migrated some apps from JBoss 4.2 to these platforms).

    In any case, this document:

    https://community.JBoss.org/wiki/UpgradeJBossASToJSF2

    advise to actually upgrade the version of the JSF, installed in the JBoss instance instead of deploy with your application. JBoss 4.2 does not recognize beans JSF managed as a resource on server, so the EJB injections do not work for example. There is workaround solutions documented, like this:

    https://community.JBoss.org/message/522790

    But I want to emphasize one point: you use JBoss 4.3, which means that it is without doubt the JBoss Enterprise platform. There is a reason that JBoss itself does not provide JSF 2 - its not supported. JBoss 4.x is too old and its not meet specifications. Even when make you it work, it can still cause unexpected behavior and does not quite work right. Be aware of this.

  • Create and confirm handful of bean

    I need to create a message confirm (with an OK and Cancel button) of a bean and handle OK and cancel within that bean. I know that I can create one on a page, but I would create it pro-grammatically. I can't find a class or method that will create a meessage confirm as a normal message. Is this possible? \

    Thank you

    User, there is no such class, you can use. If you really want to do everything in the bean, that to build the popup caught by using the RichPopup class.

    Then, you will need to add the context menu in the tree of components and show it.

    It would be much simpler to create the popup on the page and only control of the bean.

    Timo

  • How to disable registration of keys and handwritten messages?

    Hey, all. I looked everywhere in my settings but have had no luck. My phone is automatically record all keys and handwritten messages and I'm afraid it'll take too much memory on my phone. Is it possible to disable that?

    Thank you!

    Hello

    Unfortunately there is no option to turn it off

    However, there are two options to limit the amount of things that are stored on your device

    • Press and hold the message, select and click on the trash
    • Set iOS to only save messages for 30 days via Configuration-> Messages-> messages of Dungeon (However this will also remove text messagess)
  • Are there any quick replay of the notification Center of whatsapp and messenger on ios10 apps and sms messages?

    Are there any quick replay of the notification Center of whatsapp and messenger on ios10 apps and sms messages?

    See if this information from the iPhone user Guide helps. http://help.Apple.com/iPhone/10/#/iph6534c01bc

  • How to navigate to open the message to the Inbox to show all unread and read messages?

    Need for Thunderbird:
    Scenario: My Inbox is overflowing with unread and read messages. I like it at least for a while.
    I select and read a new message. I do not delete it. Then, I want to return to the full total Inbox to read and unread with a smart key messages. Part of use / available now? Right now I use... high slider to the screen and work through all the headings of e mail anyway until I return to the title that reads "Inbox." Slow and frustrating. Any solution please? Thank you

    It is Ctrl + Ctrl + 9 1 moves to the last tab on the right

  • I have now installed this last 37.01 on two computers of desktop PC and both are break much and giving message firefox still works?

    I have now installed this last 37.01 on two computers of desktop PC and both are break much and giving message firefox still works?

    Use "Firefox > output" (Windows: Firefox/file > quit;) Mac: Firefox > quit Firefox. Linux: Firefox/file > exit) to close Firefox if you are currently doing by clicking on the X close in the title bar of Firefox.

  • Is it possible to play different sounds for the emails and instant messages?

    Hello

    I was wondering if it was possible to play different sounds for the emails and instant messages. I use Thunderbird quite often with emails and instant messages imported from Gtalk.

    I think it would be very convenient to be able to distinguish the two sounds, because they do not involve the same things.

    Thank you very much.

    Olivier Hubert.

    There are only six modules of cat, three of them are on notifications. Choose the one you think will do the job for you. https://addons.Mozilla.org/en-us/Thunderbird/Extensions/chat/?sort=popular

  • cannot drag and drop messages in mail folders

    cannot drag and drop messages in mail folders

    Try to restart (reboot) your machine

Maybe you are looking for