Module CSC7321—CSN: Middleware and software architecture for Internet distributed applications

Portail informatique

Aides REST


  • If you get an error Address NOPORT already in use, it means a process is listening on this port. To obtain the PID of this process you can use the command lsof:
    lsof -n -i :NOPORT
    Then you can kill this process
    kill -9 THISPID

Get the REST operations URL and more generally logs

  • To debug your REST clients and servers it may be helpfull to see the complete URLs. For this purpose you can use the logging.
    1. In src/main/resourses, add a logging property file
      # log to System.err handlers=java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=FINEST java.util.logging.SimpleFormatter.format=%4$-7s [%3$s] %5$s%6$s%n #All log level details .level=FINE org.glassfish.jersey.level=FINE org.glassfish.jersey.tracing.level=FINE
    2. Execute your client/server with the logging file path : mvn exec:java@client -Djava.util.logging.config.file=src/main/resources/

Some links




$Date: 2018-03-07 16:01:11 +0100 (mer. 07 mars 2018) $