Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Compiling jsp

Il 14/02/2014 00:31, Jan Bartel ha scritto:
Andrea,

Can you explain your set up? How are you running jetty? From a
standard jetty distribution, or from embedded, or from the
jetty-maven-plugin?

Hi Jan,
my setup is as follows

1) Ubuntu 12.04 Server
2) Jetty download from website adn extracted to /usr/share/jetty
3) Jetty instances are started from upstart

Here the upstart script

##################################
stop on starting rc RUNLEVEL=[016]

umask 007
setuid someuser
setgid somegroup

instance $INST
kill signal KILL
respawn
respawn limit 100 10

script
    JAVA="/usr/lib/jvm/java-1.7.0-oracle/bin/java"
    JAVA_OPTIONS="-server -Xms256m -Xmx1024m -XX:+DisableExplicitGC"

    JETTY_HOME="/usr/local/jetty"
    JETTY_BASE="/var/jetty-instances-enabled/$INST"
    JETTY_OUTPUT="/var/logs/jetty-$INST.log"
    JETTY_OUTPUT2="/var/logs/jetty-$INST"

    JETTY_TMPDIR="/tmp"
    JETTY_START="$JETTY_HOME/start.jar"
    JETTY_STATE="$JETTY_BASE/${INST}.state"

    touch "$JETTY_OUTPUT"
    exec >> "$JETTY_OUTPUT"

    cd "$JETTY_BASE"

    if [ ! -r "$JETTY_START" ]
    then
echo "** ERROR: Oops! Jetty doesn't appear to be installed in $JETTY_HOME"
      echo "** ERROR:  $JETTY_START is not readable!"
      exit 1
    fi

    rm -f $JETTY_STATE
    [ ! -d $JETTY_OUTPUT2 ] && mkdir $JETTY_OUTPUT2
JAVA_OPTIONS="$JAVA_OPTIONS -Djetty.home=$JETTY_HOME -Djetty.base=$JETTY_BASE -Djava.io.tmpdir=$JETTY_TMPDIR"
    JAVA_OPTIONS="$JAVA_OPTIONS -Djetty.state=$JETTY_STATE"

exec $JAVA $JAVA_OPTIONS -jar "$JETTY_START" --start-log-file=$JETTY_OUTPUT --module=logging jetty.logs=$JETTY_OUTPUT2 --daemon 2>&1
end script

##################################

so I can do service jetty start INST=name

in the directory

/var/jetty-instaces-enabled/name I have

1) start.ini with options configured
2) etc/, with override of distribution xml
3) apps-enabled/, which contains the webapps
4) logs, lib,lib/ext, resources (I updated to jetty 9.1.2, it requires these directory to exists in jetty.base)

You should have these jars on the classpath:

This is java Java Environment:
-----------------
 java.home = /usr/lib/jvm/jdk1.7.0_45/jre
 java.vm.vendor = Oracle Corporation
 java.vm.version = 24.45-b08
 java.vm.name = Java HotSpot(TM) 64-Bit Server VM
 java.vm.info = mixed mode
 java.runtime.name = Java(TM) SE Runtime Environment
 java.runtime.version = 1.7.0_45-b18
 java.io.tmpdir = /tmp
 user.dir = /var/jetty-instances-enabled/test
 user.language = it
 user.country = IT

This is the classpath

 0:         (none specified) | /usr/lib/jvm/jdk1.7.0_45/lib/tools.jar
 1:                    (dir) | ${jetty.base}/resources
 2:                    3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
 3:                 3.1.0.M0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
4: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-http-9.1.2.v20140210.jar 5: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-server-9.1.2.v20140210.jar 6: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-xml-9.1.2.v20140210.jar 7: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-util-9.1.2.v20140210.jar 8: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-io-9.1.2.v20140210.jar 9: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-jndi-9.1.2.v20140210.jar 10: 1.4.1.v201005082020 | ${jetty.home}/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar 11: 1.2 | ${jetty.home}/lib/jndi/javax.transaction-api-1.2.jar 12: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-security-9.1.2.v20140210.jar 13: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-servlet-9.1.2.v20140210.jar
14:                    3.0.0 | ${jetty.home}/lib/jsp/javax.el-3.0.0.jar
15: 1.2.2 | ${jetty.home}/lib/jsp/javax.servlet.jsp.jstl-1.2.2.jar 16: 2.3.2 | ${jetty.home}/lib/jsp/javax.servlet.jsp-2.3.2.jar 17: 2.3.1 | ${jetty.home}/lib/jsp/javax.servlet.jsp-api-2.3.1.jar
18:                    2.3.3 | ${jetty.home}/lib/jsp/jetty-jsp-jdt-2.3.3.jar
19: 3.8.2.v20130121-145325 | ${jetty.home}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar 20: 1.2.0.v201105211821 | ${jetty.home}/lib/jsp/org.eclipse.jetty.orbit.javax.servlet.jsp.jstl-1.2.0.v201105211821.jar 21: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-plus-9.1.2.v20140210.jar 22: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-webapp-9.1.2.v20140210.jar 23: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-annotations-9.1.2.v20140210.jar
24:                      4.1 | ${jetty.home}/lib/annotations/asm-4.1.jar
25: 4.1 | ${jetty.home}/lib/annotations/asm-commons-4.1.jar 26: 1.2 | ${jetty.home}/lib/annotations/javax.annotation-api-1.2.jar 27: 9.1.2.v20140210 | ${jetty.home}/lib/jetty-deploy-9.1.2.v20140210.jar 28: 1.0 | ${jetty.home}/lib/websocket/javax.websocket-api-1.0.jar 29: 9.1.2.v20140210 | ${jetty.home}/lib/websocket/javax-websocket-client-impl-9.1.2.v20140210.jar 30: 9.1.2.v20140210 | ${jetty.home}/lib/websocket/javax-websocket-server-impl-9.1.2.v20140210.jar 31: 9.1.2.v20140210 | ${jetty.home}/lib/websocket/websocket-api-9.1.2.v20140210.jar 32: 9.1.2.v20140210 | ${jetty.home}/lib/websocket/websocket-client-9.1.2.v20140210.jar 33: 9.1.2.v20140210 | ${jetty.home}/lib/websocket/websocket-common-9.1.2.v20140210.jar 34: 9.1.2.v20140210 | ${jetty.home}/lib/websocket/websocket-server-9.1.2.v20140210.jar 35: 9.1.2.v20140210 | ${jetty.home}/lib/websocket/websocket-servlet-9.1.2.v20140210.jar


  javax.el-3.0.0.jar

present

  javax.servlet.jsp-2.3.2.jar

present

  javax.servlet.jsp-api-2.3.1.jar
present
  jetty-jsp-jdt-2.3.3.jar  (*** this one contains the jsp class that allows for compilation using jdt!)
present
org.eclipse.jdt.core-3.8.2.v20130121.jar
present

Your stack trace looks like it is falling back to using the ant
compiler, which is the last resort after trying the in-jvm compiler,
and the jdt compiler. So it looks like either the
jetty-jsp-jdt-2.3.3.jar or org.eclipse.jdt.core-3.8.2.v20130121.jar is
missing from the classpath.

The entry 0 (/usr/lib/jvm/jdk1.7.0_45/lib/tools.jar) is added through start.ini (with a --lib directive) and is the jar that actually works

This worked for me, but I'm just curious to understand why I'mnot able to compile using jetty capabilities

Thank you fr your help

--
Andrea Cappelli



Back to the top