Guest User

Untitled

a guest
May 26th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. @Grapes([
  2. @Grab(group='org.slf4j', module='slf4j-api', version='1.7.25'),
  3. @Grab(group='com.sparkjava', module='spark-core', version='2.7.2'),
  4. @Grab(group='javax.xml.bind', module='jaxb-api', version='2.3.0'),
  5. @Grab(group='com.sun.xml.bind', module='jaxb-core', version='2.3.0'),
  6. @Grab(group='com.sun.xml.bind', module='jaxb-impl', version='2.3.0')
  7. ])
  8. import groovy.json.JsonOutput
  9. import groovy.json.JsonSlurper
  10. import groovy.util.logging.Slf4j
  11. import org.apache.commons.lang3.exception.ExceptionUtils
  12. import spark.Route
  13. import static spark.Spark.*
  14.  
  15. @Slf4j
  16. class Server {
  17. public static void main(String[] args) {
  18. int serverPort = args.length > 0 ? args[0].toInteger() : 1001
  19. log.info("start server at $serverPort ... ")
  20. port(serverPort)
  21.  
  22. get("/hello", { req, rep -> "world" })
  23. }
  24. }
  25.  
  26. WARNING: An illegal reflective access operation has occurred
  27. WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/opt/groovy-2.5.0-rc-3/lib/groovy-2.5.0-rc-3.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
  28. WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
  29. WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
  30. WARNING: All illegal access operations will be denied in a future release
  31. Caught: java.lang.NoClassDefFoundError: Unable to load class groovy.xml.jaxb.JaxbGroovyMethods due to missing dependency javax/xml/bind/JAXBContext
  32. java.lang.NoClassDefFoundError: Unable to load class groovy.xml.jaxb.JaxbGroovyMethods due to missing dependency javax/xml/bind/JAXBContext
  33. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  34. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  35. at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Add Comment
Please, Sign In to add comment