Hi devs,
This week I introduced the support for chainable uberspectors, and
beside the SecureUberspector that was used before, now there's also a
DeprecatedCheckUberspector, that prints a warning in the logs whenever a
deprecated method is called from velocity.
Several things I'd like to emphasize:
- These logs break the validity check done in the XmlRpc tests, so this
allows us to detect (almost) any usage of the deprecated methods in wiki
documents and update these documents
- It also means that we can't make a product release while there are
deprecated calls in the wiki pages
- "deprecated" means "having the @Deprecated annotation". There's no
(simple) way of checking for the @deprecated doclet.
- whenever something gets deprecated, be sure to add this annotation, as
otherwise the calls to the deprecated method won't be detected
- could someone help with cleaning the wiki source in order to fix the
builds on the 1.5-depending products? Just look at the continuum build
results (for example
http://continuum.xwiki.org/continuum/buildResult.action?buildId=20015&proje…)
and look for messages like:
[WARNING] Deprecated usage of method [com.xpn.xwiki.api.XWiki.parseInt]
in Main.Dashboard@14,25
and update the affected document (could be a GSoC student...)
- the logged document name is not always right, as it doesn't reflect
inclusions and calls to $xwiki.parseText
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
* XWiki Core <http://jira.xwiki.org/jira/browse/XWIKI>*
browsing http://www.xwiki.org/xwiki/bin gives uncaught/wrapped
exception Created:
Today 06:09 AM Updated: Today 06:09 AM * Return to
search<http://jira.xwiki.org/jira/secure/IssueNavigator.jspa>
* Issue *88* of *128* issue(s)
<< Previous <http://jira.xwiki.org/jira/browse/XWIKI-2287> | XWIKI-2372 | Next
>> <http://jira.xwiki.org/jira/browse/XWIKI-358>
*Component/s:*
Core<http://jira.xwiki.org/jira/secure/IssueNavigator.jspa?sorter/order=ASC&sort…>
*Affects Version/s:*
1.3.2<http://jira.xwiki.org/jira/secure/IssueNavigator.jspa?sorter/order=ASC&sort…>
*Fix Version/s:* None
*Original Estimate:* Unknown *Remaining Estimate:* Unknown *Time
Spent:* Unknown *Environment:* Windows XP, Mozilla Firefox...
*keywords:* XWikiAction.java XWiki.java
*Description* « Hide
<http://jira.xwiki.org/jira/browse/XWIKI-2372> Although
http://www.xwiki.org/xwiki/bin/ does the "right thing"
http://www.xwiki.org/xwiki/bin doesn't:
------------------------------------------------------------
A problem occured while trying to service your request. Please contact the
support if this happens again.
Detailed information:
Error number 0 in 11: Uncaught exception
Wrapped Exception: String index out of range: -1
com.xpn.xwiki.XWikiException: Error number 0 in 11: Uncaught exception
Wrapped Exception: String index out of range: -1
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:223)
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:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Wrapped Exception:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1938)
at java.lang.String.substring(String.java:1905)
at com.xpn.xwiki.XWiki.getDocumentNameFromPath(XWiki.java:1187)
at com.xpn.xwiki.XWiki.getDocumentName(XWiki.java:4195)
at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:4225)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:173)
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:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note that the header area of the page also produces some velocity errors,
resulting in the following output prior to the above errors:
Error number 4001 in 4: Error while parsing velocity page
/templates/xwikivars.vm Wrapped Exception: Invocation of method
'hasAccessLevel' in class com.xpn.xwiki.api.XWiki threw exception
java.lang.NullPointerException @ /templates/xwikivars.vm[3,24]
Error number 4001 in 4: Error while parsing velocity page
/templates/xwikivars.vm
Wrapped Exception: Invocation of method 'hasAccessLevel' in class
com.xpn.xwiki.api.XWiki threw exception java.lang.NullPointerException @
/templates/xwikivars.vm[3,24]
com.xpn.xwiki.XWikiException: Error number 4001 in 4: Error while parsing
velocity page /templates/xwikivars.vm
Wrapped Exception: Invocation of method 'hasAccessLevel' in class
com.xpn.xwiki.api.XWiki threw exception java.lang.NullPointerException @
/templates/xwikivars.vm[3,24]
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:160)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1424)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598)
at sun.reflect.GeneratedMethodAccessor139.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.XWiki.parseTemplate(XWiki.java:1424)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598)
at sun.reflect.GeneratedMethodAccessor139.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.XWiki.parseTemplate(XWiki.java:1424)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:108)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:51)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:263)
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:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Wrapped Exception:
java.lang.NullPointerException
at com.xpn.xwiki.api.XWiki.hasAccessLevel(XWiki.java:1375)
at sun.reflect.GeneratedMethodAccessor171.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.value(ASTReference.java:419)
at
org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:73)
at
org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:125)
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:1424)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598)
at sun.reflect.GeneratedMethodAccessor139.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.XWiki.parseTemplate(XWiki.java:1424)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598)
at sun.reflect.GeneratedMethodAccessor139.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.XWiki.parseTemplate(XWiki.java:1424)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:108)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:51)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:263)
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:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Error number 4001 in 4: Error while parsing velocity page Wrapped Exception:
Invocation of method 'parseContent' in class com.xpn.xwiki.api.XWiki threw
exception java.lang.NullPointerException @ [14,16]
Error number 4001 in 4: Error while parsing velocity page
Wrapped Exception: Invocation of method 'parseContent' in class
com.xpn.xwiki.api.XWiki threw exception java.lang.NullPointerException @
<unknown template>[14,16]
com.xpn.xwiki.XWikiException: Error number 4001 in 4: Error while parsing
velocity page
Wrapped Exception: Invocation of method 'parseContent' in class
com.xpn.xwiki.api.XWiki threw exception java.lang.NullPointerException @
<unknown template>[14,16]
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:160)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1444)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1397)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598)
at sun.reflect.GeneratedMethodAccessor139.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.XWiki.parseTemplate(XWiki.java:1424)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598)
at sun.reflect.GeneratedMethodAccessor139.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.XWiki.parseTemplate(XWiki.java:1424)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:108)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:51)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:263)
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:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Wrapped Exception:
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:394)
at
com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:238)
at
com.xpn.xwiki.render.DefaultXWikiRenderingEngine.interpretText(DefaultXWikiRenderingEngine.java:156)
at com.xpn.xwiki.XWiki.parseContent(XWiki.java:1384)
at com.xpn.xwiki.api.XWiki.parseContent(XWiki.java:545)
at sun.reflect.GeneratedMethodAccessor197.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.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.ASTIfStatement.render(ASTIfStatement.java:88)
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.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:1444)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1397)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598)
at sun.reflect.GeneratedMethodAccessor139.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.XWiki.parseTemplate(XWiki.java:1424)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598)
at sun.reflect.GeneratedMethodAccessor139.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.XWiki.parseTemplate(XWiki.java:1424)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:108)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:51)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:263)
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:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
XWiki
Log-in | Register |
$doc.web: $tdoc.displayTitle
Top Menu
Documentation
Show: Comments Attachments History
Print: Print Print preview Export as PDF Export as RTF Export as HTML Export
as XAR
vmassol (SVN) wrote:
> Author: vmassol
> Date: 2008-05-07 20:29:05 +0200 (Wed, 07 May 2008)
> New Revision: 9684
>
> Modified:
> xwiki-platform/core/branches/xwiki-core-1.4/xwiki-core/src/main/java/com/xpn/xwiki/render/XWikiVelocityRenderer.java
> Log:
> XWIKI-2369: Error when custom skin defined in wiki page has a macros.vm property
>
>
> Modified: xwiki-platform/core/branches/xwiki-core-1.4/xwiki-core/src/main/java/com/xpn/xwiki/render/XWikiVelocityRenderer.java
> ===================================================================
> --- xwiki-platform/core/branches/xwiki-core-1.4/xwiki-core/src/main/java/com/xpn/xwiki/render/XWikiVelocityRenderer.java 2008-05-07 16:53:26 UTC (rev 9683)
> +++ xwiki-platform/core/branches/xwiki-core-1.4/xwiki-core/src/main/java/com/xpn/xwiki/render/XWikiVelocityRenderer.java 2008-05-07 18:29:05 UTC (rev 9684)
> @@ -104,6 +104,40 @@
> }
>
> /**
> + * @return the key used to cache the Velocity Engines. We have one Velocity Engine
> + * per skin which has a macros.vm file on the filesystem. Right now we don't
> + * support macros.vm defined in custom skins in wiki pages.
> + */
> + private static String getVelocityEngineCacheKey(String skin, XWikiContext context)
> + {
> + // We need the path relative to the webapp's home folder so we need to remove all path before
> + // the skins/ directory. This is a bit of a hack and should be improved with a proper api.
> + String skinMacros = context.getWiki().getSkinFile("macros.vm", skin, context);
> + String cacheKey;
> + if (skinMacros != null) {
> + // We're only using the path starting with the skin name since sometimes we'll
> + // get ".../skins/skins/<skinname>/...", sometimes we get ".../skins/<skinname>/...",
> + // sometimes we get "skins/<skinname>/..." and if the skin is done in wiki pages
> + // we get ".../skin/...".
> + int pos = skinMacros.indexOf("skins/");
> + if (pos > -1) {
> + cacheKey = skinMacros.substring(pos);
> + } else {
> + // If the macros.vm file is stored in a wiki page (in a macros.vm property in
> + // a XWikiSkins object) then we use the parent skin's macros.vm since we
> + // currently don't support having global velocimacros defined in wiki pages.
> + String baseSkin = context.getWiki().getBaseSkin(context);
This can lead to an infinite loop if someone uses the skin document as
its own base skin... I'd add a check here, just to be sure.
> + cacheKey = getVelocityEngineCacheKey(baseSkin, context);
> + }
> + } else {
> + // If no skin macros.vm file exists then use a "default" cache id
> + cacheKey = "default";
> + }
> +
> + return cacheKey;
> + }
> +
> + /**
> * @todo Move this initialization code to a Skin Manager component.
> */
> public static VelocityEngine getVelocityEngine(XWikiContext context) throws XWikiVelocityException
> @@ -118,19 +152,7 @@
>
> // Get the location of the skin's macros.vm file
> String skin = context.getWiki().getSkin(context);
> - // We need the path relative to the webapp's home folder so we need to remove all path before
> - // the skins/ directory. This is a bit of a hack and should be improved with a proper api.
> - String skinMacros = context.getWiki().getSkinFile("macros.vm", skin, context);
> - String cacheKey;
> - if (skinMacros != null) {
> - // We're only using the path starting with the skin name since sometimes we'll
> - // get /skins/skins/<skinname>/..., sometimes we get "/skins/<skinname>/..."
> - // and sometimes we get "skins/<skinname>/...
> - cacheKey = skinMacros.substring(skinMacros.indexOf("skins/"));
> - } else {
> - // If no skin macros.vm file exists then use a "default" cache id
> - cacheKey = "default";
> - }
> + String cacheKey = getVelocityEngineCacheKey(skin, context);
>
> // Get the Velocity Engine to use
> VelocityFactory velocityFactory =
> @@ -141,7 +163,7 @@
> } else {
> // Gather the global Velocity macros that we want to have. These are skin dependent.
> Properties properties = new Properties();
> - String macroList = "/templates/macros.vm" + ((skinMacros == null) ? "" : "," + cacheKey);
> + String macroList = "/templates/macros.vm" + (cacheKey.equals("default") ? "" : "," + cacheKey);
> properties.put(RuntimeConstants.VM_LIBRARY, macroList);
> velocityEngine = velocityFactory.createVelocityEngine(cacheKey, properties);
> }
>
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
Hello XWiki developers,
is there a documentation on adding a new property type?
I know I can do a lot with the hql type, but I'd like to enhance the
user-interface part for a better choice method of the value.
thanks for pointers.
paul
The XWiki development team is pleased to announce the release of XWiki
Workspaces 1.1 Milestone 1.
Go grab it at http://www.xwiki.org/xwiki/bin/view/Main/Download
New features have been implemented in this release, amongst them :
* Windows and generic java installers have been added for easier
installation.
* Application management per workspace : you can now install/uninstall
applications whenever you want.
* New application available : the "Workstream", to keep your coworkers
informed of what you are working on.
You can read the full release notes, including screenshots of the
aforementioned features, here :
http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesWorkspaces11Milestone1
To get started with XWiki Workspaces, point your browser at
http://workspaces.xwiki.org
Thanks
-The XWiki dev team
The XWiki development team is pleased to announce the release of XWiki
Enterprise 1.4 Release Candidate 1.
Go grab it at http://www.xwiki.org/xwiki/bin/view/Main/Download
This is the first hopefully the last release candidate for the 1.4 version.
Changes from 1.4 Milestone 2:
* Import generate DELETE notifications
* Macros declared before a call to doc.getRenderedContent() in
custom XWiki.XWikiSkins skin object are not taken into account
* Section editing is broken
* Activity statistics merge two days in one in graphics
* HTML export is broken
* Plugins should only be instantiated once
* WYSIWYG editor misinterprets velocity comments as a list
* Wysiwyg editor does not take its stylesheet from preferences
* Add correct Last-Modification header for filesystem skin files
* The indexing should be split in limited batches to reduce memory
consumption
For more information see the Release notes at:
http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWikiEnterprise14RC1
Thanks
-The XWiki dev team
Hi Guys,
I am working on XE-14 (the new Administration UI)
http://dev.xwiki.org/xwiki/bin/view/Design/ImproveWikiAdministration .
Since the admin templates will be deleted and replaced by an AdminSheet
which will be included by default in XwikiPreferences (wiki level) and
WebPreferences (space level), I need to create the WebPreferences document
for each space, attach an Xwiki.XwikiPreferences object to it and include
the AdminSheet.
To do that, I need to write some java code in the core . So , here's my
proposal:
- At xwiki intitialization create all the WebPreferences for the
currently existing spaces in the wiki (this should be done for all the
wikis, if in a multi-wiki).
- Then, use a notification system to create the WebPreferences for
any new space in the wiki in one of two ways:
a) When calling the "view" action on AnySpace.WebPreferences, check if
it exists, if not create it, attach the obj. and include the sheet
b) When calling the "save" action on AnySpace.AnyDoc, check if
AnySpace.WebPreferences exists, if not, create it etc.
I am for the second one, since the 'view' is much more often performed than
'save'.
So, my questions: what should I use for the notifications? I found this
function in the Stats notification system:
// Adding the rule which will allow this module to be called on each page
view
context.getWiki().getNotificationManager().addGeneralRule(
new XWikiActionRule(this, true, true));
But Thomas said the method above registers all types of notifs, not only on
page view.
There is also:
notify(XWikiNotificationRule rule, XWikiDocument doc, String action,
XWikiContext context)
and I can perform an if(action == "save") to use the notif system for the
"save" action.
Thomas Mortagne also told me that this notif system is a little bit outdated
and would be replaced by the observation component, but I have no idea which
I should use.
Also, according to the specifs in the draft above, so far I created the
Xwiki.AdminSheet, that will display the main categories (General,
Presentation, Rights, Users, Groups, Import/Export etc). For each section of
this menu I created a sheet (General - > Xwiki.GeneralSheet etc.) in which I
can personalize the display. I also created Xwiki.AdminSectionSheet which
contains the common code to display the fields necessary from the
Xwiki.XwikiPreferences object and this sheet will be included in the
sections where is needed (Genera, Presentation etc.) The reason I created
separated sheets for each section of the menu (which are fixed as number) is
to keep the code clean and allow the possibility to display something else
than fields from the xwiki prefs. object (for example for rights, users,
groups, import/export).
I would really really appreciate some feedback for this 2 proposals.
Thanks,
Evelina
Hi,
I think it would be a good idea to standardize on package naming. I've
seen Jerome's commit for the new invitation manager plugin and this
prompted me to send this email.
I propose the following:
* org.xwiki.<module name>.* : user public APIs
* org.xwiki.<module name>.internal.* : non user public classes
- This means no "impl" package (which IMO doesn't mean much since it
doesn't say if it's public or not).
- This also means no "api" package (which IMO is not necessary since
it should be the default and makes it more complex to use).
- I also don't think we need a "spi" package since we have components.
I'm also proposing to generally follow the rules defined here:
http://www.eclipse.org/articles/article.php?file=Article-API-Use/index.html
(see also http://jakarta.apache.org/cactus/participating/apis.html)
Here's my +1
Thanks
-Vincent