what is java.io.EOFException, Message: Can not read response from server. Expected to read 4 bytes, read 0 bytes

The connection has failed, possibly due to a firewall idle-timeout, etc. If you don’t have your JDBC driver configured to reconnect on failure, then this error will not go away unless you open a new connection. If you are using a database connection pool (you are using one, right?), then you probably want to enable … Read more

Jetty, Tomcat, Nginx, Geronimo, Glassfish: I’m confused

Jetty and Tomcat are web-containers, while Geronimo, Glassfish and JBoss support the whole J2EE stack (more or less). And, tataaa, they use/include Tomcat or Jetty for web-containers. The most important part of a fullblown J2EE server besides the web-container used to be the EJB-container allowing for deployment of EJBs, having them run in a transactional … Read more

Encoded slash (%2F) with Spring RequestMapping path param gives HTTP 400

for spring-boot, the following did the trick @SpringBootApplication public class Application extends WebMvcConfigurerAdapter { public static void main(String[] args) throws Exception { System.setProperty(“org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH”, “true”); SpringApplication.run(Application.class, args); } @Override public void configurePathMatch(PathMatchConfigurer configurer) { UrlPathHelper urlPathHelper = new UrlPathHelper(); urlPathHelper.setUrlDecode(false); configurer.setUrlPathHelper(urlPathHelper); } }

org.glassfish.jersey.servlet.ServletContainer ClassNotFoundException

The problem: java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer indicates that you try to use the Jersey 2.x servlet, but you are supplying the Jersey 1.x libs. For Jersey 1.x you have to do it like this: <servlet> <servlet-name>Jersey REST Service</servlet-name> <servlet-class> com.sun.jersey.spi.container.servlet.ServletContainer </servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>sample.hello.resources</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Jersey REST Service</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> For more information check … Read more

Why use Apache Web Server in front of Glassfish or Tomcat?

Taken from https://cwiki.apache.org/confluence/display/TOMCAT/Connectors#Connectors-Q3 Clustering. By using Apache HTTP as a front end you can let Apache HTTP act as a front door to your content to multiple Apache Tomcat instances. If one of your Apache Tomcats fails, Apache HTTP ignores it and your Sysadmin can sleep through the night. This point could be ignored if … Read more

Why use Glassfish instead of Apache? What’s it strengths and weaknesses?

GlassFish is an Application Server which can also be used as a Web Server (Http Server). A web Server means: Handling HTTP requests (usually from browsers). A Servlet Container (e.g. Tomcat) means: It can handle servlets & JSP. An Application Server (e.g. GlassFish) means: It can manage Java EE applications (usually both servlet/JSP and EJBs). … Read more

Would you, at present date, use JBoss or Glassfish (or another) as Java EE server for a new project? [closed]

I have used WebLogic, WebSphere, JBoss, GlassFish, Resin, Jetty, Tomcat, and a few others over the last 10+ years. So, if I were considering a new project, I would ask myself a few questions first. One thing that I would not question anymore is that I would flat refuse to use JSPs unless I was … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)