LibrePlan / libreplan

LibrePlan - Open Web Planning
https://www.libreplan.dev
GNU Affero General Public License v3.0
287 stars 170 forks source link

NullPointerException with the attached dump #1501

Closed kwoot closed 6 years ago

kwoot commented 12 years ago

(Original Bugzilla Bug ID: 1357)

Date: 2012-01-23 21:29:41 From: Javier Morán \<jmoran@igalia.com> To: Jacobo Aragunde Perez \<jaragunde@igalia.com> Version: libreplan-1.2 (1.2.x) Last updated: 2012-01-30 17:43:52


(Note: this issue was migrated automatically with bugzilla2github.py tool )

kwoot commented 6 years ago

Bugzilla Comment ID: 3681 Date: 2012-01-23 21:29:41 From: Javier Morán \<jmoran@igalia.com>

If with the attached dump you do the following steps you get a NullPointerException.

At this point you get the following error:

23-ene-2012 22:25:26 org.libreplan.web.error.PageForErrorOnEvent logError GRAVE: Exception desconocida: java.lang.NullPointerException. java.lang.NullPointerException at org.libreplan.web.planner.order.OrderPlanningModel.getEarnedValueChartConfigurableLegend(OrderPlanningModel.java:856) at org.libreplan.web.planner.order.OrderPlanningModel.updateEarnedValueChartLegend(OrderPlanningModel.java:823) at org.libreplan.web.planner.order.OrderPlanningModel.access$600(OrderPlanningModel.java:156) at org.libreplan.web.planner.order.OrderPlanningModel$13$1.execute(OrderPlanningModel.java:1170) at org.libreplan.web.planner.order.OrderPlanningModel$13$1.execute(OrderPlanningModel.java:1164) at org.libreplan.business.common.AdHocTransactionService.runOnReadOnlyTransaction(AdHocTransactionService.java:117) at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy30.runOnReadOnlyTransaction(Unknown Source) at org.libreplan.web.planner.order.OrderPlanningModel$13.zoomLevelChanged(OrderPlanningModel.java:1163) at org.zkoss.ganttz.timetracker.TimeTracker$1.doNotify(TimeTracker.java:190) at org.zkoss.ganttz.timetracker.TimeTracker$1.doNotify(TimeTracker.java:187) at org.zkoss.ganttz.util.WeakReferencedListeners.fireEvent(WeakReferencedListeners.java:81) at org.zkoss.ganttz.timetracker.TimeTracker.fireZoomChanged(TimeTracker.java:186) at org.zkoss.ganttz.timetracker.TimeTracker.invalidatingChangeHappened(TimeTracker.java:255) at org.zkoss.ganttz.timetracker.TimeTracker.updateIntervalIfNeeded(TimeTracker.java:299) at org.zkoss.ganttz.timetracker.TimeTracker.access$200(TimeTracker.java:49) at org.zkoss.ganttz.timetracker.TimeTracker$3.propertyChange(TimeTracker.java:269) at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:298) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:291) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:229) at org.zkoss.ganttz.data.Task$1.onStartDateChange(Task.java:96) at org.zkoss.ganttz.data.GanttDiagramGraph$StartDateNofitication.doNotification(GanttDiagramGraph.java:657) at org.zkoss.ganttz.data.GanttDiagramGraph$NotificationPendingForTask.doNotification(GanttDiagramGraph.java:625) at org.zkoss.ganttz.data.GanttDiagramGraph$DeferedNotifier.doNotifications(GanttDiagramGraph.java:599) at org.zkoss.ganttz.data.GanttDiagramGraph$DependenciesEnforcer$6.doAction(GanttDiagramGraph.java:863) at org.zkoss.ganttz.util.PreAndPostNotReentrantActionsWrapper.executeWithPreAndPostActions(PreAndPostNotReentrantActionsWrapper.java:52) at org.zkoss.ganttz.util.PreAndPostNotReentrantActionsWrapper.doAction(PreAndPostNotReentrantActionsWrapper.java:44) at org.zkoss.ganttz.data.GanttDiagramGraph$DependenciesEnforcer.onNewEntrance(GanttDiagramGraph.java:850) at org.zkoss.ganttz.data.GanttDiagramGraph$DependenciesEnforcer.access$1400(GanttDiagramGraph.java:687) at org.zkoss.ganttz.data.GanttDiagramGraph$DependenciesEnforcer$3$1.ifNewEntrance(GanttDiagramGraph.java:757) at org.zkoss.ganttz.data.ReentranceGuard.entranceRequested(GanttDiagramGraph.java:2328) at org.zkoss.ganttz.data.GanttDiagramGraph$DependenciesEnforcer$3.setStartDate(GanttDiagramGraph.java:752) at org.zkoss.ganttz.data.Task.moveTo(Task.java:363) at org.zkoss.ganttz.TaskComponent.doUpdatePosition(TaskComponent.java:347) at org.zkoss.ganttz.TaskComponent$3.service(TaskComponent.java:154) at org.zkoss.zk.ui.impl.DesktopImpl.service(DesktopImpl.java:688) at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1123) at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:562) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:457) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:465) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378) at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.rememberme.RememberMeProcessingFilter.doFilterHttp(RememberMeProcessingFilter.java:116) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)


