You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Chiappone <ch...@gmail.com> on 2007/06/13 18:14:10 UTC

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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: ASO Frustrations

Posted by Chris Chiappone <ch...@gmail.com>.
Well i found my issue.  Just in case anyone else happens to have this
problem.  The issue really was having to go from jdk 1.5 back to 1.4,
which I expect most people don't end up doing.  I was thinking that i
could extend my getAso from a parent page.  You can do that but you
have to include the <inject .../> tags in all subsequent .page files
not just the superclasses.



On 6/14/07, Chris Chiappone <ch...@gmail.com> wrote:
> I put the empty default constructors in and my <inject property="aso"
> type="state" object="sessionASO" /> is in my .page file
>
> I cannot understand why this isn't working.  I've had it working
> before in Java 1.5 but since having to use 1.4 for this project I
> can't seem to get something right.
>
> On 6/14/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:
> > just a guess.....
> > <inject property="aso" type="state" object="sessionASO"/>
> > is within you .page file and not within your .html?
> >
> >
> >
> >
> > "Jonathan Barker" <jo...@gmail.com>
> > 14.06.2007 05:16
> > Bitte antworten an
> > "Tapestry users" <us...@tapestry.apache.org>
> >
> >
> > An
> > "'Tapestry users'" <us...@tapestry.apache.org>
> > Kopie
> >
> > Thema
> > RE: ASO Frustrations
> >
> >
> >
> >
> >
> >
> > 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:chiappone@gmail.com]
> > > 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: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >
>
>
> --
> ~chris
>


-- 
~chris

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


Re: ASO Frustrations

Posted by Chris Chiappone <ch...@gmail.com>.
I put the empty default constructors in and my <inject property="aso"
type="state" object="sessionASO" /> is in my .page file

I cannot understand why this isn't working.  I've had it working
before in Java 1.5 but since having to use 1.4 for this project I
can't seem to get something right.

On 6/14/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:
> just a guess.....
> <inject property="aso" type="state" object="sessionASO"/>
> is within you .page file and not within your .html?
>
>
>
>
> "Jonathan Barker" <jo...@gmail.com>
> 14.06.2007 05:16
> Bitte antworten an
> "Tapestry users" <us...@tapestry.apache.org>
>
>
> An
> "'Tapestry users'" <us...@tapestry.apache.org>
> Kopie
>
> Thema
> RE: ASO Frustrations
>
>
>
>
>
>
> 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:chiappone@gmail.com]
> > 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: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>


-- 
~chris

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


RE: ASO Frustrations

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
just a guess.....
<inject property="aso" type="state" object="sessionASO"/>
is within you .page file and not within your .html?




"Jonathan Barker" <jo...@gmail.com> 
14.06.2007 05:16
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
"'Tapestry users'" <us...@tapestry.apache.org>
Kopie

Thema
RE: ASO Frustrations






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:chiappone@gmail.com]
> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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



RE: ASO Frustrations

Posted by Jonathan Barker <jo...@gmail.com>.
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:chiappone@gmail.com]
> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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