Hi
I have a webapp that is using JSP 2.1, Servlets 2.5 and JSTL 1.2 on Java 6. I do my testing using the maven-jetty-plugin 6.1.1rc1 without any problems. From this link: http://docs.codehaus.org/display/JETTY/JSP+2.0+v+JSP+2.1, I understand that jetty 6 will select JSP 2.1 if on JDK 5+, which is working fine.
Here is the relevant section from my pom.xml of the application war:
<!--servlet & javax-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
Now I'd like to set up automated integration tests using cargo and jetty6x embedded. The container starts up fine without errors. However, I can't render any JSPs. This is the exception I get, which as far as I can tell is because a JSP-2.0 impl is being used instead of JSP-2.1.
(TagLibraryInfoImpl.java:547) - Unknown element (deferred-value) in attribute
and Caused by: java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
at org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(SetSupport.java:140)
Here is my cargo config:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.1</version>
<configuration>
<container>
<containerId>jetty6x</containerId>
<type>embedded</type>
</container>
<configuration>
<deployables>
<deployable>
<groupId>groupId</groupId>
<artifactId>artifact</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
<wait>${cargo.wait}</wait>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
The cargo jetty6x container also uses v6.1.1rc1 of jetty, so it must be something to do with the way cargo is using jetty. I know that cargo hard-codes the versions of its container dependencies instead of using the maven dependency mechanism (probably for good reason, jira ->CARGO-571)
So my question is: has anybody else managed to use JSP 2.1 with cargo and jetty 6x embedded? Any suggestions for getting it working?
Any help much appreciated!