Jetty 9 “--module” instead of “OPTIONS”

前提是你 提交于 2019-12-11 09:28:00

问题


I am trying to switch Jetty from 7.6 to 9.2.

I read and understood that "OPTION" will no more work. So I changed my command from

java -jar start.jar --ini **OPTIONS**=server,jmx,resources,websocket,ext,plus,jsp,annotations /u/khandela/project/base//etc/config/cometd/cometd_jetty_config.xml

to

start.jar --ini **--module**=server,jmx,resources,websocket,ext,plus,jsp,annotations /u/khandela/project/base//etc/config/cometd/cometd_jetty_config.xml

But I got below warning:

WARNING: ** Unable to continue, required dependency missing. [jsp-impl/${jsp-impl}-jsp] WARNING: ** As configured, Jetty is unable to start due to a missing enabled module dependency. WARNING: ** This may be due to a transitive dependency akin to spdy on npn, which resolves based

How to resolve it ?


回答1:


The error you are seeing about [jsp-impl/${jsp-impl}-jsp] is because a default jsp implementation was not defined when you requested startup of Jetty.

Jetty 9.2.x has 2 different core JSP engines available.

  • apache - the Apache Jasper JSP engine (the new Jetty default)
  • glassfish - the Glassfish Jasper JSP engine (original version in use by Jetty. Now obsolete / buggy and deprecated)

The behavior in Jetty 9.2 was to force users to decide which implementation they want to use. This was a mistake and just confuses users that want to start jetty in their own way (ie: not using the start.ini or ${jetty.base} documented mechanisms)

A feature request was filed, and the next release of Jetty after 9.2.1 will apply defaults for this value. With autoselection for apache.

In the meantime, while you wait for Jetty 9.2.2 (or 9.3.0), add a property defining which jsp-impl you want to use.

$ start.jar --module=server,jmx,resources,websocket,ext,plus,jsp,annotations
     jsp-impl=apache
     /u/khandela/project/base/etc/config/cometd/cometd_jetty_config.xml

Note: get rid of --ini as that is not used by start.jar




回答2:


I had similar problem in Netbeans 8.0 to start Jetty 9.2.1. After creating JettyServer Jetty started, when I added into actual Jetty Base Locationin to start.ini jsp-impl=apache clause.

There is complete listing start.ini:

#===========================================================
# Jetty start.jar arguments
#
# The contents of this file, together with the *.ini
# files found in start.d directory are used to build
# the classpath and command line on a call to
#    java -jar start.jar [arg...]
#
# Use the following command to see more options
#    java -jar start.jar --help
#
# Each line in these files is prepended to the command line
# as arguments and may be either:
#  + A property like: name=value
#  + A module to enable like: --module=jmx
#  + An XML configuration file like: etc/jetty-feature.xml
#  + A start.jar option like: --dry-run
#
# If --exec or --dry-run are used, then this file may also 
# contain lines with:
#  + A JVM option like: -Xmx2000m 
#  + A System Property like: -Dcom.sun.management.jmxremote
#
# The --add-to-start=module option can be used to append
# a configuration template for a module to start.ini
# The --add-to-startd=module option can be used to create
# a configuration template for a module in start.d/module.ini
# For example configure and run with SPDY use
#
#   java -jar start.jar --add-to-startd=spdy
#   $EDITOR start.d/spdy.ini
#   java -jar start.jar
#   
#===========================================================


#
# Initialize module server
#
#--module=server
--module=server,websocket,jsp,ext,jmx,resources,plus,annotations,commandmanager
# removes bug
jsp-impl=apache
## Server Threading Configuration
# minimum number of threads
threads.min=10
# maximum number of threads
threads.max=200
# thread idle timeout in milliseconds
threads.timeout=60000
# What host to listen on (leave commented to listen on all interfaces)
#jetty.host=myhost.com
# Dump the state of the Jetty server, components, and webapps after startup
jetty.dump.start=false
# Dump the state of the Jetty server, before stop
jetty.dump.stop=false

#
# Initialize module deploy
#
--module=deploy

#
# Initialize module websocket
#
#--module=websocket

#
# Initialize module jsp
#
#--module=jsp
# JSP Configuration
# To use an non-jdk compiler for JSP compilation uncomment next line
# -Dorg.apache.jasper.compiler.disablejsr199=true

#
# Initialize module ext
#
#--module=ext

#
# Initialize module resources
#
#--module=resources

#--module=commandmanager

By comparing original start.ini file, you cas see differences.



来源:https://stackoverflow.com/questions/24524527/jetty-9-module-instead-of-options

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!