Tweaked my hivemodule.xml to the following: <service-point id="BipService" interface="org.apache.tapestry.engine.IEngineService"> <invoke-factory> <construct class="com.kodak.mis.web.engine.BipService"> <set-object property="linkFactory" value="service:tapestry.url.LinkFactory"/> </construct> </invoke-factory> </service-point>
<contribution configuration-id="tapestry.services.ApplicationServices"> <service name="bip" object="service:com.kodak.mis.web.engine.BipService"/> </contribution> Changed contribution/service/object from instance:... to service:.... Thought that simple fix would resolve it, however I now get: javax.servlet.ServletException: Unable to construct service tapestry.asset.ClasspathAssetFactory: Error building service tapestry.asset.ClasspathAssetFactory: Error at jar:file:/C:/Documents%20and%20Settings/l507107/My%20Documents/Projects/MI_4.5/Source/Kodak_MI/Java/webapps/admin/WEB-INF/lib/tapestry-4.0.2.jar!/META-INF/tapestry.asset.xml, line 81, column 75: Unable to construct service tapestry.services.ServiceMap: Error building service tapestry.services.ServiceMap: Error at jar:file:/C:/Documents%20and%20Settings/l507107/My%20Documents/Projects/MI_4.5/Source/Kodak_MI/Java/webapps/admin/WEB-INF/lib/tapestry-4.0.2.jar!/META-INF/tapestry.services.xml, line 166, column 75: Unable to initialize service tapestry.services.ServiceMap (by invoking method initializeService on org.apache.tapestry.services.impl.ServiceMapImpl): Unable to construct configuration tapestry.services.ApplicationServices: Error at context:/WEB-INF/hivemodule.xml, line 110, column 83: Unable to process attribute object (of element service): Service point com.kodak.mis.web.engine.BipService does not exist. org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:60) $ServletRequestServicer_10c2186bf14.service($ServletRequestServicer_10c2186bf14.java) $ServletRequestServicer_10c2186bf13.service($ServletRequestServicer_10c2186bf13.java) org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55) $ServletRequestServicerFilter_10c2186bf10.service($ServletRequestServicerFilter_10c2186bf10.java) $ServletRequestServicerFilter_10c2186bf0f.service($ServletRequestServicerFilter_10c2186bf0f.java) $ServletRequestServicer_10c2186bf15.service($ServletRequestServicer_10c2186bf15.java) org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52) $ServletRequestServicerFilter_10c2186bf0e.service($ServletRequestServicerFilter_10c2186bf0e.java) $ServletRequestServicerFilter_10c2186bf0d.service($ServletRequestServicerFilter_10c2186bf0d.java) $ServletRequestServicer_10c2186bf15.service($ServletRequestServicer_10c2186bf15.java) org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53) $ServletRequestServicerFilter_10c2186bf12.service($ServletRequestServicerFilter_10c2186bf12.java) $ServletRequestServicerFilter_10c2186bf11.service($ServletRequestServicerFilter_10c2186bf11.java) $ServletRequestServicer_10c2186bf15.service($ServletRequestServicer_10c2186bf15.java) $ServletRequestServicer_10c2186bf08.service($ServletRequestServicer_10c2186bf08.java) $ServletRequestServicer_10c2186bf07.service($ServletRequestServicer_10c2186bf07.java) org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123) org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:79) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) My class is compiled and deinitely in the classpath. If I remove: <contribution configuration-id="tapestry.services.ApplicationServices"> <service name="bip" object="service:com.kodak.mis.web.engine.BipService"/> </contribution> then it reads everything in ok but the page which uses this engine/service doesn't work. Any pointers on what I am missing? -Ryan On Thursday, June 29, 2006, at 01:35PM, Ryan Cuprak <[EMAIL PROTECTED]> wrote: > >Hello, > I am working my way through the "Handling File Downloads and Uploads" chapter > in the "Enjoying Web Development" book however I am crashing into a brick > wall. > The setter for the LinkFactory is never being called thus resulting in a null > pointer exception. > > hivemodule.xml snippet: > <service-point id="BipService" > interface="org.apache.tapestry.engine.IEngineService"> > <invoke-factory> > <construct class="com.kodak.mis.web.engine.BipService"> > <set-object property="linkFactory" > value="service:tapestry.url.LinkFactory"/> > </construct> > </invoke-factory> > </service-point> > > <contribution configuration-id="tapestry.services.ApplicationServices"> > <service name="BipService" > object="instance:com.kodak.mis.web.engine.BipService"/> > </contribution> > > Code snippet: >public class BipService implements IEngineService { > > private static final Logger logger = Logger.getLogger(BipService.class); > > private LinkFactory _linkFactory; > > public void setLinkFactory(LinkFactory linkFactory) { > if(logger.isDebugEnabled())logger.debug("Link factory called: " + > linkFactory); > _linkFactory = linkFactory; > } > > public ILink getLink(boolean post, Object parameter) { > Map parameters = new HashMap(); > if(logger.isDebugEnabled()) logger.debug("link factory is null " + > (_linkFactory == null) ); > return _linkFactory.constructLink(this,post,parameters,false); > } > > It is always null. For the 'set-object' line I can enter complete garbage for > the value and it won't complain! > > Am I missing something?? > > Thanks! > Ryan > >--------------------------------------------------------------------- >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]