Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7597863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:15:47+00:00 2026-05-30T22:15:47+00:00

So I have a script file we are using in house for testing. I

  • 0

So I have a script file we are using in house for testing. I want to use the script for testing over the internet but when I give it a url instead of a ip address it throws a java.lang.NoClassDefFoundError,

Why is this and what can I do to fix it

this is the script file:

import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection; 

public class SOAPClient4XG
{
  public static void main(String[] paramArrayOfString)
    throws Exception
  {
    if (paramArrayOfString.length < 2) {
      System.err.println("Usage:  java SOAPClient4XG http://soapURL soapEnvelopefile.xml [SOAPAction]");


      System.err.println("SOAPAction is optional.");
      System.exit(1);
    } 

    String str1 = paramArrayOfString[0];
    String str2 = paramArrayOfString[1];

    String str3 = "";
    if (paramArrayOfString.length > 2) {
      str3 = paramArrayOfString[2];
    } 

    URL localURL = new URL(str1);
    URLConnection localURLConnection = localURL.openConnection();
    HttpURLConnection localHttpURLConnection = (HttpURLConnection)localURLConnection;


    FileInputStream localFileInputStream = new FileInputStream(str2);

    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();


    copy(localFileInputStream, localByteArrayOutputStream);
    localFileInputStream.close();

    byte[] arrayOfByte = localByteArrayOutputStream.toByteArray();


    localHttpURLConnection.setRequestProperty("Content-Length", String.valueOf(arrayOfByte.length));

    localHttpURLConnection.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
    localHttpURLConnection.setRequestProperty("SOAPAction", str3);
    localHttpURLConnection.setRequestMethod("POST");
    localHttpURLConnection.setDoOutput(true);
    localHttpURLConnection.setDoInput(true);


    OutputStream localOutputStream = localHttpURLConnection.getOutputStream();
    localOutputStream.write(arrayOfByte);
    localOutputStream.close();



    InputStreamReader localInputStreamReader = new InputStreamReader(localHttpURLConnection.getInputStream());

    BufferedReader localBufferedReader = new BufferedReader(localInputStreamReader);

    String str4;

    while ((str4 = localBufferedReader.readLine()) != null) {
      System.out.println(str4);
    } 
    localBufferedReader.close();
  } 


  public static void copy(InputStream paramInputStream, OutputStream paramOutputStream)
    throws IOException
  {
    synchronized ()
    {
      synchronized (paramOutputStream)
      {
        byte[] arrayOfByte = new byte['Ā'];
        for (;;) {
          int i = paramInputStream.read(arrayOfByte);
          if (i == -1) break; 
          paramOutputStream.write(arrayOfByte, 0, i);
        } 
      } 
    } 
  } 
} 

and the bat file used to run it is this:

echo Check in inquiry sending:
java -cp .SOAPClient4XG http://foobar/gotdns/com:8080/axis2/services/HTNGListener checkininquiry.sms http://htng.org/1.1/Listener.Wsdl#ReceiveMessageAsync

here is the stack trace:

C:\Documents and Settings\accounting\Desktop\springer_miller_docs>java -cp .SOAP
Client4XG http://foobar.gotdns.com:8080/axis2/services/HTNGListener checkinin
quiry.sms http://htng.org/1.1/Listener.Wsdl#ReceiveMessageAsync
Exception in thread "main" java.lang.NoClassDefFoundError: http://foobar/gotd
ns/com:8080/axis2/services/HTNGListener
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:15:48+00:00Added an answer on May 30, 2026 at 10:15 pm

    Your problem has nothing to do with your code but how you’re executing it.

    Your command line says put the main file onto the class path and then execute main in a class named the first URL.

    Leave off -cp and you should be fine (at least from this stack trace).

    For reference: http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file hosting site that's using this script MFHS . I want
I have an xml file that I want to configure using a bash script.
I have a PHP script that executes a .bat file using system(cmd /c C:\dir\file.bat);
I have a batch file containing a python script using the Output template> %(NAME)s
I have a script that generates a csv file using the following code: header('Content-type:
I have a perl script read Excel file and parse using a perl module
I have a script which can overwrite values in a configuration file using options,
I have a script that reads of a global config file using Config::Tiny. Based
I have a sql script file and i want to run that i can
how to read the multiple values from XML file using perl script? i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.