You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by spamsucks <sp...@rhoderunner.com> on 2006/02/16 23:45:09 UTC

No object provider exists for prefix 'string' ?

I am trying to inject an aso into tapestry using the StateObjectFactory.

My class "StorageAdapterFactory" implements the StateObjectFactory and 
has a property "fileSystemPath" with setter/getter on it.
I am trying to pass a String argument to my StateObjectFactory, but have 
get the error that "No object provider exists for prefix 'string' "

I have tried using nothing, and with "literal:" but both of these also 
fail.  Can someone point me to how I can pass a string to my factory? 

A tired thanks (it's been tough getting this far!)

    <contribution configuration-id="tapestry.state.ApplicationObjects">
        <state-object name="stitchfolder-data" scope="application">   
         
            <invoke-factory object="service:StorageAdapterFactory"/>
        </state-object>        
    </contribution>
        
    <service-point id="StorageAdapterFactory" 
interface="org.apache.tapestry.engine.state.StateObjectFactory">
        <invoke-factory>
            <construct 
class="org.authsum.stitches.adapter.StorageAdapterFactory">
                <set-object property="fileSystemPath" 
value="string:/usr/local/rhodepc/workspace/dmi/stitchfolder"/>
            </construct>
        </invoke-factory>
    </service-point>


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


Re: No object provider exists for prefix 'string' ?

Posted by Raul Raja Martinez <do...@estudiowebs.com>.
I use HiveUtils (formerly hivetranse) ObjectBuilder for doing something 
similar. It also solves the problem of injecting dependencies into POJOS:

http://hivetranse.sourceforge.net/quickstart.html#start.objectbuilder

Here is some sample code:

hivemodule.xml

<contribution configuration-id="tapestry.state.ApplicationObjects">
  <state-object name="importantNewsArticles" scope="application">
   <invoke-factory object="object:ImportantNewsArticles" />
  </state-object>
</contribution>

<contribution configuration-id="hiveutils.ObjectBuilderObjects">
  <object name="ImportantNewsArticles" cached="true" 
class="com.estudiowebs.CMS.DAO.ImportantNewsArticles">
   <inject name="persistenceService" object="spring:persistenceService" />
  </object>
</contribution>


JAVA class

public class ImportantNewsArticles implements StateObjectFactory {

  private PersistenceService persistenceService;

  public void setPersistenceService(PersistenceService service) {
   this.persistenceService = service;
  }

  public ImportantNewsArticles() {
  }

  public Object createStateObject() {
   return yourASOObject;
  }

}



Notice how the persistenceService which is a spring managed bean gets 
injected into my ASO which is a regular POJO. In the same way you could 
inject anything that you might need to initialize your ASO.

I hope it helps.

Raul.


spamsucks wrote:
> I am trying to inject an aso into tapestry using the StateObjectFactory.
> 
> My class "StorageAdapterFactory" implements the StateObjectFactory and 
> has a property "fileSystemPath" with setter/getter on it.
> I am trying to pass a String argument to my StateObjectFactory, but have 
> get the error that "No object provider exists for prefix 'string' "
> 
> I have tried using nothing, and with "literal:" but both of these also 
> fail.  Can someone point me to how I can pass a string to my factory?
> A tired thanks (it's been tough getting this far!)
> 
>    <contribution configuration-id="tapestry.state.ApplicationObjects">
>        <state-object name="stitchfolder-data" scope="application">   
>                    <invoke-factory object="service:StorageAdapterFactory"/>
>        </state-object>           </contribution>
>           <service-point id="StorageAdapterFactory" 
> interface="org.apache.tapestry.engine.state.StateObjectFactory">
>        <invoke-factory>
>            <construct 
> class="org.authsum.stitches.adapter.StorageAdapterFactory">
>                <set-object property="fileSystemPath" 
> value="string:/usr/local/rhodepc/workspace/dmi/stitchfolder"/>
>            </construct>
>        </invoke-factory>
>    </service-point>
> 
> 
> ---------------------------------------------------------------------
> 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


Re: No object provider exists for prefix 'string' ?

Posted by Richard Kirby <rb...@capdm.com>.
Hi spamsucks,

Try using <set property="fileSystemPath" 
value="/usr/local/rhodepc/workspace/dmi/stitchfolder" />

Check out 
http://jakarta.apache.org/hivemind/hivemind/BuilderFactory.html for more 
details.

Cheers

Richard

spamsucks wrote:
> I am trying to inject an aso into tapestry using the StateObjectFactory.
>
> My class "StorageAdapterFactory" implements the StateObjectFactory and 
> has a property "fileSystemPath" with setter/getter on it.
> I am trying to pass a String argument to my StateObjectFactory, but 
> have get the error that "No object provider exists for prefix 'string' "
>
> I have tried using nothing, and with "literal:" but both of these also 
> fail.  Can someone point me to how I can pass a string to my factory?
> A tired thanks (it's been tough getting this far!)
>
>    <contribution configuration-id="tapestry.state.ApplicationObjects">
>        <state-object name="stitchfolder-data" scope="application">   
>                    <invoke-factory 
> object="service:StorageAdapterFactory"/>
>        </state-object>           </contribution>
>           <service-point id="StorageAdapterFactory" 
> interface="org.apache.tapestry.engine.state.StateObjectFactory">
>        <invoke-factory>
>            <construct 
> class="org.authsum.stitches.adapter.StorageAdapterFactory">
>                <set-object property="fileSystemPath" 
> value="string:/usr/local/rhodepc/workspace/dmi/stitchfolder"/>
>            </construct>
>        </invoke-factory>
>    </service-point>
>
>
> ---------------------------------------------------------------------
> 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