RE: unable to getRealPath for servlet context

2014-03-05 Thread Tom Leung
It is not a bug, ServletContext.getRealPath() never return a real path on OSGI container. For Equinox framework, use the following code fragment: import org.eclipse.core.runtime. FileLocator; ... ServletContext context = request.getSession().getServletContext(); URL url =

RE: unable to getRealPath for servlet context

2014-03-05 Thread asookazian2
Thx for quick response. What is the equivalent to FileLocator in karaf? -- View this message in context: http://karaf.922171.n3.nabble.com/unable-to-getRealPath-for-servlet-context-tp4032109p4032114.html Sent from the Karaf - User mailing list archive at Nabble.com.

RE: unable to getRealPath for servlet context

2014-03-05 Thread Tom Leung
try to find the corresponding org.eclipse.equinox.common file from Maven repo. -Original Message- From: asookazian2 [mailto:asookaz...@gmail.com] Sent: Thursday, March 06, 2014 12:58 PM To: user@karaf.apache.org Subject: RE: unable to getRealPath for servlet context Thx for quick

RE: unable to getRealPath for servlet context

2014-03-05 Thread asookazian2
So I tried the recommended approach in this thread and getting the following now: karaf@root() start 265 karaf@root() java.lang.NullPointerException at org.eclipse.core.internal.runtime.Activator.getURLConverter(Activator.java:313) at

RE: unable to getRealPath for servlet context

2014-03-05 Thread asookazian2
Sorry i replied before reading your reply a few mins ago. I didn't change the karaf.framework to equinox but i basically added the following dependency to my pom: dependency groupIdorg.mod4j.org.eclipse.equinox/groupId artifactIdcommon/artifactId

RE: unable to getRealPath for servlet context

2014-03-05 Thread asookazian2
OK so I made the change in config.properties to point as follows: karaf.framework=equinox saved, stopped, started karaf in debug mode i've attached a debugger session in Eclipse and see now: url = bundleentry://243.fwk42630947/ so that's not null any more. now i get the following warning in

RE: unable to getRealPath for servlet context

2014-03-05 Thread Tom Leung
-Original Message- From: asookazian2 [mailto:asookaz...@gmail.com] Sent: Thursday, March 06, 2014 2:13 PM To: user@karaf.apache.org Subject: RE: unable to getRealPath for servlet context OK so I made the change in config.properties to point as follows: karaf.framework=equinox saved, stopped

Re: unable to getRealPath for servlet context

2014-03-05 Thread Achim Nierbeck
Hi, as already stated this won't work for an OSGi Servlet Container. All of the deployment together with those information are handled by Pax Web. Jetty is just the mere container to run the stuff. To retrieve the actual ServletPath you will need to call request. getServletPath() But, this