You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Phillip Rhodes <sp...@rhoderunner.com> on 2006/01/23 21:39:44 UTC

Inject global into Visit gives me InstantiationException

I have a visit object that I have declared as abstract with an injection
of the global object.

Whenever I try to access the visit property, the application errors out
with a:
org.apache.hivemind.ApplicationRuntimeException
Unable to instantiate an instance of class com.reffects.dmi.admin.Visit:
java.lang.InstantiationException.

I have Injections of the GlobalObject working okay on my pages and
components.

I will keep banging away at solving this, but would appreciate a smack!
Thanks.


public abstract class Visit {
    @InjectState("global")
    public abstract Global getGlobalObject();
...
}


hivemodule.xml

<module id="siteadmin" version="1.0.0" package="com.reffects.dmi">
   <contribution configuration-id="tapestry.state.ApplicationObjects">
      <state-object name="visit" scope="session">
        <create-instance class="com.reffects.dmi.admin.Visit"/>
      </state-object>
    </contribution>
  <contribution configuration-id="tapestry.state.ApplicationObjects">
      <state-object name="global" scope="application">
          <create-instance class="com.reffects.dmi.Global"/>
      </state-object>
  </contribution>
</module>

siteadmin.application:
<application name="Site Admin">
  <meta key="org.apache.tapestry.global-class"
value="com.reffects.dmi.Global"/>
  <meta key="org.apache.tapestry.visit-class"
value="com.reffects.dmi.admin.Visit"/>
...
</application>




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


Re: Inject global into Visit gives me InstantiationException- SOLVED.

Posted by Phillip Rhodes <sp...@rhoderunner.com>.
I kept banging and got around my problem.

Somehow, by referring to non-existent properties in my visit object causes
the problem.  I would have expected to see something analogous to
"property requestDebug" not found in object "Visit" when the spec refers
to properties that are not in the object.


By removing this from my border spec, I resolved the
InstantiationException that was raised when trying to create my Visit
object.

        <span jwcid="@Conditional" condition="ognl:page.visit.requestDebug">
...
</span>








> I have a visit object that I have declared as abstract with an injection
> of the global object.
>
> Whenever I try to access the visit property, the application errors out
> with a:
> org.apache.hivemind.ApplicationRuntimeException
> Unable to instantiate an instance of class com.reffects.dmi.admin.Visit:
> java.lang.InstantiationException.
>
> I have Injections of the GlobalObject working okay on my pages and
> components.
>
> I will keep banging away at solving this, but would appreciate a smack!
> Thanks.
>
>
> public abstract class Visit {
>     @InjectState("global")
>     public abstract Global getGlobalObject();
> ...
> }
>
>
> hivemodule.xml
>
> <module id="siteadmin" version="1.0.0" package="com.reffects.dmi">
>    <contribution configuration-id="tapestry.state.ApplicationObjects">
>       <state-object name="visit" scope="session">
>         <create-instance class="com.reffects.dmi.admin.Visit"/>
>       </state-object>
>     </contribution>
>   <contribution configuration-id="tapestry.state.ApplicationObjects">
>       <state-object name="global" scope="application">
>           <create-instance class="com.reffects.dmi.Global"/>
>       </state-object>
>   </contribution>
> </module>
>
> siteadmin.application:
> <application name="Site Admin">
>   <meta key="org.apache.tapestry.global-class"
> value="com.reffects.dmi.Global"/>
>   <meta key="org.apache.tapestry.visit-class"
> value="com.reffects.dmi.admin.Visit"/>
> ...
> </application>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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