Oct
10
java.lang.NoSuchFieldError: USE_CUSTOM_STATUS_MSG_IN_HEADER
Posted by | Posted in GlassFish | Posted on 10-10-2008
Tagged Under : Apache, GlassFish, GlassFish Apache integration, GlassFish Application Server
Today I was trying to integrate GlassFish Application Server with Apache 2.2. After making all the required configurations, both Apache and GlassFish server successfully started. However when I try to access a JSP using Mod JK I was getting the following exception in my GlassFish log file.
java.lang.NoSuchFieldError: USE_CUSTOM_STATUS_MSG_IN_HEADER at org.apache.jk.common.JkInputStream.appendHead(JkInputStream.java:283) at org.apache.jk.core.MsgContext.action(MsgContext.java:267) at org.apache.coyote.Response.action(Response.java:221) at org.apache.coyote.Response.sendHeaders(Response.java:416) at org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:355) at org.apache.coyote.tomcat5.OutputBuffer.close(OutputBuffer.java:321) at org.apache.coyote.tomcat5.CoyoteResponse.finishResponse(CoyoteResponse.java:578) at org.apache.coyote.tomcat5.CoyoteAdapter.afterService(CoyoteAdapter.java:318) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:301) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666) at java.lang.Thread.run(Thread.java:619) PWC5752: Caught exception (java.lang.NoSuchFieldError: USE_CUSTOM_STATUS_MSG_IN_HEADER) executing org.apache.jk.common.ChannelSocket$SocketConnection@18e546, terminating thread
After a little search I could resolve this issue. It was because the version of tomcat-ajp.jar I was using was wrong. So if you are getting the same error with your GlassFish Apache integration make sure that you are using tomcat-ajp.jar from apache-tomcat-5.5.23. Yes, take the tomcat-ajp.jar from Tomcat 5.5.23 and replace incorrect jar file. You are done.



Thanks, your entry saved my life! Why on earth is setting up glassfish to accept AJP connections so difficult?
-David
Hey, thank you very much for the info. It is exactly what I was googling for. I have leave a reference to this post in my blog (in Spanish):
http://serverperformance.blogspot.com/2008/11/uso-de-apache-como-proxy-inverso-de.html
Thanks for this workaround. Apparently it is fixed in GF2.2 but the package on Ubuntu is currently 2.0 and hence you get this issue.
Thanks again.
Pete