chkal/pf-issue-test — Issue #19: Null Pointer Exception in ParameterInjector.injectParameters 
Author: chkal
Created: 2012-03-06 07:17:00+00:00
State: open

Originally filed by **stefant...@gmail.com** on 2009-07-23T14:30:49

Google Code issue: http://code.google.com/p/prettyfaces/issues/detail?id=17

How to get the sample project running:

1. You need a MySQL 5 DB and you have to create a scheme "sample" and a
user "sample" with password "sample". This user needs access to scheme
"sample".
2. extract content of zip into a folder called "sample-web"
3. build the project with maven
4. deploy the war in tomcat
5. Now Hibernate should have created 3 tables in the "sample" scheme.
6. Insert sample data by running the SQL-script "data.sql" located in
com.sample.sql package of the sample application.

What steps will reproduce the problem?
1. Open the start page http://localhost:8080/sample-web/home
2. Click on "Go to Master entity"
3. Click on the link "Sub1"
4. Upload a file -> file should appear in the table
5. Click on "Back to Master entity Master1"
6. Click on link "Sub1"
7. Repeat steps 5 and 6 till the NullPointerException is thrown (You may
vary this by also clicking on a file name to see the file details and from
there go back to the "Sub"-page)

What is the expected output? What do you see instead?

expected: display the expected page

actual:

java.lang.NullPointerException

com.ocpsoft.pretty.beans.ParameterInjector.injectParameters(ParameterInjector.java:48)

com.ocpsoft.pretty.PrettyContext.injectParameters(PrettyContext.java:105)

com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:61)

org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)

org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)

org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)

org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)

org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)

org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)

org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)

org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)

org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)

org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)

org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)

org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)

org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)

org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:277)

org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)

org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)

org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)

org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)

org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)

org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)

org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)

org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)

org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

What version of the product are you using? On what operating system?

JSF: 1.2_12
Icefaces: 1.8.1
Icefaces-Facelets: 1.8.1
Spring: 2.5.6.SEC01
Hibernate-Core: 3.3.1.GA
Hibernate-Annotations: 3.4.0.GA

Now some other versions:
Tomcat: 6.0.20
JDK: 1.6.0_13 and 1.6.0_06
OS: Win XP SP3

Please provide any additional information below.

More informations about this defect can be found in the following Google
Group discussion:

http://groups.google.com/group/prettyfaces-users/browse_thread/thread/a0ee3e642965db1e/314994de6c11fd2e?hl=en

Some further information about the sample:

The sample application will save the uploaded files on your local hard disk
in /home/sample/uploadFiles. On Windows system this folder will be created
on the current local drive (e.g. C:/home/sample/uploadFiles)

Very important for the test scenario is a slow PC! You may also achieve
this goal by running a programm like Prime95 on a fast PC. This programm
will just use your CPU up to nearly 100 % so the web app will be quite slow
and the error will appear much more likely.