Re: cocoon3 block deployment

2009-11-10 Thread Reinhard Pötz
Jos Snellings wrote:
 Hi,
 
 When trying to deploy a cocoon-3 block to Tomcat, it does not seem to
 find it: 
 java.lang.RuntimeException: There is no block 'YourBlockName' deployed.
 The available blocks are {}.
 
 I must say that the documentation on this issue is a little bit terse...
 (http://cocoon.apache.org/subprojects/block-deployment/1.1/1471_1_1.html)
 
From what I understand: 
 - pack block in a .jar file
 - add a line to the manifest file META-INF/MANIFEST.MF :
   Cocoon-Block-Name: YourBlockName
   (yes it ends with a newline)
 - place .jar in lib directory of webapp
 
 Can anybody shed some light on this issue, please?

In order to use a Cocoon *block*, you also have to install the
BlockDeploymentServletContextListener in your web.xml:

listener
listener-classorg.apache.cocoon.blockdeployment.BlockDeploymentServletContextListener/listener-class
/listener



If the block provides servlet-services, you have to use the
DispatcherServlet of the servlet-service-framework which collects and
mounts all servlets that are registered as Spring beans.

servlet
  descriptionCocoon blocks dispatcher/description
  display-nameDispatcherServlet/display-name
  servlet-nameDispatcherServlet/servlet-name

servlet-classorg.apache.cocoon.servletservice.DispatcherServlet/servlet-class
  load-on-startup1/load-on-startup
/servlet
servlet-mapping
  servlet-nameDispatcherServlet/servlet-name
  url-pattern/*/url-pattern
/servlet-mapping



And of course you have to properly setup Spring:

!--
Declare Spring context listener which sets up the Spring Application
Context containing all Cocoon components (and user defined beans as
well).
--
listener
listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
/listener

!--
Declare Spring request listener which sets up the required
RequestAttributes to support Springs and Cocoon custom bean scopes
like the request scope or the session scope.
--
listener
listener-classorg.springframework.web.context.request.RequestContextListener/listener-class
/listener


Does this answer your question?

-- 
Reinhard Pötz   Managing Director, {Indoqa} GmbH
 http://www.indoqa.com/en/people/reinhard.poetz/

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member  reinh...@apache.org


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: cocoon3 block deployment

2009-11-10 Thread Jos Snellings
Thank you for the answer, Rheinhard,

I am afraid it does not. The web.xml I am using is from the cocoon
sample, and it contains all the necessary listeners. In the log file I
find startup information, but then it does not find the block.
By the way, if one expands the block's jar file under WEB-INF/classes, 
so that we have:
   WEB-INF/classes/COB-INF
   WEB-INF/classes/META-INF
it should be found, no?

Jos

On Tue, 2009-11-10 at 14:48 +0100, Reinhard Pötz wrote:
 Jos Snellings wrote:
  Hi,
  
  When trying to deploy a cocoon-3 block to Tomcat, it does not seem to
  find it: 
  java.lang.RuntimeException: There is no block 'YourBlockName' deployed.
  The available blocks are {}.
  
  I must say that the documentation on this issue is a little bit terse...
  (http://cocoon.apache.org/subprojects/block-deployment/1.1/1471_1_1.html)
  
 From what I understand: 
  - pack block in a .jar file
  - add a line to the manifest file META-INF/MANIFEST.MF :
Cocoon-Block-Name: YourBlockName
(yes it ends with a newline)
  - place .jar in lib directory of webapp
  
  Can anybody shed some light on this issue, please?
 
 In order to use a Cocoon *block*, you also have to install the
 BlockDeploymentServletContextListener in your web.xml:
 
 listener
 listener-classorg.apache.cocoon.blockdeployment.BlockDeploymentServletContextListener/listener-class
 /listener
 
 
 
 If the block provides servlet-services, you have to use the
 DispatcherServlet of the servlet-service-framework which collects and
 mounts all servlets that are registered as Spring beans.
 
 servlet
   descriptionCocoon blocks dispatcher/description
   display-nameDispatcherServlet/display-name
   servlet-nameDispatcherServlet/servlet-name
 
 servlet-classorg.apache.cocoon.servletservice.DispatcherServlet/servlet-class
   load-on-startup1/load-on-startup
 /servlet
 servlet-mapping
   servlet-nameDispatcherServlet/servlet-name
   url-pattern/*/url-pattern
 /servlet-mapping
 
 
 
 And of course you have to properly setup Spring:
 
 !--
 Declare Spring context listener which sets up the Spring Application
 Context containing all Cocoon components (and user defined beans as
 well).
 --
 listener
 listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
 /listener
 
 !--
 Declare Spring request listener which sets up the required
 RequestAttributes to support Springs and Cocoon custom bean scopes
 like the request scope or the session scope.
 --
 listener
 listener-classorg.springframework.web.context.request.RequestContextListener/listener-class
 /listener
 
 
 Does this answer your question?
 


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: cocoon3 block deployment

2009-11-10 Thread Jos Snellings
Yet something is missing, logging at debuglevel: 
At startup, none of the methods in DeploymentUtil is ever called :-(

When a block's url is called it is not found:
2009-11-10 15:37:10,139 DEBUG main org.apache.jasper.servlet.JspServlet
- Scratch dir for the JSP engine
is: /usr/local/apache-tomcat-5.5.27/work/Catalina/localhost/testcocoon
2009-11-10 15:37:10,140 DEBUG main org.apache.jasper.servlet.JspServlet
- IMPORTANT: Do not modify the generated servlets
2009-11-10 15:37:46,378 DEBUG http-8080-Processor25
org.springframework.web.context.request.RequestContextListener - Bound
request context to thread:
org.apache.catalina.connector.requestfac...@1480773
2009-11-10 15:37:46,402 DEBUG http-8080-Processor25
org.springframework.beans.factory.support.DefaultListableBeanFactory -
Returning cached instance of singleton bean
'org.apache.cocoon.servletservice.spring.BlockServletMap'
2009-11-10 15:37:46,421 DEBUG http-8080-Processor25
org.springframework.beans.factory.support.DefaultListableBeanFactory -
Returning cached instance of singleton bean
'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0'
2009-11-10 15:37:46,429 INFO  http-8080-Processor25
org.apache.cocoon.servletservice.DispatcherServlet - No block for /
2009-11-10 15:37:46,429 DEBUG http-8080-Processor25
org.springframework.web.context.request.RequestContextListener - Cleared
thread-bound request context:
org.apache.catalina.connector.requestfac...@1480773
2009-11-10 15:38:10,296 DEBUG
ContainerBackgroundProcessor[StandardEngine[Catalina]]
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1257863890296 sessioncount 0
2009-11-10 15:38:10,297 DEBUG
ContainerBackgroundProcessor[StandardEngine[Catalina]]
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 1 expired sessions: 0

And sorry for misspelling your name, Reinhard.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Samples for Cocoon 2.2

2009-11-10 Thread Peter Hargreaves
Hi Folks,

I've followed the 2.2 tutorials and eventually came to this comment To have a 
feel for the power of CForms, take a look at the examples included included 
in the Forms block.

I simply can't find out how to do this, I can't find out how to look at any 
samples under 2.2

Assuming I'm just blind - could someone please give me a link or explain how 
best to explore the samples/examples when starting with 2.2

Many thanks,
Peter.

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Samples for Cocoon 2.2

2009-11-10 Thread Dominic Mitchell
On Tue, Nov 10, 2009 at 7:19 PM, Peter Hargreaves pe...@pdh-online.infowrote:

 Hi Folks,

 I've followed the 2.2 tutorials and eventually came to this comment To
 have a
 feel for the power of CForms, take a look at the examples included included
 in the Forms block.

 I simply can't find out how to do this, I can't find out how to look at any
 samples under 2.2

 Assuming I'm just blind - could someone please give me a link or explain
 how
 best to explore the samples/examples when starting with 2.2


You have to download the cocoon 2.2 source code and build it yourself.  I
reckon that the easiest way to do so is to git clone git://
git.apache.org/cocoon.git and then ./build.sh  ./cocoon.sh.  That will
build, install and run the samples.

-Dom


Re: Samples for Cocoon 2.2

2009-11-10 Thread Kamal Bhatt




Hang on, when did Cocoon started being hosted on Git?  I was going to
make the same suggestion with SVN:

http://svn.apache.org/repos/asf/cocoon/tags/cocoon-2.2/cocoon-forms/cocoon-forms-1/cocoon-forms-sample/

Which is where the website says the code is.

  On Tue, Nov 10, 2009 at 7:19 PM, Peter
Hargreaves pe...@pdh-online.info
wrote:
  Hi
Folks,

I've followed the 2.2 tutorials and eventually came to this comment "To
have a
feel for the power of CForms, take a look at the examples included
included
in the Forms block."

I simply can't find out how to do this, I can't find out how to look at
any
samples under 2.2

Assuming I'm just blind - could someone please give me a link or
explain how
best to explore the samples/examples when starting with 2.2
  
  
  
  You have to download the cocoon 2.2 source code and build it
yourself.  I reckon that the easiest way to do so is to git clone
git://git.apache.org/cocoon.git
and then ./build.sh
 ./cocoon.sh.  That will build, install and run the
samples.
  
  
  -Dom
  
  



-- 
Kamal Bhatt




-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: cocoon3 block deployment

2009-11-10 Thread Reinhard Pötz
Jos Snellings wrote:
 Thank you for the answer, Rheinhard,
 
 I am afraid it does not. The web.xml I am using is from the cocoon
 sample, and it contains all the necessary listeners. In the log file I
 find startup information, but then it does not find the block.
 By the way, if one expands the block's jar file under WEB-INF/classes, 
 so that we have:
WEB-INF/classes/COB-INF
WEB-INF/classes/META-INF
 it should be found, no?

No, I don't think that this works.

What libraries do you have in your /WEB-INF/lib directory?

-- 
Reinhard Pötz   Managing Director, {Indoqa} GmbH
 http://www.indoqa.com/en/people/reinhard.poetz/

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member  reinh...@apache.org


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org