Seek expert to solve the problem started spring: DisposableBean interface destruction with no problem, destory-method destroy abnormal

Exceptions are as follows:
Exception in thread “main” org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 11 in XML document from file [E: \ sshspace \ spring_login_0100 \ conf \ applicationContext_3.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute estory-method is not allowed to appear in element ean
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions (XmlBeanDefinitionReader.java: 396)
at org.springframework ……< br />
at org.springframework . context.support.FileSystemXmlApplicationContext. (FileSystemXmlApplicationContext.java: 84)
at com.gdl.study.step3.TestHelloWorld.main (TestHelloWorld.java: 12)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute estory-method is not allowed to appear in element ean
at com . sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException (Unknown Source)
====================== =========================< br />
—————- configuration File

Hello Hello Hello!

< / bean>
———————- Bean
public class HelloWorld implements IHelloWorld, InitializingBean < br />
/ /, DisposableBean
{
private String msg;
public HelloWorld () {
< br /> System.out.println (“now running HelloWorld () constructor 。”);< br />
}
public void init () {
System.out.println (“now running init method 。”);< br />
msg =” Hello World “;
}
< br /> public void clear () {
System.out.println (“now running the cleanup method”);
msg =”";< br />
}
public String getMsg () {
System.out.println (“now running getMsg method 。”);< br />
return msg;
}
——————- test main method
public static void main (String [] args) {
ApplicationContext ac = new FileSystemXmlApplicationContext (“conf \ \ applicationContext_3.xml”);
IHelloWorld hello = (IHelloWorld ) ac.getBean (“hello”);
hello.sayHello ();
}
public void setMsg (String msg) {< br />
System.out.println (“now running setMsg method 。”);< br />
this.msg = msg;
}
@ Override
public void sayHello () {
System.out.println (“sayHello method is now running 。”);< br />
System.out.println (msg);
}
/ *
* (non-Javadoc)
* @ see org.springframework.beans.factory.InitializingBean # afterPropertiesSet ()
* /
@ Override
public void afterPropertiesSet () throws Exception {
System.out.println (“now running afterPropertiesSet () method 。”);< br />
msg =” afterPropertiesSet: Hello World. “;

}
/ / / *
/ / * (non-Javadoc)
/ / * @ see org.springframework . beans.factory.DisposableBean # destroy ()
/ / * /
/ / @ Override
/ / public void destroy () throws Exception {
/ / System.out.println (“now running destroy destruction methods 。”);< br />
/ /
/ / }
}

Posted: January 6th, 2012
at 12:03pm by admin

Tagged with


Categories: Uncategorized

Comments: No comments


Think E-Cigarette, Think Kimree!