You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jozsa Kristof <dy...@kami.vein.hu> on 2001/10/29 13:55:45 UTC

Installing actions

I wrote a HelloWorld-like action based on the docs located in my cocoon
install: /cocoon/documents/actions. I've put the file in
/cocoon/WEB-INF/classes (using the package name 'test', so
/test/HelloWorldAction.class).

I've put the following lines in my sitemap:
<map:actions>
  <map:action name="hello-world" class="test.HelloWorldAction"/>
</map:actions>

<map:match pattern="hello">
  <map:act type="hello-world">
    <map:generate type="serverpages" src="hello/hello_world.xsp"/>
  </map:act>
  <map:serialize/>
</map:match>

and wrote hello/hello_world.xsp which tries to use the parameter passed by
HelloWorldAction.


However, if i try to reach host:8080/cocoon/hello, I get the following
Cocoon dump:
--
type internal-server-error

message UnnamedSelector: ComponentSelector could not find the component for
hint: hello-world

description org.apache.avalon.framework.component.ComponentException:
UnnamedSelector: ComponentSelector could not find the component for hint:
hello-world
--

..which means exactly afaik that Cocoon is unable to find the right Avalon
component for the specified action, eg. cant find HelloWorldAction.class

I've tried to check the internal Cocoon logs, but that did not helped me. So
the question is - anyone can please tell me what's wrong with the above
setup?
 
Thanks much in advance,
Christopher
-- 
.Digital.Yearning.for.Networked.Assassination.and.Xenocide

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Installing actions

Posted by Arno Illmann <ar...@ge.stalt.de>.
Hi, Christopher. I am not sure, I understood your problem (please post your code) and if I can help 
you, but I found something on the mail archive that may let you perhaps find the right track.

Best Regards, Arno

On 15.Oct.2001 -- 04:20 PM, SANSONE, AARON M [Non-Pharmacia/1000] wrote:

 > I need a simple way to place posted values from a form on the user session
 > for later use.  I thought that the SessionPropagatorAction was the way to
 > go.  Is anyone using the SessionPropagatorAction successfully in this
 > manner?
 >
 > I have a form that posts three values (text input "varOne", "varTwo" and
 > "varThree") to a matching pattern in sitemap.xmap which then calls the
 > session-propagator action to (theoretically) place posted the values on
 > the session:
 >
 > <map:match pattern="getCAParms">
 > <map:act type="session-propagator">
 > <map:parameter name="varOne" value="{varOne}"/>
 > <map:parameter name="varTwo" value="{varTwo}"/>
 > <map:parameter name="varThree" value="{varThree}"/>
 > </map:act> > </map:match>
 >
 > Obviously this doesn't do what I would have expected it to.
 >
 > I must be going about this in the wrong way, does anyone have a better
 > solution?


Aaron,

what you're missing here is, that {varOne} can't be substituted with
the desired value because Cocoon doesn't know about it. Put another
action around the session-propagator, namely the "RequestParamAction"
and set "parameters" to "true". Thus

    <map:match pattern="getCAParms">

<map:act type="request">
<map:parameter name="parameters" value="true"/>
<map:parameter name="default.varOne" value="some default value for
varOne"/>

<map:act type="session-propagator">
<map:parameter name="varOne" value="{varOne}"/>
<map:parameter name="varTwo" value="{varTwo}"/>
<map:parameter name="varThree" value="{varThree}"/>
</map:act>

</map:act>

</map:match>

HTH

	Chris.

-- C h r i s t i a n H a u l haul@informatik.tu-darmstadt.de fingerprint: 99B0 1D9D 7919 644A 4837 
7D73 FEF9 6856 335A 9E08 ---------------------------------------------------------------------



Jozsa Kristof wrote:

