(Answer) (Category) FAQ-O-Matic : (Category) General : (Category) Compiler :
I am getting "sealing violation" exceptions when I run/compile my project. What does this mean?
A jar file manifest can mark a package as "sealed." This means that the JVM will throw an exception unless every class it loads from the named package comes from the same jar file.

Say you have two versions of a jar, "myjar10.jar", and "myjar11.jar" which are two versions of the same API. Assume the API contains a sealed package called "sealme" and a class named "Foo.class". Now assume Foo.class version 1.0 has a method named "oldMethod(int)", but version 1.1 has it as "oldMethod(double)".

If your application uses both methods (by mistake or design), the JVM will attempt to load "oldMethod(int)" from the 1.0 jar, and "oldMethod(double)" from the 1.1 jar, and it will detect the seal has been breached and toss the sealing violation exception.

You have to track down which jars are duplicating a sealed package, and remove all of the duplicates from the classpath.

This feature does make it difficult to "patch" or "override" classes by prepending to the classpath a jar containing replacement classes.
2001-May-25 11:23am gyles19@visi.com

This is also a common problem with mixing TomCat's JAXP 1.0 jar with a newer JAXP 1.1 jar when developing servlets.

The solution here is to reorder your project's classpath to place JAXP1.1 jars at the start of the classpath, prior to Tomcat's jar in the list of jars. You can do this by defining a required library for the JAXP 1.1 jars (xalan.jar, xerces.jar, crimson.jar, etc) and using the "move up/move down" buttons to place them at the top of the project's required library list. This should cause them to appear before the Tomcat jars in the runtime classpath and should solve the problem.

If that doesn't work, you may have to resort to using -Djava.class.path=... in the project's VMParameters field. This completely overrides the classpath Jbuilder is trying to provide, including the JDK's jars, so you'll have to specify everything the project needs to run by typing it manually (or using a cut/paste operation from the message pane's display of a previous launch.)
2001-Jun-06 9:47pm gyles19@visi.com

Learn about JPathReport here:
  (Xref) Are there any tools available to help diagnose classpath problems?

2001-Jun-19 6:30pm gyles19@visi.com
[Append to This Answer]
2001-Jun-19 6:30pm
Previous: (Answer) I am not receiving the deprecation warnings I expected. The "show deprecation warnings" setting is enabled.
Next: (Answer) Are there any tools available to help diagnose classpath problems?
This document is: http://www.visi.com/~gyles19/cgi-bin/fom.cgi?file=173
[Search] [Appearance]
This is a Faq-O-Matic 2.709.
This FAQ administered by gyles19@visi.com.

Other JBuilder Links

Java Community
Java Tools
Code Central
JB OpenTools
Community
Recent
Threads
Borland Chat
Chat FAQ
Feature Matrices
3.0 |  3.5 |  4.0
5.0 |  6.0 |  7.0
Shop for
JBuilder
JBuilder
Downloads
and reg keys
Report Piracy
Online Manuals
4.0 |  5.0 |  6.0
7.0
Borland
DevSupport's
Bug/RFE Form

Quality Central Client
JB Patches &
Updates
JBuilder FAQs TIs
JBuilder
Newsgroups
Tamaracka's
News Archive
Mr. Haki's
JBuilder Machine
JGuru's
JBuilder FAQ
Sun's Bug
Parade
Netring Home - About - Privacy
The
JBuilder Netring Logo
The Borland JBuilder Netring by JBuilder FAQ-O-Matic
[ Join Now | List Sites | Random | << Prev | Next >> ]
[ Previous 5 Sites | Skip Previous | Skip Next | Next 5 Sites ]