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]