Java Compile Errors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dagon
    New Member
    • Feb 2008
    • 4

    #1

    Java Compile Errors

    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:

    Code:
    jar -tf DQSClient.jar
    META-INF/MANIFEST.MF
    dqsws/DQService.class
    dqsws/DQService_Impl.class
    dqsws/DQServicePort_Stub.class
    dqsws/DQServicePort.class
    dqsws/DQService.xml
    dqsws/DQService.wsdl
    I'm now trying to write a program to use the services in the Jar file and I have:

    Code:
    public class Client
    {
    public static void main (String a[])
    {
    DQService_Impl implementation=null;
    try
    {
    implementation = new DQService_Impl("http://jets-sng-uat.app.xxxx.net/DQS/DQService?WSDL");
    } catch (IOException e)
    {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    DQServicePort service = implementation.getDQServicePort();
    String output = service.getDataDictionary(arg0, arg1, arg2, arg3, arg4, arg5);
    }
    }
    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.ne t/DQS/DQService?WSDL" );

    Does anyone know what I'm missing here ?
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by Dagon
    Does anyone know what I'm missing here ?
    Did you import those classes in your .java source files? As in:

    [code=java]
    import dqsws.DQService ;
    // etc.
    [/code]

    kind regards,

    Jos

    Comment

    • Dagon
      New Member
      • Feb 2008
      • 4

      #3
      Thanks for that. The errors for the DQS modules have now gone and it's just complaining about IOException and service.getData Dictionary.

      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.getData Dictionary(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.

      Comment

      • Dagon
        New Member
        • Feb 2008
        • 4

        #4
        Importing java.io.* gets rid of the IOException, so just left with service.getData Dictionary.

        Comment

        • Dagon
          New Member
          • Feb 2008
          • 4

          #5
          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.

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Originally posted by Dagon
            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 )

            Comment

            Working...