Solved

Problems import the package javax.xml.rpc.namespace

Posted on 2003-10-24
5
2,255 Views
Last Modified: 2013-11-24
Hi!

I'm trying to use AXIS for web services, men I don't manage to import the package:
package javax.xml.rpc.namespace.

I get the error:

NHLServiceClient.java:7: package javax.xml.rpc.namespace does not exist
import javax.xml.rpc.namespace.QName;
                               ^
I've heard the package in inside the jar-file: jaxrpc.jar

I have included this file in my classpath, but it doesn't work:

Here is what i do:

_______________

:\JavaDevelopANP>set JAVA_HOME=E:\j2sdk1.4.2_02
 
E:\JavaDevelopANP>set classpath=.;%SAG_COMMON%\xts.jar;E:\Program Files\Common F
iles\Software AG\sagxds.jar;%SAG_COMMON%\saglic.jar;%SAG_COMMON%\sagxds.jar;E:\m
ysql_win2000_jconnect\mysql-connector-java-3.0.9-stable\mysql-connector-java-3.0
.9-stable-bin.jar;E:\tomcat\jtcv2\bin\tomcat-jni.jar;E:\tomcat\jtcv2\common\lib\
ant.jar;E:\tomcat\jtcv2\server\lib\catalina.jar;E:\tomcat\jtcv2\server\lib\catal
ina-ant.jar;E:\tomcat\jtcv2\server\lib\servlets-common.jar;E:\tomcat\jtcv2\serve
r\lib\tomcat-jk.jar;E:\tomcat\jtcv2\server\lib\tomcat-jk2.jar;E:\tomcat\jtcv2\se
rver\lib\tomcat-util.jar;E:\tomcat\jtcv2\server\webapps\admin\WEB-INF\lib\struts
.jar;E:\tomcat\jtcv2\webapps\axis\WEB-INF\lib\jaxrpc.jar;E:\tomcat\jtcv2\webapps
\axis\WEB-INF\lib\axis.jar;E:\tomcat\jtcv2\webapps\axis\WEB-INF\lib\commons-logg
ing.jar;E:\tomcat\jtcv2\webapps\axis\WEB-INF\lib\log4j-1.2.4.jar;E:\tomcat\jtcv2
\webapps\axis\WEB-INF\lib\wsdl4j.jar;E:\tomcat\jtcv2\webapps\axis\WEB-INF\lib\xm
l-apis.jar;E:\tomcat\jtcv2\webapps\axis\WEB-INF\lib\xmlParserAPIs.jar;E:\tomcat\
jtcv2\webapps\axis\WEB-INF\lib\xercesImpl.jar;E:\tomcat\jtcv2\webapps\axis\WEB-I
NF\lib\xercesSamples.jar;E:\AxisBeta322okt2003\axis-1_0\webapps\axis\WEB-INF\lib
\jaxrpc.jar
 
E:\JavaDevelopANP>javac NHLServiceClient.java
NHLServiceClient.java:7: package javax.xml.rpc.namespace does not exist
import javax.xml.rpc.namespace.QName;
                               ^
NHLServiceClient.java:22: cannot resolve symbol
symbol  : class QName
location: class NHLServiceClient
                call.setOperationName(new QName("getCurrentPosition"));
                                          ^
2 errors
 
E:\JavaDevelopANP>
_________________

Can anyone help me out?   : )

Thanks in advance!

Regards,
Tom-Erik
0
Comment
Question by:tomerikv
  • 2
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 125 total points
ID: 9613470
Can only think of two reasons:

a. Your classpath has not been set somehow. Do

echo %CLASSPATH%

b. That class is not in that package in that jar. Do

jar tvf E:\tomcat\jtcv2\webapps\axis\WEB-INF\lib\jaxrpc.jar
jar tvf E:\AxisBeta322okt2003\axis-1_0\webapps\axis\WEB-INF\lib
\jaxrpc.jar
0
 
LVL 3

Expert Comment

by:savalou
ID: 9613537
Try
import javax.xml.rpc.QName;

I think the packaging changed sometime back.
0
 
LVL 1

Author Comment

by:tomerikv
ID: 9613610
Hi!

You were totally right.

The package doesn't exist.

it was supposed to be:
import javax.xml.namespace.QName;

not:
import javax.xml.rpc.namespace.QName;

The code example I used hasn't be tried out, it seems.

Thanks a lot!

Kind regards,
Tom-Erik
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9613911
:-)
0
 
LVL 1

Author Comment

by:tomerikv
ID: 9613935
I've testet the code now and it works 100%!

Cheers!

\ TE
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

776 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