Hi, did you try to just drop your war into the deploy folder, from there on everything else is done by the container. This might help you more :)
regards, Achim 2011/3/14 stream liu <[email protected]>: > Hi both guy. > I've tried adding Web-ContextPath=/HelloWeb, and also adding the following > to my web.xml >> <context-param> >> <param-name>contextConfigLocation</param-name> >> <param-value>classpath:/WEB-INF/application-context.xml</param-value> >> </context-param> > but, problem still ... > could you give me a pom.xml. > i create the project use the m2eclipse in which spring-osgi archetype > thanks.... > > 2011/3/13 Achim Nierbeck <[email protected]> >> >> Hi, >> >> taking a look at the stacktrace suggests that the Web-ContextPath isn't >> configured right. >> >> You should use ?Web-ContextPath=/sample as the right extension on the >> shell command. >> But you could also just drop your war inside the deploy folder and >> everything should be fine. >> >> @Andreas, well a better nullcheck could be done :) will open a issue for >> it and try to fix it. >> >> regards, Achim >> >> > Hey ? ;), >> > >> > 1) For future requests: please a) do not use rar, but rather a more >> > unix-friendly fomrat such as zip? :) >> > >> > 2) Please include the pom in your sources. This would help building if >> > I want to try something >> > >> > 3) Ok, the error is not beautiful... (@achim: any idea how we can give >> > a more reasonable error message here in pax-web?) >> > >> > 4) Please add the following in your web.xml (then it should work (I >> > would have tried with an included pom ;)) >> > >> > <context-param> >> > <param-name>contextConfigLocation</param-name> >> > >> > <param-value>classpath:/WEB-INF/application-context.xml</param-value> >> > </context-param> >> > >> > Kind regards, >> > Andreas >> > >> > 2011/3/11 stream <[email protected]>: >> >> I use the karaf 2.2.0 and features:install spirng-dm spring2.5.6 >> >> >> >> spring-dm-web war. whatever just could run the sample of tomcat5.5 >> >> which >> >> >> >> i've read in the users guide >> >> >> >> [code] >> >> >> >> If you want to deploy a sample web application into Karaf, you could >> >> use the >> >> >> >> following command: >> >> >> >> karaf@root> osgi:install -s >> >> >> >> >> >> webbundle:http://tomcat.apache.org/tomcat-5.5-doc/appdev/sample/sample.war?Bundle-SymbolicName=tomcat-sample&Webapp-Context=/sample >> >> >> >> Then open your web browser and point >> >> >> >> to http://localhost:8181/sample/index.html. >> >> >> >> [/code] >> >> >> >> i thought could running my webApp with spring according the sample. In >> >> fact >> >> >> >> it's run well without spring at first.. >> >> >> >> but the exception happened when i used spring with spring-dm. i just >> >> add >> >> >> >> the a context in web.xml. >> >> >> >> <context-param> >> >> >> >> <param-name>contextClass</param-name> >> >> >> >> <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value> >> >> </context-param> >> >> <listener> >> >> >> >> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-clas >> >> </listener> >> >> >> >> the exception is below: >> >> >> >> Could not start the servlet context for http context >> >> >> >> [org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@cb5d35] >> >> java.lang.NullPointerException >> >> at >> >> >> >> org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper.addContext(JettyServerWrapper.java:209)[86:org.ops4j.pax.web.pax-web-jetty:1.0.1] >> >> at >> >> >> >> org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper.getOrCreateContext(JettyServerWrapper.java:112)[86:org.ops4j.pax.web.pax-web-jetty:1.0.1] >> >> at >> >> >> >> org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.addServlet(JettyServerImpl.java:137)[86:org.ops4j.pax.web.pax-web-jetty:1.0.1] >> >> at >> >> >> >> org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Started.addServlet(ServerControllerImpl.java:266)[86:org.ops4j.pax.web.pax-web-jetty:1.0.1] >> >> at >> >> >> >> org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.addServlet(ServerControllerImpl.java:107)[86:org.ops4j.pax.web.pax-web-jetty:1.0.1] >> >> at >> >> >> >> org.ops4j.pax.web.service.internal.HttpServiceStarted.registerResources(HttpServiceStarted.java:180)[85:org.ops4j.pax.web.pax-web-runtime:1.0.1] >> >> at >> >> >> >> org.ops4j.pax.web.service.internal.HttpServiceProxy.registerResources(HttpServiceProxy.java:66)[85:org.ops4j.pax.web.pax-web-runtime:1.0.1] >> >> at >> >> >> >> org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:138)[89:org.ops4j.pax.web.pax-web-extender-war:1.0.1] >> >> at >> >> >> >> org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:558)[89:org.ops4j.pax.web.pax-web-extender-war:1.0.1] >> >> at >> >> >> >> org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.register(WebAppPublisher.java:170)[89:org.ops4j.pax.web.pax-web-extender-war:1.0.1] >> >> >> >> i attache the log and file in attachfile. >> >> >> >> i hope someone could help me!~~ >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >
