Re: again with 'works in jetty, not in tomcat' for simple URI matching in 2.2

2011-02-10 Thread Andre Juffer

On 02/09/2011 04:00 PM, Myles Byrne wrote:

Thanks, Andre! It would be a godsend to route around this problem.

But I haven't been able to get param passing to work as you suggest.
Following from your example, this sitemap match:

map:pipeline
map:match pattern=something
map:match type=request-parameter pattern=url /
map:generate src={1}/
  

.. would require this matcher setup in components, no?

map:matcher name=request-parameter
src=org.apache.cocoon.matching.RequestParameterMatcher/


I actually had nothing like that in the sitemap. It just worked. But I 
should note that I was using this with a version older than cocoon 2.2. 
You are using cocoon 2.2, right?


Your url value is pointing to a remote server, other than the one you 
are running cocoon? I guess, the code above did get the value of url, 
but its value is misinterpreted  by cocoon, as it tries to find 
something of the local disk instead. The map:generate src={1} / 
could be causing this. If url's value does actually refer to a local 
resource, it is looking in the wrong place, as the url's value may be 
interpreted as being relative to the root of your block, while you may 
had a different location in mind.




I haven't been able to get this to work .. the trace says:

javax.servlet.ServletException:
org.apache.cocoon.ResourceNotFoundException: Resource not found.
...
Caused by: org.apache.excalibur.source.SourceNotFoundException:
file:///home/... /./src/main/resources/COB-INF/ doesn't exist.

.. This seems better than the outright fail of the default URI matcher,
but i'm having a hard time fixing this, too. Any pointer to get the
param passing as you suggest?

Cheers,
- Myles
FIMM.fi


On Tue, Feb 8, 2011 at 8:35 PM, Andre Juffer ajuf...@sun3.oulu.fi
mailto:ajuf...@sun3.oulu.fi wrote:

On 02/08/2011 04:32 PM, Myles Byrne wrote:

Hi all,

Coming right off the current basic archetype with samples,
simply adding
a basic URL matcher:

map:match pattern=url=**
map:generate src={1}/


You could rewrite this as

map:pipeline
map:match pattern=something
map:match type=request-parameter pattern=url /
map:generate src={1}/
  

This should work fine with a request like:

www.foo.com/something?url=value http://www.foo.com/something?url=value




etc ..

.. works fine in Jetty, but in Tomcat throws:

Javax.servlet.ServletException:
org.apache.cocoon.ProcessingException:
Sitemap: error invoking matcher  (the rest of the trace is below)

.. where the error specifies the end of the match line above.

I thought this looked like a UTF8 issue, so have followed the
directions
for this in both Cocoon and Tomcat. Since this hasn't fixed the
problem
yet, i have to ask the experts: UTF-8 issue? Anything else that can
differ so fundamentally between Jetty and Tomcat?

Cheers,
- Myles Byrne
fimm.fi http://fimm.fi http://fimm.fi


---


avax.servlet.ServletException:
org.apache.cocoon.ProcessingException: Sitemap: error invoking
matcher
atmap:match  -

file:///opt/apps/apache-tomcat-6.0.18/work/Catalina/localhost/lsdbweb-1.0.0/blocks/lsdb/sitemap.xmap:56:32

  
org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:230)

  
org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  
org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:468)

  
org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:443)

  
org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:264)

  
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

  
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy3.service(Unknown Source)

  
org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:106)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  
org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:131)

*root cause*

org.apache.cocoon.ProcessingException: Sitemap: error invoking
matcher
atmap:match  -

file:///opt/apps/apache-tomcat-6.0.18/work/Catalina/localhost/lsdbweb-1.0.0/blocks/lsdb/sitemap.xmap:56:32

  
org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.java:111)

  
org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:90)

  

Re: again with 'works in jetty, not in tomcat' for simple URI matching in 2.2

2011-02-10 Thread Myles Byrne
Andre, that's very helpful. You're right, the URL value is a remote server -
plus it's HTTPS.

What kills me is that it works fine with Jetty, but as soon as i build the
webapp and move the WAR into Tomcat, it breaks. What causes Tomcat to
evaluate a URI as a local filepath, while Jetty hits it properly?

I will try generating a 2.1 version and see if that fixes it.

Cheers,
- Myles


On Thu, Feb 10, 2011 at 10:59 AM, Andre Juffer ajuf...@sun3.oulu.fi wrote:

 On 02/09/2011 04:00 PM, Myles Byrne wrote:

 Thanks, Andre! It would be a godsend to route around this problem.

 But I haven't been able to get param passing to work as you suggest.
 Following from your example, this sitemap match:

 map:pipeline
 map:match pattern=something
 map:match type=request-parameter pattern=url /
 map:generate src={1}/
  

 .. would require this matcher setup in components, no?

 map:matcher name=request-parameter
 src=org.apache.cocoon.matching.RequestParameterMatcher/


 I actually had nothing like that in the sitemap. It just worked. But I
 should note that I was using this with a version older than cocoon 2.2. You
 are using cocoon 2.2, right?

 Your url value is pointing to a remote server, other than the one you are
 running cocoon? I guess, the code above did get the value of url, but its
 value is misinterpreted  by cocoon, as it tries to find something of the
 local disk instead. The map:generate src={1} / could be causing this. If
 url's value does actually refer to a local resource, it is looking in the
 wrong place, as the url's value may be interpreted as being relative to the
 root of your block, while you may had a different location in mind.


 I haven't been able to get this to work .. the trace says:

 javax.servlet.ServletException:
 org.apache.cocoon.ResourceNotFoundException: Resource not found.
 ...
 Caused by: org.apache.excalibur.source.SourceNotFoundException:
 file:///home/... /./src/main/resources/COB-INF/ doesn't exist.

 .. This seems better than the outright fail of the default URI matcher,
 but i'm having a hard time fixing this, too. Any pointer to get the
 param passing as you suggest?

 Cheers,
 - Myles
 FIMM.fi


 On Tue, Feb 8, 2011 at 8:35 PM, Andre Juffer ajuf...@sun3.oulu.fi
 mailto:ajuf...@sun3.oulu.fi wrote:

