Solved

Problems import the package javax.xml.rpc.namespace

Posted on 2003-10-24
5
2,237 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

932 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

9 Experts available now in Live!

Get 1:1 Help Now