cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <ilgro...@apache.org>
Subject Re: question related to using servlet: in @src
Date Tue, 22 May 2012 07:17:19 GMT
On 22/05/2012 08:58, Robby Pelssers wrote:
>
> Nope... still fails.  I will try to start in debug mode and see how 
> far I get. Meanwhile I will also try the sample block again and see if 
> that (still) works.   That one contains several similar use cases so 
> they might be broken as well.
>

Robby,
I've just generated a new project from samples archetype and everything 
seems to work, servlet:/ protocol included.
Incidentally, I've also fixed a typo in pom.xml of the generated project.

Here's what I did:

1. 'mvn clean install' from cocoon-archetype-sample/ subdir in C3 
sources, or wait for next redeployment and use 'mvn -U' in the following

2. generate a new samples block:

mvn archetype:generate \
     -DarchetypeGroupId=org.apache.cocoon.archetype-sample \
     -DarchetypeArtifactId=cocoon-archetype-sample \
     -DarchetypeVersion=3.0.0-beta-1-SNAPSHOT \
     -DgroupId=com.mycompany \
     -DartifactId=mysample \
     -Dversion=1.0-SNAPSHOT \
     
-DarchetypeRepository=https://repository.apache.org/content/repositories/snapshots/ 


3. (IMPORTANT!) add ASF SNAPSHOT repository to pom.xml

<repository>
<id>apache.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>http://repository.apache.org/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>

4. mvn jetty:run

You will now get all samples running fine on http://localhost:8888/

Regards.

> *From:*Robby Pelssers [mailto:Robby.Pelssers@nxp.com]
> *Sent:* Tuesday, May 22, 2012 8:54 AM
> *To:* dev@cocoon.apache.org
> *Subject:* RE: question related to using servlet: in @src
>
> I am reinstalling all artifacts now and see if that was the culprit. 
> Forgot to do so yesterday evening probably because I followed your 
> quick-start from latest mail discussion.  Will let you know if it 
> still fails afterwards.
>
> *From:*Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
> *Sent:* Tuesday, May 22, 2012 8:50 AM
> *To:* dev@cocoon.apache.org
> *Subject:* Re: question related to using servlet: in @src
>
> On 22/05/2012 08:42, Robby Pelssers wrote:
>
> Hi Francesco,
>
> My sitemap did declare the servlet namespace
>
> <map:sitemap
>
>         xmlns:map="http://apache.org/cocoon/sitemap" 
> <http://apache.org/cocoon/sitemap>
>
>         xmlns:servlet="http://apache.org/cocoon/servlet" 
> <http://apache.org/cocoon/servlet>
>
>         xmlns:controller="http://apache.org/cocoon/controller" 
> <http://apache.org/cocoon/controller>>
>
> But if you look more carefully that shouldn't even matter as I'm not 
> using it as a namespace prefix.  In the @src attribute I'm using it 
> but there it's just a string.
>
> <map:generate src="servlet:/testdata"/>
>
> You only need to declare it when you use a tag in the servlet 
> namespace like e.g.
>
> <map:match equals="redirect/sax-pipeline/simple-xml">
>
> <servlet:redirect-to uri="servlet:/sax-pipeline/simple-xml"/>
>
> </map:match>
>
> So this is not causing the issue.
>
>
> Ops, you are absolutely right :-)
> It looks like the ServletURLStreamHandler does not get registered...
>
> *From:*Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
> *Sent:* Tuesday, May 22, 2012 8:34 AM
> *To:* dev@cocoon.apache.org <mailto:dev@cocoon.apache.org>
> *Subject:* Re: question related to using servlet: in @src
>
> On 21/05/2012 23:49, Robby Pelssers wrote:
>
> Hi all,
>
> I noticed the cocoon protocol got ditched in favour of the servlet 
> protocol.
>
> However something puzzles me as test1 is not working but test2 is.  I 
> studied the sitemap from sample block and they use it all over the 
> place. What am I missing here?
>
> <map:match pattern="testdata">
>
> <map:generate src="data/PH3330L.xml"/>
>
> <map:serialize/>
>
> </map:match>
>
> <map:match pattern="test1">
>
> <map:generate src="servlet:/testdata"/>
>
> <map:transform src="xslt/test.xslt"/>
>
> <map:serialize/>
>
> </map:match>
>
> <map:match pattern="test2">
>
> <map:generate src="data/PH3330L.xml"/>
>
> <map:transform src="xslt/test.xslt"/>
>
> <map:serialize/>
>
> </map:match>
>
> This is the stacktrace:
>
> <exception-report class="java.net.URISyntaxException" timestamp="Mon, 
> 21 May 2012 23:48:09 +0200"><message>Illegal character in scheme name 
> at index 18: 
> com.nxp.spider2.vp_generation.service+:/testdata</message><stacktrace>java.net.URISyntaxException:

