javax.xml.namespace does not exist for JAXB application

Hi,

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

javax.xml.namespace does not exist....

What jar file i suppose to put in my classpath?

Thanks

mvkrajuAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
>>
I downloaded the jwsdp-1_3-windows-i586.exe file
from the link u have given to me.
>>

??

"JAR with javax.xml.namespace.QName API Class Files 1.1 "

is the one i intended you to download...
0
 
CEHJCommented:
Put any and all of these in ALL lib\ext folders:

jaxb-api.jar
The javax.xml.bind interfaces and helper classes
jaxb-xjc.jar
The JAXB RI binding compiler classes
jaxb-impl.jar   (formerly named jaxb-ri.jar)
The JAXB RI binding runtime framework classes
jaxb-libs.jar
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Either add the JAR files themselves to the classpath or (better) put them to the lib\ext folder.
0
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.

 
CEHJCommented:
?!
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Sorry I thought you said ext\lib
0
 
CEHJCommented:
:-)
0
 
mvkrajuAuthor Commented:
I put all the 4 jar files in the classpath.

Still i have javax.xml.namespace  does not found error!!
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Did you try putting them in lib/ext?

BTW, did you add all the 4 individual JAR files to the class-path, or did you add only their directory to the class-path?

Are you using any app-server? Tomcat, etc don't use System classpath.
0
 
mvkrajuAuthor Commented:
I am using JDK 1.4.2
actually this javax.xml.namespace.QName is a class in JDK 1.4 and later versions itself.
This class is in the JDK 1.4.2 API also
I don't understand why this compilation error is coming?
0
 
CEHJCommented:
javax.xml.namespace.QName is not in 1.4.2. It could even be an Axis class/interface
0
 
CEHJCommented:
Not until Java 1.5 is that class in the SDK.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
The closest packages that I see in the Java doc for J2SE 1.4.2 are:

javax.xml.parsers
javax.xml.transform
javax.xml.transform.dom
javax.xml.transform.sax
javax.xml.transform.stream
0
 
Mayank SAssociate Director - Product EngineeringCommented:
If you say that it is in the JDK 1.4 (let's assume that you were correct), then which JAR files were you adding to the class-path? Where are those files? Which files are those?
0
 
mvkrajuAuthor Commented:
I have put the followng things in my classpath

C:\JAVA\j2sdk1.4.2_03\jre\lib\charsets.jar
C:\JAVA\j2sdk1.4.2_03\jre\lib\jce.jar
C:\JAVA\j2sdk1.4.2_03\jre\lib\jsse.jar
C:\JAVA\j2sdk1.4.2_03\jre\lib\plugin.jar
C:\JAVA\j2sdk1.4.2_03\jre\lib\rt.jar
C:\JAVA\j2sdk1.4.2_03\jre\lib\sunrsasign.jar
C:\JAVA\j2sdk1.4.2_03\jre\lib\ext\dnsns.jar
C:\JAVA\j2sdk1.4.2_03\jre\lib\ext\ldapsec.jar
C:\JAVA\j2sdk1.4.2_03\jre\lib\ext\localedate.jar
C:\JAVA\j2sdk1.4.2_03\jre\lib\ext\sunjce_provider.jar

C:\JAVA\jwsdp-1.3\jaxb\lib\jaxb-api.jar
C:\JAVA\jwsdp-1.3\jaxb\lib\jaxb-impl.jar
C:\JAVA\jwsdp-1.3\jaxb\lib\jaxb-libs.jar
C:\JAVA\jwsdp-1.3\jaxb\lib\jaxb-xjc.jar

am i missing anything in the classpath?
may be i need to add some thing to my JDK classpath!
Please help me!

Thanks
0
 
CEHJCommented:
0
 
CEHJCommented:
Now you've posted that, can you just tell us the output of

echo %CLASSPATH%

btw?
0
 
Mayank SAssociate Director - Product EngineeringCommented:
The ones in jre\lib\ext need not be in the class-path.
0
 
CEHJCommented:
None of them needs to be actually, apart from the jaxb ones, but let's not jump the gun. Can you post the output of the command mvkraju?
0
 
Mayank SAssociate Director - Product EngineeringCommented:
I have a feeling that if he tried moving he JARs to lib/ext, it would work.
0
 
CEHJCommented:
That class may not be in those jars
0
 
mvkrajuAuthor Commented:
C:\>echo %CLASSPATH%
C:\Program Files\IBM\WMQ\Java\lib\providerutil.jar;C:\Program Files\IBM\WMQ\Java
\lib\com.ibm.mqjms.jar;C:\Program Files\IBM\WMQ\Java\lib\ldap.jar;C:\Program Fil
es\IBM\WMQ\Java\lib\jta.jar;C:\Program Files\IBM\WMQ\Java\lib\jndi.jar;C:\Progra
m Files\IBM\WMQ\Java\lib\jms.jar;C:\Program Files\IBM\WMQ\Java\lib\connector.jar
;C:\Program Files\IBM\WMQ\Java\lib\fscontext.jar;C:\Program Files\IBM\WMQ\Java\l
ib\com.ibm.mq.jar;.;C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;C:\PROGRA~1\IBM\SQLL
IB\java\db2jcc.jar;C:\PROGRA~1\IBM\SQLLIB\java\sqlj.zip;C:\PROGRA~1\IBM\SQLLIB\b
in;C:\PROGRA~1\IBM\SQLLIB\java\common.jar

By the by i am using IntelliJ IDEA IDE.
I guess this classpath does not effect my thing!
0
 
CEHJCommented:
>>By the by i am using IntelliJ IDEA IDE.

Oh well there's not much point in echoing it then, assuming it builds its own classpath. Change to

C:\JAVA\jwsdp-1.3\jaxb\lib

and tell me what you see when you run this command


for %? in (*.jar) do jar -tvf %? | find /I "QName"
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Those JARs are not there.

How are you adding to the classpath in IntelliJ IDEA? In the Classpath tab of the File -> Project Properties -> Paths dialog, click on "Add" ?
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> I guess this classpath does not effect my thing!

Perhaps it does. Most of them use their own class-paths.
0
 
mvkrajuAuthor Commented:
do you want me to type
>>for %? in (*.jar) do jar -tvf %? | find /I "QName"
this at command prompt?
0
 
CEHJCommented:
>>do you want me to type this at command prompt?

Yes, once you've changed dir to those jaxb jars
0
 
Mayank SAssociate Director - Product EngineeringCommented:
But CEHJ, the error says that the javax.xml.namespace itself does not exist?

mvkraju, did you try it adding to IDEA's class-path the way I told you?
0
 
mvkrajuAuthor Commented:
By the by i moved all the 4 jar files to alib directory as mayankeagle said.
no result.
0
 
mvkrajuAuthor Commented:
By the by i moved all the 4 jar files to alib directory as mayankeagle said.
no result.
0
 
CEHJCommented:
They should not be in a lib directory. That's not going to help

>>But CEHJ, the error says that the javax.xml.namespace itself does not exist?

What's your point here?
0
 
CEHJCommented:
What was the result of the command i asked you to run? There's not much point in moving those jars around the system if that package is not even in there
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> What's your point here?

That it could be possible that he's missing a required JAR file for the entire package.

>> By the by i moved all the 4 jar files to alib directory as mayankeagle said

Did you add them to IDEA's class-path like I have said?
0
 
mvkrajuAuthor Commented:
do i need to
>>for %? in (*.jar) do jar -tvf %? | find /I "QName"
at the command prompt?
or just
>>%? in (*.jar) do jar -tvf %? | find /I "QName"
only?
0
 
CEHJCommented:
>>That it could be possible that he's missing a required JAR file for the entire package.

Which is why i suggested searching for the class in all jars

This is a case where i would not move the jars at all, as it looks like they belong to an installation of some kind. You need to set your class path to them instead, or add them to your IDE's classpath. This is of course assuming that class is in one of them, which is still to be determined until you run the command i gave you
0
 
CEHJCommented:
This one

for %? in (*.jar) do jar -tvf %? | find /I "QName"

Before you do that, you may as well make sure you have jar in your path, so just do

jar
0
 
Mayank SAssociate Director - Product EngineeringCommented:
If you are able to find the class using that method, then can you please tell me whether you have tried adding the JARs to the class-path using the way I told you?

>> In the Classpath tab of the File -> Project Properties -> Paths dialog, click on "Add" ?
0
 
mvkrajuAuthor Commented:
jar is in my PATH
when type the command at my command prompt

>>for %? in (*.jar) do jar -tvf %? | find /I "QName"

i did not get any result!
0
 
mvkrajuAuthor Commented:
i added these jars
>> Project Settings -> select Paths in the Project tab -> select Libraries(classpath) tab in the right hand side -> added all 4 jar using "Add Jar/Directory" button.

As i told you before i am using IDEA.
0
 
CEHJCommented:
>>i did not get any result!

...which suggests that the class is not in there. Did you download the jar i pointed you to earlier?
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Then perhaps the required JAR is not there. I noticed in the Java doc that javax.xml.namespace comes with J2EE 1.4 and not with J2SE 1.4.
0
 
mvkrajuAuthor Commented:
I downloaded the jwsdp-1_3-windows-i586.exe file
from the link u have given to me.
0
 
mvkrajuAuthor Commented:
sorry i did not look at it.
Yes i downloaded the jax-1_1-fr-qname-class.zip file
I put the jax-1_1-fr-qname-class.zip file in the classpath where i put the rest of the 4 jars.

Still the error did not go away!!
0
 
CEHJCommented:
Can you run this command on that zip file:

jar -tvf jax-1_1-fr-qname-class.zip | find "QName"
0
 
CEHJCommented:
"in the classpath where"

You do realise that archives have to have their full path including their own name named don't you? i.e. the name of the folder they're in won't do
0
 
mvkrajuAuthor Commented:
sorry i did wrong before
there is a jar file when i extract jax-1_1-fr-qname-class.zip.
I put the jar file in the classpath

now that error has gone

really good job guys!!!!
excellent job!!!!
I appreciate ur support.

I need u guys to stay with me some more time.

bcz i am getting another compilation error now
this time it says
package org.relaxng.datatype does not exist.....

by the by i am inceasing my points!!!
0
 
CEHJCommented:
Oh no! ;-)

0
 
mvkrajuAuthor Commented:
may be i will give ur points then will another thread!!
will do that? :)
0
 
CEHJCommented:
Might be a good idea. Here's one for free: you need this:

http://heanet.dl.sourceforge.net/sourceforge/relaxng/relaxngDatatype-1.0.zip
0
 
mvkrajuAuthor Commented:
CEHJ could you give me another link where i can find the file
some how i could not access the file there.
0
 
CEHJCommented:
Strange - what happens? Don't know if i can remember how i got there now ..;-)
0
 
mvkrajuAuthor Commented:
never mind i could get that!
now that's woking fine
now it could not find javax.xml.XMLConstants package
any idea?
0
 
CEHJCommented:
New question time - "Treasure Hunt"(?)
0
 
mvkrajuAuthor Commented:
O.K. i am increasing points :)
0
 
CEHJCommented:
I think your other idea is better - close this one and open a new one
0
 
mvkrajuAuthor Commented:
O.k. as u like!
0
 
CEHJCommented:
:-)
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.

All Courses

From novice to tech pro — start learning today.