> Arno,
> 
>   I've tried both the cocoon/WEB-INF/classes/ dir, which should be
> auto-included due to the Tomcat config, and setting the extra-classpath
> in Cocoon's web.xml. In the first case, I get extreme errors, Cocoon cannot
> even start up its default page. In the second case, the dir in
> extra-classpath gets ignored, even if I set it absolute, relative, whatever.
> 
>   I've found a way, where Cocoon *can* find my own Action class, however.
> I've bundled my class file in the right directory structure in a .jar file,
> and dropped it into WEB-INF/lib beside cocoonXX.jar and such. Using that way
> (but only that), Cocoon can find my action class, and starts up correctly,
> but situation still aint clear..
> 
>   I'm trying to get a parameter from my Cocoon action. I've used the
> standard way of setting the parameter on the java side, from act() returning
> a Map object, just as I've seen it in the examples. I also try to reach it
> the standard way from the xsp: <xsp-request:get-parameter name="hello"
> default="did not worked"/>, and I only get the default value back every
> time. 
> 
>   So the question still stands: can anyone show me a Hello-World like
> example of setting a value from a Java action class which can be retreived
> from an xsp with the correct sitemap setup? 
> 
> I'm begging for this, I'm suffering on that very same problem for 1 whole
> week, and I cant step any further.
> 
> Best regards,
> Christopher
> 
> On Tue, Oct 30, 2001 at 09:07:35AM +0100, Arno Illmann wrote:
> 
>>Hi Christopher, here is what Vadim Gritsenko wrote to me in a similar case. 
>>In the end I putted the class file in the cocoon source and made a new 
>>build. This works, but it should be easier as shown below.
>>
>>Arno
>>
>>-----------
>>Hi,
>>
>>Here is couple of hints for you:
>>
>>1) Extra-classpath the way you specified would never work. The correct path 
>>would be:
>>
>><init-param>
>><param-name>extra-classpath</param-name>
>><param-value>C:\Programme\ApacheGroup\jakarta-tomcat-3.2.1\webapps\cocoon\WEB-INF\clas \
>>ses</param-value> </init-param>
>>
>>2) You do need to add ...\cocoon\WEB-INF\classes into classpath, because it 
>>is added
>>automatically by the servlet contaier (Tomcat)
>>
>>
>>If you have DatabaseSelectAction.class file in \
>>...\cocoon\WEB-INF\classes\org\apache\cocoon\acting, you do not required to 
>>add any \
>>classpath entries. Try to restart Tomcat and access sitemap again. If this 
>>fails, I \
>>do not have other pointers...
>>
>>Vadim
>>
>>
>>>-----Original Message-----
>>>From: Arno Illmann [mailto:arno.illmann@gmx.de]
>>>Sent: Thursday, October 04, 2001 2:34 PM
>>>To: cocoon-users@xml.apache.org
>>>Subject: installing of actions
>>>
>>>
>>>In the morning I posted this at the wrong thread so I do it again.
>>>My tryings over the day came not to success too and I hope, someone with 
>>>
>>more \
>>
>>>cocoon knowledge can shed us  some light on the following?
>>>
>>>Thanks in advance, Arno Illmann
>>>
>>>I did this:
>>>
>>>1) downloaded DatabaseSelectAction.java from CVS and compiled it to
>>>..\cocoon\WEB-INF\classes\org\apache\cocoon\acting.
>>>
>>>2) added to cocoons web.xml:
>>>
>>><init-param>
>>><param-name>extra-classpath</param-name>
>>>
>>>
>><param-value>C:\Programme\ApacheGroup\jakarta-tomcat-3.2.1\webapps\cocoon\WEB-INF\cl \
>>
>>>asses\org\apache\cocoon\ac ting\DatabaseSelectAction.class</param-value>
>>></init-param>
>>>
>>>3) added to the sitemap of the tutorial web application example:
>>>
>>><map:actions>
>>><map:action name="dbSel" 
>>>
>>src="org.apache.cocoon.acting.DatabaseSelectAction"/> <!-- \
>>
>>>added --> <map:action name="dbAdd" \
>>>src="org.apache.cocoon.acting.DatabaseAddAction"/> <map:action 
>>>
>>name="dbDel" \
>>
>>>src="org.apache.cocoon.acting.DatabaseDeleteAction"/> <map:action 
>>>
>>name="dbUpd" \
>>
>>>src="org.apache.cocoon.acting.DatabaseUpdateAction"/> <map:action 
>>>
>>name="form" \
>>
>>>src="org.apache.cocoon.acting.FormValidatorAction"/> </map:actions>
>>>
>>>The error message after invoking the tutorial is :
>>>
>>>org.apache.cocoon.ProcessingException: Exception in Handler:
>>>org.apache.avalon.framework.component.ComponentException:
>>>Could not set up Component for hint: 
>>>
>>org\apache\cocoon\www\tutorial\sitemap_xmap
>>
>>>Without <map:action name="dbSel" \
>>>src="org.apache.cocoon.acting.DatabaseSelectAction"/> it started 
>>>
>>seriously. I then
>>
>>>tried other paths in init param extra classpath, and other funny things.
>>>
>>>I think it could be no packages/path problem and compiling was without 
>>>
>>errors. But \
>>
>>>is i.e the syntax of path  to the class file right (its the right on my 
>>>
>>windows \
>>
>>>machine) or must I use a jar file? Any hints are very  very welcome.
>>>
>>>
>>
>>Jozsa Kristof wrote:
>>
>>
>>>On Mon, Oct 29, 2001 at 01:55:45PM +0100, Jozsa Kristof wrote:
>>>
>>>
>>>>I wrote a HelloWorld-like action based on the docs located in my cocoon
>>>>install: /cocoon/documents/actions. I've put the file in
>>>>/cocoon/WEB-INF/classes (using the package name 'test', so
>>>>/test/HelloWorldAction.class).
>>>>
>>>>
>>>..
>>>
>>>
>>>>..which means exactly afaik that Cocoon is unable to find the right Avalon
>>>>component for the specified action, eg. cant find HelloWorldAction.class
>>>>
>>>>
>>>Maybe I need an entry in my WEB-INF/web.xml file like:
>>><init-param>
>>> <param-name>extra-classpath</param-name>
>>> <param-value>WEB-INF/classes</param-value>
>>></init-param>
>>>
>>>??
>>>
>>>That's all I could find out.. but that did not helped even :( Maybe I need
>>>to set it somewhere else too to let Cocoon find my own Action class
>>>somewhere?
>>>
>>>Please help.. I'm getting lost completely.
>>>
>>>Christopher
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <co...@xml.apache.org>
>>For additional commands, e-mail: <co...@xml.apache.org>
>>
> 



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Installing actions

