Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScopeSearchingPropertyAccessor cause NPE [SWF-1572] #753

Closed
spring-operator opened this issue Oct 18, 2012 · 4 comments
Closed

ScopeSearchingPropertyAccessor cause NPE [SWF-1572] #753

spring-operator opened this issue Oct 18, 2012 · 4 comments
Assignees
Milestone

Comments

@spring-operator
Copy link
Contributor

Felix Martin opened SWF-1572 and commented

ScopeSearchingPropertyAccessor causes a NPE if it's elected to access a property the first time the expression is evaluated and can't recover the property the following times.

Attached there is a project to reproduce the error:

  • If we start the application and the first request is /webflow-tests/scopeSearchingProps?test=kk, subsequents requests to /webflow-test/scopeSearchinProps throw a NPE
  • If we start the application and the first request is /webflow-tests/scopeSearchingProps, subsequents requests to /webflow-test/scopeSearchinProps work fine

Affects: 2.1.1, 2.3.0

Reference URL: http://www.linkedin.com/groups/Anyone-having-expertise-in-Spring-46964.S.169940852?qid=40c39805-87f8-4d0d-a256-85d82ab5f71f&trk=group_most_popular-0-b-ttl&goback=.gmp_46964.gde_46964_member_169940852.gmp_46964

Attachments:

@spring-operator
Copy link
Contributor Author

Felix Martin commented

I think the method read should throw an AccessException if scope == null

@spring-operator
Copy link
Contributor Author

Phil Webb commented

java.lang.NullPointerException
	at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:75)
	at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:52)
	at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)
	at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)
	at org.springframework.binding.expression.spel.SpringELExpression.getValue(SpringELExpression.java:84)
	at org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:75)
	at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)
	at org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145)
	at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)
	at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:101)
	at org.springframework.webflow.engine.State.enter(State.java:194)
	at org.springframework.webflow.engine.Transition.execute(Transition.java:228)
	at org.springframework.webflow.engine.DecisionState.doEnter(DecisionState.java:51)
	at org.springframework.webflow.engine.State.enter(State.java:194)
	at org.springframework.webflow.engine.Flow.start(Flow.java:527)
	at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:368)
	at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:223)
	at org.springframework.webflow.executor.FlowExecutorImpl.launchExecution(FlowExecutorImpl.java:140)
	at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:226)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)

@spring-operator
Copy link
Contributor Author

Phil Webb commented

commit 55a69b568fae03e9c59a858c0b0845bb1c609b93
Author: Phillip Webb <pwebb@vmware.com>
Commit: Phillip Webb <pwebb@vmware.com>

    Fix potential ScopeSearchingPropertyAccessor NPE
    
    ScopeSearchingPropertyAccessor.read() now returns a TypedValue
    representing null rather than null itself.  This prevents a
    NullPointerException from being thrown from deeper within the Spring
    SpEL code
    
    Issue: SWF-1572

@spring-operator
Copy link
Contributor Author

Phil Webb commented

Hi Felix,

Thanks for raising this, it should now be fixed in the latest 2.4 SNAPSHOT.

Cheers,
Phil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants