Solved

Problems import the package javax.xml.rpc.namespace

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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 how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

760 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

17 Experts available now in Live!

Get 1:1 Help Now