Problems in startup class (MDB on Weblogic 7.0 / IBM MQ)

Hello friends,
          I am trying to communicate with IBM MQ through Weblogic 7.0 SP2 and
          using MDB.
          This is a bit strange but I had to reinstall Weblogic and I tried to
          deploy the Startup class . However I am getting this error:
          The WebLogic Server did not start up properly.
          Exception raised:
          java.lang.NoSuchMethodError
          at com.ibm.mq.jms.services.ConfigEnvironment.<clinit>(ConfigEnvironment.java:173)
          at java.lang.Class.forName0(Native Method)
          I am totally at loss to understand this as it was working before I
          reinstalled the Weblogic. (Maybe I am skipping something which I had
          earlier done :-().
          All help appreciated.
          Thanks in advance,
          Milan Doshi
          

Since your simply running an MQ client in a startup class, you should
          be able to reproduce the issue without WebLogic in the mix. Once
          that is done, contact IBM for support. I continue to suspect
          a command-line problem - IBM is expecting something on
          the java JVM command-line that is missing.
          Tom
          Milan Doshi wrote:
          > Hello Tom,
          >
          > Thanks for the reply. I did ensure that all the relevant IBM jars are
          > in the classpath but I still get that error.Infact the claspath was
          > allready in place.
          >
          > Please give me your suggestions as I am totally at sea.
          >
          >
          > <May 23, 2003 5:31:17 PM EDT> <Emergency> <WebLogicServer> <000342>
          > <Unable to initialize the server: Fatal initialization excepti
          > on
          > Throwable: java.lang.NoSuchMethodError
          > java.lang.NoSuchMethodError
          > at com.ibm.mq.jms.services.ConfigEnvironment.<clinit>(ConfigEnvironment.java:173)
          > at java.lang.Class.forName0(Native Method)
          > at java.lang.Class.forName(Class.java:115)
          > at com.ibm.mq.jms.MQConnection.<clinit>(MQConnection.java:149)
          > at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:142)
          > at com.jpmc.ivr.middle.util.MQJMSStartup.startup(MQJMSStartup.java:112)
          > at weblogic.t3.srvr.StartupClassService.invokeStartup(StartupClassService.java:158)
          > at weblogic.t3.srvr.StartupClassService.invokeClass(StartupClassService.java:139)
          > at weblogic.t3.srvr.StartupClassService.access$0(StartupClassService.java:130)
          > at weblogic.t3.srvr.StartupClassService$1.run(StartupClassService.java:102)
          > at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
          > at weblogic.t3.srvr.StartupClassService.invokeStartupClass(StartupClassService.java:97)
          > at weblogic.t3.srvr.StartupClassService.initialize(StartupClassService.java:60)
          > at weblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.java:54)
          > at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
          > at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
          > at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
          > at weblogic.Server.main(Server.java:32)
          >
          > ***************************************************************************
          > The WebLogic Server did not start up properly.
          >
          > Thanks and regards,
          >
          > Milan Doshi
          >
          > Tom Barnes <[email protected]> wrote in message news:<[email protected]>...
          >
          >>Make sure that your MQ client classes are in
          >>the classpath used to boot the WL JVM. If you
          >>re-installed WL, and are using the installation's
          >>WL boot scripts rather than your own, the JVM
          >>will have a vanilla classpath - which, of course,
          >>won't include IBM classes.
          >>
          >>Tom
          >>
          >>Milan Doshi wrote:
          >>
          >>>Hello friends,
          >>>
          >>>I am trying to communicate with IBM MQ through Weblogic 7.0 SP2 and
          >>>using MDB.
          >>>
          >>>This is a bit strange but I had to reinstall Weblogic and I tried to
          >>>deploy the Startup class . However I am getting this error:
          >>>
          >>>
          >>>The WebLogic Server did not start up properly.
          >>>Exception raised:
          >>>java.lang.NoSuchMethodError
          >>> at com.ibm.mq.jms.services.ConfigEnvironment.<clinit>(ConfigEnvironment.java:173)
          >>> at java.lang.Class.forName0(Native Method)
          >>>
          >>>I am totally at loss to understand this as it was working before I
          >>>reinstalled the Weblogic. (Maybe I am skipping something which I had
          >>>earlier done :-().
          >>>
          >>>All help appreciated.
          >>>
          >>>Thanks in advance,
          >>>
          >>>Milan Doshi
          >>
          

Similar Messages

  • Problem with startup classes

    Hi,
    I am using a custom connection pool to make database connection.I have a
    start up class in which i am initialising the connection pool.This part
    works fine at the time of start up of the server.
    But, when i run my application which is trying to access the database , i am
    unable to get handle to the above created pool.
    Is this because of two different classloaders being used for start up
    classes and web application?
    If so, what could be the possible solution?If anybody knows please let me
    know.

    1. use jndi to register and locate your resource.(connection pool). this
    could be one solution
    2. Instead load thru' your startup class a file prop file wherein you tell
    weblogic the name and property of the coonection pool. Use these properties
    to create a connection pool.
    3. There is a connection API within weblogic to write java code to create
    your connection pool.
    Hope these things helps.
    Chandra
    "makkineni" <[email protected]> wrote in message
    news:3a8afc20$[email protected]..
    Hi,
    I am using a custom connection pool to make database connection.I have a
    start up class in which i am initialising the connection pool.This part
    works fine at the time of start up of the server.
    But, when i run my application which is trying to access the database , iam
    unable to get handle to the above created pool.
    Is this because of two different classloaders being used for start up
    classes and web application?
    If so, what could be the possible solution?If anybody knows please let me
    know.

  • Weblogic startup class: problem calling EJB's

    Has anyone ever experienced a problem in using a startup class (registered in weblogic.properties)
    and tried to lookup and use an EJB in the same application?
    Basically, I have a startup class which registers to receive messages from an
    MQ queue, and when it receives a message, it tries to do a lookup of a bean and
    use it, but I receive a 'NullPointerException'.
    I'm running Weblogic 5.1
    (I know that Weblogic 6.0 makes use of MessageDrivenBeans, but my app isn't using
    6 or EJB 2.0)
    Thanks...

    Can you post weblogic.log? Are you sure that EJB was deployed successfully.
    Also comment the PROVIDER_URL in initial context and see if that solves the problem
    Viresh Garg
    BEA Systems
    shaun wrote:
    The exception is simply a 'NullPointerException' coming from the startup class
    (I don't have the old log file or I would include the trace here.). Basically,
    when my startup class receives a call to the onMessage(...) method (from listening
    for messages), it looks up an EJB on the server, through the InitialContect class
    and gets a 'null' returned back, thereby throwing the NullPointerException.
    If anyone else is successful in having a startup class which can lookup and call
    an EJB within the same Weblogic server, please help.
    Thanks again....
    Viresh Garg <[email protected]> wrote:
    Can you post the exception stack trace? Also what exactly are you doing
    in startup class.
    Viresh Garg
    Principal Developer Relations Engineer
    BEA Systems
    Shaun wrote:
    Has anyone ever experienced a problem in using a startup class (registeredin weblogic.properties)
    and tried to lookup and use an EJB in the same application?
    Basically, I have a startup class which registers to receive messagesfrom an
    MQ queue, and when it receives a message, it tries to do a lookup ofa bean and
    use it, but I receive a 'NullPointerException'.
    I'm running Weblogic 5.1
    (I know that Weblogic 6.0 makes use of MessageDrivenBeans, but my appisn't using
    6 or EJB 2.0)
    Thanks...

  • Weblogic Startup Class

    Hello,
    I need to set up a start up class for quartz jobs in my weblogic server.
    I have created the startup class from the weblogic console but i dont know where to put the class or java file.
    Where is it read from?

    follow this :
    http://download.oracle.com/docs/cd/E13222_01/wls/docs81/ConsoleHelp/startup_shutdown.html#1108355

  • Unable to create thread from startup class

    Hi,
    We are trying to create thread from our scheduler class. This scheduler class
    is called from a Startup class configured in WebLogic 7. But we failed to create
    thread. It does not showing any error also. Can anyone plz suggest what could
    be the problem.
    Thanks & Regards,
    Siddhartha

    Hi,
    We are trying to create thread from our scheduler class. This scheduler class
    is called from a Startup class configured in WebLogic 7. But we failed to create
    thread. It does not showing any error also. Can anyone plz suggest what could
    be the problem.
    Thanks & Regards,
    Siddhartha

  • About startup classes

    Hi !
    I got a problem using startup classes.
    When i use web interface from wls 6.0, it is not clear to me how i can use it.
    I write the name of startup class, ok, then, i write the class name, then , incluing
    all path ?
    Well, i tried writing with path, without path, and wls shows the same:
    bla bla ... startup class : classdefnofound
    do i need to add to the classpath environment?
    Why ?
    jsanza

    Yes, you need to compile your startup class into a directory that is in the CLASSPATH.
    Of course, the drawback is that any classes referenced by your startup classes also need
    to be in the CLASSPATH (which can be a problem if your startup class tries to call EJBs
    thus you end up putting some EJB-related classes in the CLASSPATH preventing these beans
    from being reloaded).
    jsanza wrote:
    Hi !
    I got a problem using startup classes.
    When i use web interface from wls 6.0, it is not clear to me how i can use it.
    I write the name of startup class, ok, then, i write the class name, then , incluing
    all path ?
    Well, i tried writing with path, without path, and wls shows the same:
    bla bla ... startup class : classdefnofound
    do i need to add to the classpath environment?
    Why ?
    jsanza

  • Problems with Deployment, Startup classes and MBeanHome

    Hello,
    we have the following problem: How to initialize our application
    correctly???
    We are using MDBs as message consumers but have to guarantee the order of
    incoming
    messages. Due to a shortcoming in the JMS implementation (Order of
    redelivered messages
    is not guaranteed before WLS 8.1!!!) we are using a singleton class to keep
    the health state
    of the different message queues within the application (controlling whether
    the MDBs are
    supposed to proceed with processing or to discard any incoming messages).
    Thus the MDBs
    have to access this singleton, what implies latter has to be initialized
    prior to the application
    deployment. That's what we are using a startup class for, which is marked to
    be loaded before
    appplication deployment...
    Fortunately the according bug is fixed with WLS 7.0.2.0, so the class is
    loaded, but we are
    not able to access the MBeanHome interface (We like to register MBean to
    provide
    adminstrative access to the health state)!!!
    javax.naming.NameNotFoundException: Unable to resolve
    'weblogic.management.home.localhome' Resolved: 'weblogic.management'
    Unresolved:'home' ; remaining name 'home.localhome'
    at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
    So when is the MBeanServer started???
    Before application deployment??? After??? Is there any way to tell WLS not
    to load the startup
    class before the MBeanServer is available respectively the MBeanHome is
    accessible via JNDI
    but before application deployment???
    Any hints are welcome!!!
    Regards,
    CK

    this seems like a bug. the mbeanhome should be available for lookup in
    startup classes. also posting to system management newsgroup.
    "Carsten Kaiser" <[email protected]> wrote in message
    news:[email protected]..
    Hello,
    we have the following problem: How to initialize our application
    correctly???
    We are using MDBs as message consumers but have to guarantee the order of
    incoming
    messages. Due to a shortcoming in the JMS implementation (Order of
    redelivered messages
    is not guaranteed before WLS 8.1!!!) we are using a singleton class tokeep
    the health state
    of the different message queues within the application (controllingwhether
    the MDBs are
    supposed to proceed with processing or to discard any incoming messages).
    Thus the MDBs
    have to access this singleton, what implies latter has to be initialized
    prior to the application
    deployment. That's what we are using a startup class for, which is markedto
    be loaded before
    appplication deployment...
    Fortunately the according bug is fixed with WLS 7.0.2.0, so the class is
    loaded, but we are
    not able to access the MBeanHome interface (We like to register MBean to
    provide
    adminstrative access to the health state)!!!
    javax.naming.NameNotFoundException: Unable to resolve
    'weblogic.management.home.localhome' Resolved: 'weblogic.management'
    Unresolved:'home' ; remaining name 'home.localhome'
    at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
    So when is the MBeanServer started???
    Before application deployment??? After??? Is there any way to tell WLS not
    to load the startup
    class before the MBeanServer is available respectively the MBeanHome is
    accessible via JNDI
    but before application deployment???
    Any hints are welcome!!!
    Regards,
    CK

  • A startup class to enable MQ Queues to trigger MDBs in WLS 6.1(sp4)

              Hi,
              I am hoping for references to documentation or opinions on the following method
              allowing the use of MQ queues to drive MDBs in WLS. The technique involves rebinding
              the connection factory in jndi at "weblogic.jms.MessageDrivenBeanConnectionFactory"
              with MQs connection factory.
              I read in various newsgroup posts that replacing WLS' ConnectionFactory with MQ's
              in a startup class will not allow MDBs to be linked to an MQ queue because startup
              classes are run after MDB deployment during startup. However I found some unused
              in-house code which appeared to do just that and it works.
              Here is the code in abbreviated form:
              public String startup(String str, Hashtable args) throws Exception
                   bindMQFactory();
                   bindMQQueues();
                   return "";
              private void bindMQFactory() throws Exception
                   // Create MQ Factory and configure it
                   MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
                   factory.setChannel(channel );
                   factory.setHostName(host);
                   factory.setPort(Integer.parseInt(port));
                   factory.setQueueManager(qmanager);
                   factory.setTransportType( JMSC.MQJMS_TP_CLIENT_MQ_TCPIP );
                   // bind connection factory into WLS JNDI for later use by clients
                   _wlsContext.bind( connectionFactoryJndi, factory );
                   // Force mq connection factory to be the one used for mdb's
                   _wlsContext.rebind("weblogic.jms.MessageDrivenBeanConnectionFactory", factory);
              private void bindMQQueue() throws Exception
                   // create queue and configure it
                   MQQueue queue = new MQQueue();
                   queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ );
                   queue.setBaseQueueName( mqQueueName );
                   // bind queue in WLS JNDI
                   _wlsContext.bind( wlsJndi, queue );
              Thanks in advance for any comments or opinions on the above.
              regards
              Martin
              

    Start with the white-paper:
              "Using Foreign JMS Providers with WebLogic Server"
              Note that to get transactional behavior you
              will need to use the WebLogic Messaging Bridge feature.
              Note that integrating MQ is easier in 8.1 - consider
              using WL 8.1 if you can.
              One more comment in-line.
              Martin wrote:
              > Hi,
              >
              > I am hoping for references to documentation or opinions on the following method
              > allowing the use of MQ queues to drive MDBs in WLS. The technique involves rebinding
              > the connection factory in jndi at "weblogic.jms.MessageDrivenBeanConnectionFactory"
              > with MQs connection factory.
              Not recommended. Highly not recommended. Do not use the same name
              as the internal factory. Create your own name for a CF, and change the
              weblogic ejb jar to reference your name. The above white-paper
              states how to do this.
              >
              > I read in various newsgroup posts that replacing WLS' ConnectionFactory with MQ's
              > in a startup class will not allow MDBs to be linked to an MQ queue because startup
              > classes are run after MDB deployment during startup. However I found some unused
              > in-house code which appeared to do just that and it works.
              >
              > Here is the code in abbreviated form:
              > public String startup(String str, Hashtable args) throws Exception
              > {
              >      bindMQFactory();
              >      bindMQQueues();
              >
              >      return "";
              > }
              >
              > private void bindMQFactory() throws Exception
              > {
              >
              >      // Create MQ Factory and configure it
              >      MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
              >      factory.setChannel(channel );
              >      factory.setHostName(host);
              >      factory.setPort(Integer.parseInt(port));
              >      factory.setQueueManager(qmanager);
              >      factory.setTransportType( JMSC.MQJMS_TP_CLIENT_MQ_TCPIP );
              >
              >      // bind connection factory into WLS JNDI for later use by clients
              >      _wlsContext.bind( connectionFactoryJndi, factory );
              >
              >      // Force mq connection factory to be the one used for mdb's
              >      _wlsContext.rebind("weblogic.jms.MessageDrivenBeanConnectionFactory", factory);
              > }
              >
              > private void bindMQQueue() throws Exception
              > {
              >      // create queue and configure it
              >      MQQueue queue = new MQQueue();
              >      queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ );
              >      queue.setBaseQueueName( mqQueueName );
              >
              >      // bind queue in WLS JNDI
              >      _wlsContext.bind( wlsJndi, queue );
              > }
              >
              > Thanks in advance for any comments or opinions on the above.
              >
              > regards
              >
              > Martin
              

  • Weblogic startup class and EAR file

    Hi,
    I am using WL 8.1.5.
    I have a weblogic starup class MyStartup that implements T3StartupDef. (it does not specify package).
    I jar-ed it. And I placed MyStartup.jar file into the MyEA.ear file. And I placed that into applications dir.
    With WL Console I defined the startup class and for the ClassName specified MyStartup.
    Yet I get the java.lang.ClassNotFoundException.
    I also have a Manifest.mf file with
    Class-Path: MyStartup.jar
    Please help me solve this problem, I literally don't know what to do next.
    MB

    Hi,
    thanks.
    This seems like a completely opposite method of the depplying startup class with weblogic console.
    Does my class still need to implement T3StartupDef?
    I get this exception. And my classnotfound is still there.
    Exception:weblogic.management.ApplicationException: startup.MyStartup
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2484)
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2396)
         at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:883)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:591)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500)
         at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    Regards,
    MB

  • Weblogic Startup Class does not run as Windows Service

    If you know the answer, plase send me an email at [email protected]
    I'm running a weblogic startup class that starts a Thread. I need to
    run a batch program that should be running as long as WebLogic is
    running (to process new orders).
    It works fine when I run WebLogic (5.1 SP8) from a script, but causes
    problem when I'm running it as a Windows Service. It calls the
    startup class, however, the startup class never spawns the Thread
    class.
    Following is excerpts from different components:
    =============================================================
    *** weblogic.properties ***
    weblogic.system.startupClass.pdfCreatorStart=WebLogicStartupPdfCreator
    *** WebLogicStartupPdfCreator.java ***
    public class WebLogicStartupPdfCreator implements T3StartupDef {
    public String startup(String name, Hashtable args) throws
    Exception {
    Thread t = new ProductionPdfBatchRunner();
    t.start();
    return "success";
    *** ProductionPdfBatchRunner.java ***
    public class ProductionPdfBatchRunner extends Thread {
    public void run() {
    try {
    //work being done here
    this.sleep(30000);
    catch (InterruptedException ie) {               
    catch(Exception e) {
    e.printStackTrace();
    =============================================================
    Thanks for any help

    Hi,
    Ok. Few suggestions.
    1. Can you review the SAP note:
    552286  Troubleshooting for the SAP Web Dispatcher
    2. When you said: "web dispatcher does not get started ", what error you got ? Can you be more details here ?
    3. Please check the trace file dev_webdisp" that generated in the work directory. If the log entries is not abvious, increase the trace level to 2 or 3, and reproduce and re-check the trace file.
    4. What is the output of the command "sapwebdisp -v"
    5. How about sapwebdisp.pfl ? Are those settings correct ?
    Hope this helps.
    Regards,
    Vincent

  • Startup Class in WebLogic server 6.1

    I Have a Java application as startup class in Weblogic server 6.1 . I need to stop
    the application without restarting the Weblogi server (The startup class should
    be removed and the change should be reflected in WebLogic server). Is it possible
    to achieve this. I Know that we can remove the startup class from the console
    but the change is getting reflected only if i restart the WebLogic Server. Can
    some one help me out ?.
    Thanks,
    S Gopikrishna

    Even if it is EJB-only, adding .war with startup logic will be more convinient
    than startup classes.
    S Gopikrishna <[email protected]> wrote:
    Hi
    Thanks a lot for the info. My application is not servlet based rather not
    web based. In this case how to solve my startupclass problem.
    Regards,
    S Gopikrishna
    Dimitri Rakitine <[email protected]> wrote:
    You can deploy web-app(stand-alone, or as a part of an EAR), which has
    servlets marked as
    load-on-startup (in that case you can use servlet's init() method to
    perform your startup
    logic), or has servlet context listeners registered
    (http://e-docs.bea.com/wls/docs61/webapp/app_events.html#177041) - contextInitialized()
    callback will be called when application is deployed, and contextDestroyed()
    will be called when application is undeployed.
    S Gopikrishna <[email protected]> wrote:
    Thanks a lot for the info. Iam pretty new to WeblogicServer. Can utell me about
    how to use load-on-startup servlets or application listeners ?.
    Thanks in Advance
    S Gopikrishna
    Dimitri Rakitine <[email protected]> wrote:
    You can look into using load-on-startup servlets or application listeners
    instead
    of startup classes in 6.1 - that way you can redeploy your application
    and re-execute
    it's startup logic without placing any classes in the system classpath
    or restarting
    WebLogic.
    S Gopikrishna <[email protected]> wrote:
    I Have a Java application as startup class in Weblogic server 6.1
    I need to stop
    the application without restarting the Weblogi server (The startupclass should
    be removed and the change should be reflected in WebLogic server).Is it possible
    to achieve this. I Know that we can remove the startup class from
    the
    console
    but the change is getting reflected only if i restart the WebLogicServer. Can
    some one help me out ?.
    Thanks,
    S Gopikrishna--
    Dimitri--
    Dimitri
    Dimitri

  • WLS 10.0 Mp1 - Weblogic startup class to initialize client's SSL channels

    Hi,
    Is it possible to use Weblogic startup class to initialize client's SSL channels?
    Any pointers are appreciated.
    Thanks in advance.

    Hey
    If possible can you explain the issue in detail.
    What do you mean by “initialize client's SSL channels”
    Regards,
    Hussain

  • Weblogic startup class (urgent)

    Hi All,
    I need a java program (weblogic startup class) which should fetch data from the database and instantiate another one class (it will be the data holder) and store that object into a webapplication context. Anyone tried this? Since its urgent any help will be appreciated.
    Thanks in advance
    Cheers,
    Pandiaraj

    Do this in the init() method of a servlet and start
    the servlet when you start your weblogic server
    second that. just give a value of 1 for <load-on-startup> in web.xml

  • Probelems with MDB listening to MQ (Startup class issue )

    Hello ,
              I am supposed to write a Message driven bean that would reside on
              Weblogic7.0 and listen to a particular queue of IBM MQ.
              I understand that we need to write a Start-up class for this. I have
              written the start-up class but I am getting the following error:
              <Apr 16, 2003 3:17:14 PM EDT> <Warning> <EJB> <010061> <The
              Message-Driven EJB: SimpleMDB is unable
              to connect to the JMS destination: ivtQ. The EJB container will
              automatically attempt to re-establis
              h the connection with the JMS server. This warning may occur during
              WebLogic Cluster start-up if the
              JMS destination is located on another server. When the JMS server
              connection is re-established, the
              Message-Driven EJB will again receive JMS messages.
              The Error was:
              The JMS destination with the JNDI name: ivtQ could not be found.
              Please ensure that the JNDI name in
              the weblogic-ejb-jar.xml is correct, and the JMS destination has been
              deployed.>
              I understand that there are some configuration issues:
              Can you please guide where am I going wrong:
              1.     What should be the value of the <destination-jndi-name> in the
              Weblogic-ejb-jar. I have not passed any Queue name through the
              start-up class &#8230;Is it ok?
              2.     Then what queue name should I specify. (ofcousrse it should be the
              MQ queue name but do I need to add that in the JNDI or in the
              weblogic console&#8230;?
              3.     Please confirm that the <connection-factory-jndi-name> mentioned in
              the weblogic-ejb-jar.xml should be the same as what I am passing as
              JNDIName (through weblogic console).
              4.     Kindly advice if I am missing anything (especially in my start-ip
              class)
              Here are my Deployemnt descriptors:
              weblogic-ejb-jar
              <?xml version="1.0"?>
              <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic
              7.0.0 EJB//EN" "http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd">
              <weblogic-ejb-jar>
                   <weblogic-enterprise-bean>
                        <ejb-name>SimpleMDB</ejb-name>
                        <message-driven-descriptor>
                             <pool>
                                  <max-beans-in-free-pool>8</max-beans-in-free-pool>
                                  <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
                             </pool>
                             <destination-jndi-name>ivtQ</destination-jndi-name>               
                             <initial-context-factory>
              com.sun.jndi.fscontext.RefFSContextFactory
              </initial-context-factory>
                             <provider-url>
              file:/D:/JNDI/
              </provider-url>
                             <connection-factory-jndi-name>
              MyQCF
              </connection-factory-jndi-name>
                        </message-driven-descriptor>
                   </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              ejb-jar.xml
              <?xml version="1.0"?>
              <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise
              JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
              <ejb-jar>
                   <enterprise-beans>
                        <message-driven>
                             <ejb-name>SimpleMDB</ejb-name>
                             <ejb-class>weblogic.jms.whitepaper.SimpleMDB</ejb-class>
                             <transaction-type>Container</transaction-type>
                             <message-driven-destination>
                                  <!-- In WebLogic Server 6.0, this next parameter is named
              "jms-destination-type" -->
                                  <destination-type>javax.jms.Queue</destination-type>
                             </message-driven-destination>
                        </message-driven>
                   </enterprise-beans>
                   <assembly-descriptor>
                        <container-transaction>
                             <method>
                                  <ejb-name>SimpleMDB</ejb-name>
                                  <method-name>*</method-name>
                             </method>
                             <trans-attribute>Required</trans-attribute>
                        </container-transaction>
                   </assembly-descriptor>
              </ejb-jar>
              My Start-up class is as follows:
              import com.ibm.mq.jms.*;
              import java.util.*;
              import javax.jms.*;
              import javax.naming.*;
              import weblogic.common.*;
              public class MQJMSStartup implements T3StartupDef
                   /** * The name of the queue manager to connect to. The startup class
              * will throw an exception if this parameter is not set. */
                   public final static String QM_NAME_PROPERTY = "QManager";
                   /** * The host name where the queue manager runs. If not set, the *
              startup class will create a "bindings mode" connection to a * queue
              manager on the local host. */
                   public final static String QM_HOST_PROPERTY = "QManagerHost";
                   /** * The port number where the queue manager listens. If not set,
              this * defaults to 1414, the default MQSeries port */
                   public final static String QM_PORT_PROPERTY = "QManagerPort";
                   /** * The name in JNDI to store this queue manager object under. * If
              not set, the startup class will throw an exception. */
                   public static final String JNDI_NAME_PROPERTY = "JNDIName";
                   // Required
                   public MQJMSStartup()
                   // Required, but not needed
                   public void setServices(T3ServicesDef services)
                        public String startup(String name, Hashtable args) throws Exception
                        String qmName = (String)args.get(QM_NAME_PROPERTY);
                        System.out.println("*****The qmName is "+qmName);
                        if (qmName == null)
                             throw new Exception("Startup parameter " + QM_NAME_PROPERTY + "
              must be set");
                        String jndiName = (String)args.get(JNDI_NAME_PROPERTY);
                        System.out.println("***The JNDI Nname is "+jndiName);
                        if (jndiName == null)
                             throw new Exception("Startup parameter " + JNDI_NAME_PROPERTY + "
              must be set");
                        String qmHost = (String)args.get(QM_HOST_PROPERTY);
                        System.out.println("*****The qmHost is "+qmHost);
                        String qmPort = (String)args.get(QM_PORT_PROPERTY);
                        System.out.println("*****The qmPort is "+qmPort);
                        MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
                        factory.setQueueManager(qmName);
                        if (qmHost == null)
                             factory.setTransportType(JMSC.MQJMS_TP_BINDINGS_MQ);
                             factory.setHostName(qmHost);
                             if (qmPort != null)
                                  try
                                       int portNum = Integer.parseInt(qmPort);
                                       factory.setPort(portNum);
                                  catch (NumberFormatException ignore)
                        else
                             factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
                        InitialContext context = new InitialContext();
                        context.bind(jndiName, factory);
                        context.close();
                        StringBuffer buf = new StringBuffer();
                        buf.append( "A connection factory was created for the MQ Queue
              Manager ");
                        buf.append(qmName);
                        buf.append(" and stored in JNDI at ");
                        buf.append(jndiName);
                        System.out.println("*****The mqstartup is executed
              succesfully"+buf.toString());
                        return buf.toString();
              The args that I pass through the weblogic console is as follows:
              QManager=QM_mphasis_eight, JNDIName=MyQCF
              Please advice,
              regards,
              Milan Doshi
              

    Thanks for the response.
              I have written the startUp class but I am getting the following error:
              The Error was:
              The JMS destination with the JNDI name: MySenderQueue could not be
              found. Please ensure that the
              JNDI name in the weblogic-ejb-jar.xml is correct, and the JMS
              destination has been deployed.>
              =====
              My startup class is as follows:
              String qmPort = (String)args.get(QM_PORT_PROPERTY);
              String qmHost = (String)args.get(QM_HOST_PROPERTY);
              String qmName = (String)args.get(QM_NAME_PROPERTY);
              MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
              factory.setQueueManager(qmName);
              factory.setHostName(qmHost);
              if (qmPort != null)
              try
              int portNum = Integer.parseInt(qmPort);
              factory.setPort(portNum);
              catch (NumberFormatException ignore)
              if (qmHost == null)
              factory.setTransportType(JMSC.MQJMS_TP_BINDINGS_MQ);
              else
              factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
              InitialContext context = new InitialContext();
              context.bind(jndiName, factory);
              QueueConnection connection = factory.createQueueConnection();
              boolean transacted = false;
              QueueSession session = connection.createQueueSession( transacted,
              Session.AUTO_ACKNOWLEDGE);
              Queue ioQueue = session.createQueue("MySenderQueue");
              context.bind("MySenderQueue",ioQueue);
              context.close();
              ===================================================
              My Weblogic-ejb-jar.xml is like this:
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>SimpleMDB</ejb-name>
              <message-driven-descriptor>
              <pool>
              <max-beans-in-free-pool>8</max-beans-in-free-pool>
              <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
              </pool>
              <destination-jndi-name>MySenderQueue</destination-jndi-name>
              <connection-factory-jndi-name>
              MyQCF
              </connection-factory-jndi-name>
              </message-driven-descriptor>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              ======================================================
              Can you please guide me what is wrong in registering the Queue?
              Thanks once again for the response,
              Milan Doshi
              "sudhir" <[email protected]> wrote in message news:<[email protected]>...
              > Mian,
              >
              > You should pass the Queue Name in the startup class arguments. This would be
              > the same name as the MQ Queue you have defined. There is no need to specify to
              > provider URL to the file ... If you do, then ensure that the the queue name should
              > refer to the MQ Administered Queue object defined by jmsadmin.
              >
              > -Sudhir
              >
              >
              >
              > [email protected] (Milan Doshi) wrote:
              > >Hello ,
              > >
              > >I am supposed to write a Message driven bean that would reside on
              > >Weblogic7.0 and listen to a particular queue of IBM MQ.
              > >
              > >I understand that we need to write a Start-up class for this. I have
              > >written the start-up class but I am getting the following error:
              > >
              > ><Apr 16, 2003 3:17:14 PM EDT> <Warning> <EJB> <010061> <The
              > >Message-Driven EJB: SimpleMDB is unable
              > >to connect to the JMS destination: ivtQ. The EJB container will
              > >automatically attempt to re-establis
              > >h the connection with the JMS server. This warning may occur during
              > >WebLogic Cluster start-up if the
              > > JMS destination is located on another server. When the JMS server
              > >connection is re-established, the
              > > Message-Driven EJB will again receive JMS messages.
              > >The Error was:
              > >The JMS destination with the JNDI name: ivtQ could not be found.
              > >Please ensure that the JNDI name in
              > > the weblogic-ejb-jar.xml is correct, and the JMS destination has been
              > >deployed.>
              > >
              > >I understand that there are some configuration issues:
              > >
              > >Can you please guide where am I going wrong:
              > >1.     What should be the value of the <destination-jndi-name> in the
              > >Weblogic-ejb-jar. I have not passed any Queue name through the
              > >start-up class ?Is it ok?
              > >2.     Then what queue name should I specify. (ofcousrse it should be the
              > >weblogic console??
              > >3.     Please confirm that the <connection-factory-jndi-name> mentioned in
              > >the weblogic-ejb-jar.xml should be the same as what I am passing as
              > >JNDIName (through weblogic console).
              > >4.     Kindly advice if I am missing anything (especially in my start-ip
              > >class)
              > >
              > >Here are my Deployemnt descriptors:
              > >
              > >weblogic-ejb-jar
              > >
              > ><?xml version="1.0"?>
              > ><!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic
              > >7.0.0 EJB//EN" "http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd">
              > ><weblogic-ejb-jar>
              > >     <weblogic-enterprise-bean>
              > >          <ejb-name>SimpleMDB</ejb-name>
              > >          <message-driven-descriptor>
              > >               <pool>
              > >                    <max-beans-in-free-pool>8</max-beans-in-free-pool>
              > >                    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
              > >               </pool>
              > >               <destination-jndi-name>ivtQ</destination-jndi-name>               
              > >               <initial-context-factory>
              > > com.sun.jndi.fscontext.RefFSContextFactory
              > > </initial-context-factory>
              > >               <provider-url>
              > > file:/D:/JNDI/
              > > </provider-url>
              > >               <connection-factory-jndi-name>
              > > MyQCF
              > > </connection-factory-jndi-name>
              > >          </message-driven-descriptor>
              > >     </weblogic-enterprise-bean>
              > ></weblogic-ejb-jar>
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >ejb-jar.xml
              > >
              > ><?xml version="1.0"?>
              > ><!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise
              > >JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
              > ><ejb-jar>
              > >     <enterprise-beans>
              > >          <message-driven>
              > >               <ejb-name>SimpleMDB</ejb-name>
              > >               <ejb-class>weblogic.jms.whitepaper.SimpleMDB</ejb-class>
              > >               <transaction-type>Container</transaction-type>
              > >               <message-driven-destination>
              > >                    <!-- In WebLogic Server 6.0, this next parameter is named
              > >"jms-destination-type" -->
              > >                    <destination-type>javax.jms.Queue</destination-type>
              > >               </message-driven-destination>
              > >          </message-driven>
              > >     </enterprise-beans>
              > >     <assembly-descriptor>
              > >          <container-transaction>
              > >               <method>
              > >                    <ejb-name>SimpleMDB</ejb-name>
              > >                    <method-name>*</method-name>
              > >               </method>
              > >               <trans-attribute>Required</trans-attribute>
              > >          </container-transaction>
              > >     </assembly-descriptor>
              > ></ejb-jar>
              > >
              > >
              > >My Start-up class is as follows:
              > >
              > >import com.ibm.mq.jms.*;
              > >import java.util.*;
              > >import javax.jms.*;
              > >import javax.naming.*;
              > >import weblogic.common.*;
              > >
              > >
              > >public class MQJMSStartup implements T3StartupDef
              > >{
              > >     /** * The name of the queue manager to connect to. The startup class
              > >* will throw an exception if this parameter is not set. */
              > >     public final static String QM_NAME_PROPERTY = "QManager";
              > >     
              > >     /** * The host name where the queue manager runs. If not set, the *
              > >startup class will create a "bindings mode" connection to a * queue
              > >manager on the local host. */
              > >     public final static String QM_HOST_PROPERTY = "QManagerHost";
              > >     
              > >     /** * The port number where the queue manager listens. If not set,
              > >this * defaults to 1414, the default MQSeries port */
              > >     public final static String QM_PORT_PROPERTY = "QManagerPort";
              > >          
              > >     /** * The name in JNDI to store this queue manager object under. * If
              > >not set, the startup class will throw an exception. */
              > >     public static final String JNDI_NAME_PROPERTY = "JNDIName";
              > >
              > >     // Required
              > >     public MQJMSStartup()
              > >     {
              > >     }
              > >
              > >     // Required, but not needed
              > >     public void setServices(T3ServicesDef services)
              > >     {
              > >     }
              > >
              > >          public String startup(String name, Hashtable args) throws Exception
              > >     {
              > >          String qmName = (String)args.get(QM_NAME_PROPERTY);
              > >          System.out.println("*****The qmName is "+qmName);
              > >          if (qmName == null)
              > >          {
              > >               throw new Exception("Startup parameter " + QM_NAME_PROPERTY + "
              > >must be set");
              > >          }
              > >          String jndiName = (String)args.get(JNDI_NAME_PROPERTY);
              > >          System.out.println("***The JNDI Nname is "+jndiName);
              > >          if (jndiName == null)
              > >          {
              > >               throw new Exception("Startup parameter " + JNDI_NAME_PROPERTY + "
              > >must be set");
              > >          }
              > >          String qmHost = (String)args.get(QM_HOST_PROPERTY);
              > >          System.out.println("*****The qmHost is "+qmHost);
              > >          String qmPort = (String)args.get(QM_PORT_PROPERTY);
              > >          System.out.println("*****The qmPort is "+qmPort);
              > >          MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
              > >          factory.setQueueManager(qmName);
              > >          if (qmHost == null)
              > >          {
              > >               factory.setTransportType(JMSC.MQJMS_TP_BINDINGS_MQ);
              > >               factory.setHostName(qmHost);
              > >               if (qmPort != null)
              > >               {
              > >                    try
              > >                    {
              > >                         int portNum = Integer.parseInt(qmPort);
              > >                         factory.setPort(portNum);
              > >                    }
              > >                    catch (NumberFormatException ignore)
              > >                    {
              > >
              > >                    }
              > >               }
              > >          }
              > >          else
              > >          {
              > >               factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
              > >          }
              > >
              > >          InitialContext context = new InitialContext();
              > >          context.bind(jndiName, factory);
              > >          context.close();
              > >          StringBuffer buf = new StringBuffer();
              > >          buf.append( "A connection factory was created for the MQ Queue
              > >Manager ");
              > >          buf.append(qmName);
              > >          buf.append(" and stored in JNDI at ");
              > >          buf.append(jndiName);
              > >          System.out.println("*****The mqstartup is executed
              > >succesfully"+buf.toString());
              > >          return buf.toString();
              > >     }
              > >}
              > >
              > >
              > >
              > >
              > >The args that I pass through the weblogic console is as follows:
              > >
              > >QManager=QM_mphasis_eight, JNDIName=MyQCF
              > >
              > >
              > >
              > >
              > >
              > >Please advice,
              > >
              > >regards,
              > >
              > >Milan Doshi
              

  • Clustering of startup classes in WebLogic

              Hi
              WE have an application running as startup class in WLS 6.1 . I want to know
              how this class can be deployed in clustered environment. Iam pretty ne to clustering
              . Can some body help me out ?.
              Thanks in advance,
              S Gopikrishna
              

    I don't know what you mean.
              If you want each instance of your app to be running something, you should
              use a load-on-startup Servlet with its init() method instead of a startup
              class.
              If you want each instance of a server (not each instance of your app, since
              an app can be loaded multiple times on a server) to be running something,
              you should use a startup class.
              If you want exactly one instance in a cluster to be running something ...
              well, good luck. There's no guarantees in this regard, but the easiest way
              is to pin it to one server and make sure that that server never goes down
              because it is a single point of failure.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              Clustering Weblogic? You're either using Coherence, or you should be!
              Download a Tangosol Coherence eval today at http://www.tangosol.com/
              "S Gopikrishna" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi
              >
              > Thanks a lot for the reply. My startup class listens continously on a
              queue.
              > I need to know whether my startup class will also be clustered just like
              EJB.
              > If not what is the altrnative.
              >
              > Regards,
              > S Gopikrishna
              >
              >
              >
              >
              > "Cameron Purdy" <[email protected]> wrote:
              > >When you have a startup class in a cluster, each server will run that
              > >startup class one time. In other words, it always runs once per server.
              > >
              > >Peace,
              > >
              > >--
              > >Cameron Purdy
              > >Tangosol, Inc.
              > >Clustering Weblogic? You're either using Coherence, or you should be!
              > >Download a Tangosol Coherence eval today at http://www.tangosol.com/
              > >
              > >
              > >
              > >"S Gopikrishna" <[email protected]> wrote in message
              > >news:[email protected]...
              > >>
              > >> Hi
              > >> WE have an application running as startup class in WLS 6.1 . I
              > >want
              > >to know
              > >> how this class can be deployed in clustered environment. Iam pretty
              > >ne to
              > >clustering
              > >> Can some body help me out ?.
              > >>
              > >> Thanks in advance,
              > >> S Gopikrishna
              > >
              > >
              >
              

Maybe you are looking for