You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xml-commons-dev@xerces.apache.org by Sh...@lotus.com on 2001/06/14 22:21:27 UTC

xml-commons JAXP FindFactory class requires JDK 1.2+ to compile?

Is this true?  I thought we weren't going to require JDK 1.2+ quite yet.
I was about to temporarily copy the JAXP stuff into the xml-xalan tree so
we can short-term use the new code in the xalan build, but I don't want to
yank xalan developers into the 1.2+ requirement yet.  (Yes, I should help
working on moving xml-commons integration out, but the rest of life is
interfering right now)

Is there any simple way to make this also compile on 1.1, perhaps with a
couple of reflection calls?  Or should I just skip this for now, and update
to 1.2 later?

(I cc:'d a few people who might not yet have subscribed to commons-dev)
- Shane
E:\builds\xml-commons\java\external>build

Xalan-J 2.x Build
-------------
"f:\jdks\jdk1.1.8\bin\java"  -Dant.home="" -classpath
"bin\ant.jar;bin\xerces.ja
r;f:\jdks\jdk1.1.8\lib\classes.zip;f:\jdks\jsdk2.0\lib\jsdk.jar;f:
\jdks\jdk1.1.8
\lib\classes.zip" org.apache.tools.ant.Main
Buildfile: build.xml

prepare:
    [mkdir] Created dir: E:\builds\xml-commons\java\external\build\classes
    [mkdir] Created dir: E:\builds\xml-commons\java\external\build\docs
    [mkdir] Created dir: E:
\builds\xml-commons\java\external\build\docs\javadoc

compile:
    [javac] Compiling 121 source files to E:
\builds\xml-commons\java\external\bu
ild\classes
    [javac] E:
\builds\xml-commons\java\external\src\javax\xml\parsers\FactoryFin
der.java:264: Method getContextClassLoader() not found in class
java.lang.Thread
.
    [javac]             return Thread.currentThread().getContextClassLoader
();
    [javac]
^
    [javac] E:
\builds\xml-commons\java\external\src\javax\xml\transform\FactoryF
inder.java:263: Method getContextClassLoader() not found in class
java.lang.Thre
ad.
    [javac]             return Thread.currentThread().getContextClassLoader
();
    [javac]
^
    [javac] E:
\builds\xml-commons\java\external\src\org\xml\sax\helpers\ParserAd
apter.java:568: Method add(org.xml.sax.SAXException) not found in class
java.uti
l.Vector.
    [javac]                 exceptions.add(e);
    [javac]                               ^
    [javac] E:
\builds\xml-commons\java\external\src\org\xml\sax\helpers\ParserAd
apter.java:591: Method get(int) not found in class java.util.Vector.
    [javac]             errorHandler.error
((SAXParseException)(exceptions.get(i)
));
    [javac]
^
    [javac] 4 errors

BUILD FAILED


Re: xml-commons JAXP FindFactory class requires JDK 1.2+ to compile?

Posted by Edwin Goei <ed...@sun.com>.
Shane_Curcuru@lotus.com wrote:
> 
> Is this true?  I thought we weren't going to require JDK 1.2+ quite yet.
> I was about to temporarily copy the JAXP stuff into the xml-xalan tree so
> we can short-term use the new code in the xalan build, but I don't want to
> yank xalan developers into the 1.2+ requirement yet.  (Yes, I should help
> working on moving xml-commons integration out, but the rest of life is
> interfering right now)

The JAXP code in javax.xml.* packages runs in JDK 1.1 but requires JDK
1.2 or better to compile.  This allows users to run the code in any JDK
1.1 VM such as the native IE or Netscape Navigator VMs.  Building the
code requires Java 2, but I don't see this as a problem now that Java 2
is available for all major development platforms: unix, Windows, Mac OS
X.

> Is there any simple way to make this also compile on 1.1, perhaps with a
> couple of reflection calls?  Or should I just skip this for now, and update
> to 1.2 later?

It can be done but I would not call it simple.  It took a while to get
that code working the way it was written.

BTW, the latest SAX code has Java 2 runtime dependencies in it which IMO
is worse than a Java 2 compile time dependency.  I ran into that problem
and had to fix the SAX code.  I don't remember if I reported this to
David Megginson.

-Edwin

Re: xml-commons JAXP FindFactory class requires JDK 1.2+ to compile?

Posted by Gary L Peskin <ga...@firstech.com>.
I don't know if this is an issue for anyone else but optimization level
40 under IBM OS/400 tries to preload all referenced classes.  This could
be a problem for those running under 1.1.  They'd have to specify a
lower optimization level which is not usually the norm.

Gary

Edwin Goei wrote:
> 
> cmanolache@yahoo.com wrote:
> >
> > There is a workaround in xml-xalan's version of jaxp, using reflection,
> > you could use that if requiring JDK1.2 to compile is too much.
> 
> So who requires compilation with JDK 1.1?  What's wrong with compiling
> with Java 2 and distributing the jar files?
> 
> -Edwin

Re: xml-commons JAXP FindFactory class requires JDK 1.2+ to compile?

Posted by Edwin Goei <ed...@sun.com>.
cmanolache@yahoo.com wrote:
> 
> There is a workaround in xml-xalan's version of jaxp, using reflection,
> you could use that if requiring JDK1.2 to compile is too much.

So who requires compilation with JDK 1.1?  What's wrong with compiling
with Java 2 and distributing the jar files?

-Edwin

Re: xml-commons JAXP FindFactory class requires JDK 1.2+ to compile?

Posted by Gary L Peskin <ga...@firstech.com>.
Shane --

FWIW, I like Costin's idea of using the tomcat3 compat package.  Don't
know much about it besides what I've read here but it does seem to be
the cleanest way to get around this limitation without having reflection
calls all over the place.

Gary

cmanolache@yahoo.com wrote:
> 
> There is a workaround in xml-xalan's version of jaxp, using reflection,
> you could use that if requiring JDK1.2 to compile is too much.
> 
> Another solution ( used by tomcat3) is a small "compat" package that
> provides a simple interface for some of the common jdk1.2 calls you may
> need in 1.1 ( class loader, doPriviledged, context class loader, etc ).
> 
> Costin
> 
> On Thu, 14 Jun 2001 Shane_Curcuru@lotus.com wrote:
> 
> > Is this true?  I thought we weren't going to require JDK 1.2+ quite yet.
> > I was about to temporarily copy the JAXP stuff into the xml-xalan tree so
> > we can short-term use the new code in the xalan build, but I don't want to
> > yank xalan developers into the 1.2+ requirement yet.  (Yes, I should help
> > working on moving xml-commons integration out, but the rest of life is
> > interfering right now)
> >
> > Is there any simple way to make this also compile on 1.1, perhaps with a
> > couple of reflection calls?  Or should I just skip this for now, and update
> > to 1.2 later?
> >
> > (I cc:'d a few people who might not yet have subscribed to commons-dev)
> > - Shane
> > E:\builds\xml-commons\java\external>build
> >
> > Xalan-J 2.x Build
> > -------------
> > "f:\jdks\jdk1.1.8\bin\java"  -Dant.home="" -classpath
> > "bin\ant.jar;bin\xerces.ja
> > r;f:\jdks\jdk1.1.8\lib\classes.zip;f:\jdks\jsdk2.0\lib\jsdk.jar;f:
> > \jdks\jdk1.1.8
> > \lib\classes.zip" org.apache.tools.ant.Main
> > Buildfile: build.xml
> >
> > prepare:
> >     [mkdir] Created dir: E:\builds\xml-commons\java\external\build\classes
> >     [mkdir] Created dir: E:\builds\xml-commons\java\external\build\docs
> >     [mkdir] Created dir: E:
> > \builds\xml-commons\java\external\build\docs\javadoc
> >
> > compile:
> >     [javac] Compiling 121 source files to E:
> > \builds\xml-commons\java\external\bu
> > ild\classes
> >     [javac] E:
> > \builds\xml-commons\java\external\src\javax\xml\parsers\FactoryFin
> > der.java:264: Method getContextClassLoader() not found in class
> > java.lang.Thread
> > .
> >     [javac]             return Thread.currentThread().getContextClassLoader
> > ();
> >     [javac]
> > ^
> >     [javac] E:
> > \builds\xml-commons\java\external\src\javax\xml\transform\FactoryF
> > inder.java:263: Method getContextClassLoader() not found in class
> > java.lang.Thre
> > ad.
> >     [javac]             return Thread.currentThread().getContextClassLoader
> > ();
> >     [javac]
> > ^
> >     [javac] E:
> > \builds\xml-commons\java\external\src\org\xml\sax\helpers\ParserAd
> > apter.java:568: Method add(org.xml.sax.SAXException) not found in class
> > java.uti
> > l.Vector.
> >     [javac]                 exceptions.add(e);
> >     [javac]                               ^
> >     [javac] E:
> > \builds\xml-commons\java\external\src\org\xml\sax\helpers\ParserAd
> > apter.java:591: Method get(int) not found in class java.util.Vector.
> >     [javac]             errorHandler.error
> > ((SAXParseException)(exceptions.get(i)
> > ));
> >     [javac]
> > ^
> >     [javac] 4 errors
> >
> > BUILD FAILED
> >

Re: xml-commons JAXP FindFactory class requires JDK 1.2+ to compile?

Posted by cm...@yahoo.com.
There is a workaround in xml-xalan's version of jaxp, using reflection,
you could use that if requiring JDK1.2 to compile is too much. 

Another solution ( used by tomcat3) is a small "compat" package that 
provides a simple interface for some of the common jdk1.2 calls you may
need in 1.1 ( class loader, doPriviledged, context class loader, etc ).

Costin


On Thu, 14 Jun 2001 Shane_Curcuru@lotus.com wrote:

> Is this true?  I thought we weren't going to require JDK 1.2+ quite yet.
> I was about to temporarily copy the JAXP stuff into the xml-xalan tree so
> we can short-term use the new code in the xalan build, but I don't want to
> yank xalan developers into the 1.2+ requirement yet.  (Yes, I should help
> working on moving xml-commons integration out, but the rest of life is
> interfering right now)
> 
> Is there any simple way to make this also compile on 1.1, perhaps with a
> couple of reflection calls?  Or should I just skip this for now, and update
> to 1.2 later?
> 
> (I cc:'d a few people who might not yet have subscribed to commons-dev)
> - Shane
> E:\builds\xml-commons\java\external>build
> 
> Xalan-J 2.x Build
> -------------
> "f:\jdks\jdk1.1.8\bin\java"  -Dant.home="" -classpath
> "bin\ant.jar;bin\xerces.ja
> r;f:\jdks\jdk1.1.8\lib\classes.zip;f:\jdks\jsdk2.0\lib\jsdk.jar;f:
> \jdks\jdk1.1.8
> \lib\classes.zip" org.apache.tools.ant.Main
> Buildfile: build.xml
> 
> prepare:
>     [mkdir] Created dir: E:\builds\xml-commons\java\external\build\classes
>     [mkdir] Created dir: E:\builds\xml-commons\java\external\build\docs
>     [mkdir] Created dir: E:
> \builds\xml-commons\java\external\build\docs\javadoc
> 
> compile:
>     [javac] Compiling 121 source files to E:
> \builds\xml-commons\java\external\bu
> ild\classes
>     [javac] E:
> \builds\xml-commons\java\external\src\javax\xml\parsers\FactoryFin
> der.java:264: Method getContextClassLoader() not found in class
> java.lang.Thread
> .
>     [javac]             return Thread.currentThread().getContextClassLoader
> ();
>     [javac]
> ^
>     [javac] E:
> \builds\xml-commons\java\external\src\javax\xml\transform\FactoryF
> inder.java:263: Method getContextClassLoader() not found in class
> java.lang.Thre
> ad.
>     [javac]             return Thread.currentThread().getContextClassLoader
> ();
>     [javac]
> ^
>     [javac] E:
> \builds\xml-commons\java\external\src\org\xml\sax\helpers\ParserAd
> apter.java:568: Method add(org.xml.sax.SAXException) not found in class
> java.uti
> l.Vector.
>     [javac]                 exceptions.add(e);
>     [javac]                               ^
>     [javac] E:
> \builds\xml-commons\java\external\src\org\xml\sax\helpers\ParserAd
> apter.java:591: Method get(int) not found in class java.util.Vector.
>     [javac]             errorHandler.error
> ((SAXParseException)(exceptions.get(i)
> ));
>     [javac]
> ^
>     [javac] 4 errors
> 
> BUILD FAILED
>