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.
