Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 13794 invoked from network); 7 Aug 2009 09:57:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Aug 2009 09:57:27 -0000 Received: (qmail 75352 invoked by uid 500); 7 Aug 2009 09:57:33 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 75278 invoked by uid 500); 7 Aug 2009 09:57:33 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 75268 invoked by uid 99); 7 Aug 2009 09:57:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2009 09:57:33 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2009 09:57:22 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MZMC5-0006MJ-SW for users@cxf.apache.org; Fri, 07 Aug 2009 02:57:01 -0700 Message-ID: <24861993.post@talk.nabble.com> Date: Fri, 7 Aug 2009 02:57:01 -0700 (PDT) From: Sergey Beryozkin To: users@cxf.apache.org Subject: Re: static properties file can't be found in JAXRSInInterceptor In-Reply-To: <24859608.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sergey.beryozkin@iona.com References: <24859608.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi It appears when the server is running in a standalone mode the JAX-RS runtime attempts to handle static content requests like http://localhost:9000/main/index/Application_en-US.properties Can you provide some more information please. When you have your web app running in Tomcat, what is the value of a url pattern for CXFServlet ? Do requests like http://localhost:9000/main/index/Application_en-US.properties work properly in Tomcat ? Also, I'm not quite following what is being done in serveHTML(); Can you explain ? May be also outline the structure of your web app... I'm wondering, does it have to be done before the JAXRSServer is created ? thanks, Sergey Sam.Wang wrote: > > Hello everyone, I have an issue about the static file mapping. > > The Application_**.properties can't be found in out demo. but it works > well when I bring it out into tomcat. > > 2009-8-7 13:59:08 org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor > processRequest > Warning: .No root resource matching request path > /main/index/Application_en-US.properties is found. > 2009-8-7 13:59:08 org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper > toResponse > Warning: WebApplicationException has been caught : no cause is available > > following is my demo code. > > public class JAXRSServer { > > protected JAXRSServer() throws Exception { > JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); > sf.setResourceClasses(CustomerService.class); > //sf.setResourceProvider(CustomerService.class, new > SingletonResourceProvider(new CustomerService())); > sf.setAddress("http://localhost:9000/"); > > sf.create(); > } > > public static void main(String args[]) throws Exception { > new JAXRSServer(); > serveHTML(); > System.out.println("Server ready..."); > > Thread.sleep(5 * 600 * 1000); > System.out.println("Server exiting"); > System.exit(0); > } > > private static void serveHTML() throws Exception { > Bus bus = BusFactory.getDefaultBus(); > ServerRegistry sr = bus.getExtension(ServerRegistry.class); > JettyHTTPServerEngineFactory jhsef = > bus.getExtension(JettyHTTPServerEngineFactory.class); > ServerImpl si = (ServerImpl) sr.getServers().get(0); > JettyHTTPDestination jhd = (JettyHTTPDestination) si.getDestination(); > JettyHTTPServerEngine engine = (JettyHTTPServerEngine) jhd.getEngine(); > org.mortbay.jetty.Server server = engine.getServer(); > Handler serverHandler = server.getHandler(); > ContextHandlerCollection contextHandlerCollection = > (ContextHandlerCollection) serverHandler; > HandlerList handlerList = new HandlerList(); > ResourceHandler resourceHandler = new ResourceHandler(); > handlerList.addHandler(resourceHandler); > handlerList.addHandler(contextHandlerCollection); > server.setHandler(handlerList); > handlerList.start(); > resourceHandler.setResourceBase("./WebContent"); > } > > can everyone give me some suggestion? > > > > -- View this message in context: http://www.nabble.com/static-properties-file-can%27t-be-found-in-JAXRSInInterceptor-tp24859608p24861993.html Sent from the cxf-user mailing list archive at Nabble.com.