• Bug
  • Status: Closed
  • 3 Minor
  • Resolution: Fixed
  • DSO:L1
  • kkannaiy
  • Reporter: asingh
  • August 27, 2008
  • 0
  • Watchers: 0
  • February 12, 2013
  • June 11, 2009

Attachments

Description

Using spring web-flow, if we use CHM in a domain object which gets stored as one of the scope variables in web-flow gives NPE.

java.lang.NullPointerException java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.__RWL__tc_lock(ReentrantReadWriteLock/java:637) java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock/java) java.util.concurrent.ConcurrentHashMap$Segment.lock(ConcurrentHashMap.java) java.util.concurrent.ConcurrentHashMap$Segment.put(ConcurrentHashMap.java:408) java.util.concurrent.ConcurrentHashMap.put(Unknown Source) java.util.concurrent.ConcurrentHashMap.readObject(Unknown Source) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946) java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908) java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) java.util.HashMap.readObject(HashMap.java:1067) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946) java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908) java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:479) org.springframework.webflow.core.collection.LocalAttributeMap.readObject(LocalAttributeMap.java:331) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946) java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) java.util.HashMap.readObject(HashMap.java:1067) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946) java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908) java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:479) org.springframework.webflow.core.collection.LocalAttributeMap.readObject(LocalAttributeMap.java:331) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946) java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) org.springframework.webflow.engine.impl.FlowSessionImpl.readExternal(FlowSessionImpl.java:147) java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) java.util.LinkedList.readObject(LinkedList.java:776) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946) java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) org.springframework.webflow.engine.impl.FlowExecutionImpl.readExternal(FlowExecutionImpl.java:514) java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot.deserialize(SerializedFlowExecutionSnapshot.java:193) org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot.unmarshal(SerializedFlowExecutionSnapshot.java:98) org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory.restoreExecution(SerializedFlowExecutionSnapshotFactory.java:80) org.springframework.webflow.execution.repository.snapshot.AbstractSnapshottingFlowExecutionRepository.restoreFlowExecution(AbstractSnapshottingFlowExecutionRepository.java:89) org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository.getFlowExecution(DefaultFlowExecutionRepository.java:104) org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:152) org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:173) org.springframework.webflow.mvc.servlet.FlowController.handleRequest(FlowController.java:172) org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Have attached a sample webapp which reproduces this problem How to reproduce: Untar attached sample-webapp.tar in a dir cd sample-webapp mvn tc:run

Point your browser to http://localhost:8080/sample-webapp/welcome.do Click “Increment visit counter”. Then Click “back to index”

Point your browser to the other webserver, http://localhost:8081/sample-webapp/welcome.do Click “Increment visit counter” Now clicking “back to index” will give the above NPE.

Comments

Alex Miller 2008-09-12

Probably fixed by this issue but need to double-check.

Fiona OShea 2008-12-17

Assigning to Alex to double-check

Fiona OShea 2009-06-08

Can you double check the fix?

Abhishek Singh 2009-06-11

Fixed.

Not able to reproduce problem anymore with attached example and way to reproduce. Most probably fixed with CDV-244/CDV-907

Kalai Kannaiyan 2009-08-07

Tested with Terracotta 2.7.0, as of 20080925-140928 (Revision 10251 by [email protected] from 2.7), it is working fine.

Steps: Untar attached sample-webapp.tar in a dir cd sample-webapp mvn tc:run

Point your browser to http://localhost:8080/sample-webapp/welcome.do Click “Increment visit counter”. Then Click “back to index”

Point your browser to the other webserver, http://localhost:8081/sample-webapp/welcome.do Click “Increment visit counter” Now clicking “back to index”

Actual: Goes back to welcome.do page