On Thu, Mar 5, 2009 at 13:57, Dan Miron <dan.miron(a)xwiki.com> wrote:
Thomas Mortagne wrote:
On Wed, Mar 4, 2009 at 19:26, Sergiu Dumitriu <sergiu(a)xwiki.com> wrote:
Dan Miron wrote:
Hi guys,
Proposal: create a new bridge called WikiAccessBridge whose purpose is,
for now, to get the temporary directory's location.
Reason: in my ChartMacro I need a temporary folder for storing images,
and then sending them to the output.
I'm thinking of providing two methods:
File getTemporaryDirectory() - to get the directory as a File, thus
having the ability to write files within it
URL getAttachmentURL(String fileName) - to get a newly created file as a
web URL (e.g:
http://localhost/my_newly_created_temporary_file.png)
I plan to put the specifications of the bridge within org.xwiki.bridge
and the implementation within com.xpn.xwiki
This is not a wiki functionality, so I'm -1 for the name
WikiAccessBridge. Maybe ContainerBridge?
What about put getTemporaryDirectory() in ApplicationContext
(core-container-api module) which contains getResourceAsStream and
getResource ?
This involves that the container-api module should make use of the
xwiki-core artifact. Is it ok? If yes, then there is a problem, because when
i add the xwiki-core as dependency in container-api/pom.xml, the application
breaks down, meaning that each time I try to access a page, it displays an
ugly error message similar to the one from the attachment.
No this means the implementation of the ApplicationContext need to
know the temporary folder and the implementation of the
ApplicationContext is container-servlet module which has access to
container temporary folder. container-servlet has also access to
xwiki.properties so we could migrate temporary folder property from
xwiki.cfg to xwiki.properties has we will have to do anyway since
xwiki.cfg is the "old" configuration file.
By the way DocumentAccessBridge already contains a
getAttachmentURL(String documentName, String attachmentName)
Yes, I could use that, I must say I didn't notice there is already such a
method.
Tnx. for the feedback,
Dan
Error number 3 in 0: Could not initialize main XWiki context
Wrapped Exception: null
RequestURI=/xwiki/bin/view/Main/Tutorial
Caused by:
com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main
XWiki context
Wrapped Exception: null
at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:326)
at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:387)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:135)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115)
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:707)
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:1124)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:111)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at
com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at
com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:145)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at
com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:287)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:361)
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:766)
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:324)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:538)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
Wrapped Exception:
java.lang.NullPointerException
at
org.xwiki.configuration.internal.DefaultConfigurationSourceCollection.initialize(DefaultConfigurationSourceCollection.java:63)
at
org.xwiki.plexus.lifecycle.phase.InitializePhase.execute(InitializePhase.java:44)
at
org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:128)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:142)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:132)
at
org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:90)
at
org.codehaus.plexus.DefaultComponentLookupManager.lookup(DefaultComponentLookupManager.java:147)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:283)
at
org.codehaus.plexus.component.composition.AbstractComponentComposer.findRequirement(AbstractComponentComposer.java:241)
at
org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:66)
at
org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirement(FieldComponentComposer.java:57)
at
org.codehaus.plexus.component.composition.AbstractComponentComposer.assembleComponent(AbstractComponentComposer.java:143)
at
org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:71)
at
org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:46)
at
org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:128)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:142)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:132)
at
org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:90)
at
org.codehaus.plexus.DefaultComponentLookupManager.lookup(DefaultComponentLookupManager.java:147)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:283)
at
org.codehaus.plexus.component.composition.AbstractComponentComposer.findRequirement(AbstractComponentComposer.java:241)
at
org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:66)
at
org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirement(FieldComponentComposer.java:57)
at
org.codehaus.plexus.component.composition.AbstractComponentComposer.assembleComponent(AbstractComponentComposer.java:143)
at
org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:71)
at
org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:46)
at
org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:128)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:142)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:132)
at
org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:90)
at
org.codehaus.plexus.DefaultComponentLookupManager.lookup(DefaultComponentLookupManager.java:147)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:277)
at
org.xwiki.plexus.manager.PlexusComponentManager.lookup(PlexusComponentManager.java:76)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:545)
at com.xpn.xwiki.XWiki.getCacheFactory(XWiki.java:5267)
at
com.xpn.xwiki.store.XWikiCacheStore.initCache(XWikiCacheStore.java:90)
at
com.xpn.xwiki.store.XWikiCacheStore.initCache(XWikiCacheStore.java:84)
at com.xpn.xwiki.store.XWikiCacheStore.(XWikiCacheStore.java:64)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:692)
at com.xpn.xwiki.XWiki.(XWiki.java:668)
at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:316)
at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:387)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:135)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115)
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:707)
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:1124)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:111)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at
com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at
com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:145)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at
com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:287)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:361)
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:766)
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:324)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:538)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
Powered by Jetty://
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne