11

During development the REST service (Spring Boot 1.1.18) all seems to went fine, but as we executed different performance and load test the service stopped to response with following error:

org.apache.tomcat.util.net.NioEndpoint log - 
java.lang.NoClassDefFoundError: org/apache/tomcat/util/ExceptionUtils
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:711) ~[tomcat-embed-core-7.0.55.jar!/:7.0.55]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1695) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_55]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-7.0.55.jar!/:7.0.55]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_55]

The tests covers this workflow:

  • 1) login
  • 2) get information from database
  • 3) parse information from a file (resided on the service host)
  • step 2) and 3) are repeated 2000 times with 5 running threads

The service didn't crash totally, it is still reachable via JMX, but doesn't respond on HTTP - requests.

I'm searching for a reason, but with no luck.

UPDATE:

I added JAVA_OPTS for heap, stack tuning and permanent generation size and now the service is stable and performs much better.

-Xmx768m -Xms512m -Xss4m  -XX:NewSize=256m -XX:MaxNewSize=256m -XX:MaxPermSize=128m -XX:PermSize=128m

That's great, but why?

UPDATE:

Nothing help's, the error still remains, also with Sprint Boot 1.2.0

3
  • That's very strange. org.apache.tomcat.util.ExceptionUtils is in the tomcat-embed-core jar which, from the stacktrace you've posted, I can see that you're using. Was that the full stack trace or was there a cause for the NoClassDefFoundError? Commented Nov 12, 2014 at 15:36
  • That's the full stacktrace, it occurred when the service doesn't respond. The HTTP thread's are on stage TIMED_WAITING and no thread is terminated. Commented Nov 13, 2014 at 9:12
  • There's an issue on Spring Boot that appears to trigger a similar exception when the .jar is replaced while it's still running. Could that happen in the tests you're running as well? Commented Jun 18, 2015 at 12:48

2 Answers 2

1

have you ever run "gradle clean" or "mvn clean" in the source code directory, which could remove the fat jar generated by spring boot, it should be the root cause for the exception. Since the running jvm cannot find the class file which is removed.

Sign up to request clarification or add additional context in comments.

Comments

1

If you repackage the fat spring-boot JAR file, the positions of beginnings of subjars change. It happens when you change something in properties file/xml in your fat-jar. You do it when you edit sometething in the configuration file with mc (mcedit) application. Put your configuration files outside the fat jar.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.