On 02/08/2011 04:32 PM, Myles Byrne wrote:

Hi all,

Coming right off the current basic archetype with samples,
simply adding
a basic URL matcher:

map:match pattern=url=**
map:generate src={1}/


You could rewrite this as

map:pipeline
map:match pattern=something
map:match type=request-parameter pattern=url /
map:generate src={1}/
  

This should work fine with a request like:

www.foo.com/something?url=value 
 http://www.foo.com/something?url=value





etc ..

.. works fine in Jetty, but in Tomcat throws:

Javax.servlet.ServletException:
org.apache.cocoon.ProcessingException:
Sitemap: error invoking matcher  (the rest of the trace is below)

.. where the error specifies the end of the match line above.

I thought this looked like a UTF8 issue, so have followed the
directions
for this in both Cocoon and Tomcat. Since this hasn't fixed the
problem
yet, i have to ask the experts: UTF-8 issue? Anything else that can
differ so fundamentally between Jetty and Tomcat?

Cheers,
- Myles Byrne
fimm.fi http://fimm.fi http://fimm.fi



---


avax.servlet.ServletException:
org.apache.cocoon.ProcessingException: Sitemap: error invoking
matcher
atmap:match  -

  
 file:///opt/apps/apache-tomcat-6.0.18/work/Catalina/localhost/lsdbweb-1.0.0/blocks/lsdb/sitemap.xmap:56:32


  
 org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:230)


  org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)

  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


  
 org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:468)


  
 org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:443)


  
 org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:264)


  
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)


  
 org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy3.service(Unknown Source)


  
 org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:106)

  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


  
 org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:131)

*root cause*

org.apache.cocoon.ProcessingException: Sitemap: 

Re: again with 'works in jetty, not in tomcat' for simple URI matching in 2.2

2011-02-09 Thread Myles Byrne
Thanks, Andre! It would be a godsend to route around this problem.

But I haven't been able to get param passing to work as you suggest.
Following from your example, this sitemap match:

map:pipeline
 map:match pattern=something
   map:match type=request-parameter pattern=url /
 map:generate src={1}/
 

.. would require this matcher setup in components, no?

map:matcher name=request-parameter
src=org.apache.cocoon.matching.RequestParameterMatcher/

I haven't been able to get this to work .. the trace says:

javax.servlet.ServletException: org.apache.cocoon.ResourceNotFoundException:
Resource not found.
...
Caused by: org.apache.excalibur.source.SourceNotFoundException:
file:///home/... /./src/main/resources/COB-INF/ doesn't exist.

.. This seems better than the outright fail of the default URI matcher, but
i'm having a hard time fixing this, too. Any pointer to get the param
passing as you suggest?

Cheers,
- Myles
FIMM.fi


On Tue, Feb 8, 2011 at 8:35 PM, Andre Juffer ajuf...@sun3.oulu.fi wrote:

 On 02/08/2011 04:32 PM, Myles Byrne wrote:

 Hi all,

 Coming right off the current basic archetype with samples, simply adding
 a basic URL matcher:

 map:match pattern=url=**
 map:generate src={1}/


 You could rewrite this as

 map:pipeline
  map:match pattern=something
map:match type=request-parameter pattern=url /
  map:generate src={1}/
  

 This should work fine with a request like:

 www.foo.com/something?url=value




  etc ..

 .. works fine in Jetty, but in Tomcat throws:

 Javax.servlet.ServletException: org.apache.cocoon.ProcessingException:
 Sitemap: error invoking matcher  (the rest of the trace is below)

 .. where the error specifies the end of the match line above.

 I thought this looked like a UTF8 issue, so have followed the directions
 for this in both Cocoon and Tomcat. Since this hasn't fixed the problem
 yet, i have to ask the experts: UTF-8 issue? Anything else that can
 differ so fundamentally between Jetty and Tomcat?

 Cheers,
 - Myles Byrne
 fimm.fi http://fimm.fi


 ---


 avax.servlet.ServletException: org.apache.cocoon.ProcessingException:
 Sitemap: error invoking matcher
atmap:match  -
 file:///opt/apps/apache-tomcat-6.0.18/work/Catalina/localhost/lsdbweb-1.0.0/blocks/lsdb/sitemap.xmap:56:32

  
 org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:230)

  org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  
 org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:468)

  
 org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:443)

  
 org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:264)

  
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

  
 org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy3.service(Unknown Source)

  
 org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:106)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  
 org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:131)

 *root cause*

 org.apache.cocoon.ProcessingException: Sitemap: error invoking matcher
atmap:match  -
 file:///opt/apps/apache-tomcat-6.0.18/work/Catalina/localhost/lsdbweb-1.0.0/blocks/lsdb/sitemap.xmap:56:32

  
 org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.java:111)

  
 org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:90)

  
 org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)

  
 org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)

  
 org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)

  
 org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:81)

  
 org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:239)

  
 org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:171)

  
 org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:247)

  
 org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:351)

  
 org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:169)

  org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  
 org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:468)