Link to home
Start Free TrialLog in
Avatar of mte01
mte01Flag for Lebanon

asked on

NoClassDefFoundError: weblogic/apache/xerces/framework/XMLParser

Hey experts,

 The error in the title above is occuring at runtime at the 2nd line of the following:

DOMParser parser = new DOMParser();
parser.parse(xmlFiles[i].getAbsolutePath());

I opened the jar file of the correpsonding package, it does not contain the framework folder; I downloaded the org.apache.xerces package (2.6.2) from the internet, and it also did not contain the framework folder...any idea from where this framework class is coming?? (I didn't look at newer version of the xerces package)
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

That looks like a weblogic class - are you working with W?
Avatar of mte01

ASKER

>>are you working with WL?

Yes, what do I try to search for??
do a search thru your web logic jars as a strat
Avatar of mte01

ASKER

>>objects

All occurences of xercesImpl.jar (that contains the apache.xerces classes) in WL's directory do not contain the framework folder

I am doing right now a deep search (using an external tool that does internal search into any file) of the text "apache.xerces.framework" in WL's directory
> All occurences of xercesImpl.jar (that contains the apache.xerces classes) in WL's directory do not contain the framework folder

i was referring to the web logic jars.
if you're not using web logic classes at all then the problem may be in your parser configuration ie. its set to use the wrong implementation (in this case weblogics)
But do any of the xerces classes start with

/weblogic

?
Avatar of mte01

ASKER

>>But do any of the xerces classes start with /weblogic

No..and this is weird since other java files (that are in this project, and which I haven't worked with) are using this kind of import: import weblogic.apache.xerces.utils.URI; successfully without any problems at compile-time or at run-time

>>i was referring to the web logic jars.

How should the hierarchy of the classes be in these jars??
They must be on the classpath somewhere. See my previous in your other one about printing the classpath. One of those probably contains the Weblogic packages
> No..and this is weird since other java files (that are in this project, and which I haven't worked with) are using this
> kind of import: import weblogic.apache.xerces.utils.URI; successfully without any problems at compile-time or at run-time

then there must be wl classes somewhere :)

And mixing of parsers may be wjhats causing your problems.
SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

ASKER

>>BTW, using that kind of code ensures your code is not portable from one application-server to another.

This is not only my project....I am only modifying & adding some files to it, and I got stuck on this (all these jars were configured a long time ago)...

>>CEHJ, objects

Now I lately discovered that this XMLParser class is found, but in the parsers folder (and not in the framework folder), and according to someone who has worked with previous WL versions, this used to be under framework directory in WL6 & 7, but it isn't in WL8 (which is the one I am using right now)....I don't why it's referencing it when I am calling the parse method of class DOMParser...

And regarding the WL jars....I really don't know why they aren't there..but I suppose that they are referenced by "weblogic." while they are actually under their normal hierarchy (org.apache.xerces.etc..) in the jar files in the WL corresponding direcotry
>> This is not only my project....I am only modifying & adding some files to it

Yeah, that is understood. But as a general practice - this is not a recommended approach. If your other team members worked on some code which uses those classes, though - ask them where the required JARs are ;-) I guess somebody would know.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

ASKER

>>If your other team members worked on some code which uses those classes, though - ask them where the required JARs are ;-)

Of the team members here in Lebanon, no one has worked on such a thing..this was probably done by someone the US team. If this problem cannot be resolved, we should contact them of course. Moreover, around 90 developers in the world are working on this project :), so it is really difficult to do this kind of direct communication. On the other hand, I am sure that they did that for a certain reason, and this software is used only with WL.

>>Try setting the System property

I'll be trying that now
I understand why it is difficult to change it but nevertheless it is a point to be kept in mind in the future :) all app-server specific class-names should be maintained in properties or configuration-files.
Avatar of mte01

ASKER

It worked on a friend's PC who has got the same project configuration....so I guess it's some problem from my PC..
thanks for your help guys!!
OK. Glad it's running
no worries :)