Hi Jos,

Now my sitemap file looks lik this,

<map:components>
        <map:generators default="file">
            <map:generator name="jsp" 
src="org.apache.cocoon.generation.JSPGenerator"/>
        </map:generators>
</map:components>

    <map:pipelines>
        <map:pipeline id="demo">

            <map:match pattern="test">
                <map:generate type="jsp" src="intro.jsp"/>
                <map:transform src="demo/welcome.xslt"/>
                <map:serialize type="xhtml"/>
            </map:match>
        </map:pipeline>
    </map:pipelines>

And my jsp file is in the \target\rcl\webapp\WEB-INF\intro.jsp

Jsp file content is as follows,

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
Test jsp content
</body>
</html>

Now I get the following error

javax.servlet.ServletException: org.apache.cocoon.ProcessingException: You must 
not reference a file outside of the servlet context at 
file:///D:/Projects/cocoonProjects/ical/target/rcl/webapp/. at <map:serialize 
type="xhtml"> - 
file:///D:/Projects/cocoonProjects/ical/./src/main/resources/COB-INF/sitemap.xmap:88:46
 at <map:transform> - 
file:///D:/Projects/cocoonProjects/ical/./src/main/resources/COB-INF/sitemap.xmap:87:57
 at <map:generate type="jsp"> - 
file:///D:/Projects/cocoonProjects/ical/./src/main/resources/COB-INF/sitemap.xmap:86:59
 at <map:match> - 
file:///D:/Projects/cocoonProjects/ical/./src/main/resources/COB-INF/sitemap.xmap:85:39

Can anybody advise me how to correct this error,
Any advise is appreciated,

Thanks and regards,
Venura.

-----Original Message-----
From: Venura Kahawala [mailto:[email protected]] 
Sent: Wednesday, March 03, 2010 4:05 PM
To: [email protected]
Subject: RE: Type 'jsp' does not exist for 'map:generate'

HI Jos,

When I first created the test cocoon project using the maven, a cocoon.xconf 
file was not created and I copied it from the following location,
http://cocoon.apache.org/2.0/developing/httprequest.html

Anyway bellow is the cocoon.xconf file I copied,


<?xml version="1.0"?>

<cocoon version="2.0">

<!-- ===================== General Components =========================== -->

  <component role="org.apache.cocoon.components.parser.Parser" 
             class="org.apache.cocoon.components.parser.JaxpParser"/>
  <component role="org.apache.cocoon.components.store.Store"  
             class="org.apache.cocoon.components.store.MemoryStore"/>

  <component
      
role="org.apache.cocoon.components.language.programming.ProgrammingLanguageSelector"
      class="org.apache.cocoon.CocoonComponentSelector">
    <component-instance name="java" 
      
class="org.apache.cocoon.components.language.programming.java.JavaLanguage">
      <parameter name="compiler" 
      value="org.apache.cocoon.components.language.programming.java.Javac"/>
      <parameter name="code-formatter" 
      
value="org.apache.cocoon.components.language.programming.java.JstyleFormatter"/>
      <parameter name="class-loader" 
      value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
    </component-instance>
  </component>

  <component role="org.apache.cocoon.components.classloader.ClassLoaderManager" 
      class="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>

  <component
      role="org.apache.cocoon.components.language.markup.MarkupLanguageSelector"
      class="org.apache.cocoon.CocoonComponentSelector">
    <component-instance name="xsp" 
        
class="org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage">
      <parameter name="prefix" value="xsp"/>
      <parameter name="uri" value="http://apache.org/xsp"/>

      <target-language name="java">
        <parameter name="core-logicsheet" 
value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl"/>

        <builtin-logicsheet>
          <parameter name="prefix" value="xsp-request"/>
          <parameter name="uri" value="http://apache.org/xsp/request/2.0"/>
          <parameter name="href" 
value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
        </builtin-logicsheet>

        <builtin-logicsheet>
          <parameter name="prefix" value="xsp-response"/>
          <parameter name="uri" value="http://apache.org/xsp/response/2.0"/>
          <parameter name="href" 
value="resource://org/apache/cocoon/components/language/markup/xsp/java/response.xsl"/>
        </builtin-logicsheet>
      </target-language>
    </component-instance>

    <component-instance name="sitemap" 
       
class="org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage">
      <parameter name="prefix" value="map"/>
      <parameter name="uri" value="http://apache.org/cocoon/sitemap/1.0"/>

      <target-language name="java">
        <parameter name="core-logicsheet" 
value="resource://org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl"/>
      </target-language>
    </component-instance>
  </component>

  <component 
role="org.apache.cocoon.components.language.generator.ProgramGenerator" 
             
class="org.apache.cocoon.components.language.generator.ProgramGeneratorImpl">
    <parameter name="auto-reload" value="true"/>
  </component>

  <!-- these components is used as a PoolController for the sitemap component 
pools  -->
  <component role="org.apache.avalon.util.pool.PoolController" 
             class="org.apache.cocoon.util.ComponentPoolController"/>

  <sitemap file="sitemap.xmap"/> 
</cocoon>

Please check this and any advise is appreciated.
Thanks and regards,
Venura.

-----Original Message-----
From: Jos Snellings [mailto:[email protected]] 
Sent: Wednesday, March 03, 2010 3:46 PM
To: [email protected]
Subject: RE: Type 'jsp' does not exist for 'map:generate'

Hi Venura,

Mmm, first I redirect this discussion to "[email protected]", for
that is the appropriate group.
Next I would suggest to send the contents of your cocoon.xconf. There
may be a declaration missing there.

Jos

On Wed, 2010-03-03 at 14:37 +0530, Venura Kahawala wrote:
> Hi Jos,
> 
> Thanks a lot for the reply
> 
> But in the bellow link it says that Jsp can be used as a generator
> http://cocoon.apache.org/2.1/userdocs/jsp-generator.html
> 
> I latter added the bellow part to my sitemap.xmap file. 
>     <map:components>
>         <map:generators default="file">
>             <map:generator name="jsp" src="intro"/>
> 
>         </map:generators>
>     </map:components>
> 
> So my new sitemap file looks like this,
> 
> <map:sitemap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>              xsi:schemaLocation="http://apache.org/cocoon/sitemap/1.0 
> http://cocoon.apache.org/schema/sitemap/cocoon-sitemap-1.0.xsd";
>              xmlns:map="http://apache.org/cocoon/sitemap/1.0";
>              xmlns:avalon="http://cocoon.apache.org/schema/avalon";>
> 
>     <map:components>
>         <map:generators default="file">
>             <map:generator name="jsp" src="intro"/>
> 
>         </map:generators>
>     </map:components>
> 
>     <map:flow language="javascript"/>
>     <map:pipelines>
>         <map:pipeline id="demo">
>             <map:match pattern="test">
>                 <map:generate type="jsp" />
>                 <map:transform src="demo/welcome.xslt"/>
>                 <map:serialize type="xhtml"/>
>             </map:match>
>         </map:pipeline>
>     </map:pipelines>
> </map:sitemap>
> 
> This avoids the "Type 'jsp' does not exist for 'map:generate'" error. Here 
> intro is the jsp file and it returns the simple xml formatted string.
> But when I enter the " http://localhost:8888/ical/test"; in the browser it now 
> gives the following error,
> 
> javax.servlet.ServletException: 
> org.springframework.beans.factory.BeanDefinition
> StoreException: Unable to read Avalon configuration from 'sitemap.xmap' .; 
> nested
>  exception is 
> org.apache.avalon.framework.configuration.ConfigurationException:
> Unable to create class for component with role 
> org.apache.cocoon.generation.Gene
> rator/jsp with class: intro
> 
> Appreciate any advise,
> Thanks and regards,
> Venura.
> 
> 
> -----Original Message-----
> From: Jos Snellings [mailto:[email protected]] 
> Sent: Wednesday, March 03, 2010 1:57 PM
> To: [email protected]
> Subject: Re: Type 'jsp' does not exist for 'map:generate'
> 
> Hi again,
> 
> I am sorry. xsp does not exist anymore from 2.2. My mistake.
> I responded in haste.
> 
> Jos
> 
> On Wed, 2010-03-03 at 09:21 +0100, Jos Snellings wrote:
> > Hi,
> > 
> > Maybe you mean: "
> > <generate type="xsp" src="intro.xsp"/>
> > 
> > an xsp page is a special variant of a jsp page. 
> > 
> > As far as I know, plain jsp does not fit in cocoon.
> > 
> > Cheers
> > 
> > 
> > On Wed, 2010-03-03 at 12:25 +0530, Venura Kahawala wrote:
> > > Hi,
> > > 
> > >  
> > > 
> > > For cocoon 2.2, with maven, I have this pipeline in my experimental 
> > > sitemap-file:
> > > <map:sitemap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > >              xsi:schemaLocation="http://apache.org/cocoon/sitemap/1.0 
> > > http://cocoon.apache.org/schema/sitemap/cocoon-sitemap-1.0.xsd";
> > >              xmlns:map="http://apache.org/cocoon/sitemap/1.0";> 
> > >     <map:flow language="javascript"/>
> > >     
> > >     <map:pipelines>
> > >         <map:match pattern="intro.jsp">
> > >                 <map:generate type="jsp" src="intro.jsp"/>
> > >                 <map:transform src="demo/welcome.xslt"/>
> > >                 <map:serialize type="xhtml"/>
> > >             </map:match>
> > >     </map:pipeline> 
> > >  
> > > </map:sitemap>
> > >  
> > > When I run the maven command “mvn jetty-run” I get the following error
> > >  
> > > Caused by: 
> > > org.apache.avalon.framework.configuration.ConfigurationException: Ty
> > > e 'jsp' does not exist for 'map:generate'
> > >  
> > > Is there something missing in my sitemap? Or is there something I have to 
> > > do with maven or do I have to add some
> > > other configurations. And if there are other configurations please advise 
> > > me where I can find those files in my application. Please advise me.
> > > Greetings and thanks for helping!
> > > Venura.
> > > 
> > >  
> > > 
> > > 
> > 
> > 
> > 
> 
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to