473,386 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Java Compile Errors

4
I'm fairly new to Java and have to write an interface program to get some data from an application server. The environment is Solaris.

I used WebLogic and the ANT command to create a JAR file with the details of the application server. That side of things seemed to work correctly and when I list the jar file I see:

Expand|Select|Wrap|Line Numbers
  1. jar -tf DQSClient.jar
  2. META-INF/MANIFEST.MF
  3. dqsws/DQService.class
  4. dqsws/DQService_Impl.class
  5. dqsws/DQServicePort_Stub.class
  6. dqsws/DQServicePort.class
  7. dqsws/DQService.xml
  8. dqsws/DQService.wsdl
  9.  
I'm now trying to write a program to use the services in the Jar file and I have:

Expand|Select|Wrap|Line Numbers
  1. public class Client
  2. {
  3. public static void main (String a[])
  4. {
  5. DQService_Impl implementation=null;
  6. try
  7. {
  8. implementation = new DQService_Impl("http://jets-sng-uat.app.xxxx.net/DQS/DQService?WSDL");
  9. } catch (IOException e)
  10. {
  11. // TODO Auto-generated catch block
  12. e.printStackTrace();
  13. }
  14. DQServicePort service = implementation.getDQServicePort();
  15. String output = service.getDataDictionary(arg0, arg1, arg2, arg3, arg4, arg5);
  16. }
  17. }
  18.  
I've added the DQSClient.jar to the $CLASSPATH variable and I try to compile, but it doesn't seem to recognise any of the classes defined in the JAR file. I get errors along the lines of:

Client.java:8: cannot resolve symbol
symbol : class DQService_Impl
location: class Client
implementation = new DQService_Impl("http://jets-sng-uat.app.xxxx.net/DQS/DQService?WSDL");

Does anyone know what I'm missing here ?
Feb 5 '08 #1
5 1560
JosAH
11,448 Expert 8TB
Does anyone know what I'm missing here ?
Did you import those classes in your .java source files? As in:

Expand|Select|Wrap|Line Numbers
  1. import dqsws.DQService;
  2. // etc.
  3.  
kind regards,

Jos
Feb 5 '08 #2
Dagon
4
Thanks for that. The errors for the DQS modules have now gone and it's just complaining about IOException and service.getDataDictionary.

Client.java:14: cannot resolve symbol
symbol : class IOException
location: class Client
} catch (IOException e)
^
Client.java:20: cannot resolve symbol
symbol : variable arg0
location: class Client
String output = service.getDataDictionary(arg0, arg1, arg2, arg3, arg4, arg5);
^
These weren't in the Jar file that I created, so I suppose I must need to get them from somewhere else.
Feb 5 '08 #3
Dagon
4
Importing java.io.* gets rid of the IOException, so just left with service.getDataDictionary.
Feb 5 '08 #4
Dagon
4
Looking at that some more, I think it's a problem with the way the arguments are being passed around. I'm working off a scrap of code that was pasted on the web site of the owners of the application server, so it's probably out of date and not very well written.
Feb 5 '08 #5
r035198x
13,262 8TB
Looking at that some more, I think it's a problem with the way the arguments are being passed around. I'm working off a scrap of code that was pasted on the web site of the owners of the application server, so it's probably out of date and not very well written.
That's the advantage of trying to understand code before using it.
The args are probably supposed to be supplied to the main method as input to the program so you need to change your arg0, arg1, e.t.c to a[0], a[1] (to match the name of the variable taken as argument to your main method )
Feb 5 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

198
by: Michael N. Christoff | last post by:
Java, the software developed by Sun Microsystems in the mid-1990s as a universal operating system for Internet applications, gave NASA a low-cost and easy-to-use option for running Spirit, the...
55
by: Elijah | last post by:
I have read many of the topics on learning C++ or Java first. It seems like everyone says something different. I would like to know if I should learn C++ or Java. First a little about myself. I...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
26
by: Christoph Zwerschke | last post by:
You will often hear that for reasons of fault minimization, you should use a programming language with strict typing: http://turing.une.edu.au/~comp284/Lectures/Lecture_18/lecture/node1.html I...
9
by: IchBin | last post by:
I am trying to get Java to work from within PHP. I have been looking at: http://us2.php.net/java The error and line of PHP code: $system = new Java('java.lang.System'); Fatal error: Class...
148
by: BillJosephson | last post by:
Want to do OOP. Does c++ have all the abilities of java, or is it some subset? Thanks...
35
by: mwelsh1118 | last post by:
Why doesn't C# allow incremental compilation like Java? Specifically, in Java I can compile single .java files in isolation. The resulting individual .class files can be grouped into .jar files....
1
by: lucky29105 | last post by:
I am at my wits end here- I have an assignment due today (05/11) and I still cannot compile. I am getting 14 errors! I don't want someone to do my work, but I need help, I am stuck. Here is the...
6
by: aureao4 | last post by:
I'm new to Java and programming. I'm trying to code a payroll program and continue getting errors. The program worked last week, this week I have to add set, get and a class. I've written the class...
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.