Unable to start up Eureka server in a stand alone host..

4,565 views
Skip to first unread message

ksuco...@gmail.com

unread,
Jul 10, 2014, 12:37:49 PM7/10/14
to eureka_...@googlegroups.com
I am not able to start the Eureka server by following the instruction. It looks like the demo should work in a single machine environment without any AWS dependency (which is what I want). However, I am getting the following exceptions during startup and on a periodic basis:

2014-07-10 09:26:49,888 ERROR com.netflix.discovery.DiscoveryClient:1058
[localhost-startStop-1] [makeRemoteCall] Can't get a response from
http://localhost/eureka/v2/apps/
Can't contact any eureka nodes - possibly a security group issue?
com.sun.jersey.api.client.ClientHandlerException:
java.net.SocketTimeoutException: Read timed out

2014-07-10 09:20:01,809 ERROR com.netflix.discovery.DiscoveryClient:1058 [pool-
6-thread-1] [makeRemoteCall] Can't get a response from
http://localhost/eureka/v2/apps/
Can't contact any eureka nodes - possibly a security group issue?
java.lang.RuntimeException: Bad status: 404

2014-07-10 09:26:01,877 ERROR com.netflix.discovery.DiscoveryClient:683 [pool-
6-thread-1] [fetchRegistry] DiscoveryClient_EUREKA/US5442499A7472 - was unable
to refresh its cache! status = Bad status: 404
java.lang.RuntimeException: Bad status: 404

I have the following properties in eureka-server.properties:

eureka.waitTimeInMsWhenSyncEmpty=0
eureka.registration.enabled=false
eureka.numberRegistrySyncRetries=1


Any insight / help is appreciated.

Thanks.

Renat Bek

unread,
Jul 13, 2014, 9:04:04 PM7/13/14
to eureka_...@googlegroups.com, ksuco...@gmail.com
Did you deploy it into webapp directory 'eureka'? it could be a simple directory name mismatch - check again and let me know, I can help you set it up.

fie...@gmail.com

unread,
Jul 18, 2014, 10:41:36 AM7/18/14
to eureka_...@googlegroups.com, ksuco...@gmail.com
I am also having the same issue, are you saying that the war should be in webapps/eureka/eureka-server.war and not webapps/eureka-server.war?

- Justin

Renat Bekbolatov

unread,
Jul 18, 2014, 6:20:25 PM7/18/14
to eureka_...@googlegroups.com, ksuco...@gmail.com, fie...@gmail.com
It should be webapps/eureka.war when you drop it there and just make sure it gets deployed into directory webapps/eureka to make everything work out of the box.

ksuco...@gmail.com

unread,
Jul 20, 2014, 4:05:22 AM7/20/14
to eureka_...@googlegroups.com, ksuco...@gmail.com
On Thursday, July 10, 2014 9:37:49 AM UTC-7, ksuco...@gmail.com wrote:

This turned out to be an operator error. I had the server war file inflated twice in the webapp directory - once as the snapshot version, the other as 'eureka'. There were probably some resource conflicts when both instances tried to startup at the same time.

This was discovered when Renat emailed me and asked what was in my webapp directory. Thanks.

suni...@gmail.com

unread,
Oct 25, 2014, 8:05:03 PM10/25/14
to eureka_...@googlegroups.com, ksuco...@gmail.com
On Thursday, July 10, 2014 9:37:49 AM UTC-7, ksuco...@gmail.com wrote:

I'm seeing the exact same error(s) and I have double checked the name and location of the WAR file. It is in webapps and is called eureka.war.

I'm running Tomcat8 on Windows 7 (64).

Andrew Spyker

unread,
Oct 26, 2014, 9:38:51 AM10/26/14
to eureka_...@googlegroups.com, ksuco...@gmail.com, suni...@gmail.com
Are you running Tomcat (and thus Eureka) on port 80 or 8080?  By default, Tomcat runs on port 8080, so when Eureka looks to connect to http://localhost/eureka, it will fail as this is assuming port 80.  To fix Eureka to talk to itself on port 8080, you can edit:

