Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Package doesnot exist

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am creatig a small client java program and i am importing some classes but i had errors during compilation, the error is that cannot find the package! How to find it ?where to put it?This is my code:

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;

public class Client {
public static void main(String [] args) {
try {
String endpointURL =
"http://localhost:8080/axis/services/SilverService";

Integer in = new Integer(10);
Service service = new Service();
Call call = (Call) service.createCall();

call.setTargetEndpointAddress(
new java.net.URL(endpointURL) );
call.setOperationName(
new QName("SilverService", "getIncrement") );

Object ret = call.invoke( new Object[] { in } );

System.out.println("Object = " + ret.getClass().getName());
System.out.println("Number Returned : " + ret.toString());
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
 
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would be helpful if you could post the full error message. (And it is generally a good idea to do such when posting questions. - See the TellTheDetails tip for more information.)

Most likely your issue is that the package that is not being found in not on your classpath. So most likely you need to adjust your classpath. If its the org.apache.axis.client package not being found, you need to add the Apache Axis JAR to your classpath. (If you are not sure how to do that, let us know and we can show you.) But depending on the error message you are getting, there may be other things you may need to do.
[ August 04, 2008: Message edited by: Mark Vedder ]
 
Sheriff
Posts: 22126
114
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to include the Axis JAR file in the classpath when compiling. javax.xml.namespace.QName won't be a problem if you're using Java 5.0 or higher.
 
feda alshahwan
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear
Thank you for your response.I am using NetBeans. How to include a classpath using NetBeans?
When I used JDK1.5.0_16 from command line I got the following:


C:\tomcat50-jwsdp\tomcat50-jwsdp\webapps\axis\WEB-INF\classes>javac -cp %AXISCLA
SSPATH% %AXIS_HOME%\web-inf\classes\Client\src\client\Client.java
C:\TOMCAT50-JWSDP\TOMCAT50-JWSDP\WEBAPPS\AXIS\web-inf\classes\Client\src\client\
Client.java:10: java.security.Provider.Service is already defined in a single-ty
pe import
import org.apache.axis.client.Service;
^
C:\TOMCAT50-JWSDP\TOMCAT50-JWSDP\WEBAPPS\AXIS\web-inf\classes\Client\src\client\
Client.java:20: cannot find symbol
symbol : constructor Service()
location: class java.security.Provider.Service
Service service = new Service();
^
C:\TOMCAT50-JWSDP\TOMCAT50-JWSDP\WEBAPPS\AXIS\web-inf\classes\Client\src\client\
Client.java:21: cannot find symbol
symbol : method createCall()
location: class java.security.Provider.Service
Call call = (Call) service.createCall();
^
3 errors

C:\tomcat50-jwsdp\tomcat50-jwsdp\webapps\axis\WEB-INF\classes>
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic