Re: [Simpleweb-Support] mapper.xml not working
Brought to you by:
niallg
From: Niall G. <gal...@ya...> - 2007-04-17 09:27:18
|
Hi, Yes, the tutorial is slightly out of date in this respect. It looks like your mapper.xml file is not correctly formatted. It should look like <mapper> <lookup> <service name="name" type="package.MyClass"/> </lookup> <resolve> <match name="name" path="/*"/> </resolve> </mapper> Niall ----- Original Message ---- From: Hugo Weber <ug...@li...> To: sim...@li... Sent: Tuesday, April 17, 2007 1:18:00 AM Subject: [Simpleweb-Support] mapper.xml not working I'm doing the tutorial samples for the HelloService and it only works if I add the following lines to the DemoServer.java: engine.load("default", "HelloService"); engine.link("*", "default"); Looks like stuff on mapper.xml is bean ignored. The mapper.xml is shown bellow. What's Wrong? The steps I made... I Copied DemoServer and DemoHandler sources from the tutorial "getting started - r2" and HelloService from the tutorial "Simplest possible Service". They compile but don't work. I found out the following error is due to a missing mapper.xml file. simple.http.serve.LocateException: File not found at simple.http.serve.FileLocator.getLocation(FileLocator.java:138) at simple.http.serve.FileLocator.getLocation(FileLocator.java:112) at simple.http.serve.FileLocator.getFile(FileLocator.java:157) at simple.http.load.PatternResolver.load(PatternResolver.java:146) at simple.http.load.PatternResolver.load(PatternResolver.java:130) at simple.http.load.PatternResolver.init(PatternResolver.java:106) at simple.http.load.PatternResolver.<init>(PatternResolver.java:91) at simple.http.load.PatternMapper.<init>(PatternMapper.java:106) at simple.http.load.PatternMapper.<init>(PatternMapper.java:92) at simple.http.load.MapperFactory.getInstance(MapperFactory.java:73) at simple.http.load.MapperEngine.<init>(MapperEngine.java:243) at simple.http.load.MapperEngine.<init>(MapperEngine.java:222) at simple.http.load.MapperEngine.<init>(MapperEngine.java:176) at simple.http.load.MapperEngine.<init>(MapperEngine.java:150) at simple.http.load.MapperEngine.<init>(MapperEngine.java:105) at simple.http.load.MapperEngine.<init>(MapperEngine.java:86) at DemoServer.main(DemoServer.java:12) So I place this mapper.xml file and the error above is solved, however, HelloService still not working. <?xml version="1.0"?> <!DOCTYPE mapper SYSTEM "http://www.simpleframework.org/dtd/mapper.dtd";> <mapper> <resolve match="/*" name="default" type="HelloService"/> </mapper> Searching on the simple site I found this link http://kasparov.skife.org/blog/2004/04/23 named "It's all so simple" That's where I got the lines engine.load("default", "HelloService"); engine.link("*", "default"); Why it only works with the load and link methods and not what is on the mapper.xml file? Thank you, Hugo. = -- Powered by Outblaze ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |