Avatar of mvkraju
mvkraju

asked on 

javax.xml.namespace.NamespaceContext and javax.xml.XMLConstants not found when compiling JAXB generated classes

Hi,

 I am trying to run JAXB application
When i am trying to compile, after i generate Java classes using JAXB

the compiler could not found the following classes
javax.xml.XMLConstants
javax.xml.namespace.NamespaceContext

What jar file i suppose to put in my classpath?

Thanks
Java

Avatar of undefined
Last Comment
CEHJ
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

That comes with the web services development pack. Where are your jars for that - put them into your classpath
Avatar of mvkraju
mvkraju

ASKER

yes i put them in the classpath.
I put the following jars in the class path tose are related to JAXB
jaxb-api.jar
jaxb-impl.jar
jaxb-libs.jar
jaxb-xjc.jar

am i missing anything else?
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

>>am i missing anything else?

Well i don't know if you're missing anything, but since it's part of the wsdp, i would download that and make sure you've got all jars
Avatar of mvkraju
mvkraju

ASKER

Ofcourse as CEHJ said i also put
jax-1_1-fr-qname-class.jar and relaxngDatatype.jar in my classpath
Avatar of mvkraju
mvkraju

ASKER

i could see only those 4 jars under
jwsdp-1.3\jaxb\lib
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

I gave you a command to search jars before. Try it out on XMLConstants
Avatar of mvkraju
mvkraju

ASKER

I tried last time also, i did not get any result
may be i might be doing dome thing wrong in executing the command
could you guide me step by step.
Avatar of mvkraju
mvkraju

ASKER

o.k. i could run the command againest XMLConstants
like >>jar -tvf *.jar | find "XMLConstants"
there is no result
Avatar of mvkraju
mvkraju

ASKER

i checked XMLConstants against all the individual jar which i have, but there is no result
Avatar of mvkraju
mvkraju

ASKER

I am increasing points guys. I need urgent help
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

>>

o.k. i could run the command againest XMLConstants
like >>jar -tvf *.jar | find "XMLConstants"
there is no result

>>

I don't know where you're quoting that command from - it's not from me, and won't work ;-) The one i gave you will
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

This is slightly better than the one i gave you though:


for %a in (*.jar) do @echo Looking in %a ... & @jar -tvf "%a" | @find /I "XMLConstants"
Avatar of mvkraju
mvkraju

ASKER

I used ur command, XMLConstants is not there :(
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

So did you download the wsdp?
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Look at the title bar of the browser when you open this page:

http://java.sun.com/webservices/docs/1.3/api/javax/xml/XMLConstants.html
Avatar of mvkraju
mvkraju

ASKER

CEHJ

  You know what?
under jwsdp-1.3\jwsdp-shared\lib there are bunch of jar files

we have to put them in the classpath, then we will not get any error.
Thanks for ur support.
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of mvkraju
mvkraju

ASKER

CEHJ i am awarding these points to you.
Eventhough i did not get satisfied answer from you.

Your comment did not say that i suppose to put all the libraries those are under jwsdp-shared directory.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

>>Your comment did not say that i suppose to put all the libraries those are under jwsdp-shared directory.

Obviously, all classes, and by extension all jars, that your application needs must be in the classpath. I'm not aware of where they are on your file system originally but the general point holds
Java
Java

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

102K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo