We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

NoClassDefFoundError: weblogic/apache/xerces/framework/XMLParser

mte01
mte01 asked
on
Medium Priority
642 Views
Last Modified: 2013-11-23
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)
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016

Commented:
That looks like a weblogic class - are you working with W?

Author

Commented:
>>are you working with WL?

Yes, what do I try to search for??
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
do a search thru your web logic jars as a strat

Author

Commented:
>>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
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
> 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)
CERTIFIED EXPERT
Top Expert 2016

Commented:
But do any of the xerces classes start with

/weblogic

?

Author

Commented:
>>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??
CERTIFIED EXPERT
Top Expert 2016

Commented:
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
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
> 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.
Mayank SPrincipal Technologist
CERTIFIED EXPERT
Commented:
>> using this kind of import: import weblogic.apache.xerces.utils.URI; successfully

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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
>>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
Mayank SPrincipal Technologist
CERTIFIED EXPERT

Commented:
>> 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.
CERTIFIED EXPERT
Top Expert 2016
Commented:
Try setting the System property

org.xml.sax.driver

to the fq name of the parser you want
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
Have a look at the stack trace, it should give you better idea why/whats calling it

Author

Commented:
>>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
Mayank SPrincipal Technologist
CERTIFIED EXPERT

Commented:
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.

Author

Commented:
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!!
CERTIFIED EXPERT
Top Expert 2016

Commented:
OK. Glad it's running
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
no worries :)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.