How to update Mojarra version in GlassFish

GlassFish itself already ships with JSF bundled which get by default classloading precedence over the one bundled in the webapp. You basically need to tell GlassFish to use the webapp bundled JSF instead. Edit the webapp’s /WEB-INF/glassfish-web.xml (or /WEB-INF/sun-web.xml if you’re using one of the first GF3 versions) to add the following two entries: <class-loader … Read more

How to install the GlassFish 3 server adapter with Eclipse Helios 3.6

Eclipse Helios 3.6 At the time of writing this (07/26/2010), there are in theory two ways to install the GlassFish Server adapter: via the Eclipse Marketplace or via an update site. Update: As mentioned by Thorbjørn in a comment, the adapter is now (09/24/2010) available in the Additional server adapters dialogue (the “normal way”). New … Read more

How do I specify the JDK for a GlassFish domain?

Here you can find how to set path to JDK for Glassfish: http://www.devdaily.com/blog/post/java/fixing-glassfish-jdk-path-problem-solved Check glassfish\config\asenv.bat where java path is configured REM set AS_JAVA=C:\Program Files\Java\jdk1.6.0_04\jre/.. set AS_JAVA=C:\Program Files\Java\jdk1.5.0_16

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

JDBC MySql connection pooling practices to avoid exhausted connection pool

The exception indicates a typical case of application code which leaks database connections. You need to ensure that you acquire and close all of them (Connection, Statement and ResultSet) in a try-with-resources block in the very same method block according the normal JDBC idiom. public void create(Entity entity) throws SQLException { try ( Connection connection … Read more