Jump to content
Excelsior Forums
Sign in to follow this  
parad

disabling/overriding parts of JDK packages

Recommended Posts

Using the SAX1/2 parser Piccolo (http://piccolo.sourceforge.net/) and it has I think some small differences in the org.xml.sax interfaces. I use

-IGNORECLASSDUPLICATION+

and that makes the program compile, but it chrashes on execution. So I was wondering if anyone knew how to make JET use the packages defined by

!module to override packages in the JDK?

(both JDK1.4 and Piccolo.jar has org.xml.sax... in it)

Share this post


Link to post
Share on other sites

Unfortunately, there is no simple way like BOOTCLASSPATH because the respective classes are pre-compiled into JET RT DLLs

A possible workaround is to make customized versions of JET/BIN/sym.zip and JET/BIN/bod.zip :

 - rename or copy them to sym1.zip and bod1.zip

 - remove the org/xml/sax directories from sym1.zip and bod1.zip

 - edit JET/BIN/jc.red (replace original zip names with the customized ones)

This trick is known to work with CORBA, but there is no guarantee that it will work with other packages. And NEVER try it with core packages like java.lang.

Share this post


Link to post
Share on other sites

tried this and used the org/xml part from the Piccolo.jar (stripped some stuff

out of that one as well), but then I get:

F425

file open error: "org/xml/sax/~Locator.sym" no such file

but it's _there_ inside the jar I'm using (trippel checked) It fails in the parsing stage. The file is _not_ present in the sym dir though.

so ... :( The original Piccolo.jar works well when using jdk1.4 and javac, but with jc it don't

Share this post


Link to post
Share on other sites

working on the problem right now

on linux/win32 using jdk1.3 and jdk1.4 (on win32) everything works smoothly

when using either the Piccolo (made it work, just stripped stuff from the Piccolo.jar) or crimson SAX2 parser. BUT when compiling with jc (using either crimson or Piccolo) I get a SaxException, and according to my code it should only do that when some variable is null. Now, on java it is _not_ null, and when dumping the variable one line above the actual if test it's not null when using jc either! It all seems like there might be some bug in jc :(

public void startElement(.....) {

  String foo = bar.something();

  if (foo != null) {

     System.out.println("notnull: " + foo);

  } else {

     System.out.println("null: " + foo)

  }

}

with similar code as above our myapp.exe returns:

notnull: whatever#1

which is ok, but then:

notnull: whatever#2

null: whatever#2

which is NOT ok... seems like it optimize away the else??

Share this post


Link to post
Share on other sites

change my code from

if (foo != null) {

  // do some stuff

} else {

  // throw some exception

}

to:

if (foo == null) thow somexception;

// do some stuff

and now it works...

clearly a bug :(

Share this post


Link to post
Share on other sites

the pack was already installed, we tried singeling out only parts of the code to give to you but then the bug didn't manifest :( (sensitive data in the complete source)

Share this post


Link to post
Share on other sites
Sign in to follow this  

×