5 Replies Latest reply on Dec 14, 2004 11:44 AM by bill.burke

    Different handling of XML entities between FINAL and RC1

      Hi.

      I've updated JBossAOP to FINAL version and have problem with my XML entities which I access from XML my-aop-file.xml file.

      Here's the code:

      $cd /home/nthx/private/YYY/Project/
      $ls
       configurations/
       src/
       build.xml
      
      
      $cat /home/nthx/private/YYY/Project/configurations/myAOP-A.xml
      
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE aop [
       ENTITY include1.ent SYSTEM "configurations/META-INF/include1.ent"
       ...
      ]>
      <aop>
       &include1.ent;
       ...
      </aop>
      
      
      
      $ant
      ...
      internal:parametrisied-aopc:
       [aopc] [info] Total length of filenames to be compiled is greater than 1000, listing files
       in --SOURCEPATH: /tmp/src5805.tmp
       [aopc] [debug] jboss.aop.class.path is NULL
       [aopc] [debug] jboss.aop.search.classpath: 'null' true
       [aopc] [debug] jboss.aop.path: /home/nthx/private/YYY/Project/configurations/myAOP-A.xml
       [aopc] jboss.aop.path[0]: /home/nthx/private/YYY/Project/configurations/myAOP-A.xml
       [aopc] [deploying] file:/home/nthx/private/YYY/Project/configurations/myAOP-A.xml
       [aopc] java.io.FileNotFoundException: JAR entry configurations/META-INF/include1.ent not found
      in /home/nthx/private/YYY/Project/lib/jboss-aop.jar
       [aopc] at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:97)
       [aopc] at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:107)
       [aopc] at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
       [aopc] at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
       [aopc] at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
       [aopc] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown Source)
       [aopc] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.
      dispatch(Unknown Source)
       [aopc] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       [aopc] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       [aopc] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       [aopc] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       [aopc] at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
       [aopc] at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
       [aopc] at org.jboss.aop.AspectXmlLoader.loadURL(AspectXmlLoader.java:948)
       [aopc] at org.jboss.aop.AspectXmlLoader.deployXML(AspectXmlLoader.java:885)
       [aopc] at org.jboss.aop.Deployment.deployXmlFile(Deployment.java:164)
       [aopc] at org.jboss.aop.Deployment.preconfigThroughSystemProperty(Deployment.java:146)
       [aopc] at org.jboss.aop.Deployment.deploy(Deployment.java:36)
       [aopc] at org.jboss.aop.AspectManager.instance(AspectManager.java:122)
       [aopc] at org.jboss.aop.standalone.Compiler.compile(Compiler.java:160)
       [aopc] at org.jboss.aop.standalone.Compiler.main(Compiler.java:67)
       [aopc] java.lang.RuntimeException: [error] failed to load
      aop path: /home/nthx/private/YYY/Project/configurations/myAOP-A.xml
       [aopc] at org.jboss.aop.Deployment.preconfigThroughSystemProperty(Deployment.java:155)
       [aopc] at org.jboss.aop.Deployment.deploy(Deployment.java:36)
       [aopc] at org.jboss.aop.AspectManager.instance(AspectManager.java:122)
       [aopc] at org.jboss.aop.standalone.Compiler.compile(Compiler.java:160)
       [aopc] at org.jboss.aop.standalone.Compiler.main(Compiler.java:67)
       [aopc] Caused by: java.io.FileNotFoundException: JAR entry configurations/META-INF/include1.ent
      not found in /home/nthx/private/YYY/Project/lib/jboss-aop.jar
       [aopc] at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:97)
       [aopc] at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:107)
       [aopc] at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
       [aopc] at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
       [aopc] at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
       [aopc] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown Source)
       [aopc] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.
      dispatch(Unknown Source)
       [aopc] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       [aopc] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       [aopc] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       [aopc] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       [aopc] at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
       [aopc] at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
       [aopc] at org.jboss.aop.AspectXmlLoader.loadURL(AspectXmlLoader.java:948)
       [aopc] at org.jboss.aop.AspectXmlLoader.deployXML(AspectXmlLoader.java:885)
       [aopc] at org.jboss.aop.Deployment.deployXmlFile(Deployment.java:164)
       [aopc] at org.jboss.aop.Deployment.preconfigThroughSystemProperty(Deployment.java:146)
       [aopc] ... 4 more
      


      I run it through ant task, and all the files which you see here exist in apropriate directories with apropriate names.

      This code has worked until RC1 (don't know about RC2).


      Thanks for help,
      Tomasz

        • 1. Re: javassist handling of

          I know that, and that's the reason I am saying that different classpaths for javac and aopc (or even runtime).

          Sometimes during compilation, you knowingly (or unknowingly) include some classpath that you are not using in one specific runtime. So during runtime, you don't include that specific library in the classpath. And everything will be fine since the code is not used.

          But this is not fine under Javassist since it requires access to every import package.

          -Ben

          • 2. Re: Different handling of XML entities between FINAL and RC1
            bill.burke

            A workaround is to take out the include.

            I'll have to put this on the TODO list.

            Thanks for finding the bug and reporting,

            Bill

            • 3. Re: Different handling of XML entities between FINAL and RC1

              Hi!

              No problem. But it's essential for me to have "included" entities.

              Say you have a product line and some already developed aspects, and want to include A, B, C concerns for configuration 1 of application, and only A and C for 2nd application.
              The only way, I think is to have two separate XML AOP files: config1-aop.xml and config2-aop.xml and manage concerns by including them using XML entities.

              Well, one could use some Ant's task to do this, but this is cleaner I think.

              So, this way it is possible to develop product lines with JBossAOP.


              See you,
              Tomasz Nazar

              • 4. Re: Different handling of XML entities between FINAL and RC1
                bill.burke

                The SystemProperty jboss.aop.path can take multiple XML files. They are deployed in the order you specify in the jboss.aop.path.

                Also, jboss.aop.path can take a directory. If you specify a directory, it will load all *aop.xml files in that directory.


                The include is a bug though and we'll fix as soon as we can.

                Bill

                • 5. Re: Different handling of XML entities between FINAL and RC1
                  bill.burke

                  thanks...added to jira.