[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] Embedded Jetty 9 + JSTL = The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
|
James,
Prior to 9.2, jetty used the jsp impl from glassfish. This impl
requires that the jstl jars are on the server's classpath - ie on the
parent of the webapp's classloader. So putting the jstl jar into
WEB-INF/lib will not work. Neither can the jstl jar be unpacked onto
the classpath - it must appear as a jar. So you need to modify the way
you're setting up your executable jar to ensure that the jar
containing the jstl .tlds is found on a classloader that is the parent
of the webapp.
Also, just to be sure you've got the right mix of jetty, jsp and jstl
jars: run the jetty-maven-plugin with -X argument, and you'll see the
list of jars that plugin has on its classpath (ie the server
classpath) as compared with the webapp dependency jars (the virtual
'WEB-INF/lib'). Compare the plugin classpath jars to the ones you are
using with your executable jar.
regards
Jan
On 16 August 2013 19:40, James Cook <james@xxxxxxxxxxx> wrote:
> Hi Everyone,
>
> I am currently looking at upgraded from Jetty 7 to Jetty 9 and I am stuck on
> the JSTL tags. I have scoured the internet and can see various solutions,
> ultimately come back to getting the jstl jar into the web-inf folder and all
> is well. However that doesn't appear to work for me.
>
> This is how I am building (Via Maven) my self-executing WAR:
>
> <profile>
> <id>Jetty_9</id>
> <properties>
> <jetty9.version>9.0.4.v20130625</jetty9.version>
> </properties>
> <dependencies>
> <dependency>
> <groupId>ch.qos.logback</groupId>
> <artifactId>logback-classic</artifactId>
> <version>${logback.version}</version>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>ch.qos.logback</groupId>
> <artifactId>logback-access</artifactId>
> <version>${logback.version}</version>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>ch.qos.logback</groupId>
> <artifactId>logback-core</artifactId>
> <version>${logback.version}</version>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.slf4j</groupId>
> <artifactId>slf4j-api</artifactId>
> <version>${slf4j.version}</version>
> <scope>provided</scope>
> </dependency>
>
> <dependency>
> <groupId>org.eclipse.jetty.orbit</groupId>
> <artifactId>javax.servlet</artifactId>
> <version>3.0.0.v201112011016</version>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.eclipse.jetty</groupId>
> <artifactId>jetty-webapp</artifactId>
> <version>${jetty9.version}</version>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.eclipse.jetty</groupId>
> <artifactId>jetty-plus</artifactId>
> <version>${jetty9.version}</version>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.eclipse.jetty</groupId>
> <artifactId>jetty-jsp</artifactId>
> <version>${jetty9.version}</version>
> </dependency>
> </dependencies>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>2.3.2</version>
> <configuration>
> <source>${compileSource}</source>
> <target>${compileSource}</target>
> </configuration>
> </plugin>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-antrun-plugin</artifactId>
> <version>1.7</version>
> <executions>
> <execution>
> <id>main-class-placement</id>
> <phase>prepare-package</phase>
> <configuration>
> <target>
> <move
> todir="${project.build.directory}/${project.build.finalName}/">
> <fileset
> dir="${project.build.directory}/classes/">
> <include name="Main.class"/>
> </fileset>
> </move>
> </target>
> </configuration>
> <goals>
> <goal>run</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-dependency-plugin</artifactId>
> <version>2.6</version>
> <executions>
> <execution>
> <id>jetty-classpath</id>
> <phase>prepare-package</phase>
> <goals>
> <goal>unpack-dependencies</goal>
> </goals>
> <configuration>
> <includeGroupIds>
> org.eclipse.jetty,org.slf4j,ch.qos
> </includeGroupIds>
> <includeScope>provided</includeScope>
> <excludes>META-INF/*</excludes>
> <outputDirectory>
>
> ${project.build.directory}/${project.build.finalName}
> </outputDirectory>
> </configuration>
> </execution>
> </executions>
> </plugin>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-war-plugin</artifactId>
> <version>2.3</version>
> <configuration>
> <archive>
> <manifest>
> <mainClass>Main</mainClass>
> </manifest>
> </archive>
> </configuration>
> <executions>
> <execution>
> <id>default-war</id>
> <phase>package</phase>
> <goals>
> <goal>war</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> </profile>
>
> I also have:
>
> <profile>
> <id>Jetty_9_Plugin</id>
> <properties>
> <jetty9.version>9.0.4.v20130625</jetty9.version>
> </properties>
> <dependencies>
> <dependency>
> <groupId>org.eclipse.jetty.orbit</groupId>
> <artifactId>javax.servlet</artifactId>
> <version>3.0.0.v201112011016</version>
> <scope>provided</scope>
> </dependency>
> </dependencies>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>2.3.2</version>
> <configuration>
> <excludes>
> <exclude>Main.java</exclude>
> </excludes>
> <source>${compileSource}</source>
> <target>${compileSource}</target>
> </configuration>
> </plugin>
> <plugin>
> <groupId>org.eclipse.jetty</groupId>
> <artifactId>jetty-maven-plugin</artifactId>
> <version>${jetty9.version}</version>
> <configuration>
> <webAppConfig>
>
> <descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
>
> <jettyEnvXml>${server.environment.location}</jettyEnvXml>
> </webAppConfig>
> <systemProperties>
> <systemProperty>
> <name>logback.configurationFile</name>
>
> <value>${logback.configurationFile}</value>
> </systemProperty>
> </systemProperties>
> </configuration>
> </plugin>
> </plugins>
> </build>
> </profile>
>
> which runs as expected with the mvn jetty:run command.
>
> Any suggestions would be greatly welcome.
>
> Cheers
>
> James
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
--
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'