Re: Xerces/XMLC/Java classloading question
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
The solution is purely and simply to delete any and all Xerces/XML related jars from ANT_HOME/lib.....that is, if you are using j2sdk1.4.x. If you are using JDK1.3.x, then you will need some XML parser in ANT_HOME/lib simply in order for Ant to parse XML build files. In that case, you also need to add xerces-1.4.4-xmlc-2.1.jar to ANT_HOME/lib. I'm not sure of a way around this? If you test things out with the build and forking works to alleviate the issues while leaving the contents of ANT_HOME/lib alone, then I am all for forking. Let us know how it works for you. Also, the classpaths generated in the build.xml already include all xmlc related jars, but if Xerces2 is already in ANT_HOME/lib, it is in our build classpath by default, so there isn't much of a way around that. It isn't a matter point just pointing at XMLC.jar...especially since XMLC.jar also depends on an XML parser and dom packages outside its own jar. Now, Richard Kunze added some reflection code which allows Xerces2 to exist in CATALINA_HOME/common/endorsed while xmlc's xerces version is in CATALINA_HOME/shared/lib. Of course this is at runtime and we've already found out that this trick doesn work when the XMLC class was built from an XML file rather than an HTML file. In addition, the new XMLC template reloading is more sensitive at runtime. The point is, it might be possible to make some changes to the XMLC ant task or internal XMLC compiler to allow it to coexist with Xerces2. We'd have to find out if this is possible from Richard, though. Again, test some things out and report back what you find. Jake At 09:25 AM 1/23/2003 -0700, you wrote: >I've started to run into some troubles trying to compile Barracuda on our >new server box. Specifically, the issue comes down to the fact that we >have xerces2 installed in /usr/share/java (this was a package dependency >for Ant 1.5) which causes the XMLC compiling stuff to choke. > >Now, the problem is solved in this particular instance by simply removing >the /usr/share/java/xerces-j2-2.2.1.jar so that >/var/tomcat4/common/endorsed/xerces-1.4.4-xmlc-2.1.jar gets used instead. >However that doesn't solve the general problem that users may have a newer >version of Xerces installed on their box yet XMLC requires a very specific >(and XMLC-tweaked) version. > >I'm wondering if there is a way, perhaps in the build.xml script, that >when the XMLC stuff is done you can point it directly to the XMLC jar? >Obviously since Ant has already started using the (newer) xerces jar that >is in the classpath this would at least require forking a new java >process, but I think that would be okay. > >What is everyone's thought on this? Or is this even possible? > >-shawn > >_______________________________________________ >Barracuda mailing list >[email protected] >http://barracudamvc.org/lists/listinfo/barracuda