You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Danny Gallagher <da...@gmail.com> on 2010/06/24 20:43:49 UTC

underscore in a hostname

Tomcat 6.0
Windows XP

Installed tomcat, everything looks fine, I can run the manager application

Then I try to deploy a war file that is a spring based sample application.

Getting an exception about an invalid character in my hostname.
My computer name does in fact have an underscore in it.

Did some poking around to try to find a way around this, not clear on what
to do.

Am I better off just changing my computer name to something with no
underscore?
Is there a tomcat configuration where I can change it to my IP or localhost?
I searched for my computer name in the conf directory and did not see
anywhere it was used.
Why did the manager application not complain about the same issue? Only the
spring application.

Thanks for any nudge (or shove) in the right direction.

RE: underscore in a hostname

Posted by "Baron, Bob (LNG-HBE)" <Bo...@lexisnexis.com>.
I'd recommend just changing the name of the machine. I ran into this
problem years ago and ran into all kinds of nasty problems - I had an
issue open with Microsoft for over a month until an ACTUAL developer
tracked it down as the culprit. I've made sure that no machine I'd ever
have to interact with had an underscore again!

Not that it's always credible, but Wikipedia actually has a pretty good
summary in the 'Restrictions on valid host names' section. Read the
RFC's for more detail.

http://en.wikipedia.org/wiki/Hostname

Bob


-----Original Message-----
From: Danny Gallagher [mailto:dannygallagher2@gmail.com] 
Sent: Thursday, June 24, 2010 2:44 PM
To: users@tomcat.apache.org
Subject: underscore in a hostname

Tomcat 6.0
Windows XP

Installed tomcat, everything looks fine, I can run the manager
application

Then I try to deploy a war file that is a spring based sample
application.

Getting an exception about an invalid character in my hostname.
My computer name does in fact have an underscore in it.

Did some poking around to try to find a way around this, not clear on
what
to do.

Am I better off just changing my computer name to something with no
underscore?
Is there a tomcat configuration where I can change it to my IP or
localhost?
I searched for my computer name in the conf directory and did not see
anywhere it was used.
Why did the manager application not complain about the same issue? Only
the
spring application.

Thanks for any nudge (or shove) in the right direction.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: underscore in a hostname

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Danny,

On 6/24/2010 2:43 PM, Danny Gallagher wrote:
> Getting an exception about an invalid character in my hostname.
> My computer name does in fact have an underscore in it.

Underscores aren't allowed in hostnames in URLs (see RFC 1738,
http://www.ietf.org/rfc/rfc1738.txt, and search for "hostname"), so
that's likely the problem. ;)

Perhaps Microsoft Windows allows more characters in the "machine name"
which gets turned into the hostname, which is then invalid :(

Would you mind posting the stack trace just for giggles?

> Am I better off just changing my computer name to something with no
> underscore?

Probably.

> Is there a tomcat configuration where I can change it to my IP or localhost?

That depends on where the exception is being thrown.

> I searched for my computer name in the conf directory and did not see
> anywhere it was used.
> Why did the manager application not complain about the same issue? Only the
> spring application.

It's probably trying to use a specific hostname instead of just
"localhost" or something equivalent.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwjwH8ACgkQ9CaO5/Lv0PAcDQCeMSXG/lOwkKgxN131J+4J+J3j
CMYAn18TdynL7OCna//GKT9A3xU1fzEN
=vVIM
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org