You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Laurent Trillaud <lt...@jouve.fr> on 2003/11/06 10:31:59 UTC

[portal] NPE when using more than 1 applications

Hi
The goal is to retrieved handler application information inside the
portal page by an action

The application is declare like this :
            <authentication-manager>
               <handlers>
                   <handler name="portalhandler">
                       <redirect-to uri="cocoon:/login" />
                       <authentication
uri="cocoon:raw:/sunrise-authuser" />
                       <applications>
                           <application loadondemand="true"
name="portal">
                               <configuration name="portal">
                                   <profiles>...
                                   </profiles>
                               </configuration>
                           </application>
                           <application name="myapp">
                           	<load
uri="cocoon:raw:/myapp/load-myapp"/>
                           </application>
                        </applications>
                   </handler>
               </handlers>
           </authentication-manager>

Myapp load is loaded succesfuly at login

Now I use it like this:

  <map:match pattern="portal">
      <map:act type="auth-protect">
          <map:parameter name="handler" value="portalhandler" />
          <map:parameter name="application" value="myapp" />
                    
          <map:act type="xsp-action" src="myAction.xsp">
           <map:generate type="portal" label="content">
              <map:parameter name="portal-name" value="portal" />
           </map:generate>
           <map:transform src="{global:skin}styles/portal-page.xsl" />
           <map:transform type="cinclude" />
           <map:transform type="encodeURL" />
           <map:serialize type="html" />
          </map:act>
       	<map:redirect-to uri="logout"/> 
      </map:act>
   </map:match>

I have change the application name from portal to myapp to get my
context. In fact I got also the portal context because it is declare as
module.
At this point I have both authentication and application in session.
But I got this Null pointer exception, when I access to the portal page.

Original Exception:
org.apache.avalon.framework.CascadingRuntimeException: Exception during
loading of profile.
	at
org.apache.cocoon.portal.profile.impl.AbstractUserProfileManager.getPort
alLayout(AbstractUserProfileManager.java:345)
	at
org.apache.cocoon.portal.impl.PortalManagerImpl.showPortal(PortalManager
Impl.java:105)
	at
org.apache.cocoon.portal.generation.PortalGenerator.generate(PortalGener
ator.java:86)

Any ideas?
Laurent


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: RE : [portal] NPE when using more than 1 applications

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Laurent Trillaud wrote:
> 
> Yes, it's why at the beginning I protected my page with both
> applications to have the portal generator still access to the auth
> context and have the action to access to the myapp context.
> But it was the same, I got a NPE.
> Thanks for your help.
> Laurent
>    <map:match pattern="portal">
>        <map:act type="auth-protect">
>            <map:parameter name="handler" value="portalhandler" />
> HERE       <map:parameter name="application" value="portal" />
> HERE       <map:parameter name="application" value="myapp" />

This doesn't work, the parameters are key-value pairs, so you
can only have one value for a single key.
(The second one overwrites the first one)

Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE : [portal] NPE when using more than 1 applications

Posted by Laurent Trillaud <lt...@jouve.fr>.
Yes, it's why at the beginning I protected my page with both
applications to have the portal generator still access to the auth
context and have the action to access to the myapp context.
But it was the same, I got a NPE.
Thanks for your help.
Laurent
   <map:match pattern="portal">
       <map:act type="auth-protect">
           <map:parameter name="handler" value="portalhandler" />
HERE       <map:parameter name="application" value="portal" />
HERE       <map:parameter name="application" value="myapp" />
           <map:act type="xsp-action" src="myAction.xsp">
            <map:generate type="portal" label="content">
               <map:parameter name="portal-name" value="portal" />
            </map:generate>
            <map:transform src="{global:skin}styles/portal-page.xsl"
            <map:transform type="cinclude" />
            <map:transform type="encodeURL" />
            <map:serialize type="html" />
           </map:act>
       	<map:redirect-to uri="logout"/>
       </map:act>
    </map:match>

> -----Message d'origine-----
> De : Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
> Envoyé : vendredi 7 novembre 2003 14:39
> À : users@cocoon.apache.org
> Objet : RE: RE : [portal] NPE when using more than 1 applications
> 
> Laurent Trillaud wrote:
> 
> > -----Original Message-----
> > From: Laurent Trillaud [mailto:ltrillaud@jouve.fr]
> > Sent: Friday, November 07, 2003 1:50 PM
> > To: users@cocoon.apache.org
> > Subject: RE : [portal] NPE when using more than 1 applications
> >
> >
> > Ooops, you're right. It's
> > Caused by: java.lang.NullPointerException
> > 	at
> >
org.apache.cocoon.portal.profile.impl.AuthenticationProfileManager.loadP
> > rofile(AuthenticationProfileManager.java:123)
> > 	at
> >
org.apache.cocoon.portal.profile.impl.AbstractUserProfileManager.getPort
> > alLayout(AbstractUserProfileManager.java:327)
> > Laurent
> >
> Ok, I think I found the problem. You have two applications, and you
> configure for one of them the portal. You have to use this application
> in the auth-protect action for the portal pipeline, because the
> portal looks into "current" application for the portal configuration
> but doesn't find it - as it's configured in the other one.
> 
> HTH
> Carsten
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: RE : [portal] NPE when using more than 1 applications

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Laurent Trillaud wrote:

> -----Original Message-----
> From: Laurent Trillaud [mailto:ltrillaud@jouve.fr]
> Sent: Friday, November 07, 2003 1:50 PM
> To: users@cocoon.apache.org
> Subject: RE : [portal] NPE when using more than 1 applications
> 
> 
> Ooops, you're right. It's
> Caused by: java.lang.NullPointerException
> 	at
> org.apache.cocoon.portal.profile.impl.AuthenticationProfileManager.loadP
> rofile(AuthenticationProfileManager.java:123)
> 	at
> org.apache.cocoon.portal.profile.impl.AbstractUserProfileManager.getPort
> alLayout(AbstractUserProfileManager.java:327)
> Laurent
> 
Ok, I think I found the problem. You have two applications, and you
configure for one of them the portal. You have to use this application
in the auth-protect action for the portal pipeline, because the
portal looks into "current" application for the portal configuration
but doesn't find it - as it's configured in the other one.

HTH
Carsten


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE : [portal] NPE when using more than 1 applications

Posted by Laurent Trillaud <lt...@jouve.fr>.
Ooops, you're right. It's
Caused by: java.lang.NullPointerException
	at
org.apache.cocoon.portal.profile.impl.AuthenticationProfileManager.loadP
rofile(AuthenticationProfileManager.java:123)
	at
org.apache.cocoon.portal.profile.impl.AbstractUserProfileManager.getPort
alLayout(AbstractUserProfileManager.java:327)
Laurent

> -----Message d'origine-----
> De : Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
> Envoyé : vendredi 7 novembre 2003 10:19
> À : users@cocoon.apache.org
> Objet : RE: [portal] NPE when using more than 1 applications
> 
> Hi Laurent,
> 
> in line 345 is another exception catched and rethrown.
> Can you please provide information about this original
> exception?
> 
> Thanks
> Carsten
> 
> > -----Original Message-----
> > From: Laurent Trillaud [mailto:ltrillaud@jouve.fr]
> > Sent: Thursday, November 06, 2003 10:32 AM
> > To: users@cocoon.apache.org
> > Subject: [portal] NPE when using more than 1 applications
> >
> >
> > Hi
> > The goal is to retrieved handler application information inside the
> > portal page by an action
> >
> > The application is declare like this :
> >             <authentication-manager>
> >                <handlers>
> >                    <handler name="portalhandler">
> >                        <redirect-to uri="cocoon:/login" />
> >                        <authentication
> > uri="cocoon:raw:/sunrise-authuser" />
> >                        <applications>
> >                            <application loadondemand="true"
> > name="portal">
> >                                <configuration name="portal">
> >                                    <profiles>...
> >                                    </profiles>
> >                                </configuration>
> >                            </application>
> >                            <application name="myapp">
> >                            	<load
> > uri="cocoon:raw:/myapp/load-myapp"/>
> >                            </application>
> >                         </applications>
> >                    </handler>
> >                </handlers>
> >            </authentication-manager>
> >
> > Myapp load is loaded succesfuly at login
> >
> > Now I use it like this:
> >
> >   <map:match pattern="portal">
> >       <map:act type="auth-protect">
> >           <map:parameter name="handler" value="portalhandler" />
> >           <map:parameter name="application" value="myapp" />
> >
> >           <map:act type="xsp-action" src="myAction.xsp">
> >            <map:generate type="portal" label="content">
> >               <map:parameter name="portal-name" value="portal" />
> >            </map:generate>
> >            <map:transform src="{global:skin}styles/portal-page.xsl"
/>
> >            <map:transform type="cinclude" />
> >            <map:transform type="encodeURL" />
> >            <map:serialize type="html" />
> >           </map:act>
> >        	<map:redirect-to uri="logout"/>
> >       </map:act>
> >    </map:match>
> >
> > I have change the application name from portal to myapp to get my
> > context. In fact I got also the portal context because it is declare
as
> > module.
> > At this point I have both authentication and application in session.
> > But I got this Null pointer exception, when I access to the portal
page.
> >
> > Original Exception:
> > org.apache.avalon.framework.CascadingRuntimeException: Exception
during
> > loading of profile.
> > 	at
> >
org.apache.cocoon.portal.profile.impl.AbstractUserProfileManager.getPort
> > alLayout(AbstractUserProfileManager.java:345)
> > 	at
> >
org.apache.cocoon.portal.impl.PortalManagerImpl.showPortal(PortalManager
> > Impl.java:105)
> > 	at
> >
org.apache.cocoon.portal.generation.PortalGenerator.generate(PortalGener
> > ator.java:86)
> >
> > Any ideas?
> > Laurent
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: [portal] NPE when using more than 1 applications

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Hi Laurent,

in line 345 is another exception catched and rethrown.
Can you please provide information about this original
exception?

Thanks
Carsten

> -----Original Message-----
> From: Laurent Trillaud [mailto:ltrillaud@jouve.fr]
> Sent: Thursday, November 06, 2003 10:32 AM
> To: users@cocoon.apache.org
> Subject: [portal] NPE when using more than 1 applications
> 
> 
> Hi
> The goal is to retrieved handler application information inside the
> portal page by an action
> 
> The application is declare like this :
>             <authentication-manager>
>                <handlers>
>                    <handler name="portalhandler">
>                        <redirect-to uri="cocoon:/login" />
>                        <authentication
> uri="cocoon:raw:/sunrise-authuser" />
>                        <applications>
>                            <application loadondemand="true"
> name="portal">
>                                <configuration name="portal">
>                                    <profiles>...
>                                    </profiles>
>                                </configuration>
>                            </application>
>                            <application name="myapp">
>                            	<load
> uri="cocoon:raw:/myapp/load-myapp"/>
>                            </application>
>                         </applications>
>                    </handler>
>                </handlers>
>            </authentication-manager>
> 
> Myapp load is loaded succesfuly at login
> 
> Now I use it like this:
> 
>   <map:match pattern="portal">
>       <map:act type="auth-protect">
>           <map:parameter name="handler" value="portalhandler" />
>           <map:parameter name="application" value="myapp" />
>                     
>           <map:act type="xsp-action" src="myAction.xsp">
>            <map:generate type="portal" label="content">
>               <map:parameter name="portal-name" value="portal" />
>            </map:generate>
>            <map:transform src="{global:skin}styles/portal-page.xsl" />
>            <map:transform type="cinclude" />
>            <map:transform type="encodeURL" />
>            <map:serialize type="html" />
>           </map:act>
>        	<map:redirect-to uri="logout"/> 
>       </map:act>
>    </map:match>
> 
> I have change the application name from portal to myapp to get my
> context. In fact I got also the portal context because it is declare as
> module.
> At this point I have both authentication and application in session.
> But I got this Null pointer exception, when I access to the portal page.
> 
> Original Exception:
> org.apache.avalon.framework.CascadingRuntimeException: Exception during
> loading of profile.
> 	at
> org.apache.cocoon.portal.profile.impl.AbstractUserProfileManager.getPort
> alLayout(AbstractUserProfileManager.java:345)
> 	at
> org.apache.cocoon.portal.impl.PortalManagerImpl.showPortal(PortalManager
> Impl.java:105)
> 	at
> org.apache.cocoon.portal.generation.PortalGenerator.generate(PortalGener
> ator.java:86)
> 
> Any ideas?
> Laurent
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org