[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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[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 Cook
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
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

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

blue182
Hello everyone,
As many others, I'm also facing the PWC6188-Error saying
> "http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application".
This is a quite common problem, however, I didn't make it to find a suitable solution.

First off, some background. We just migrated to Maven. Switching from a fat Tomcat web-server to an embedded Jetty 9 web-server.

Following, I already read this very usefull documentation: http://stackoverflow.com/tags/jstl/info
Regarding this doc, following might be useful...

**JSP - Taglib reference:**
> .<.%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%.>.

**web.xml header**

    <web-app
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://java.sun.com/xml/ns/javaee"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
        http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        id="YourWebAppID"
        version="2.5">

In conclusion, I need at least JSTL 1.1 and a servletcontainer with support for 2.5 Servlet specification.
*Thus, Jetty 9 with JSTL 1.2 might fit. <-- Really?*


Furthermore, I want to talk about building and deploying of the webapp.
Regarding this post:
> http://stackoverflow.com/questions/2151075/cannot-load-jstl-taglib-within-embedded-jetty-server

I might have some dependency issues. Here you can see all the dependencies defined in pom.xml of the web-application:

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
       
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
            <scope>provided</scope>
        </dependency>
       
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts-core</artifactId>
            <version>${struts.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts-taglib</artifactId>
            <version>${struts.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.3.1</version>
        </dependency>
       
       

       
       
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-webapp</artifactId>
            <version>${jetty.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

Running 'mvn jetty:run' works just fine. It also packages the war-file, containing the following libs:

    ls target/ROOT/WEB-INF/lib
        antlr-2.7.2.jar
        commons-beanutils-1.8.0.jar
        commons-chain-1.2.jar
        commons-digester-1.8.jar
        commons-fileupload-1.3.1.jar
        commons-io-2.2.jar
        commons-logging-1.0.4.jar
        commons-validator-1.3.1.jar
        oro-2.0.8.jar
For me, this looks just fine. All web-app related libs are packed inside war.
So, this war might not work properly in Tomcat web-server, thus the JSTL tag lib is not provided by the web-app. However, I'm going to use embedded Jetty 9... and here are all the dependencies defined in pom.xml from my server-container:

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${lib.log4j.version}</version>
        </dependency>
       
       

       
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
            <version>10.10.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-email</artifactId>
            <version>1.3.3</version>
        </dependency>

       
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-webapp</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-jsp</artifactId>
            <version>${jetty.version}</version>
        </dependency>
    </dependencies>

Because of licensing of some included libraries, I need to provide all jars as they are. Meaning, I might not extract and include classes to my resulting jar. Thus, my maven assembly creates a following structure:

    *prefix*
        /bin
        myexecute.sh (calls java -jar ${prefix}/lib/java/main_app.jar)
        /lib/java
        *.jar (all the jar files)


*prefix*/lib/java lists following libraries:

    ls
        activation-1.1.jar
        commons-email-1.3.3.jar
        derby-10.10.2.0.jar
        main_app.jar
        javax.el-3.0.0.jar
        javax.servlet-api-3.1.0.jar
        javax.servlet.jsp-2.3.2.jar
        javax.servlet.jsp-api-2.3.1.jar
        javax.servlet.jsp.jstl-1.2.0.v201105211821.jar
        javax.servlet.jsp.jstl-1.2.2.jar
        jetty-http-9.2.2.v20140723.jar
        jetty-io-9.2.2.v20140723.jar
        jetty-jsp-9.2.2.v20140723.jar
        jetty-schemas-3.1.M0.jar
        jetty-security-9.2.2.v20140723.jar
        jetty-server-9.2.2.v20140723.jar
        jetty-servlet-9.2.2.v20140723.jar
        jetty-util-9.2.2.v20140723.jar
        jetty-webapp-9.2.2.v20140723.jar
        jetty-xml-9.2.2.v20140723.jar
        log4j-1.2.17.jar
        mail-1.4.7.jar
        org.eclipse.jdt.core-3.8.2.v20130121.jar

The classpath inside the main_app.jar looks just fine. All necessary java libraries are listed and the application works properly. However, I can't access the web-app, because of the PWC6188.
Please notice, **There is no PWC6188-error, when running the application using eclipse or maven**. I set up the project using 'mvn eclipse:eclipse' btw.
Following, regarding this thread

> http://stackoverflow.com/questions/19448594/jetty-9-the-absolute-uri-http-java-sun-com-jsp-jstl-core-cannot-be-resolved

just jetty-webapp and jetty-jsp artifacts are required, to set up Jetty containerserver with JSP, JSTL, Servlet etc. support.


What else have I done? I read some useful info about Jetty class loading.
> http://www.eclipse.org/jetty/documentation/current/jetty-classloading.html
It states, that libraries defined in WEB-INF folder has a higher priority than libs from it's container server. However, even if I switch priority, I'm facing PWC6188. As mentioned here

> http://stackoverflow.com/questions/2151075/cannot-load-jstl-taglib-within-embedded-jetty-server

it might be a solution to set a classloader - I tried, without success.

Because of the fact, that the webapp runs properly using eclipse IDE, I took a deeper look on what it actually does. I figured that:
When I use eclipse to create a runnable jar ...
1) ... and choose to extract all dependencies in target jar (resulting to have just one jar), the webapp works well.
--> However, this conflicts with some licenses of dependencies. I might not extract and include object-code in resulting jar.
2) ... and choose to place dependencies as jar next to my resulting jar (leaving all depedencies as they are), I'm facing PWC6188-Error.



In conclusion, as you might notice, I tried a lot and got quite deep into all this JSTL lib. However, I can't manage to get rid of PWC6188 error. I bet it's something trivial, however, it might also be a major problem of Jetty 9.
Thus, I like to say thanks for any help!
Reply | Threaded
Open this post in threaded view
|

Re: 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

Jan Bartel-3
In reply to this post by James Cook
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 <[hidden email]> 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
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>



--
Jan Bartel <[hidden email]>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'
_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: 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

Jan Bartel-3
In reply to this post by blue182
blue182,

You've certainly done some delving :)

The list of jars you show don't look right to me - the jsp jars do not
appear to be the same as that from the jetty-9.2.2 distro in
lib/apache-jsp and lib/apache-jstl - make sure they're the same.

Also, you need to tell jetty which jars on the container's classpath
contain worthwhile stuff to look for - like tlds, annotations etc.
Both the standard distro and the jetty-maven-plugin set the context
attribute named
'org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern' to do
this. Here's what the etc/jetty-deploy.xml sets it to for the distro
(note that the jstl .tld files are inside the file
lib/apache-jstl/org.apache.taglibs.taglibs-standard-impl-1.2.1.jar):

 <Call name="setContextAttribute">
     <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
      <Arg>.*/[^/]*servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$</Arg>
 </Call>

By default, this isn't set to anything, so in your embedded code, you
need to set it. Don't forget you'll need to escape the \ in java.

regards,
Jan



On 31 July 2014 18:55, blue182 <[hidden email]> wrote:

> Hello everyone,
> As many others, I'm also facing the PWC6188-Error saying
>> "http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or
>> the jar files deployed with this application".
> This is a quite common problem, however, I didn't make it to find a suitable
> solution.
>
> First off, some background. We just migrated to Maven. Switching from a fat
> Tomcat web-server to an embedded Jetty 9 web-server.
>
> Following, I already read this very usefull documentation:
> http://stackoverflow.com/tags/jstl/info
> Regarding this doc, following might be useful...
>
> **JSP - Taglib reference:**
>> .<.%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%.>.
>
> **web.xml header**
>
>     <web-app
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xmlns="http://java.sun.com/xml/ns/javaee"
>         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>         http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>         id="YourWebAppID"
>         version="2.5">
>
> In conclusion, I need at least JSTL 1.1 and a servletcontainer with support
> for 2.5 Servlet specification.
> *Thus, Jetty 9 with JSTL 1.2 might fit. <-- Really?*
>
>
> Furthermore, I want to talk about building and deploying of the webapp.
> Regarding this post:
>> http://stackoverflow.com/questions/2151075/cannot-load-jstl-taglib-within-embedded-jetty-server
>
> I might have some dependency issues. Here you can see all the dependencies
> defined in pom.xml of the web-application:
>
>     <dependencies>
>         <dependency>
>             <groupId>junit</groupId>
>             <artifactId>junit</artifactId>
>             <version>3.8.1</version>
>             <scope>test</scope>
>         </dependency>
>
>         <dependency>
>             <groupId>log4j</groupId>
>             <artifactId>log4j</artifactId>
>             <version>${log4j.version}</version>
>             <scope>provided</scope>
>         </dependency>
>
>         <dependency>
>             <groupId>org.apache.struts</groupId>
>             <artifactId>struts-core</artifactId>
>             <version>${struts.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.struts</groupId>
>             <artifactId>struts-taglib</artifactId>
>             <version>${struts.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>commons-fileupload</groupId>
>             <artifactId>commons-fileupload</artifactId>
>             <version>1.3.1</version>
>         </dependency>
>
>
>
>
>
>         <dependency>
>             <groupId>org.eclipse.jetty</groupId>
>             <artifactId>jetty-webapp</artifactId>
>             <version>${jetty.version}</version>
>             <scope>provided</scope>
>         </dependency>
>         <dependency>
>             <groupId>javax.servlet</groupId>
>             <artifactId>jsp-api</artifactId>
>             <version>2.0</version>
>             <scope>provided</scope>
>         </dependency>
>     </dependencies>
>
> Running 'mvn jetty:run' works just fine. It also packages the war-file,
> containing the following libs:
>
>     ls target/ROOT/WEB-INF/lib
>         antlr-2.7.2.jar
>         commons-beanutils-1.8.0.jar
>         commons-chain-1.2.jar
>         commons-digester-1.8.jar
>         commons-fileupload-1.3.1.jar
>         commons-io-2.2.jar
>         commons-logging-1.0.4.jar
>         commons-validator-1.3.1.jar
>         oro-2.0.8.jar
> For me, this looks just fine. All web-app related libs are packed inside
> war.
> So, this war might not work properly in Tomcat web-server, thus the JSTL tag
> lib is not provided by the web-app. However, I'm going to use embedded Jetty
> 9... and here are all the dependencies defined in pom.xml from my
> server-container:
>
>     <dependencies>
>         <dependency>
>             <groupId>junit</groupId>
>             <artifactId>junit</artifactId>
>             <version>3.8.1</version>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>log4j</groupId>
>             <artifactId>log4j</artifactId>
>             <version>${lib.log4j.version}</version>
>         </dependency>
>
>
>
>
>         <dependency>
>             <groupId>javax.mail</groupId>
>             <artifactId>mail</artifactId>
>             <version>1.4.7</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.derby</groupId>
>             <artifactId>derby</artifactId>
>             <version>10.10.2.0</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.commons</groupId>
>             <artifactId>commons-email</artifactId>
>             <version>1.3.3</version>
>         </dependency>
>
>
>         <dependency>
>             <groupId>org.eclipse.jetty</groupId>
>             <artifactId>jetty-webapp</artifactId>
>             <version>${jetty.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.eclipse.jetty</groupId>
>             <artifactId>jetty-jsp</artifactId>
>             <version>${jetty.version}</version>
>         </dependency>
>     </dependencies>
>
> Because of licensing of some included libraries, I need to provide all jars
> as they are. Meaning, I might not extract and include classes to my
> resulting jar. Thus, my maven assembly creates a following structure:
>
>     *prefix*
>         /bin
>         myexecute.sh (calls java -jar ${prefix}/lib/java/main_app.jar)
>         /lib/java
>         *.jar (all the jar files)
>
>
> *prefix*/lib/java lists following libraries:
>
>     ls
>         activation-1.1.jar
>         commons-email-1.3.3.jar
>         derby-10.10.2.0.jar
>         main_app.jar
>         javax.el-3.0.0.jar
>         javax.servlet-api-3.1.0.jar
>         javax.servlet.jsp-2.3.2.jar
>         javax.servlet.jsp-api-2.3.1.jar
>         javax.servlet.jsp.jstl-1.2.0.v201105211821.jar
>         javax.servlet.jsp.jstl-1.2.2.jar
>         jetty-http-9.2.2.v20140723.jar
>         jetty-io-9.2.2.v20140723.jar
>         jetty-jsp-9.2.2.v20140723.jar
>         jetty-schemas-3.1.M0.jar
>         jetty-security-9.2.2.v20140723.jar
>         jetty-server-9.2.2.v20140723.jar
>         jetty-servlet-9.2.2.v20140723.jar
>         jetty-util-9.2.2.v20140723.jar
>         jetty-webapp-9.2.2.v20140723.jar
>         jetty-xml-9.2.2.v20140723.jar
>         log4j-1.2.17.jar
>         mail-1.4.7.jar
>         org.eclipse.jdt.core-3.8.2.v20130121.jar
>
> The classpath inside the main_app.jar looks just fine. All necessary java
> libraries are listed and the application works properly. However, I can't
> access the web-app, because of the PWC6188.
> Please notice, **There is no PWC6188-error, when running the application
> using eclipse or maven**. I set up the project using 'mvn eclipse:eclipse'
> btw.
> Following, regarding this thread
>
>> http://stackoverflow.com/questions/19448594/jetty-9-the-absolute-uri-http-java-sun-com-jsp-jstl-core-cannot-be-resolved
>
> just jetty-webapp and jetty-jsp artifacts are required, to set up Jetty
> containerserver with JSP, JSTL, Servlet etc. support.
>
>
> What else have I done? I read some useful info about Jetty class loading.
>> http://www.eclipse.org/jetty/documentation/current/jetty-classloading.html
> It states, that libraries defined in WEB-INF folder has a higher priority
> than libs from it's container server. However, even if I switch priority,
> I'm facing PWC6188. As mentioned here
>
>> http://stackoverflow.com/questions/2151075/cannot-load-jstl-taglib-within-embedded-jetty-server
>
> it might be a solution to set a classloader - I tried, without success.
>
> Because of the fact, that the webapp runs properly using eclipse IDE, I took
> a deeper look on what it actually does. I figured that:
> When I use eclipse to create a runnable jar ...
> 1) ... and choose to extract all dependencies in target jar (resulting to
> have just one jar), the webapp works well.
> --> However, this conflicts with some licenses of dependencies. I might not
> extract and include object-code in resulting jar.
> 2) ... and choose to place dependencies as jar next to my resulting jar
> (leaving all depedencies as they are), I'm facing PWC6188-Error.
>
>
>
> In conclusion, as you might notice, I tried a lot and got quite deep into
> all this JSTL lib. However, I can't manage to get rid of PWC6188 error. I
> bet it's something trivial, however, it might also be a major problem of
> Jetty 9.
> Thus, I like to say thanks for any help!
>
>
>
> --
> View this message in context: http://jetty.4.x6.nabble.com/jetty-users-Embedded-Jetty-9-JSTL-The-absolute-uri-http-java-sun-com-jsp-jstl-core-cannot-be-resolven-tp4961067p4962870.html
> Sent from the Jetty User mailing list archive at Nabble.com.
> _______________________________________________
> jetty-users mailing list
> [hidden email]
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users



--
Jan Bartel <[hidden email]>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'
_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users