Can't run jetty 9

Starting on a new computer. Downloaded jetty 9. Can't run. Tried various combinations of jetty.xml, jetty-jmx.xml etc. Don't really know what I need. Downloaded Jetty 8 and that works out of the box.

/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:57886,suspend=y,server=n -DSTOP.PORT=0 -Dcom.sun.management.jmxremote= -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -DOPTIONS=jmx -Dfile.encoding=UTF-8 -classpath "start.jar:/Applications/IntelliJ IDEA 12.app/lib/idea_rt.jar" org.eclipse.jetty.start.Main etc/jetty-jmx.xml etc/jetty-debug.xml etc/jetty-deploy.xml etc/jetty-http.xml etc/jetty.xml /private/var/folders/23/4wglf_dj07q4kzgvs0872gth8cljyd/T/context8783342856028245761config/jetty-contexts.xml
Detected server http port: 80
Connected to the target VM, address: '127.0.0.1:57886', transport: 'socket'
[2013-11-23 08:14:27,358] Artifact dhap-dm-ui-web:war exploded: Server is not connected. Deploy is not available.
[2013-11-23 08:14:27,359] Artifact static-shared:Web exploded: Server is not connected. Deploy is not available.
2013-11-23 08:14:27.790:WARN:oejx.XmlConfiguration:main: Config error at <Call name="addBean"><Arg>|      <New id="MBeanContainer" ><Arg>|          <Ref refid="MBeanServer"/>|        </Arg></New>|    </Arg></Call> java.lang.ClassNotFoundException: org.eclipse.jetty.jmx.MBeanContainer in file:/Users/briantj/dev/thirdparty/jetty-distribution-9.1.0.v20131115/etc/jetty-jmx.xml
java.lang.reflect.InvocationTargetException
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:606)
     at org.eclipse.jetty.start.Main.invokeMain(Main.java:297)
     at org.eclipse.jetty.start.Main.start(Main.java:706)
     at org.eclipse.jetty.start.Main.main(Main.java:103)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.jmx.MBeanContainer
     at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
     at org.eclipse.jetty.util.Loader.loadClass(Loader.java:86)
     at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:364)
     at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:754)
     at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1125)
     at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1030)
     at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:721)
     at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:417)
     at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:354)
     at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:262)
     at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1238)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1174)
Disconnected from the target VM, address: '127.0.0.1:57886', transport: 'socket'
     ... 7 more

Usage: java -jar start.jar [options] [properties] [configs]
       java -jar start.jar --help  # for more information
Disconnected from server

1 comment

I think this post may come in handy: http://stackoverflow.com/questions/20646938/jetty-options-all-migration-to-jetty-9-modules

Basically you need to generate a new start.ini file for Jetty 9. It has a new syntax for module loading and the default packaging you get from homebrew is not very helpful.

You can add the modules you want manually to the start.ini;

I for added these to my default start.ini:

--module=jmx

--module=websocket

--module=jsp

--module=http

--module=webapp

Or you can generate a new start.ini file like this (create a base of your own and run this from that folder). Just remove any modules you don't need:

java -jar ../start.jar --add-to-start=ext,resources,jsp,continuation,rewrite,proxy,monitor,stats,ipaccess,jmx,requestlog,logging,https,http,webapp,annotations,websocket,spdy
0

Please sign in to leave a comment.