09 May 2009

Sun's JVM has an HTTP server embedded: com.sun.net.httpserver

Very useful ! Sun's Java Standard Edition has a simple HTTP Server: com.sun.net.httpserver.

It simplifies dependencies since you don't have to add a new library. It is straightforward to use it with Jersey to publish Restful Services. But it isn't a standard feature !

Eclipse users might see compile errors saying Access restriction: The type ... is not accessible due to restriction on required library ...
The problem is that the HTTP server is part of the Sun JRE6 but not part of standardized Java.
Eclipse therefore blocks access to it.
This can be fixed by going to the Window->Preferences window, selecting Java->Compiler->Errors/Warnings, selecting Deprecated and Restricted API and then changing the setting for Forbidden Reference and Discouraged Reference to Warning instead of Error.
Post a Comment

In 2018, there will be innovations, but no jobs

There will be innovations, but no jobs : Trends 2017: The disconnect between growth and employment (International Labour Organization - U...