[jira] Closed: (FELIX-2691) Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec?
[ https://issues.apache.org/jira/browse/FELIX-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Felix Meschberger closed FELIX-2691. Close issues after release Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec? Key: FELIX-2691 URL: https://issues.apache.org/jira/browse/FELIX-2691 Project: Felix Issue Type: Bug Components: HTTP Service Affects Versions: http-2.0.4 Environment: Not relevant Reporter: Misha Koshelev Assignee: Felix Meschberger Fix For: http-2.2.0 Attachments: FELIX-2691-HttpServiceImpl-isNameValid-comply-OSGI-R42.patch Original Estimate: 0.5h Remaining Estimate: 0.5h Filing bug per: http://www.mail-archive.com/dev@felix.apache.org/msg19853.html The R4.2 enterprise spec from http://www.osgi.org/Download/File?url=/download/r4v42/r4.enterprise.pdf on page 48 clearly states: The name parameter must also not end with slash ('/') with the exception that a name of the form / is used to denote the root of the bundle. The relevant code, in trunk, is, from http://svn.apache.org/repos/asf/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceImpl.java public void registerResources(String alias, String name, HttpContext context) throws NamespaceException { if (!isNameValid(name)) { throw new IllegalArgumentException( Malformed resource name [ + name + ]); } ... and private boolean isNameValid(String name) { if (name == null) { return false; } if (name.endsWith( / )) { return false; } return true; } -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (FELIX-2691) Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec?
[ https://issues.apache.org/jira/browse/FELIX-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Felix Meschberger reassigned FELIX-2691: Assignee: Felix Meschberger Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec? Key: FELIX-2691 URL: https://issues.apache.org/jira/browse/FELIX-2691 Project: Felix Issue Type: Bug Components: HTTP Service Affects Versions: http-2.0.4 Environment: Not relevant Reporter: Misha Koshelev Assignee: Felix Meschberger Attachments: FELIX-2691-HttpServiceImpl-isNameValid-comply-OSGI-R42.patch Original Estimate: 0.5h Remaining Estimate: 0.5h Filing bug per: http://www.mail-archive.com/dev@felix.apache.org/msg19853.html The R4.2 enterprise spec from http://www.osgi.org/Download/File?url=/download/r4v42/r4.enterprise.pdf on page 48 clearly states: The name parameter must also not end with slash ('/') with the exception that a name of the form / is used to denote the root of the bundle. The relevant code, in trunk, is, from http://svn.apache.org/repos/asf/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceImpl.java public void registerResources(String alias, String name, HttpContext context) throws NamespaceException { if (!isNameValid(name)) { throw new IllegalArgumentException( Malformed resource name [ + name + ]); } ... and private boolean isNameValid(String name) { if (name == null) { return false; } if (name.endsWith( / )) { return false; } return true; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Resolved: (FELIX-2691) Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec?
[ https://issues.apache.org/jira/browse/FELIX-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Felix Meschberger resolved FELIX-2691. -- Resolution: Fixed Fix Version/s: http-2.0.6 Thanks for providing the patch. Fixed in Rev. 1056570 Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec? Key: FELIX-2691 URL: https://issues.apache.org/jira/browse/FELIX-2691 Project: Felix Issue Type: Bug Components: HTTP Service Affects Versions: http-2.0.4 Environment: Not relevant Reporter: Misha Koshelev Assignee: Felix Meschberger Fix For: http-2.0.6 Attachments: FELIX-2691-HttpServiceImpl-isNameValid-comply-OSGI-R42.patch Original Estimate: 0.5h Remaining Estimate: 0.5h Filing bug per: http://www.mail-archive.com/dev@felix.apache.org/msg19853.html The R4.2 enterprise spec from http://www.osgi.org/Download/File?url=/download/r4v42/r4.enterprise.pdf on page 48 clearly states: The name parameter must also not end with slash ('/') with the exception that a name of the form / is used to denote the root of the bundle. The relevant code, in trunk, is, from http://svn.apache.org/repos/asf/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceImpl.java public void registerResources(String alias, String name, HttpContext context) throws NamespaceException { if (!isNameValid(name)) { throw new IllegalArgumentException( Malformed resource name [ + name + ]); } ... and private boolean isNameValid(String name) { if (name == null) { return false; } if (name.endsWith( / )) { return false; } return true; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec?
Hi Misha, This in fact looks like a bug. Do you mind filing a JIRA issue at https://issues.apache.org/jira/browse/FELIX. Thanks alot. Regards Felix Am Montag, den 08.11.2010, 16:24 -0600 schrieb Misha Koshelev: Dear All: Thank you all for your help and patience with me. I am working on the following OpenMRS ticket: http://tickets.openmrs.org/browse/TRUNK-1596 I am trying to use Apache Felix instead of Spring DM Web Extender. I have had some problems with JSP support, and am trying to use the Equinox JSP bundle: http://www.eclipse.org/equinox/server/jsp_support.php with Felix, specifically using the bridge sample in 2.0.4. I have double checked code in trunk. I _am_ successful with Equinox servlet bridge, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=329706 However, this example: http://prdownloads.sourceforge.net/sse-examples/org.eclipse.equinox.jsp.examples-proj.zip?download contains the following lines in org.eclipse.equinox.jsp.examples.Activator: HttpContext commonContext = new BundleEntryHttpContext(context.getBundle(), /web); //$NON-NLS-1$ httpService.registerResources(/jsp-examples, /, commonContext); //$NON-NLS-1$ //$NON-NLS-2$ Servlet adaptedJspServlet = new ContextPathServletAdaptor(new JspServlet(context.getBundle(), /web), /jsp-examples); //$NON-NLS-1$//$NON-NLS-2$ httpService.registerServlet(/jsp-examples/*.jsp, adaptedJspServlet, null, commonContext); //$NON-NLS-1$ Felix bridge complains: java.lang.IllegalArgumentException: Malformed resource name [/] at org.apache.felix.http.base.internal.service.HttpServiceImpl.registerResources(HttpServiceImpl.java:105) at org.eclipse.equinox.jsp.examples.Activator$HttpServiceTracker.addingService(Activator.java:38) at org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1030) The relevant code, in trunk, is, from http://svn.apache.org/repos/asf/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceImpl.java public void registerResources(String alias, String name, HttpContext context) throws NamespaceException { if (!isNameValid(name)) { throw new IllegalArgumentException( Malformed resource name [ + name + ]); } ... and private boolean isNameValid(String name) { if (name == null) { return false; } if (name.endsWith( / )) { return false; } return true; } However, the R4.2 enterprise spec from http://www.osgi.org/Download/File?url=/download/r4v42/r4.enterprise.pdf on page 48 clearly states: The name parameter must also not end with slash (’/’) with the exception that a name of the form “/” is used to denote the root of the bundle. Should isNameValid not read, similar to isAliasValid, in the same file: private boolean isNameValid(String name) { if (name == null) { return false; } if (!name.equals(/) ( !name.startsWith(/) || name.endsWith(/))) { return false; } return true; } ??? Thank you Yours Misha
[jira] Created: (FELIX-2691) Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec?
Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec? Key: FELIX-2691 URL: https://issues.apache.org/jira/browse/FELIX-2691 Project: Felix Issue Type: Bug Components: HTTP Service Affects Versions: http-2.0.4 Environment: Not relevant Reporter: Misha Koshelev Filing bug per: http://www.mail-archive.com/dev@felix.apache.org/msg19853.html The R4.2 enterprise spec from http://www.osgi.org/Download/File?url=/download/r4v42/r4.enterprise.pdf on page 48 clearly states: The name parameter must also not end with slash ('/') with the exception that a name of the form / is used to denote the root of the bundle. The relevant code, in trunk, is, from http://svn.apache.org/repos/asf/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceImpl.java public void registerResources(String alias, String name, HttpContext context) throws NamespaceException { if (!isNameValid(name)) { throw new IllegalArgumentException( Malformed resource name [ + name + ]); } ... and private boolean isNameValid(String name) { if (name == null) { return false; } if (name.endsWith( / )) { return false; } return true; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (FELIX-2691) Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec?
[ https://issues.apache.org/jira/browse/FELIX-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Misha Koshelev updated FELIX-2691: -- Attachment: FELIX-2691-HttpServiceImpl-isNameValid-comply-OSGI-R42.patch Here is relevant text from spec: 102.10.3.2 org.osgi.service.http public void registerResources( String alias, String name, HttpContext context ) throws NamespaceException alias name in the URI namespace at which the resources are registered name the base name of the resources that will be registered context the HttpContext object for the registered resources, or null if a default HttpContext is to be created and used. Registers resources into the URI namespace. The alias is the name in the URI namespace of the Http Service at which the registration will be mapped. An alias must begin with slash ('/') and must not end with slash ('/'), with the exception that an alias of the form / is used to denote the root alias. The name parameter must also not end with slash ('/') with the exception that a name of the form / is used to denote the root of the bundle. See the specification text for details on how HTTP requests are mapped to servlet and resource registra- tions. Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec? Key: FELIX-2691 URL: https://issues.apache.org/jira/browse/FELIX-2691 Project: Felix Issue Type: Bug Components: HTTP Service Affects Versions: http-2.0.4 Environment: Not relevant Reporter: Misha Koshelev Attachments: FELIX-2691-HttpServiceImpl-isNameValid-comply-OSGI-R42.patch Original Estimate: 0.5h Remaining Estimate: 0.5h Filing bug per: http://www.mail-archive.com/dev@felix.apache.org/msg19853.html The R4.2 enterprise spec from http://www.osgi.org/Download/File?url=/download/r4v42/r4.enterprise.pdf on page 48 clearly states: The name parameter must also not end with slash ('/') with the exception that a name of the form / is used to denote the root of the bundle. The relevant code, in trunk, is, from http://svn.apache.org/repos/asf/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceImpl.java public void registerResources(String alias, String name, HttpContext context) throws NamespaceException { if (!isNameValid(name)) { throw new IllegalArgumentException( Malformed resource name [ + name + ]); } ... and private boolean isNameValid(String name) { if (name == null) { return false; } if (name.endsWith( / )) { return false; } return true; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
Re: Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec?
Hi Felix Done https://issues.apache.org/jira/browse/FELIX-2691 Fyi, I have attached another proposed patch here. Per my other email wrt JSP issues http://www.mail-archive.com/dev@felix.apache.org/msg19852.html it looks like we will have to use Equinox HTTP Service :( unless you have some other suggestions... However, I hope the bug and proposed patch are helpful. We will gladly revisit Felix Http Service if some kind of JSP support is feasible (through Equinox JSP or otherwise). Thank you Misha On Tue, Nov 9, 2010 at 3:13 AM, Felix Meschberger fmesc...@gmail.com wrote: Hi Misha, This in fact looks like a bug. Do you mind filing a JIRA issue at https://issues.apache.org/jira/browse/FELIX. Thanks alot. Regards Felix Am Montag, den 08.11.2010, 16:24 -0600 schrieb Misha Koshelev: Dear All: Thank you all for your help and patience with me. I am working on the following OpenMRS ticket: http://tickets.openmrs.org/browse/TRUNK-1596 I am trying to use Apache Felix instead of Spring DM Web Extender. I have had some problems with JSP support, and am trying to use the Equinox JSP bundle: http://www.eclipse.org/equinox/server/jsp_support.php with Felix, specifically using the bridge sample in 2.0.4. I have double checked code in trunk. I _am_ successful with Equinox servlet bridge, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=329706 However, this example: http://prdownloads.sourceforge.net/sse-examples/org.eclipse.equinox.jsp.examples-proj.zip?download contains the following lines in org.eclipse.equinox.jsp.examples.Activator: HttpContext commonContext = new BundleEntryHttpContext(context.getBundle(), /web); //$NON-NLS-1$ httpService.registerResources(/jsp-examples, /, commonContext); //$NON-NLS-1$ //$NON-NLS-2$ Servlet adaptedJspServlet = new ContextPathServletAdaptor(new JspServlet(context.getBundle(), /web), /jsp-examples); //$NON-NLS-1$//$NON-NLS-2$ httpService.registerServlet(/jsp-examples/*.jsp, adaptedJspServlet, null, commonContext); //$NON-NLS-1$ Felix bridge complains: java.lang.IllegalArgumentException: Malformed resource name [/] at org.apache.felix.http.base.internal.service.HttpServiceImpl.registerResources(HttpServiceImpl.java:105) at org.eclipse.equinox.jsp.examples.Activator$HttpServiceTracker.addingService(Activator.java:38) at org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1030) The relevant code, in trunk, is, from http://svn.apache.org/repos/asf/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceImpl.java public void registerResources(String alias, String name, HttpContext context) throws NamespaceException { if (!isNameValid(name)) { throw new IllegalArgumentException( Malformed resource name [ + name + ]); } ... and private boolean isNameValid(String name) { if (name == null) { return false; } if (name.endsWith( / )) { return false; } return true; } However, the R4.2 enterprise spec from http://www.osgi.org/Download/File?url=/download/r4v42/r4.enterprise.pdf on page 48 clearly states: The name parameter must also not end with slash (’/’) with the exception that a name of the form “/” is used to denote the root of the bundle. Should isNameValid not read, similar to isAliasValid, in the same file: private boolean isNameValid(String name) { if (name == null) { return false; } if (!name.equals(/) ( !name.startsWith(/) || name.endsWith(/))) { return false; } return true; } ??? Thank you Yours Misha Index: samples/bridge/src/main/webapp/WEB-INF/framework.properties === --- samples/bridge/src/main/webapp/WEB-INF/framework.properties (revision 1033153) +++ samples/bridge/src/main/webapp/WEB-INF/framework.properties (working copy) @@ -159,4 +159,4 @@ org.xml.sax,\ org.xml.sax.ext,\ org.xml.sax.helpers,\ - javax.servlet;javax.servlet.http;version=2.5 + javax.servlet;javax.servlet.http;javax.servlet.resources;version=2.5
Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi R4.2 spec?
Dear All: Thank you all for your help and patience with me. I am working on the following OpenMRS ticket: http://tickets.openmrs.org/browse/TRUNK-1596 I am trying to use Apache Felix instead of Spring DM Web Extender. I have had some problems with JSP support, and am trying to use the Equinox JSP bundle: http://www.eclipse.org/equinox/server/jsp_support.php with Felix, specifically using the bridge sample in 2.0.4. I have double checked code in trunk. I _am_ successful with Equinox servlet bridge, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=329706 However, this example: http://prdownloads.sourceforge.net/sse-examples/org.eclipse.equinox.jsp.examples-proj.zip?download contains the following lines in org.eclipse.equinox.jsp.examples.Activator: HttpContext commonContext = new BundleEntryHttpContext(context.getBundle(), /web); //$NON-NLS-1$ httpService.registerResources(/jsp-examples, /, commonContext); //$NON-NLS-1$ //$NON-NLS-2$ Servlet adaptedJspServlet = new ContextPathServletAdaptor(new JspServlet(context.getBundle(), /web), /jsp-examples); //$NON-NLS-1$//$NON-NLS-2$ httpService.registerServlet(/jsp-examples/*.jsp, adaptedJspServlet, null, commonContext); //$NON-NLS-1$ Felix bridge complains: java.lang.IllegalArgumentException: Malformed resource name [/] at org.apache.felix.http.base.internal.service.HttpServiceImpl.registerResources(HttpServiceImpl.java:105) at org.eclipse.equinox.jsp.examples.Activator$HttpServiceTracker.addingService(Activator.java:38) at org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1030) The relevant code, in trunk, is, from http://svn.apache.org/repos/asf/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceImpl.java public void registerResources(String alias, String name, HttpContext context) throws NamespaceException { if (!isNameValid(name)) { throw new IllegalArgumentException( Malformed resource name [ + name + ]); } ... and private boolean isNameValid(String name) { if (name == null) { return false; } if (name.endsWith( / )) { return false; } return true; } However, the R4.2 enterprise spec from http://www.osgi.org/Download/File?url=/download/r4v42/r4.enterprise.pdf on page 48 clearly states: The name parameter must also not end with slash (’/’) with the exception that a name of the form “/” is used to denote the root of the bundle. Should isNameValid not read, similar to isAliasValid, in the same file: private boolean isNameValid(String name) { if (name == null) { return false; } if (!name.equals(/) ( !name.startsWith(/) || name.endsWith(/))) { return false; } return true; } ??? Thank you Yours Misha