A blog by a system administrator and programmer.

org.apache.jasper.JasperException: java.lang.NullPointerException 
Monday, August 19, 2013, 09:19 PM - (860) 732-0263
Posted by Administrator
If your server can startup normally but when you try to access any jsp and the pages show the following exception.

java.lang.NullPointerException org.apache.jsp.index_jsp._jspInit(index_jsp.java:26) org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52) org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:164) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.pahome.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:18) org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738) com.pahome.filter.CheckLoginFilter.doFilter(CheckLoginFilter.java:173) com.pahome.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:18)

At line 26 it usually show something like this.
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();

It usually means that your WEB-INF contain duplicated jars especially jsp-api.jar and servlet-api.jar. Remove them and restart your server will solve the problem.
2774 comments ( 7212 views )   |  (704) 957-2263   |  5408140197 ( 2.7 / 76 )
configure generates .infig.status: error: cannot find input file 
Tuesday, May 7, 2013, 11:31 AM - System
Posted by Administrator
if you see error
.infig.status: error: cannot find input file

during ./configure

it is properly due to MSDOS return character issue.

If you system have dos2unix then just simple convert configure.ac/configure.in.
If you don't have unix2dos ... you can try to use vi and run
set ff=unix

then run
autoreconf -vif

after that you can run configure again.

BTW it is suggest to also convert the shell scripts, sometimes they will also cause problems.

9402123735 ( 51854 views )   |  permalink   |  bunchflower familyspam26721437329165147133336-597-7479 ( 3.1 / 57 )
java OutOfMemoryError Cont. 
Thursday, November 17, 2011, 09:00 PM - System
Posted by Freddy Chu
If you still face the problem of

java.lang.OutOfMemoryError: PermGen space

Event you have increase the -XX:MaxPermSize.

You can try the following jvm args.

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

Usually only java web container like tomcat / jboss / jetty with many contexts will need that flag.

But remember enabling this will decrease the performance. Use with care.

P.S. java 1.6 seems do not support CMSPermGenSweepingEnabled.
3 comments ( 222 views )   |  949-838-3634   |  (403) 973-4392978-780-0008spaded814-394-6168 ( 3.1 / 419 )
Java Out of Memory problems 
Sunday, September 18, 2011, 02:31 PM - Programming
Posted by Freddy Chu

Java heap

java.lang.OutOfMemoryError: Java heap

Just simply apply -Xmx will fix the issue. But notice that one thing there have max. value for difference os.
32bit Windows around 2G
32bit Linux around 2.5G
64bit I only tried to use 4G, the limit seems much higher than 32bit systems.

PermGen space

java.lang.OutOfMemoryError: PermGen space

Presenting the Permanent Generation

By my understanding, PermGen space is for loading classes specifications. Usually you will not able to see this exception. Expecte that you have many lib need to be load and use.
Using Jboss with more than 1 big web application may hit this. You can change this limit by using -XX:PermSize and -XX:MaxPermSize

GC overhead limit exceeded

I think this is most uncommon exception that will be hitted
java.lang.OutOfMemoryError: GC overhead limit exceeded

Excessive GC Time and OutOfMemoryError
The parallel collector will throw an OutOfMemoryError if too much time is being spent in garbage collection: if more than 98% of the total time is spent in garbage collection and less than 2% of the heap is recovered, an OutOfMemoryError will be thrown. This feature is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small. If necessary, this feature can be disabled by adding the option -XX:-UseGCOverheadLimit to the command line.


The best way is to solve the coding problem. It is believed that the code have genereated too many trivial object. Especially in loops, if that is the case rather reuse the object than new an object.

If you really don't want to change the code or you cannot found the problem you can try the following way. Hopefully it will solve the issue, but not the best way and may require a long time to finish.

JVM have 3 difference garbage collectors you can try switching between them.

serial collector
single processor
jvm flag: -XX:+UseSerialGC

parallel collector
high throughput sometimes with pause
jvm flag: -XX:+UseParallelGC

concurrent collector
low lag time & moderate throughput
jvm flag: -XX:+UseConcMarkSweepGC -XX:+UseParNewGC

(360) 238-3599 ( 21317 views )   |  786-475-5702   |  9033452679 ( 2.9 / 4775 )
my Apache production checklist 
Sunday, February 20, 2011, 04:23 PM - waitress
Posted by Freddy Chu

Apache (httpd)

Lower KeepAliveTimeout
Default usually around 15 but I will choose from 5-10 but remember do not set the value too low as it will cause tcp overhead

Reduce extra dns lookup for log
HostnameLookups off

Disable directory listing
Remove "Indexes" from Options

Disable .htaccess files
Reduce file IO to search and access permission files, put all access control