Results 1 to 2 of 2

Thread: problem setting up JMS listener

  1. #1
    Join Date
    Jul 2005
    Posts
    10

    Default problem setting up JMS listener

    I have a class (no http) that listens for messages using JMS. What is the best way to implement this in a web app using the spring framework? If I run my listener as a standalone java application and then run my webapp everything is fine. I tried initializing the listener in a servlet during init but but it hangs my server. The last output from the log shows the c3p0 initilization and then it just hangs and the server never finishes starting up. The jms listener appears to be working , see bottom log excerpt, but I can not make any http requests to the server(tomcat). Thanks in advance.

    Scott


    init(ServletConfig config) throws ServletException {
    super.init(config);
    try{


    ApplicationContext ctx =
    WebApplicationContextUtils.getWebApplicationContex t(this.getServletContext());
    if(ctx.containsBean("orderManager")){
    log.debug("attempting to initialize Order Service Listener");
    listener=new OrderManagerListener((OrderManager)ctx.getBean("or derManager"));
    listener.run();
    log.debug("Successfully initialized Order Service Listener");
    }
    else{
    log.error("Error initializing Order Service Listener");
    }
    }
    catch(ConfigurationException ce){
    log.error("error initializing order service listener :"+ce);
    }




    Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@1142196 [ con
    nectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSourc e@621
    0fb [ acquireIncrement -> 3, autoCommitOnClose -> false, connectionTesterClassNa
    me -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation ->
    null, forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> -1
    , initialPoolSize -> 3, maxIdleTime -> 0, maxPoolSize -> 15, maxStatements -> 0,
    minPoolSize -> 3, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSour
    ce@a9255c [ description -> null, driverClass -> oracle.jdbc.OracleDriver, factor
    yClassLocation -> null, jdbcUrl -> jdbc:oracle:thin:@//10.8.44.32:1521/GPSD, pro
    perties -> {user=aaaL, password=aaa1} ] , propertyCycle -> 300, testConn
    ectionOnCheckout -> false ] , factoryClassLocation -> null, numHelperThreads ->
    3 ]
    this is where the log hangs



    27 Jul 2005 15:18:29,640 [DEBUG] AsyncWireDedicatedThread.debug - Thread-1[93920
    51]: Arming async wire with trigger com.stc.jms.sockets.ProxyStcms$1@198e8b4
    27 Jul 2005 15:18:29,640 [DEBUG] AsyncWireDedicatedThread.debug - Thread-1[93920
    51]: Creating JMS AsyncWireDedicatedThread S0C0W1
    27 Jul 2005 15:18:29,640 [DEBUG] AsyncWireDedicatedThread.debug - JMS AsyncWireD
    edicatedThread S0C0W1[4918203]: JMS AsyncWireDedicatedThread Thread started
    27 Jul 2005 15:18:29,640 [DEBUG] AsyncWireDedicatedThread.debug - JMS AsyncWireD
    edicatedThread S0C0W1[4918203]: Async wire waiting for bytes to come in

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Seems that the listener blocks the invoking thread. So you might try to perform the listener initialization in a separate thread.

    Regards,
    Andreas

Similar Threads

  1. Context initialization failed
    By kanonmicke in forum Container
    Replies: 7
    Last Post: Sep 29th, 2005, 12:35 AM
  2. passwordEncoder problem
    By markt in forum Security
    Replies: 2
    Last Post: Jul 23rd, 2005, 06:40 AM
  3. Replies: 2
    Last Post: May 13th, 2005, 05:42 AM
  4. Strange problem setting a property
    By kdenehy in forum Container
    Replies: 8
    Last Post: Apr 28th, 2005, 09:16 PM
  5. Transaction Management
    By caverns in forum Data
    Replies: 3
    Last Post: Mar 8th, 2005, 06:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •