cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <robby.pelss...@ciber.com>
Subject RE: tutorial example work with jetty but not on tomcat6
Date Mon, 08 Mar 2010 13:04:46 GMT
Hi Jens,

I did not find anything peculiar right away but I can tell you that I specify the versions
of the project/block dependendies in the parent pom.  This ensures I use the same versions
over my modules and whenever I want to upgrade to a new version I only need to do it in the
parent pom.

Another question... do you use the cocoon-spring-configurator?  If so... don't forget to specify
the java parameter -Dorg.apache.cocoon.mode=xxxx for your tomcat instance.

Cheers,
Robby

E.g.:

<?xml version="1.0" encoding="UTF-8"?>
<project 
  xmlns="http://maven.apache.org/POM/4.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <packaging>pom</packaging>
  
  <groupId>com.nxp.spider2</groupId>
  <artifactId>productinformationparent</artifactId>
  <version>1.0-SNAPSHOT</version>
  
  <name>Productinformation parent pom</name>
  
  <modules>
    <module>../productinformationwebapp</module>
    <module>../flyers</module>
    <module>../productpreview</module>
    <module>../producttransformer</module>
    <module>../intranet</module>    
    <module>../shared</module>
    <module>../parametricsearch</module>
    <module>../datasheet</module>                
  </modules>

  <dependencyManagement>
    <dependencies>
      <!--  Apache Cocoon dependencies -->
      <dependency>
        <groupId>org.apache.cocoon</groupId>
        <artifactId>cocoon-core</artifactId>
        <version>2.2.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.cocoon</groupId>
        <artifactId>cocoon-servlet-service-components</artifactId>
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.cocoon</groupId>
        <artifactId>cocoon-template-impl</artifactId>
        <version>1.1.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.cocoon</groupId>
        <artifactId>cocoon-flowscript-impl</artifactId>
        <version>1.0.0</version>
      </dependency>    
      <dependency>
        <groupId>org.apache.cocoon</groupId>
        <artifactId>cocoon-forms-impl</artifactId>
        <version>1.1.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.cocoon</groupId>
        <artifactId>cocoon-html-impl</artifactId>
        <version>1.0.0</version>
      </dependency>       
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>net.sf.saxon</groupId>
        <artifactId>saxon</artifactId>
        <version>8.7</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.3.1</version>
      </dependency>    
          
     <!-- utility libraries --> 
     <dependency>
	   <groupId>commons-lang</groupId>
	   <artifactId>commons-lang</artifactId>
	   <version>2.4</version>
	 </dependency>      
      
	  <!-- test dependencies -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.4</version>
        <!-- <scope>test</scope> -->
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>2.5.5</version>
        <scope>test</scope>		
      </dependency>
    </dependencies>
  </dependencyManagement>
  
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
  
  <profiles>
    <profile>
      <id>dev</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>	  
      <build>
        <finalName>productinformation</finalName>
      </build>
    </profile>
  </profiles>
  
</project>

-----Original Message-----
From: Jens Reufsteck [mailto:jens.reufsteck@staufenbiel.de] 
Sent: Monday, March 08, 2010 1:41 PM
To: users@cocoon.apache.org
Subject: RE: tutorial example work with jetty but not on tomcat6

> Maybe you can copy paste your dependencies and also the relevant snippets from your
> block-servlet-service.xml?
> 

This is the parent pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

        <modelVersion>4.0.0</modelVersion>
        <packaging>pom</packaging>

        <groupId>gti.ffm</groupId>
        <artifactId>getting-started</artifactId>
        <version>1.0.0</version>

        <name>Getting started</name>

        <modules>
                <module>testApp</module>
                <module>samples</module>
        </modules>
</project>

These are the dependencies of the webapps pom.xml

  <dependencies>
    <dependency>
      <groupId>gti.ffm</groupId>
      <artifactId>samples</artifactId>
      <version>1.0.0</version>
    </dependency>
  </dependencies>

And these are the dependencies in the pom.xml of the first (and only) block:

  <dependencies>
    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-core</artifactId>
      <version>2.2.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-servlet-service-components</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-template-impl</artifactId>
      <version>1.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-flowscript-impl</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.4</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

And here is the block-servlet-service.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:servlet="http://cocoon.apache.org/schema/servlet"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                           http://cocoon.apache.org/schema/servlet http://cocoon.apache.org/schema/servlet/cocoon-servlet-1.0.xsd">

  <bean name="gti.ffm.samples.service" class="org.apache.cocoon.sitemap.SitemapServlet">
    <servlet:context mount-path="/samples" context-path="blockcontext:/samples/"/>
  </bean>

</beans>

Apart from the parent pom and the dependency in the webapps pom everything is just as it came
out of the archetypes.

