For those who are curious, the fix is...
When calling the service I needed to prefix the applicationId as specified
in the hivemind.xml file e.g: @InjectObject("service: applicationId
.ImageService")


I was tearing my hair out with this one!!!

Thanks to those who tried to help.


Deon


-----Original Message-----
From: Deon Visagie [mailto:[EMAIL PROTECTED] 
Sent: 15 June 2006 04:18 PM
To: 'Tapestry users'
Subject: RE: Injecting Service Error

Hi

I already had the following at the top of my hivemodule.xml file

<module id="SAC" version="1.0.0" package="org.apache.tapestry.workbench">

And even if I change it to:

<module id="SAC" version="1.0.0"
package="mypackagename.tapestry.ImageService">

It still doesn't work - same error.

Btw, in my code below, my ImageService package actually is something like

mypackagename.tapestry.ImageService and not mypackagename.ImageService

so I thought that tapestry.ImageService was still then referring to my own
class.


Deon


-----Original Message-----
From: Andreas Bulling [mailto:[EMAIL PROTECTED] On Behalf Of
Andreas Bulling
Sent: 15 June 2006 03:54 PM
To: Tapestry users
Subject: Re: Injecting Service Error

Well, IMO HiveMind isn't able to find your ImageService service point
and defaults to tapestry.ImageService where it can't be found, too.
Try to put something like this in your hivemodule.xml

<module id="your_application_id" version="1.0.0"
package="path.to.the.package.with.ImageService">

hth
  Andreas

On 15. Jun 2006 - 15:08:56, Deon Visagie wrote:
| Hi 
| 
| I am trying to inject a service so that I preview images stored in a blob
in
| the database. I have the following code but it gives me an error that the
| service can't be found when I view that particular page.
| 
| 
| hivemodule.xml
| --------------
|       <contribution configuration-id="tapestry.url.ServiceEncoders">
|               <page-service-encoder id="page" extension="html"
| service="page"/>
|               <direct-service-encoder id="direct"
| stateless-extension="direct" stateful-extension="sdirect"/>
|       </contribution>
| 
|       <contribution configuration-id="tapestry.services.FactoryServices">
|          <service name="ImageService" object="service:ImageService"/>
|       </contribution> 
| 
|       <service-point id="ImageService"
| interface="org.apache.tapestry.engine.IEngineService">
|          <invoke-factory>
|             <construct class="mypackagename.ImageService">
|               <set-object property="linkFactory"
| value="infrastructure:linkFactory"/>
|             </construct>
|          </invoke-factory>
|       </service-point> 
| 
| 
| ImageService.java
| -----------------
| 
| public class ImageService
|       implements IEngineService
| {
|       private LinkFactory linkFactory;
| 
|       public ILink getLink(boolean isPost, Object parameters)
|       {
|               Object[] parameterArray = (Object[]) parameters;
|               Object reportId = parameterArray[0];
|               
|               Map serviceParameters = new HashMap();
|               serviceParameters.put(ServiceConstants.SERVICE, getName());
|               serviceParameters.put(ServiceConstants.PARAMETER, new
| Object[] {reportId});
|               
|               return linkFactory.constructLink(this, isPost,
| serviceParameters, true);
|       }
|       
|       public String getName()
|       {
|               return "ImageService";
|       }
|       
|       public void service(IRequestCycle cycle)
|               throws IOException
|       {
|               // ...
|       }
| 
|       /**
|        * @return Returns the linkFactory.
|        */
|       public LinkFactory getLinkFactory()
|       {
|               return linkFactory;
|       }
| 
|       /**
|        * @param linkFactory The linkFactory to set.
|        */
|       public void setLinkFactory(LinkFactory linkFactory)
|       {
|               this.linkFactory = linkFactory;
|       }
| }
| 
| And my java class for the page
| ------------------------------
| 
| @InjectObject("service:ImageService")
| public abstract IEngineService getImageService();
| 
| 
| The @InjectObject line throws the following error: Service point
| tapestry.ImageService does not exist
| 
| What am I missing? I know my hivemodule.xml file is being read as the
| friendly urls work fine.

---------------------------------------------------------------------
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]


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

Reply via email to