The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

luislobo (8) [Avatar] Offline
#1
Hi,

I am trying to make the first sample work. I am using Spring 3.0.

The only way I could make it work is using this code for HelloApp.java:


package com.springinaction.chapter01.hello;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;

import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;

public class HelloApp {

public static void main(String[] args) throws Exception
{

Resource rs = new FileSystemResource("C:\wsAprendizaje\TestHolaMundo\bin\com\springinaction\chapter01\hello\hello.xml");

BeanFactory factory = new XmlBeanFactory(rs);


GreetingService greetingService =
(GreetingService) factory.getBean("greetingService");

greetingService.sayGreeting();

}
}

Please see if you can update your sample because XmlBeanFactory was throwing exceptions because of the constructor.

Thank you!
luislobo (8) [Avatar] Offline
#2
Re: First sample is not working for me
Also, Apendix A makes references to Spring 1.1... we are now with 3.0, may be that should be updated also.