• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 609
  • Last Modified:

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)
0
mte01
Asked:
mte01
  • 6
  • 5
  • 5
  • +1
3 Solutions
 
CEHJCommented:
That looks like a weblogic class - are you working with W?
0
 
mte01Author Commented:
>>are you working with WL?

Yes, what do I try to search for??
0
 
objectsCommented:
do a search thru your web logic jars as a strat
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
mte01Author 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
0
 
objectsCommented:
> 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)
0
 
CEHJCommented:
But do any of the xerces classes start with

/weblogic

?
0
 
mte01Author 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??
0
 
CEHJCommented:
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
0
 
objectsCommented:
> 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.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> 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.
0
 
mte01Author 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
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> 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.
0
 
CEHJCommented:
Try setting the System property

org.xml.sax.driver

to the fq name of the parser you want
0
 
objectsCommented:
Have a look at the stack trace, it should give you better idea why/whats calling it
0
 
mte01Author 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
0
 
Mayank SAssociate Director - Product EngineeringCommented:
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.
0
 
mte01Author 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!!
0
 
CEHJCommented:
OK. Glad it's running
0
 
objectsCommented:
no worries :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 5
  • 5
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now