Programming

Tomcat 실행 에러: java.net.MalformedURLException

혤혤혤 2017. 3. 28. 14:11

Tomcat 설치후 실행을 했더니 다음과 같은 에러가 발생!!!

java.net.MalformedURLException: Local host name unknown:

내가 뭘 잘못했니 왜 나만안되니...ㅠㅠ

울면서 검색해본결과 


/etc/hosts 파일에 hostname이 localhost로 설정되지 않아서 그렇다고함.

확인을 위해서 cat /etc/hosts 명령어를 실행

그런데 왜죠... 넘나 이쁘게 localhost가 잘 써있는데... 나는 왜 안되는거죠??


MacBook-Pro:~ USERNAME$ cat /etc/hosts

##

# Host Database

#

# localhost is used to configure the loopback interface

# when the system is booting.  Do not change this entry.

##

127.0.0.1 localhost 

::1             localhost 


다시 구글링을 막 해서 찾은 해결 방법

현재 hostname을 localhost 옆에 추가해야함

참고: http://stackoverflow.com/a/20983480


MacBook-Pro:~ USERNAME$ hostname

MacBook-Pro.local

MacBook-Pro:~ USERNAME$ sudo vi /etc/hosts

##

# Host Database

#

# localhost is used to configure the loopback interface

# when the system is booting.  Do not change this entry.

##

127.0.0.1       localhost MacBook-Pro.local

::1             localhost MacBook-Pro.local