Posted by Lajos Moczar <lm...@galatea.com>.
Kristof,

I'm curious about your problem; what version of Cocoon & Tomcat are you 
running?

Regards,

Lajos
galatea.com



Jozsa Kristof wrote:

> Arno,
> 
>   I've tried both the cocoon/WEB-INF/classes/ dir, which should be
> auto-included due to the Tomcat config, and setting the extra-classpath
> in Cocoon's web.xml. In the first case, I get extreme errors, Cocoon cannot
> even start up its default page. In the second case, the dir in
> extra-classpath gets ignored, even if I set it absolute, relative, whatever.
> 
>   I've found a way, where Cocoon *can* find my own Action class, however.
> I've bundled my class file in the right directory structure in a .jar file,
> and dropped it into WEB-INF/lib beside cocoonXX.jar and such. Using that way
> (but only that), Cocoon can find my action class, and starts up correctly,
> but situation still aint clear..
> 
>   I'm trying to get a parameter from my Cocoon action. I've used the
> standard way of setting the parameter on the java side, from act() returning
> a Map object, just as I've seen it in the examples. I also try to reach it
> the standard way from the xsp: <xsp-request:get-parameter name="hello"
> default="did not worked"/>, and I only get the default value back every
> time. 
> 
>   So the question still stands: can anyone show me a Hello-World like
> example of setting a value from a Java action class which can be retreived
> from an xsp with the correct sitemap setup? 
> 
> I'm begging for this, I'm suffering on that very same problem for 1 whole
> week, and I cant step any further.
> 
> Best regards,
> Christopher
> 
> On Tue, Oct 30, 2001 at 09:07:35AM +0100, Arno Illmann wrote:
> 
>>Hi Christopher, here is what Vadim Gritsenko wrote to me in a similar case. 
>>In the end I putted the class file in the cocoon source and made a new 
>>build. This works, but it should be easier as shown below.
>>
>>Arno
>>
>>-----------
>>Hi,
>>
>>Here is couple of hints for you:
>>
>>1) Extra-classpath the way you specified would never work. The correct path 
>>would be:
>>
>><init-param>
>><param-name>extra-classpath</param-name>
>><param-value>C:\Programme\ApacheGroup\jakarta-tomcat-3.2.1\webapps\cocoon\WEB-INF\clas \
>>ses</param-value> </init-param>
>>
>>2) You do need to add ...\cocoon\WEB-INF\classes into classpath, because it 
>>is added
>>automatically by the servlet contaier (Tomcat)
>>
>>
>>If you have DatabaseSelectAction.class file in \
>>...\cocoon\WEB-INF\classes\org\apache\cocoon\acting, you do not required to 
>>add any \
>>classpath entries. Try to restart Tomcat and access sitemap again. If this 
>>fails, I \
>>do not have other pointers...
>>
>>Vadim
>>
>>
>>>-----Original Message-----
>>>From: Arno Illmann [mailto:arno.illmann@gmx.de]
>>>Sent: Thursday, October 04, 2001 2:34 PM
>>>To: cocoon-users@xml.apache.org
>>>Subject: installing of actions
>>>
>>>
>>>In the morning I posted this at the wrong thread so I do it again.
>>>My tryings over the day came not to success too and I hope, someone with 
>>>
>>more \
>>
>>>cocoon knowledge can shed us  some light on the following?
>>>
>>>Thanks in advance, Arno Illmann
>>>
>>>I did this:
>>>
>>>1) downloaded DatabaseSelectAction.java from CVS and compiled it to
>>>..\cocoon\WEB-INF\classes\org\apache\cocoon\acting.
>>>
>>>2) added to cocoons web.xml:
>>>
>>><init-param>
>>><param-name>extra-classpath</param-name>
>>>
>>>
>><param-value>C:\Programme\ApacheGroup\jakarta-tomcat-3.2.1\webapps\cocoon\WEB-INF\cl \
>>
>>>asses\org\apache\cocoon\ac ting\DatabaseSelectAction.class</param-value>
>>></init-param>
>>>
>>>3) added to the sitemap of the tutorial web application example:
>>>
>>><map:actions>
>>><map:action name="dbSel" 
>>>
>>src="org.apache.cocoon.acting.DatabaseSelectAction"/> <!-- \
>>
>>>added --> <map:action name="dbAdd" \
>>>src="org.apache.cocoon.acting.DatabaseAddAction"/> <map:action 
>>>
>>name="dbDel" \
>>
>>>src="org.apache.cocoon.acting.DatabaseDeleteAction"/> <map:action 
>>>
>>name="dbUpd" \
>>
>>>src="org.apache.cocoon.acting.DatabaseUpdateAction"/> <map:action 
>>>
>>name="form" \
>>
>>>src="org.apache.cocoon.acting.FormValidatorAction"/> </map:actions>
>>>
>>>The error message after invoking the tutorial is :
>>>
>>>org.apache.cocoon.ProcessingException: Exception in Handler:
>>>org.apache.avalon.framework.component.ComponentException:
>>>Could not set up Component for hint: 
>>>
>>org\apache\cocoon\www\tutorial\sitemap_xmap
>>
>>>Without <map:action name="dbSel" \
>>>src="org.apache.cocoon.acting.DatabaseSelectAction"/> it started 
>>>
>>seriously. I then
>>
>>>tried other paths in init param extra classpath, and other funny things.
>>>
>>>I think it could be no packages/path problem and compiling was without 
>>>
>>errors. But \
>>
>>>is i.e the syntax of path  to the class file right (its the right on my 
>>>
>>windows \
>>
>>>machine) or must I use a jar file? Any hints are very  very welcome.
>>>
>>>
>>
>>Jozsa Kristof wrote:
>>
>>
>>>On Mon, Oct 29, 2001 at 01:55:45PM +0100, Jozsa Kristof wrote:
>>>
>>>
>>>>I wrote a HelloWorld-like action based on the docs located in my cocoon
>>>>install: /cocoon/documents/actions. I've put the file in
>>>>/cocoon/WEB-INF/classes (using the package name 'test', so
>>>>/test/HelloWorldAction.class).
>>>>
>>>>
>>>..
>>>
>>>
>>>>..which means exactly afaik that Cocoon is unable to find the right Avalon
>>>>component for the specified action, eg. cant find HelloWorldAction.class
>>>>
>>>>
>>>Maybe I need an entry in my WEB-INF/web.xml file like:
>>><init-param>
>>> <param-name>extra-classpath</param-name>
>>> <param-value>WEB-INF/classes</param-value>
>>></init-param>
>>>
>>>??
>>>
>>>That's all I could find out.. but that did not helped even :( Maybe I need
>>>to set it somewhere else too to let Cocoon find my own Action class
>>>somewhere?
>>>
>>>Please help.. I'm getting lost completely.
>>>
>>>Christopher
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <co...@xml.apache.org>
>>For additional commands, e-mail: <co...@xml.apache.org>
>>
> 



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Installing actions

