Community
Participate
Working Groups
When using LTW you can get this exception: I am using LTW and I get this exception: [WebappClassLoader@1478a43] warning parse definitions failed -- (SAXParseException) Premature end of file. [INFO] [talledLocalContainer] Premature end of file. [INFO] [talledLocalContainer] org.xml.sax.SAXParseException: Premature end of file. [INFO] [talledLocalContainer] at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1183) [INFO] [talledLocalContainer] at org.aspectj.weaver.loadtime.definition.DocumentParser.parse(DocumentParser.java:108) [INFO] [talledLocalContainer] at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(ClassLoaderWeavingAdaptor.java:211) [INFO] [talledLocalContainer] at org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(DefaultWeavingContext.java:121) [INFO] [talledLocalContainer] at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(ClassLoaderWeavingAdaptor.java:137) [INFO] [talledLocalContainer] at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(Aj.java:262) [INFO] [talledLocalContainer] at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor. I was using this aop.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd"> <aspectj> <weaver options="-verbose -showWeaveInfo"> <include within="com.mycomp.domain.message.event.hibernate.*"/> </weaver> <aspects> <aspect name="org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect"/> <aspect name="org.springframework.transaction.aspectj.AnnotationTransactionAspect"/> </aspects> </aspectj> The error went away with removing the xml declaration and the DTD declaration.
take a look for 1.6.3 - are we using the parser correctly?
I can't recreate this - can you? I am on Java6 (1.6.0_06-b02). If I add those initial lines it works fine. If I remove them it works fine. if I add them and make a mistake in the DTD name, it fails as expected. A google for the SAX problem indicates this can happen if there is a network issue preventing correct download of the DTD. I wonder if this was happening at the time you were having the problem? Can you just retry it now, or perhaps grab the DTD and put it in a local file then change the URL in the DOCTYPE element to point to the local version to see if it helps.
closing as works for me - may have been an intermittent network glitch to the eclipse.org servers. please reopen if still a problem.
This bug also appears for me. I use aspectj 1.6.2 and Java 1.6.10. Also tried it with aspectj 1.6.4 and with Java 1.6.13 and the same exception is thrown. If I try to take the file locally, I get the same exception.
Marius - you need to reopen it, not just cc on a closed bug :) I'll reopen it. I just tried again on 1.6.5 dev builds with java 1.6.0_13 and using the aop.xml file you sent me: --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd"> <aspectj> <aspects> <aspect name="Aspect"/> <include within="package..*"/> </aspects> </aspectj> --- it worked just fine. Do you *really* need to include the dtd reference in the xml file?
I had a similar problem when having 2 aop.xml files in my project (a project with multiple subprojects in maven). Moving all information into one aop.xml file fixed the problem for me.
Natan's comment is interesting. In AspectJ 1.6.5 I fixed bug 274986. That was where the caching of the DTD caused a problem if it was reused (by loading a second aop.xml file for example). It might be that fix addresses this issue too.