Steven Dolg | 1 Dec 2009 22:21

Re: REST / Can't find URLResponseBuilder

Jos Snellings schrieb:
> If I understand you well, your assignment is to:
>
> * catch a get URL emitted by Google Earch
> * this url contains coordinates
> * on the basis of these coordinates you lookup things in an XML file.
>
> Here's my advice: forget about the RESTController and just write a
> generator, like:
> public class SehensWuerdigkeitenGenerator extends AbstractSAXGenerator
> implements CachingPipelineComponent {
>   
>      <at> SitemapParameter
>     private String language;
>   
>      <at> SitemapParameter
>     private String cmd;
>     
>     private String pur;
>     private String par;
>     
>     private HttpServletRequest request;
>   

Well I agree that this looks very nice, unfortunately the 
 <at> SitemapParameter annotation is only available in the REST module of 
Cocoon and only working for Controllers.
A meaningful explanation would include the layered approach and 
assumptions about the environment - I'll do this another time.

(Continue reading)

Jos Snellings | 2 Dec 2009 07:23
Picon

Re: REST / Can't find URLResponseBuilder

O yes, you are right! It dates from a couple of trials in alpha-1,
when I was having trouble to make setup() work. Thanks.

Jos

On Tue, 2009-12-01 at 22:21 +0100, Steven Dolg wrote:
> Jos Snellings schrieb:
> > If I understand you well, your assignment is to:
> >
> > * catch a get URL emitted by Google Earch
> > * this url contains coordinates
> > * on the basis of these coordinates you lookup things in an XML file.
> >
> > Here's my advice: forget about the RESTController and just write a
> > generator, like:
> > public class SehensWuerdigkeitenGenerator extends AbstractSAXGenerator
> > implements CachingPipelineComponent {
> >   
> >      <at> SitemapParameter
> >     private String language;
> >   
> >      <at> SitemapParameter
> >     private String cmd;
> >     
> >     private String pur;
> >     private String par;
> >     
> >     private HttpServletRequest request;
> >   
> 
(Continue reading)

Debiprasanna Tripathy | 3 Dec 2009 00:24
Picon

Re: ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error


Hi Paul,

This usually happens when a client canceled the request, e.g. by clicking
'Cancel' while the page is still being loaded. 

You can do the following code to avoid to log  

catch(Exception e){ // catch the Exception

 String  clientAbortException = "";
 index = e.toString().indexOf(":");
  if(index != 0){
     clientAbortException = e.toString().substring(0, index );
   }
  if("ClientAbortException" .equalsIgnoreCase(clientAbortException)) { //
check it the exception is the 

// ClientAbortException  then do nothing
    //	Down Loading Canceled  by the Client
     if (out != null) {
	try{
	  if(out != null)
	    out.close();  // close the output stream
	  if(in != null)
	    in.close(); // close the input stream
	}
	catch(Exception ee){
	// catch  nothing
	}
(Continue reading)

Dick Deneer | 3 Dec 2009 16:40

Xpointer


I read that Cocoon has XPointer functionalty.
Can I use this independently: Can I use a xml text file as input to the
parser, supply an xpointer expression and get the offset in the xml of the
result nodeset. If this is possible can you please supply a hint to get me
started?
Thanks,
DD
--

-- 
View this message in context: http://old.nabble.com/Xpointer-tp26627996p26627996.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.
Thomas Markus | 4 Dec 2009 10:47

cocoon3 sitemap call

hi,

i tried to manually load and invoke a sitemap and it works fine now. but
how can i access resulting content type? i cant find something.

thx
Thomas
Thomas Markus | 4 Dec 2009 14:01

cocoon3 inside portlets

hi,

whats the best approach to use cocoon3 as portlet content producer?

currently i use cocoon3 trunk and build a running sample

regards

Thomas
Jos Snellings | 4 Dec 2009 15:15
Picon

URLConnectionUtils.closeLoudly()

Hi!

At the end of RESTController I get:

2009-12-04 14:57:26,014 ERROR http-8080-Processor20
org.apache.cocoon.sitemap.InvocationImpl/handle-errors - Error while
executing the sitemap. [request-uri=/editor/put/definition/1124]
java.lang.NullPointerException
        at
org.apache.cocoon.pipeline.util.URLConnectionUtils.closeQuietly(URLConnectionUtils.java:37)
        at
org.apache.cocoon.rest.controller.response.URLResponse.execute(URLResponse.java:91)
        at
org.apache.cocoon.rest.controller.SpringRESTController.invoke(SpringRESTController.java:88)
        at
org.apache.cocoon.controller.SpringControllerComponent.execute(SpringControllerComponent.java:50)
        at
org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:147)
        at
org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:126)
        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)

It is certainly not closing a connection quietly :-) 

In URLResponse.java, is it possible that in execute()
(Continue reading)

Johannes Lichtenberger | 4 Dec 2009 15:29
Picon
Favicon

Re: URLConnectionUtils.closeLoudly()

On Fri, 2009-12-04 at 15:15 +0100, Jos Snellings wrote:

[StackTrace]

> It is certainly not closing a connection quietly :-) 
> 
> In URLResponse.java, is it possible that in execute()
> 
> servletConnection = this.url.openConnection(); is null?
> 
> Responses are like:
>    if (action.equals("st")) return new
> URLResponse("servlet:/thesaurusedit/stdemo",data);
>             	if (action.equals("term")) return new
> URLResponse("servlet:/edit/term", data);
>             }
>             
> 	return new URLResponse("servlet:editor/workspace", data);

