Well, it seems fine to me, but there must be something wrong with it, since this is the meaning of the exception. The meaning of the exception is that the XML, somewhere between the opening and the closing of the beans element, there are some text written, which is not enclosed in an element. Please make sure that this is not in the XML file being parsed, and if you have copied any part of the XML (no matter how small) from somewhere, make sure that every character is correct (sometimes double quotes are writted differently in PDFs for example). Finally, I have a few comments, but don't know if they have any value for your case.
Line 15 of your XML has a double slash instead of one (this might cause a problem)
Line 17 of your XML can be written as <aop:aspectj-autoproxy/> instead of <aop:aspectj-autoproxy></aop:aspectj-autoproxy>
No need to define bean for Main class in line 20 of your XML[/tt]
Use the following snippet to load the application context instead of what you have in line 11
To Run this program i included:
1) aopalliance. jar in classpath
2)i commented the first line
Now Output of the program is simply Hello World.
Excepted Output is
Q1) Why actual output is different from expected output?Why "Hello from @Before Annotation in Aspectj" and "Hello from @AfterReturning Annotation in Aspectj" is not getting printed in console?Please refer above program for more details.
Joined: Jan 28, 2008
Well, I don't know a lot of AOP, so I can't help with that. Sorry