-
Jan 8th, 2007, 10:34 AM
#11
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
-
Jan 8th, 2007, 01:18 PM
#12
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.
-
Jan 10th, 2007, 06:35 AM
#13
@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
-
Forum Rules