Attached file: dump_dev_10.sql File description: database dump

kwoot commented 6 years ago

Bugzilla Comment ID: 3701 Date: 2012-01-26 09:37:45 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

The bug was introduced in commit 4d132a1aeba3e0ee931c6f2bf30ac81fb2f0a535, so this is a regression from bug #1335.

kwoot commented 6 years ago

Bugzilla Comment ID: 3706 Date: 2012-01-30 11:47:30 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

I have a patch for this bug. It consists on a validation of the date in the earned value datebox before refreshing the data in the legend. If the value is not valid, it is replaced with a valid one.

But the patch doesn't work in all the circumstances. It looks like under some situations the dates interval in the earned value chart are different to the dates in the gantt diagram in the moment the legend is updated.

For example, this happens in the attached dump, when you set a progress of 100% in the end date for task T1 (project 11), and then move T2 back in time. The exception happens even after having applied my patches.

kwoot commented 6 years ago

Bugzilla Comment ID: 3707 Date: 2012-01-30 12:43:45 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

(In reply to comment #2)

But the patch doesn't work in all the circumstances.

Validations are cached, so if the date was validated in the past and it was valid, the validator won't run again until the date is changed. In our case this is not interesting, because the date doesn't change but the validation conditions do, so we have to force the validation. I did it with a setValue(getValue) combo.

kwoot commented 6 years ago

Bugzilla Comment ID: 3709 Date: 2012-01-30 16:17:13 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

commit a5484c2fe089e343b15242dcdac78e6b8a10fe84 Author: Jacobo Aragunde Pérez jaragunde@igalia.com Date: Mon Jan 30 10:55:50 2012 +0100

Bug #1357: Small code rewrite to simplify the fix of the bug

FEA: ItEr76S04BugFixing

commit 4e40c8e1237f6b92425756a27365cb57c8c99f19 Author: Jacobo Aragunde Pérez jaragunde@igalia.com Date: Mon Jan 30 12:32:57 2012 +0100

Bug #1357: Check if the date is out of the visualization area, and in that case
set a new date before updating the legend.

FEA: ItEr76S04BugFixing
kwoot commented 6 years ago

Bugzilla Comment ID: 3710 Date: 2012-01-30 17:38:42 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

This patch is also necessary, because the intervals doesn't include the end date (they are close-open).

commit efe574b25eecd2255daeae924bbfcb7ebc58eabb Author: Jacobo Aragunde Pérez jaragunde@igalia.com Date: Mon Jan 30 18:31:02 2012 +0100

Bug #1357: Use end date minus one day as default date for earned value chart.

The end date of the time intervals managed by ChartFillers don't include the
end date, so it was wrong considering it as a correct date.

FEA: ItEr76S04BugFixing
kwoot commented 6 years ago

Bugzilla Comment ID: 3711 Date: 2012-01-30 17:43:52 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

(In reply to comment #5)

This patch is also necessary, because the intervals doesn't include the end date (they are close-open).

commit efe574b25eecd2255daeae924bbfcb7ebc58eabb

The correct hash is 0d96d481970c997659dccb02b2bb5a8fdf1bc541