> Illegal character in scheme name at index 18: 
> com.nxp.spider2.vp_generation.service+:/testdata
>
>
> ...did you declare xmlns:servlet="http://apache.org/cocoon/servlet" 
> <http://apache.org/cocoon/servlet>?
>
>
>                 at java.net.URI$Parser.fail(URI.java:2810)
>
>                 at java.net.URI$Parser.checkChars(URI.java:2983)
>
>                 at java.net.URI$Parser.parse(URI.java:3010)
>
>                 at java.net.URI.<init>(URI.java:735)
>
>                 at 
> org.apache.cocoon.servletservice.AbsoluteServletConnection.<init>(AbsoluteServletConnection.java:70)
>
>                 at 
> org.apache.cocoon.servletservice.url.ServletURLConnection.<init>(ServletURLConnection.java:92)
>
>                 at 
> org.apache.cocoon.servletservice.url.ServletURLStreamHandler.openConnection(ServletURLStreamHandler.java:30)
>
>                 at java.net.URL.openConnection(URL.java:945)
>
>                 at 
> org.apache.cocoon.sax.component.XMLGenerator$URLGenerator.execute(XMLGenerator.java:433)
>
>                 at 
> org.apache.cocoon.sax.component.XMLGenerator.execute(XMLGenerator.java:121)
>
>                 at 
> org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:150)
>
>                 at 
> org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:146)
>
>                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)
>
>                 at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
>                 at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>                 at java.lang.reflect.Method.invoke(Method.java:597)
>
>                 at 
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
>
>                 at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>
>                 at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>
>                 at 
> org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
>
>                 at 
> org.apache.cocoon.servlet.collector.ResponseHeaderCollector.interceptInvoke(ResponseHeaderCollector.java:94)
>
>                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)
>
>                 at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
>                 at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>                 at java.lang.reflect.Method.invoke(Method.java:597)
>
>                 at 
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>
>               at 
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>
>                 at 
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>
>                 at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>
>                 at 
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
>
>                 at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>
>                 at 
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
>
>                 at $Proxy29.execute(Unknown Source)
>
>                 at 
> org.apache.cocoon.sitemap.InvocationImpl.execute(InvocationImpl.java:163)
>
>                 at 
> org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:68)
>
>                 at 
> org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:100)
>
>                 at 
> org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
>
>                 at 
> org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:100)
>
>                 at 
> org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
>
>                 at 
> org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:245)
>
>                 at 
> org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:313)
>
>                 at 
> org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:92)
>
>                 at 
> org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:54)
>
>                 at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>
>                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)
>
>                 at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
>                 at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>                 at java.lang.reflect.Method.invoke(Method.java:597)
>
>                 at 
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
>
>                 at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>
>                 at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>
>                 at 
> org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
>
>                 at 
> org.apache.cocoon.jnet.URLHandlerFactoryCollector.installURLHandlers(URLHandlerFactoryCollector.java:37)
>
>                 at 
> sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
>
>                 at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>                 at java.lang.reflect.Method.invoke(Method.java:597)
>
>                 at 
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>
>               at 
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>
>                 at 
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>
>                 at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>
>                 at 
> org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
>
>                 at 
> org.apache.cocoon.jnet.URLHandlerFactoryCollector.installURLHandlers(URLHandlerFactoryCollector.java:37)
>
>                 at 
> sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
>
>                 at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>                 at java.lang.reflect.Method.invoke(Method.java:597)
>
>                 at 
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
>
>               at 
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
>
>                 at 
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
>
>                 at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>
>                 at 
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
>
>                 at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>
>                 at 
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
>
>                 at $Proxy20.service(Unknown Source)
>
>                 at 
> org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:481)
>
>                 at 
> org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:455)
>
>                 at 
> org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:245)
>
>                 at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>
>                 at 
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
>
>                 at $Proxy24.service(Unknown Source)
>
>                 at 
> org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:106)
>
>                 at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>
>                 at 
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingServlet.service(ReloadingServlet.java:115)
>
>                 at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>
>                 at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)
>
>                 at 
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingSpringFilter.doFilter(ReloadingSpringFilter.java:71)
>
>                 at 
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingServletFilter.doFilter(ReloadingServletFilter.java:66)
>
>                 at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
>
>                 at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
>
>                 at 
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>
>                 at 
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>
>                 at 
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>
>                 at 
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
>
>                 at 
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>
>                 at 
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>
>                 at 
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>
>                 at org.mortbay.jetty.Server.handle(Server.java:326)
>
>                 at 
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>
>                 at 
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
>
>                 at 
> org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
>
>                 at 
> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
>
>                 at 
> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>
>                 at 
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
>
>                 at 
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>
> </stacktrace></exception-report>
>
> <http://people.apache.org/%7Eilgrosso/>

-- 
Francesco Chicchiriccò

Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


Mime
View raw message