Well, you know I'm not really familiar with cocoon, but I would replace
action.equals("st") with "st".equals(action) and action.equals("term")
equally, so you can't get NullPointerExceptions in this place (I know
it's not the source of the problem).

greetings,
Johannes  
Steven Dolg | 4 Dec 2009 15:35

Re: URLConnectionUtils.closeLoudly()

Jos Snellings schrieb:
> Hi!
>
> At the end of RESTController I get:
>
> 2009-12-04 14:57:26,014 ERROR http-8080-Processor20
> org.apache.cocoon.sitemap.InvocationImpl/handle-errors - Error while
> executing the sitemap. [request-uri=/editor/put/definition/1124]
> java.lang.NullPointerException
>         at
> org.apache.cocoon.pipeline.util.URLConnectionUtils.closeQuietly(URLConnectionUtils.java:37)
>         at
> org.apache.cocoon.rest.controller.response.URLResponse.execute(URLResponse.java:91)
>         at
> org.apache.cocoon.rest.controller.SpringRESTController.invoke(SpringRESTController.java:88)
>         at
> org.apache.cocoon.controller.SpringControllerComponent.execute(SpringControllerComponent.java:50)
>         at
> org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:147)
>         at
> org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:126)
>         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)
>
> It is certainly not closing a connection quietly :-) 
>
(Continue reading)

Robby Pelssers | 4 Dec 2009 16:06

problem with zip serializer Cocoon 2.2: Component with role 'org.apache.cocoon.serialization.Serializer/' and key 'map' is not defined in this service selector

xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" xmlns="http://www.w3.org/TR/REC-html40">

Hi guys,

 

I defined a custom serializer to add a specific doctype declaration:

 

      <map:serializer

        logger="sitemap.serializer.xml" mime-type="text/xml" name="map"

        src="org.apache.cocoon.serialization.XMLSerializer">

        <doctype-system>http://nww.qa.spider.nxp.com:8310/xmetal/schemas/map.dtd</doctype-system>

      </map:serializer>

 

 

I dynamically generate the zip archive using inline xml content.

 

Ziparchive xml snippet (1)

<?xml version="1.0" encoding="UTF-8"?>

<zip:archive xmlns:zip="http://apache.org/cocoon/zip-archive/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

            <zip:entry name="PH3330L.xml" serializer="map">

                        <map id="emptymap" rev="000.000" title="PH3330L">

                                    <topicmeta>

                                                <critdates>

                                                            <revised modified="20091204"/>

                                                </critdates>

                                                <releasestate content="released"/>

                                                <owner content="NXP"/>

                                    </topicmeta>

                                    <topicgroup>

                                                <topichead navtitle="PH3330L"/>

                                                <topicref href="product_profile" navtitle="product_profile"/>

                                                <topicref href="pinning_information" navtitle="pinning_information"/>

                                                <topicref href="ordering_information" navtitle="ordering_information"/>

                                                <topicref href="marking" navtitle="marking"/>

                                    </topicgroup>

                        </map>

            </zip:entry>

</zip:archive>

 

 

My sitemap snippet looks like this:

 

      <map:match pattern="zip">

        <map:generate src="cocoon:/datasheet_mockup"/>

        <map:transform src="xslt/datasheet2zip.xslt" type="saxon" label="zip"/>  àresults in (1)

        <map:serialize type="zip"/>

      </map:match>

 

I can process this pipeline up until transformation.  But the zip serializer gives me following exception:

 

Caused by: org.apache.avalon.framework.service.ServiceException: Component with role 'org.apache.cocoon.serialization.Serializer/' and key 'map' is not defined in this service selector. (Key='AvalonServiceSelector')

      at org.apache.cocoon.serialization.ZipArchiveSerializer.addEntry(ZipArchiveSerializer.java:333)

      at org.apache.cocoon.serialization.ZipArchiveSerializer.startElement(ZipArchiveSerializer.java:211)

      at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:585)

      at org.apache.cocoon.core.container.spring.avalon.PoolableProxyHandler.invoke(PoolableProxyHandler.java:71)

      at $Proxy12.startElement(Unknown Source)

      at net.sf.saxon.event.ContentHandlerProxy.startContent(ContentHandlerProxy.java:253)

 

 

I would expect that the name of the serializer is used as key… or is my assumption wrong and do I need to add some extra configuration to the custom serializer?

 

May thx in advance,

Robby Pelssers


Gmane