Solved

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

Posted on 2004-03-26
19
651 Views
Last Modified: 2013-11-23
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
0
Comment
Question by:mvkraju
  • 10
  • 9
19 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 10689041
That comes with the web services development pack. Where are your jars for that - put them into your classpath
0
 

Author Comment

by:mvkraju
ID: 10690066
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?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10690132
>>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
0
 

Author Comment

by:mvkraju
ID: 10690136
Ofcourse as CEHJ said i also put
jax-1_1-fr-qname-class.jar and relaxngDatatype.jar in my classpath
0
 

Author Comment

by:mvkraju
ID: 10690156
i could see only those 4 jars under
jwsdp-1.3\jaxb\lib
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10690411
I gave you a command to search jars before. Try it out on XMLConstants
0
 

Author Comment

by:mvkraju
ID: 10690476
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.
0
 

Author Comment

by:mvkraju
ID: 10690586
o.k. i could run the command againest XMLConstants
like >>jar -tvf *.jar | find "XMLConstants"
there is no result
0
 

Author Comment

by:mvkraju
ID: 10690626
i checked XMLConstants against all the individual jar which i have, but there is no result
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:mvkraju
ID: 10690983
I am increasing points guys. I need urgent help
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10695482
>>

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
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10695598
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"
0
 

Author Comment

by:mvkraju
ID: 10715012
I used ur command, XMLConstants is not there :(
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10715022
So did you download the wsdp?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10715057
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
0
 

Author Comment

by:mvkraju
ID: 10731957
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.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 50 total points
ID: 10733670
>>we have to put them in the classpath, then we will not get any error.

(as per my very first comment ;-))
0
 

Author Comment

by:mvkraju
ID: 10786466
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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10790356
>>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
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now