Posted by Jozsa Kristof <dy...@kami.vein.hu>.
Arno,

  I've tried both the cocoon/WEB-INF/classes/ dir, which should be
auto-included due to the Tomcat config, and setting the extra-classpath
in Cocoon's web.xml. In the first case, I get extreme errors, Cocoon cannot
even start up its default page. In the second case, the dir in
extra-classpath gets ignored, even if I set it absolute, relative, whatever.

  I've found a way, where Cocoon *can* find my own Action class, however.
I've bundled my class file in the right directory structure in a .jar file,
and dropped it into WEB-INF/lib beside cocoonXX.jar and such. Using that way
(but only that), Cocoon can find my action class, and starts up correctly,
but situation still aint clear..

  I'm trying to get a parameter from my Cocoon action. I've used the
standard way of setting the parameter on the java side, from act() returning
a Map object, just as I've seen it in the examples. I also try to reach it
the standard way from the xsp: <xsp-request:get-parameter name="hello"
default="did not worked"/>, and I only get the default value back every
time. 

  So the question still stands: can anyone show me a Hello-World like
example of setting a value from a Java action class which can be retreived
from an xsp with the correct sitemap setup? 

I'm begging for this, I'm suffering on that very same problem for 1 whole
week, and I cant step any further.

Best regards,
Christopher

