Issue Details (XML | Word | Printable)

Key: XWIKI-2296
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Sergiu Dumitriu
Reporter: Alexander Heinrich
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XWiki Core

EventCalendar Exception after creating Events

Created: 27/Mar/08 15:45   Updated: 26/Jun/08 04:18
Component/s: Plugin - Other
Affects Version/s: 1.4 M1
Fix Version/s: 1.5 RC1

File Attachments: 1. Text File CalendarData.txt (2 kB)

Issue Links:
Related
 

keywords: bugfixingday
Date of First Response: 28/Mar/08 04:50
Resolution Date: 26/Jun/08 04:18
Development Priority: Low


 Description  « Hide
Hello,
I just tried to create some CalendarEvents.
After creating them I'll be able to see the Events.
But after some time I'll get the following exception if I want to watch a month which has some events.

Error number 4001 in 4: Error while parsing velocity page Main.EventCalendar
Wrapped Exception: Invocation of method 'getHTMLCalendar' in class com.xpn.xwiki.plugin.calendar.CalendarPluginApi threw exception java.lang.NullPointerException @ Main.EventCalendar19,8?
com.xpn.xwiki.XWikiException: Error number 4001 in 4: Error while parsing velocity page Main.EventCalendar
Wrapped Exception: Invocation of method 'getHTMLCalendar' in class com.xpn.xwiki.plugin.calendar.CalendarPluginApi threw exception java.lang.NullPointerException @ Main.EventCalendar19,8?
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:160)
at com.xpn.xwiki.render.XWikiVelocityRenderer.render(XWikiVelocityRenderer.java:95)
at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:252)
at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:176)
at com.xpn.xwiki.XWiki.include(XWiki.java:3350)
at com.xpn.xwiki.api.XWiki.includeForm(XWiki.java:1362)
at com.xpn.xwiki.api.XWiki.includeForm(XWiki.java:1328)
at sun.reflect.GeneratedMethodAccessor234.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:241)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:155)
at com.xpn.xwiki.render.XWikiVelocityRenderer.render(XWikiVelocityRenderer.java:95)
at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:252)
at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:176)
at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:145)
at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderDocument(DefaultXWikiRenderingEngine.java:134)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:418)
at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:371)
at sun.reflect.GeneratedMethodAccessor226.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:241)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:155)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1415)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598)
at sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:88)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:107)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:241)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:155)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1415)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:108)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:199)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:619)

Wrapped Exception:

java.lang.NullPointerException at com.xpn.xwiki.plugin.calendar.CalendarData.getContent(CalendarData.java:242) at com.xpn.xwiki.plugin.calendar.CalendarPlugin.getHTMLCalendar(CalendarPlugin.java:192) at com.xpn.xwiki.plugin.calendar.CalendarPlugin.getHTMLCalendar(CalendarPlugin.java:95) at com.xpn.xwiki.plugin.calendar.CalendarPluginApi.getHTMLCalendar(CalendarPluginApi.java:60) at sun.reflect.GeneratedMethodAccessor236.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:241) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:155) at com.xpn.xwiki.render.XWikiVelocityRenderer.render(XWikiVelocityRenderer.java:95) at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:252) at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:176) at com.xpn.xwiki.XWiki.include(XWiki.java:3350) at com.xpn.xwiki.api.XWiki.includeForm(XWiki.java:1362) at com.xpn.xwiki.api.XWiki.includeForm(XWiki.java:1328) at sun.reflect.GeneratedMethodAccessor234.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318) at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:241) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:155) at com.xpn.xwiki.render.XWikiVelocityRenderer.render(XWikiVelocityRenderer.java:95) at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:252) at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:176) at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:145) at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderDocument(DefaultXWikiRenderingEngine.java:134) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:418) at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:371) at sun.reflect.GeneratedMethodAccessor226.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:241) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:155) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1415) at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598) at sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318) at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:88) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:107) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:241) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:155) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1415) at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:108) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:199) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:619)

At this time I only can watch the calendar if I switch to an empty month/year with the URL parameter month= or year=
I can fix the problem for some time if I klick "Save & View" at the Objects Editor.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Sergiu Dumitriu added a comment - 28/Mar/08 04:50
What version are you using?

Alexander Heinrich added a comment - 28/Mar/08 07:10
I'm using version 1.3.8295
It occured in version 1.2.2.7518 too.

Alexander Heinrich added a comment - 04/Apr/08 15:27
I tried to create my own CalendarSheet but the error occurs there too.
It occurs in this line:
$cview.getHTMLCalendar($cparams, "")

I don't understand why :/
How can I find out which value null is?

Here the code snippet:

#set($cview = $xwiki.calendar)
#set($cparams = $cview.calendarParams)
#if($request.month)
$cparams.put("month", $request.get("month"))
#end
#if($request.year)
$cparams.put("year", $request.get("year"))
#end
#set($rqcategories = $xwiki.arrayList)
#foreach($rqcateg in $request.get("category").split(","))
#if(!$rqcateg.trim().equals(""))
#set($discard = $rqcategories.add($rqcateg.trim()))
#end
#end
$cparams.put("categories", $rqcategories)

$cview.getHTMLCalendar($cparams, "")


Alexander Heinrich added a comment - 09/Apr/08 12:09
Hello,
please move this issue to the XWIKI-Core Project

Glenn Everitt added a comment - 06/May/08 21:27
In xwiki-core/src/main/java/com/xpn/xwiki/plugin/calendar/CalendarData.java in the method

public String getContent(Calendar tddate, String filteredUser, String filteredLocation, List filteredCategories, XWikiContext context)

The problem I encountered is this line:

String location = event.getLocation().trim();

In my case getLocation returned null and then the trim fails with NPE. It looks like the problem could occur with other places such getUser, although I think if user is null it get set to "NA" somewhere. I am on XE version 1.3.2 with Tomcat 5.5 and Oracle 10


Glenn Everitt added a comment - 06/May/08 23:13
I've attached a patch (warning this is my first patch for xwiki) for CalendarData.java I'm using XE 1.3.2

Sergiu Dumitriu added a comment - 07/May/08 00:06
Ah, the problem is Oracle, as it converts empty strings to NULL, that's why we couldn't reproduce it. It would have helped a lot if you specified this earlier.

Sergiu Dumitriu added a comment - 24/Jun/08 17:25
I'd say it is of medium priority, as this actually affects all String properties on Oracle, but the code throws exceptions only in the Calendar plugin.

Vincent Massol added a comment - 24/Jun/08 20:24
The reason we've decided for low is because we'd like to propose to remove the Calendar application and the Photo Album application from the default XE (proposal to be sent to the list). The reason is that they are "unfinished" apps not good enough to be proposed by default in a professional wiki. Basically the idea is to increase XE's quality. We could put them back if we decide to invest in these apps and improve them. Right now the idea is to spend more on improving the Blogging application since it's a more important app (for a Bliki ).

I'll send an email on the list about this proposal.

Thanks


Vincent Massol added a comment - 24/Jun/08 20:24
Didn't read your comment properly so increasing to medium as you suggested.

Sergiu Dumitriu added a comment - 25/Jun/08 09:42
To explain that a bit... The problem is that all string properties are defined as empty strings initially, and are like that as long as the data is loaded from the cache. But as we all know, Oracle doesn't like empty strings, so it converts them to NULL. And when the xobjects are loaded from the database, the string values (and large strings, and list items) are NULL. Of course, the code using those values should expect null values and ignore them. Most of the xobjects are used from velocity, which kindly ignores null values. The Java code that also uses objects most of the time checks for null, but when it doesn't, it will fail when the wiki is using Oracle. We can't rely on the java code to work around this problem, so, in order to have a really stable and cool platform, we should make sure that objects are loaded with the right values. This should be fixed in the storage, when loading properties we should know that there are no NULL values (if a property is defined, then it has a value; NULL means that the property is not defined at all).

Of course, the Calendar plugin could be improved, but that is a local fix that doesn't solve the general problem.


Sergiu Dumitriu added a comment - 26/Jun/08 04:18
Fixed in rev. 10831