webapps/eureka/WEB-INF/classes/eureka-client.properties

add a property as follows:

eureka.serviceUrl.default=http://localhost:8080/eureka/v2/

Sunit Kavathekar

unread,
Oct 27, 2014, 12:46:26 PM10/27/14
to Andrew Spyker, eureka_...@googlegroups.com, ksuco...@gmail.com
My Tomcat instance was running on port 80. I found a hung instance of tomcat and killed it via the task manager. Then I cleaned up webapps and dropped eureka.war into it afresh. I may have gottten past the initial error, but trying to invoke /eureka still gives me an error. I'm going to scour the logs to see what is going wrong. Thanks for your help.

Sunit Kavathekar

unread,
Oct 29, 2014, 12:56:41 PM10/29/14
to Andrew Spyker, eureka_...@googlegroups.com, Kevin Su
Now, I am getting this error when I try and get to /eureka:

28-Oct-2014 18:39:22.364 SEVERE [http-nio-80-exec-10] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [jsp] in context with path [/eureka] threw exception [Unable to compile class for JSP: 

An error occurred at line: [53] in the generated java file: [A:\Tomcat8\work\Catalina\localhost\eureka\org\apache\jsp\jsp\status_jsp.java]
The method getDispatcherType() is undefined for the type HttpServletRequest

Stacktrace:] with root cause
 org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [53] in the generated java file: [A:\Tomcat8\work\Catalina\localhost\eureka\org\apache\jsp\jsp\status_jsp.java]
The method getDispatcherType() is undefined for the type HttpServletRequest

Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:855)
at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:843)
at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:804)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.netflix.eureka.ServerRequestAuthFilter.doFilter(ServerRequestAuthFilter.java:34)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.netflix.eureka.StatusFilter.doFilter(StatusFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

28-Oct-2014 18:49:07.074 INFO [http-nio-80-exec-3] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('org.apache.jasper.runtime.JspApplicationContextImpl', 'org.apache.jasper.runtime.JspApplicationContextImpl@4f82ea07')
28-Oct-2014 18:49:07.094 INFO [http-nio-80-exec-3] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('org.apache.jasper.compiler.ELInterpreter', 'org.apache.jasper.compiler.ELInterpreterFactory$DefaultELInterpreter@5eff0646')
28-Oct-2014 18:49:07.214 INFO [http-nio-80-exec-3] org.apache.catalina.core.ApplicationContext.log SessionListener: sessionCreated('D653FD44FC9DA1457A2A443F8F1AE396')
28-Oct-2014 18:49:30.329 SEVERE [http-nio-80-exec-7] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [jsp] in context with path [/eureka] threw exception [Unable to compile class for JSP: 

An error occurred at line: [53] in the generated java file: [A:\Tomcat8\work\Catalina\localhost\eureka\org\apache\jsp\jsp\status_jsp.java]
The method getDispatcherType() is undefined for the type HttpServletRequest

Stacktrace:] with root cause
 org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [53] in the generated java file: [A:\Tomcat8\work\Catalina\localhost\eureka\org\apache\jsp\jsp\status_jsp.java]
The method getDispatcherType() is undefined for the type HttpServletRequest

Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:855)
at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:843)
at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:804)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.netflix.eureka.ServerRequestAuthFilter.doFilter(ServerRequestAuthFilter.java:34)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.netflix.eureka.StatusFilter.doFilter(StatusFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)


On Sun, Oct 26, 2014 at 6:38 AM, Andrew Spyker <awsp...@gmail.com> wrote:

Andrew Spyker

unread,
Oct 29, 2014, 1:10:45 PM10/29/14
to eureka_...@googlegroups.com, awsp...@gmail.com, ksuco...@gmail.com, suni...@gmail.com
Someone else with the same error on tomcat-user's forum:


Are you compiling this eureka.war yourself or grabbing from maven central?


I worry that this is an environment issue.

Sunit Kavathekar

unread,
Oct 29, 2014, 3:58:58 PM10/29/14
to Andrew Spyker, eureka_...@googlegroups.com, ksuco...@gmail.com
I've been building the WAR file myself. I'll give the maven WAR a shot now.

