Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: JMS example application

  1. #11

    Default

    Again, thanks for the help.

    I'll clarify:

    public static void main(String[] args) {
    logger.info("Initializing client");
    ApplicationContext ctx =
    new ClassPathXmlApplicationContext(new String[]{"./client-appctx.xml", "./jms-setup.xml"});
    UserService userService = (UserService) ctx.getBean("userService");
    logger.info("Running client");

    //next line is reached
    userService.addUser(new User("franz", "Franz Mayr", "frnz"));

    //this next line and section is NEVER reached.
    logger.info("All users: " + userService.findAllUsers());

    logger.info("User Hinz: " + userService.findUserByLogin("hinz"));
    logger.info("User Kunz: " + userService.findUserByLogin("kunz"));
    logger.info("User ffff: " + userService.findUserByLogin("ffff"));

    logger.info("Shutting down client");
    }

    I am sure I can't close AppContext before calling my service?!

    Cheers,
    Martin

  2. #12
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    No, but logging "Shutting down client" isn't going to do it either. Make the last line of your main ((ConfigurableApplicationContext )ctx).close(); and see what happens.

  3. #13

    Default

    @david_syer
    Thanks for the well-intentioned help, but... that does not work.

    Nothing happens.
    The line where the ctx should be closed is never reached. I am starting to assume that there is a incompatibility between my spring and activemq versions.

    Anyway. Cheers,
    Martin

Posting Permissions

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