cocoon-users-fr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Salvetti <m...@notremanou.net>
Subject Re: Comment acceder au contexte authentication depuis le flowscript
Date Thu, 18 Aug 2005 12:31:32 GMT
Merci de ta réponse,

voila la trace :

java.lang.NullPointerException
    at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.handleContinuation(FOM_JavaScriptInterpreter.java:853)
    at 
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:123)
    at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
    at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
    at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
    at 
org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:138)
    at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
    at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:138)
    at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
    at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
    at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234)
    at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176)
    at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243)
    at 
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117)
    at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
    at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
    at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
    at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:138)
    at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
    at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
    at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234)
    at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176)
    at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:243)
    at org.apache.cocoon.Cocoon.process(Cocoon.java:608)
    at 
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1123)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.NullPointerException
    at 
org.apache.cocoon.webapps.authentication.context.AuthenticationContext.setXML(AuthenticationContext.java:214)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at 
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
    at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
    at 
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1134)
    at 
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190)
    at 
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138)
    at 
org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121)
    at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
    at 
org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:1591)
    at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.handleContinuation(FOM_JavaScriptInterpreter.java:843)
    ... 49 more


Sylvain Wallez a écrit :

> Marc Salvetti wrote:
>
>> Bonjour,
>>
>> j'ai cette fonction dans mon script :
>> function saveCartDoc(contextName, path, cartDoc){
>>
>>    var manager = 
>> cocoon.getComponent(Packages.org.apache.cocoon.webapps.authentication.AuthenticationManager.ROLE);

>>
>>    try{
>>        cocoon.log.debug("saving cartdoc to context " + contextName + 
>> " at path " + path);
>>        var frag = cartDoc.createDocumentFragment();
>>        frag.appendChild(cartDoc.getDocumentElement());
>>        var user = manager.isAuthenticated("cfmhandler");
>>        var ctx = user.getContext();
>>        ctx.setXML(path, frag);          } finally {
>>        cocoon.releaseComponent(manager);
>>    }
>> }
>>
>> Et j'ai deux questions :
>> -Est-ce que cette approche est correcte pour écrire dans le contexte ?
>
>
>
> Je ne sais pas trop dire, parce que je n'utilise pas 
> l'authentication-fw... (et au passage, cette API qui réclame un 
> DocumentFragment n'est pas vraiment sympathique...)
>
>> -Pourquoi le code plante au moment du releaseComponent() ? d'après 
>> l'erreur manager est toujours null car j'ai une NPE sur cette ligne.
>
>
>
> Tu peux nous donner la trace de la NPE ?
>
> Sylvain
>

---------------------------------------------------------------------
Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/
Pour vous desinscrire : mailto:users-fr-unsubscribe@cocoon.apache.org
Autres commandes : mailto:users-fr-help@cocoon.apache.org


Mime
View raw message