Thanks

Sunit Kavathekar

unread,
Oct 31, 2014, 10:42:59 AM10/31/14
to Andrew Spyker, eureka_...@googlegroups.com, Kevin Su
OK. Got Eureka server to work with Tomcat7/jdk7 on Ubuntu Linux. Needed to change 3 pieces of config in 3 props files - client-test, client-prod and client. Don;t know which one overrides the others - didn't want to take a chance.

name=eureka-server
port=8080

Now trying to make this work with Tomcat8 on Windows.

Thanks

matt...@gmail.com

unread,
Dec 4, 2014, 7:00:21 PM12/4/14
to eureka_...@googlegroups.com, awsp...@gmail.com, ksuco...@gmail.com, suni...@gmail.com
in case this is of any help to anyone, i was able to get the server, service & client to run (windows 7 64, tomcat 7). First, I built the 'demo' (got via git) and deployed my .war to tomcat per the instructions.

the runservice.sh & runclient.sh were unusable on my machine (tried via command prompt & cygwin), so I ended up importing the whole thing as a Gradle project into my STS (Spring eclipse).

i found the 2 test classes (SampleEurekaService.java & SampleEurekaClient.java). in STS/eclipse I created 2 run configurations and put the following in the vm arguments:

for service:
-Deureka.region=default -Deureka.environment=test -Deureka.name=sampleservice -Deureka.vipAddress=sampleservice.mydomain.net -Deureka.port=8081 -Deureka.preferSameZone=false -Deureka.shouldUseDns=false -Deureka.us-east-1.availabilityZones=default -Deureka.serviceUrl.default=http://localhost:8080/eureka/v2/

for client:
-Deureka.region=default -Deureka.environment=test -Deureka.name=sampleEurekaClient -Deureka.preferSameZone=true -Deureka.shouldUseDns=false -Deureka.us-east-1.availabilityZones=default -Deureka.serviceUrl.default=http://localhost:8080/eureka/v2/

i ran the server via tomcat (startup.bat) and was able to see the web page at:
http://localhost:8080/eureka/ (NOTE: NOT http://localhost:8080/eureka/v2/) after a little while

i then ran the service in STS and waited

once I saw the below, i started my client:
...
Registering service to eureka with STARTING status
Simulating service initialization by sleeping for 60 seconds...
31333 [pool-2-thread-1] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_SAMPLESERVICE/INT002520 - Re-registering apps/SAMPLESERVICE
31333 [pool-2-thread-1] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_SAMPLESERVICE/INT002520: registering service...
31344 [pool-2-thread-1] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_SAMPLESERVICE/INT002520 - registration status: 204
Done sleeping, now changing status to UP
Waiting for service to register with eureka..
61342 [pool-2-thread-1] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_SAMPLESERVICE/INT002520 - Re-registering apps/SAMPLESERVICE
61342 [pool-2-thread-1] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_SAMPLESERVICE/INT002520: registering service...
61349 [pool-2-thread-1] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_SAMPLESERVICE/INT002520 - registration status: 204
Waiting for service to register with eureka..

started the client (tried several times) until I FINALLY saw the below in the console view:
...
271 [main] INFO com.netflix.discovery.DiscoveryClient - Starting heartbeat executor: renew interval is: 30
Connected to server. Sending a sample request
Waiting for server response..
Received response from server. Communication all fine using Eureka :
Exiting the client. Demo over..
1302 [main] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_SAMPLEEUREKACLIENT/INT002520 - deregister status: 404

although i feel some sense of achievement (this took me 1/2 the day) there is NO friggen way I can pitch this for use at work; we're working on microservices and need a service discovery mechanism - we're not running in a cloud

clustered environments are new to me, perhaps this is why this was so difficult (have tried Spring Server Config - it has been a nightmare for me - and ZooKeeper) so am still searching for something that is user-friendly (have given up on open-source code that "works" and is documented)
Reply all
Reply to author
Forward
0 new messages