Many thanks!
Jens




> Kind regards,
> Robby Pelssers
> 
> -----Original Message-----
> From: Jens Reufsteck [mailto:jens.reufsteck@staufenbiel.de]
> Sent: Monday, March 08, 2010 11:54 AM
> To: users@cocoon.apache.org; Jens Reufsteck
> Subject: RE: tutorial example work with jetty but not on tomcat6
> 
> I tried to dig deeper into the problem, but I'm really stuck.
> 
> Am Donnerstag, 4. März 2010 14:58:41 schrieben Sie:
> > I've just started with Cocoon 2.2 (after using Cocoon 2.1 successfully for
> > many years).
> >
> > I'm following the tutorials, i.e. I'm using mvn (2.2.1) having installed
> >  the webapp plus an example block.
> >
> > Everything's fine with jetty (mvn jetty:run out of the webapp directory).
> >  On tomcat I'm getting the following Exception:
> >
> 
> What I found is:
> 
> Everything works fine without flowscript. As soon as I've got the map:flow
> element in the sitemap, I get the error message as passed earlier.
> 
> > 2010-03-04 13:50:30,826 ERROR http-8080-1 cocoon.access - Internal Cocoon
> > Problem
> > org.apache.avalon.framework.service.ServiceException: Exception during
> >  lookup of component with
> >  'org.apache.cocoon.components.flow.Interpreter/javascript'.
> >  (Key='AvalonServiceManager')
> >         at
> > org.apache.cocoon.core.container.spring.avalon.AvalonServiceManager.lookup(
> > AvalonServiceManager.java:63)
> >
> > ...
> >
> > Caused by: org.springframework.beans.factory.BeanCreationException: Error
> > creating bean with name
> > 'org.apache.cocoon.components.flow.Interpreter/javascript': Initialization
> >  of bean failed; nested exception is
> > org.springframework.beans.factory.BeanCreationException: Unable to
> >  initialize Avalon component with role
> > org.apache.cocoon.components.flow.Interpreter/javascript; nested exception
> >  is java.lang.NullPointerException
> >         at
> > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactor
> > y.doCreateBean(AbstractAutowireCapableBeanFactory.java:445)
> >
> > ...
> 
> The catalina.out log says:
> 
> FATAL Servlet.service() for servlet DispatcherServlet threw exception
> java.lang.NullPointerException
> 
> 
> And when starting tomcat I find the following in the logs:
> 
> INFO  2010-03-08 09:49:32,776 [main]
> org.springframework.web.context.support.XmlWebApplicationContext - Bean
> 'org.apache.avalon.framework.context.Context' is not eligible for getting
> processed by all BeanPostProcessors (for example: not eligible for auto-
> proxying)
> INFO  2010-03-08 09:49:32,777 [main]
> org.springframework.web.context.support.XmlWebApplicationContext - Bean
> 'org.apache.avalon.framework.context.Context' is not eligible for getting
> processed by all BeanPostProcessors (for example: not eligible for auto-
> proxying)
> INFO  2010-03-08 09:49:32,778 [main]
> org.springframework.web.context.support.XmlWebApplicationContext - Bean
> 'org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo' is not
> eligible for getting processed by all BeanPostProcessors (for example: not
> eligible for auto-proxying)
> INFO  2010-03-08 09:49:32,778 [main]
> org.springframework.web.context.support.XmlWebApplicationContext - Bean
> 'org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo' is not
> eligible for getting processed by all BeanPostProcessors (for example: not
> eligible for auto-proxying)
> 
> No idea, if this is related.
> 
> Sorry, I'm new to Cocoon 2.2, I'm newbie with maven, i'm newbie with spring,
> and I'm not expert with tomcat.
> 
> Any help is much appreciated!
> Jens Reufsteck
> 
> --
> Jens Reufsteck
> Marketing & Online Director
> 
> Staufenbiel GmbH
> Events & Recruiting Solutions
> (bisher Hobsons GmbH)
> 
> Wildunger Straße 6, 60487 Frankfurt am Main
> www.staufenbiel.de www.hobsons.de www.groupgti.com
> 
> Tel.:  +49 (069) 25537-140
> Fax:   +49 (069) 25537-2140
> 
> 
> Geschäftsführer: Judith Oppitz, Birgit Giesen, Graham Storey, Martin Halliday
> Amtsgericht Frankfurt HRB 58610
> 
> Internet communications are not secure and therefore Staufenbiel GmbH does not accept
> legal responsibility
> for the contents of this message. Any views or opinions presented are solely those of
the
> author and do not
> necessarily represent those of Staufenbiel GmbH unless otherwise specifically stated.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org



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

Mime
View raw message