简体   繁体   中英

javax.servlet.UnavailableException: EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap - running Struts 1.3.5 on Jetty 9.2.2

I am in the process of migrating from jetty 8.1.5 to 9.2.2. Our app uses Spring and We support some of the old struts controllers.

We use struts 1.3.5. When I start the server, I keep getting the following exception.

Does this mean, I need to migrate struts as well? Is there another solution to fix this?

I tried on java 7 and 8. Same thing happens. Please suggest.

javax.servlet.UnavailableException: EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:399)
    at javax.servlet.GenericServlet.init(GenericServlet.java:244)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:600)
    at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:462)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:742)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)
    at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:172)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:485)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:290)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:606)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:535)
    at java.lang.Thread.run(Thread.java:722)

The class is probably missing from your war's WEB-INF/lib

EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap

That is the original implementation of the ConcurrentHashMap of what eventually became java.util.concurrent package in Java 1.5

Just checked 8.1.5.v20120716

[jetty-distribution-8.1.5.v20120716]$ find lib -name "*.jar" -exec jar -tvf {} \; |\
    grep -i edu.oswego

Jetty does not come with these classes (nor would it have exceptions in the WebAppClassloader to allow them to be used from the server Classloader)

Something else in your configuration must have added them for you.

Look for the backport-util-concurrent jars and add them to your WEB-INF/lib directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM