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 7128323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:07:36+00:00 2026-05-28T11:07:36+00:00

I am using JBoss 6.0. I am running a simple webserver using the jboss.resteasy

  • 0

I am using JBoss 6.0. I am running a simple webserver using the jboss.resteasy library to provide simple XML responses to HTTP requests.

I have:
– A server
– A simple Java Client that creates a GET request

Now the thing is, if I use the browser to access the URL, I get the wanted XML. But if I use my Java client, which has the following code:

//Register the fake instrument
GetMethod get = new GetMethod("http:/localhost:8080/"+PROJECT_NAME+"/webserver/registerInstrument/?name=FakeClient&value=0");
HttpClient client = new HttpClient();

try {
    int status = client.executeMethod(get);
} catch (HttpException e) {
    System.out.println("[FakeClient] HttpException executing AddInstrument GET request: "+e);
} catch (IOException e) {
    System.out.println("[FakeClient] IOException executing AddInstrument GET request: "+e);
}

Then I get the following exception:

log4j:WARN No appenders could be found for logger (org.apache.commons.httpclient.params.DefaultHttpParams).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.IllegalArgumentException: Host name may not be null
at org.apache.commons.httpclient.HttpHost.<init>(HttpHost.java:68)
at org.apache.commons.httpclient.HttpHost.<init>(HttpHost.java:107)
at org.apache.commons.httpclient.HttpMethodBase.setURI(HttpMethodBase.java:280)
at org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:220)
at org.apache.commons.httpclient.methods.GetMethod.<init>(GetMethod.java:89)
at client.FakeClient.<init>(FakeClient.java:30)
at client.FakeClient.main(FakeClient.java:22)

At first I thought this could be a problem with the JBoss logging, but if I access the URL through the browser, I obtain the desired XML with no problems.

Is this a problem with the Java client application?

Thank you

  • 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-28T11:07:37+00:00Added an answer on May 28, 2026 at 11:07 am

    The ‘log4j:WARN’ is just a warning. It has nothing do to with the actual exception being thrown.

    The exception message states that ‘Host name may not be null’. This clearly indicates that there is something wrong the the hostname. And looking at you code, I can spot one error.

    You need to add an extra forward slash:

    GetMethod get = new GetMethod("http://localhost:8080/" ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using apache as my front http server which handles requests for JBoss
I'm using the java bonjour library (dns_sd.jar) in a web application running in Jboss
I have a Java web application running on JBoss using JAAS for authentication. I
I am running a JBoss instance on a linux server I am using the
Imagine you are developing a Java EE app using Hibernate and JBoss. You have
I have legacy application using struts & ejb2.0 , hibernate v3.0 running on JBoss
I'm debugging an application on a remote server running JBoss using Eclipse. My particular
I have a network server that was implemented using Jboss Netty. It servers the
I have a Java EE application running on jboss-5.0.0.GA. The application uses BIRT report
We have an web application running under JBoss 5 which periodically launches a 'java'

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.