9/13/2013

NoSuchMethodError: javax.xml.parsers.DocumentBuilderFactory.newInstance

This is the error from running a webapp deployed to appserver:

java.lang.NoSuchMethodError: javax.xml.parsers.DocumentBuilderFactory.newInstance(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljavax/xml/parsers/DocumentBuilderFactory;
The cause: there is an xml-apis.jar under JBOSS_HOME/lib/endorsed directory, and so javax.xml.* classes in xml-apis.jar override those same class from JDK. In particular, DocumentBuilderFactory class in xml-apis.jar is of old version and only has newInstance() method, but not newInstance(String, ClassLoader) method. DocumentBuilderFactory.newInstance(String factoryClassName, ClassLoader) is introduced in Java 6.

The fix is to remove xml-apis.jar from JBOSS_HOME/lib/endorsed directory. XML parser has been in Java proper for a long time, and there is no need for xml-apis.jar in most modern applications.

27 comments:

Anonymous said...

Thank you!! Lost a whole day to this problem and this post finally solved it!

FloridaStream said...

Very userfull info man, now in 2015 you saved my life for error java.lang.NoSuchMethodError: javax.xml.parsers.SAXParser.getXMLReader, i remove the ompile 'dom4j:dom4j:20040902.021138' and my apk work fine, tks. I love you =D

Anna said...

Great and Useful Article.

Online Java Course

Java Online Training

Java Course Online

J2EE training

online J2EE training

Best Recommended books for Spring framework

Java Interview Questions












Java Training Institutes in Chennai

Java Training in Chennai

J2EE Training in Chennai

java j2ee training institutes in chennai

Anonymous said...

I was very impressed by this post, this site has always been pleasant news. Thank you very much for such an interesting post. Keep working, great job! In my free time, I like play game: redball4games.com. What about you?

alicetaylor said...

I would like to thank you for your nicely written post

potaup

ngocanhng said...

Your blog posts are more interesting and impressive. I think there are many people like and visit it regularly, including me.I actually appreciate your own position and I will be sure to come back here.
brtaram

Tuckerjackk said...

TrendMiner
TrendMiner
Apsense
Uberant
Minds
Pixnet
Sebangsa
Jack Tucker
Hail Hydra

customized gifts for him said...

vintage linens pillow
baby burlap decorative
baby burlap pillow

Elon Brown said...

I personally thought the written post is well suited and trouble-free for me to go after provided guideline. Overall, I really enjoyed the assistance provided by you.If you are looking  for  the best antivirus software and support so you should try one of them which may help you a lot. Click below:
  Norton.com/setup   
mcafee.com/activate mcafee.com/activate

Elon Brown said...

I appreciate your blog and thanks for the informative share. If you are looking for  the best antivirus software and support so you should try one of them which may help you a lot. Click below:
office.com/setup    office.com/setup

Anonymous said...

Helpful information. Thank! I want to share a link with you free online slots no download. This is an online casino with a favorable welcome bonus.

meldaresearch said...

Finding the best healthcare assignment writing services and Medical Assignment Writing Services is not easy unless one is keen to establish a reliable custom medical research paper provider & medical writing service help online.

meldaresearch said...

It is important for theology & religion writing service students to seek Religion & Theology Research Writing Services from a reputable theology & religion research paper service provider for their custom theology & religion assignment writing services.

meldaresearch said...

Online health & safety essay writing services are very difficult to complete and many students are always searching for Health & Safety Writing Services to help them complete their health & safety research paper writing services and health & safety coursework writing services.

meldaresearch said...

Finding the best biological science paper writing help and Biological Science Writing Services is not easy unless one is keen to establish a reliable biological science research paper provider & biological science coursework writing services.

Plumbing & HVAC Services San Diego said...

ظهور نخستین سایت های شرط بندی
اما نخستین سایت های شرط بندی چگونه شکل گرفتند؟ قبل از اینکه به مبحث اصلی مقاله یعنی معرفی سایت بازی انفجار نیترو بپردازیم، بد نیست کمی با ظهور نخستین سایت های شرط بندی آشنا شویم. اگر فراموش نکرده باشید اشاره کردیم بازی های شرط بندی در گذشته محدودیت های زیادی را داشتند.
حضرات نیترو
حضرات
بازی رولت

اما امروزه قدرت اینرنت باعث شده تا این بازی به سایت های شرط بندی کوچ کنند و از محدودیت مکانی خارج شوند. تاریخ دقیق ظهور سایت های شرط بندی در دسترس نمی باشد.
بتخته نرد آنلاین نیترو
تخته نرد آنلاین
بلک جک نیترو

اما با رجوع به تاریخچه بعضی از این سایت های از جمله سایت نیترو، خواهیم دریافت که پیشرفت تکنولوژی، بزرگترین ترغیب کننده برای ایجاد این سایت ها بوده است. البته مطالب گفته شده تمامی اطلاعات درباره این سایت های نمی باشد.
پوکر آنلاین نیترو
پوکر آنلاین
بلک جک

شمار سایت های شرط بندی امروزه رو به افزایش می باشد. برای مثال می توانیم به سایت نیترو اشاره کنیم. این سایت معتبر یکی از پیشگامان در این عرصه می باشد که قصد داریم در این مقاله شما را بیشتر با آن آشنا کنیم.
پاسور آنلاین نیترو
پاسور آنلاین

ترفند برد و آموزش بازی انفجار آنلاین و شرطی، نیترو بهترین و پرمخاطب ‌ترین سایت انفجار ایرانی، نحوه برد و واقعیت ربات ها و ...
Visit https://www.wmsociety.org/
here for more information

nirjonniyaz said...

토토사이트검증 토토 먹튀 검증 저희 먹튀커머스 는 2016년 5월 부터 지금까지 먹튀커머스 를 믿고 방문 해주시는 유저 분들을 위해 더이상 먹튀 없는 공정한 배팅 문화 를 만들기 위해서 항상 노력하고 유저분들에 소리에 귀를 기울리는 NO.1 먹튀검증 커뮤니티 입니다. 또한 먹튀커머스 에서는 무분별한 배팅사이트 들을 일방적으로 추천 하지 않고 철저한 검수 작업을 토대로 사전에 먹튀 사고가 발생 안되게끔 유저 분들 에게 추천하는 만큼 저희측에 등록 되어 있는 배팅사이트 내에서 혹여 먹튀가 발생 한다면 오로지 그책임은 저희 먹튀커머스 에 있음을 알려 드립니다. / 먹튀 검증

tarzanturkk said...

Establish internet connection on your system.
Open a web browser and go to www.norton.com/setup.
Log in to your account with correct username and password.
Search for the product that you have bought online after entering into your account.
Select the product that you have purchased and move to download option.
Press the download button to pour Norton setup into your system.
Allocate the memory location in your system to the downloaded setup file according to your convenience. Otherwise, it will save at it’s by default location, i.e. download section of the system.
Be patient till it downloaded into your system.
Now, your system holds the setup file of Norton security package, and you are all ready to install it on your system.norton.com/setup
www.norton.com/setup

ravisynit said...

great java tips At SynergisticIT we offer the best java bootcamp california

aditya said...


I read that Post and got it fine and informative.

spotify premium apk android
Dhar Mann
lola Iolani Momoa
pubfilm
Spy Dialer
free edu email

Princess said...

Thanks for sharing this useful information.
Latest Jobs in Pakistan
Latest Jobs
Latest Government Jobs in Pakistan

unknown said...

HVAC & Plumbing Services
Air Star Heating guarantees reliability and quality for all equipment and services.

Air Star Heating specialists always try to deliver the most excellent quality of services to our customers at an affordable price. It is understood that every client has different needs and different problems. We try to accomplish the needs of every client according to their requests. We are having considerable experience in this field. Our specialists understand very well how things work. It doesn’t matter in which field of industry you are looking for services.
Plumbing & HVAC Services in San Diego. Call now (858) 900-9977 ✓Licensed & Insured ✓Certified Experts ✓Same Day Appointment ✓Original Parts Only ✓Warranty On Every Job.
Visit:- https://airstarheating.com

Michael Smith said...

Beating everything, truly like this message. Unremittingly it's difficult to pick the positive from for the check people, yet I think you nailed it! Fix HP Envy 4520 Printer Offline by HP experts. Contact our executives to resolve HP Envy Printer 4520 Offline.

Hosting said...

Your blog is so sharp. stay mindful of a confounding work! Hi I providing hosting in 80% off. For more information visit my website click here Hostinger Coupon 2021

Kumar Vishwakarma said...

Thanks

James William said...

Masterminding a site that watches out for your affiliation will assist with getting you affiliation the prospect that it needs to get by among the different areas on the web today. The Epson Error Code 0x88 indicate ink system error in Epson printer. Epson executives help you to fix the issue.

Kartikey said...

Thanks.Totally loved it
Hope you will continue posting these kinds of stuff