Hi Minal
 
Oh, there's a big difference between saying you got a 'security exceptoin' when the message is actually 'sealing violatoin'. (I wish there was a SealingViolationException to make these kinds of things more obvious but there you go).
 
"sealing violation" is one of those yucky CLASSPATH problems. This is generally caused by a bad classpath where bits of a JAR X is loaded from one place then other bits of another JAR Y are loaded which expect the original bits to be loaded from its jar, but they've already been loaded from X and so causing a conflict.
 
This usually indicates duplications on the classpath. Without knowing your classpath its hard to guess the real cause but I'd say its probably one of these things
 
* set your CLASSPATH to only dom4j-full.jar and you'll be fnie
* set your CLASSPATH to only dom4j.jar and only one XML parser (crimson.jar or xerces.jar) and you'll be fine
 
The problem may well be that you have one or more jars with the SAX distribution on the classspath, e.g. sax.jar and dom4j-full.jar or dom4j-full.jar and xerces.jar.
 
So I'd clean your CLASSPATH up a bit and you should be fine.
 
A quick word of warning, be very, very careful about *ever* putting jars into the $JAVA_HOME/jre/lib/ext directory - its easy to forget what you put there and for conflicts to occur.
 
I hope that helps

James
----- Original Message -----
Sent: Friday, July 02, 1999 7:57 PM
Subject: Re: [dom4j-user] (no subject)

Hi James,
 
Thanks for your prompt reply.However I am still facing the same problem of the Sealing violation error.
 
I am writing a standalone application and not an applet.
 
This is what my xml writer code looks like.The error is pointed at the XMLWriter object creation.
 
 ->XMLWriter writer = new XMLWriter(new FileWriter("Out.xml"));
writer.write( document );
writer.close();
 
Am sending along the error screen trap as an attachment.
Kindly help me out.
 
Thanking you,
 
Minal
----- Original Message -----
Sent: Wednesday, September 26, 2001 12:23 AM
Subject: Re: [dom4j-user] (no subject)

Hi Minal
 
Could it be that you are writing an applet and creating an XMLWriter that writes to a local file? Applets generally can't write to local files unless they're signed. You could try this instead...
 
StringWriter buffer = new StirngWriter();
XMLWriter writer = new XMLWriter( buffer );
writer.write( document );
String text = buffer.toString();
 
If the above works then the problem you were having was caused by you not being allowed to write to files in the sandbox where you ware.
 
BTW the above could be simplified as either
 
StringWriter buffer = new StirngWriter();
document.write( buffer );
 
or
 
String text = document.asXML();

James
----- Original Message -----
Sent: Monday, July 26, 1999 8:24 PM
Subject: [dom4j-user] (no subject)

Hi All,
 
I have just downloaded the dom4j package and am trying to run the Creating an Xml Document example in the Quickstart guide.After the document is created I tried to ouput the Document as an Xml file .The code compiles perfectly ,however at run time I get a java.lang.SecurityException:sealing violation error.
 
The exception points to the location where I create an XMLWriter object.
 
I would be thankful if anyone could help me out with this error.
 
Minal Ashar
Zenith Infotech Ltd.
 
 
 

Reply via email to