Active MQ – java.io.IOException: tmpFile.renameTo(classFile) failed

Posted on

I downloaded the latest version of Apache ActiveMQ. Post download followed the simple steps for installation and then followed the starting ActiveMQ. It started and I tried accessing the admin console @ http://localhost:8161/admin/.

It opened by showed an error message:

Error!

Exception occurred while processing this request, check the log for more information!

What do you want to do next?

ActiveMQ Console

And my command prompt had this stacktrace:

jvm 1    | java.io.IOException: tmpFile.renameTo(classFile) failed
jvm 1    |      at org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:235)
jvm 1    |      at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:158)
jvm 1    |      at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:390)
jvm 1    |      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
jvm 1    |      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)
jvm 1    |      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:360)
jvm 1    |      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
jvm 1    |      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
jvm 1    |      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
jvm 1    |      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
jvm 1    |      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
jvm 1    |      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
jvm 1    |      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:574)
jvm 1    |      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
jvm 1    |      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
jvm 1    |      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
jvm 1    |      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
jvm 1    |      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
jvm 1    |      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
jvm 1    |      at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:293)
jvm 1    |      at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:120)
jvm 1    |      at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:566)
jvm 1    |      at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
jvm 1    |      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
jvm 1    |      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
jvm 1    |      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1320)
jvm 1    |      at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
jvm 1    |      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
jvm 1    |      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1291)
jvm 1    |      at org.apache.activemq.web.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:102)
jvm 1    |      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1291)
jvm 1    |      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443)
jvm 1    |      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
jvm 1    |      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
jvm 1    |      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
jvm 1    |      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
jvm 1    |      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
jvm 1    |      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
jvm 1    |      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
jvm 1    |      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
jvm 1    |      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
jvm 1    |      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
jvm 1    |      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
jvm 1    |      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
jvm 1    |      at org.eclipse.jetty.server.Server.handle(Server.java:367)
jvm 1    |      at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486)
jvm 1    |      at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
jvm 1    |      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
jvm 1    |      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
jvm 1    |      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
jvm 1    |      at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
jvm 1    |      at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
jvm 1    |      at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
jvm 1    |      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
jvm 1    |      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
jvm 1    |      at java.lang.Thread.run(Thread.java:744)

Fix is very simple, if you are on Windows 7 then while launching ActiveMQ:

  1. Stop ActiveMQ if it is running
  2. Start command prompt as Administrator (Start Menu -> Type cmd -> Right click on cmd -> choose Run as Administrator
  3. Or go to the /bin/(win32 or win64 based on your system and right click on activemq.bat and choose Run as Administrator

Now again access the admin console. BINGO problem solved!!!

Happy coding….

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s