On Tue, Oct 30, 2001 at 09:07:35AM +0100, Arno Illmann wrote:
> Hi Christopher, here is what Vadim Gritsenko wrote to me in a similar case. 
> In the end I putted the class file in the cocoon source and made a new 
> build. This works, but it should be easier as shown below.
> 
> Arno
> 
> -----------
> Hi,
> 
> Here is couple of hints for you:
> 
> 1) Extra-classpath the way you specified would never work. The correct path 
> would be:
> 
> <init-param>
> <param-name>extra-classpath</param-name>
> <param-value>C:\Programme\ApacheGroup\jakarta-tomcat-3.2.1\webapps\cocoon\WEB-INF\clas \
> ses</param-value> </init-param>
> 
> 2) You do need to add ...\cocoon\WEB-INF\classes into classpath, because it 
> is added
> automatically by the servlet contaier (Tomcat)
> 
> 
> If you have DatabaseSelectAction.class file in \
> ...\cocoon\WEB-INF\classes\org\apache\cocoon\acting, you do not required to 
> add any \
> classpath entries. Try to restart Tomcat and access sitemap again. If this 
> fails, I \
> do not have other pointers...
> 
> Vadim
> 
> > -----Original Message-----
> > From: Arno Illmann [mailto:arno.illmann@gmx.de]
> > Sent: Thursday, October 04, 2001 2:34 PM
> > To: cocoon-users@xml.apache.org
> > Subject: installing of actions
> >
> >
> > In the morning I posted this at the wrong thread so I do it again.
> > My tryings over the day came not to success too and I hope, someone with 
> more \
> > cocoon knowledge can shed us  some light on the following?
> >
> > Thanks in advance, Arno Illmann
> >
> > I did this:
> >
> > 1) downloaded DatabaseSelectAction.java from CVS and compiled it to
> > ..\cocoon\WEB-INF\classes\org\apache\cocoon\acting.
> >
> > 2) added to cocoons web.xml:
> >
> > <init-param>
> > <param-name>extra-classpath</param-name>
> >
> > 
> <param-value>C:\Programme\ApacheGroup\jakarta-tomcat-3.2.1\webapps\cocoon\WEB-INF\cl \
> > asses\org\apache\cocoon\ac ting\DatabaseSelectAction.class</param-value>
> > </init-param>
> >
> > 3) added to the sitemap of the tutorial web application example:
> >
> > <map:actions>
> > <map:action name="dbSel" 
> src="org.apache.cocoon.acting.DatabaseSelectAction"/> <!-- \
> > added --> <map:action name="dbAdd" \
> > src="org.apache.cocoon.acting.DatabaseAddAction"/> <map:action 
> name="dbDel" \
> > src="org.apache.cocoon.acting.DatabaseDeleteAction"/> <map:action 
> name="dbUpd" \
> > src="org.apache.cocoon.acting.DatabaseUpdateAction"/> <map:action 
> name="form" \
> > src="org.apache.cocoon.acting.FormValidatorAction"/> </map:actions>
> >
> > The error message after invoking the tutorial is :
> >
> > org.apache.cocoon.ProcessingException: Exception in Handler:
> > org.apache.avalon.framework.component.ComponentException:
> > Could not set up Component for hint: 
> org\apache\cocoon\www\tutorial\sitemap_xmap
> >
> > Without <map:action name="dbSel" \
> > src="org.apache.cocoon.acting.DatabaseSelectAction"/> it started 
> seriously. I then
> > tried other paths in init param extra classpath, and other funny things.
> >
> > I think it could be no packages/path problem and compiling was without 
> errors. But \
> > is i.e the syntax of path  to the class file right (its the right on my 
> windows \
> > machine) or must I use a jar file? Any hints are very  very welcome.
> >
> 
> 
> Jozsa Kristof wrote:
> 
> >On Mon, Oct 29, 2001 at 01:55:45PM +0100, Jozsa Kristof wrote:
> >
> >>I wrote a HelloWorld-like action based on the docs located in my cocoon
> >>install: /cocoon/documents/actions. I've put the file in
> >>/cocoon/WEB-INF/classes (using the package name 'test', so
> >>/test/HelloWorldAction.class).
> >>
> >..
> >
> >>..which means exactly afaik that Cocoon is unable to find the right Avalon
> >>component for the specified action, eg. cant find HelloWorldAction.class
> >>
> >
> >Maybe I need an entry in my WEB-INF/web.xml file like:
> ><init-param>
> >  <param-name>extra-classpath</param-name>
> >  <param-value>WEB-INF/classes</param-value>
> ></init-param>
> >
> >??
> >
> >That's all I could find out.. but that did not helped even :( Maybe I need
> >to set it somewhere else too to let Cocoon find my own Action class
> >somewhere?
> >
> >Please help.. I'm getting lost completely.
> >
> >Christopher
> >
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 

-- 
.Digital.Yearning.for.Networked.Assassination.and.Xenocide

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Installing actions

Posted by Arno Illmann <ar...@ge.stalt.de>.
Hi Christopher, here is what Vadim Gritsenko wrote to me in a similar case. In the end I putted the 
class file in the cocoon source and made a new build. This works, but it should be easier as shown 
below.

Arno

-----------
Hi,

Here is couple of hints for you:

1) Extra-classpath the way you specified would never work. The correct path would be:

<init-param>
<param-name>extra-classpath</param-name>
<param-value>C:\Programme\ApacheGroup\jakarta-tomcat-3.2.1\webapps\cocoon\WEB-INF\clas \
ses</param-value> </init-param>

2) You do need to add ...\cocoon\WEB-INF\classes into classpath, because it is added
automatically by the servlet contaier (Tomcat)


If you have DatabaseSelectAction.class file in \
...\cocoon\WEB-INF\classes\org\apache\cocoon\acting, you do not required to add any \
classpath entries. Try to restart Tomcat and access sitemap again. If this fails, I \
do not have other pointers...

Vadim

 > -----Original Message-----
 > From: Arno Illmann [mailto:arno.illmann@gmx.de]
 > Sent: Thursday, October 04, 2001 2:34 PM
 > To: cocoon-users@xml.apache.org
 > Subject: installing of actions
 >
 >
 > In the morning I posted this at the wrong thread so I do it again.
 > My tryings over the day came not to success too and I hope, someone with more \
 > cocoon knowledge can shed us  some light on the following?
 >
 > Thanks in advance, Arno Illmann
 >
 > I did this:
 >
 > 1) downloaded DatabaseSelectAction.java from CVS and compiled it to
 > ..\cocoon\WEB-INF\classes\org\apache\cocoon\acting.
 >
 > 2) added to cocoons web.xml:
 >
 > <init-param>
 > <param-name>extra-classpath</param-name>
 >
 > <param-value>C:\Programme\ApacheGroup\jakarta-tomcat-3.2.1\webapps\cocoon\WEB-INF\cl \
 > asses\org\apache\cocoon\ac ting\DatabaseSelectAction.class</param-value>
 > </init-param>
 >
 > 3) added to the sitemap of the tutorial web application example:
 >
 > <map:actions>
 > <map:action name="dbSel" src="org.apache.cocoon.acting.DatabaseSelectAction"/> <!-- \
 > added --> <map:action name="dbAdd" \
 > src="org.apache.cocoon.acting.DatabaseAddAction"/> <map:action name="dbDel" \
 > src="org.apache.cocoon.acting.DatabaseDeleteAction"/> <map:action name="dbUpd" \
 > src="org.apache.cocoon.acting.DatabaseUpdateAction"/> <map:action name="form" \
 > src="org.apache.cocoon.acting.FormValidatorAction"/> </map:actions>
 >
 > The error message after invoking the tutorial is :
 >
 > org.apache.cocoon.ProcessingException: Exception in Handler:
 > org.apache.avalon.framework.component.ComponentException:
 > Could not set up Component for hint: org\apache\cocoon\www\tutorial\sitemap_xmap
 >
 > Without <map:action name="dbSel" \
 > src="org.apache.cocoon.acting.DatabaseSelectAction"/> it started seriously. I then
 > tried other paths in init param extra classpath, and other funny things.
 >
 > I think it could be no packages/path problem and compiling was without errors. But \
 > is i.e the syntax of path  to the class file right (its the right on my windows \
 > machine) or must I use a jar file? Any hints are very  very welcome.
 >


Jozsa Kristof wrote:

> On Mon, Oct 29, 2001 at 01:55:45PM +0100, Jozsa Kristof wrote:
> 
>>I wrote a HelloWorld-like action based on the docs located in my cocoon
>>install: /cocoon/documents/actions. I've put the file in
>>/cocoon/WEB-INF/classes (using the package name 'test', so
>>/test/HelloWorldAction.class).
>>
> ..
> 
>>..which means exactly afaik that Cocoon is unable to find the right Avalon
>>component for the specified action, eg. cant find HelloWorldAction.class
>>
> 
> Maybe I need an entry in my WEB-INF/web.xml file like:
> <init-param>
>   <param-name>extra-classpath</param-name>
>   <param-value>WEB-INF/classes</param-value>
> </init-param>
> 
> ??
> 
> That's all I could find out.. but that did not helped even :( Maybe I need
> to set it somewhere else too to let Cocoon find my own Action class
> somewhere?
> 
> Please help.. I'm getting lost completely.
> 
> Christopher
> 



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Installing actions

Posted by Jozsa Kristof <dy...@kami.vein.hu>.
On Mon, Oct 29, 2001 at 01:55:45PM +0100, Jozsa Kristof wrote:
> I wrote a HelloWorld-like action based on the docs located in my cocoon
> install: /cocoon/documents/actions. I've put the file in
> /cocoon/WEB-INF/classes (using the package name 'test', so
> /test/HelloWorldAction.class).
..
> ..which means exactly afaik that Cocoon is unable to find the right Avalon
> component for the specified action, eg. cant find HelloWorldAction.class

Maybe I need an entry in my WEB-INF/web.xml file like:
<init-param>
  <param-name>extra-classpath</param-name>
  <param-value>WEB-INF/classes</param-value>
</init-param>

??

That's all I could find out.. but that did not helped even :( Maybe I need
to set it somewhere else too to let Cocoon find my own Action class
somewhere?

Please help.. I'm getting lost completely.

Christopher
-- 
.Digital.Yearning.for.Networked.Assassination.and.Xenocide

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Installing actions

Posted by Jozsa Kristof <dy...@kami.vein.hu>.
On Wed, Oct 31, 2001 at 10:09:29AM +0100, Christian Haul wrote:
> On 29.Oct.2001 -- 01:55 PM, Jozsa Kristof wrote:
> > I wrote a HelloWorld-like action based on the docs located in my cocoon
> > install: /cocoon/documents/actions. I've put the file in
> > /cocoon/WEB-INF/classes (using the package name 'test', so
> > /test/HelloWorldAction.class).
> 
> Jozsa, I think that everything is OK with your setup. Alas, I had
> similar problems with an early beta of tomcat 4. So, this might be a
> container problem rather than a cocoon one.

Hi Chris,

  thanks for your mail. I got so crazy on that problem (over 40 hours of
suffering :), so I decided not to use Actions at all. I'll solve the problem
using standard xsp logicsheet files; but I still have a class-finding
problem: if I want to include my Java class from xsp:include, it *only*
finds it if it's included in a jar file in cocoon/WEB-INF/lib/, it seems to
be unable to use the extra-classpath property setting from cocoon's web.xml.

Have you met this problem?

Christopher
(Kristof stands for Christopher in Hungarian ;)
-- 
.Digital.Yearning.for.Networked.Assassination.and.Xenocide

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>