Chris,

Nothing jumps out at me as *wrong*, but I've run into strange problems when
I omit constructors.  Try adding no-arg constructors to your factory and ASO
classes.

I lean more toward annotations, so I hardly ever use the <inject> method, so
I wouldn't even know what I was missing there.

Jonathan

> -----Original Message-----
> From: Chris Chiappone [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 13, 2007 12:14 PM
> To: Tapestry List
> Subject: ASO Frustrations
> 
> Could someone take a quick look at this and see if i'm doing anything
> wrong.  I am trying to use and session based ASO but it doesn't seem
> to be getting injected properly, i've looked at this code over and
> over and must be missing something.
> 
> hivemodule.xml
> 
>    <service-point id="SessionFactory"
> interface="org.apache.tapestry.engine.state.StateObjectFactory">
>         <invoke-factory>
>             <construct class="application.aso.SessionASOFactory">
> 
>             </construct>
>         </invoke-factory>
>     </service-point>
> 
> 
> 
>     <contribution configuration-id="tapestry.state.ApplicationObjects">
>         <state-object name="globalASO" scope="application">
>             <invoke-factory object="service:GlobalFactory"/>
>         </state-object>
>         <state-object name="sessionASO" scope="session">
>             <invoke-factory object="service:SessionFactory"/>
>         </state-object>
> 
>     </contribution>
> 
> page.html contains:
> 
> <inject property="aso" type="state" object="sessionASO"/>
> 
> page.java contains:
> 
> public abstract SessionASO getAso();
> 
>       public Client getCurrentClient() {
>               SessionASO aso = getAso();
>               if(aso == null){
>                       logger.info("Why the hell is the aso null?");
>               }
>          }
> 
> SessionASOFactory.java:
> 
> public class SessionASOFactory implements StateObjectFactory {
>       private static final Log logger =
> LogFactory.getLog(SessionASOFactory.class
>                       .getName());
> 
>       public Object createStateObject() {
>               SessionASO aso = new SessionASO();
>               logger.info("Createing a new sessionASO object from
factory");
>               return aso;
>       }
> }
> 
> SessionASO.java:
> 
> public class SessionASO implements Serializable
> {
> 
>       private Client sessionClient;
> 
>       public Client getSessionClient() {
>               return sessionClient;
>       }
> 
>       public void setSessionClient(Client sessionClient) {
>               this.sessionClient = sessionClient;
>       }
> 
> 
> }
> 
> Thanks for the help.
> --
> ~chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to