Category Java Application Servers
Overview J2EE application server has two containers (run time environments) – one is web container and other is EJB container Web container hosts web applications based on JSP/Servlets API – designed specifically for web request handling – more of request/response distributed computing. Web container requires the web module to be packaged in WAR file that […]
How to run Java services (or background daemon processes) in an application server or web container?
I’ve presented here a simple example to illustrate how to convert stand-alone java programs (mostly, JARs) to WARs which can then be deployed in full-blown application servers (JBoss, WebSphere, etc.) or light weight web containers (Tomcat, Jetty, etc.). This’s generally done to avoid the hassle of managing background daemon processes separately. Also, deploying all of […]
JBoss AS (Application Server) provides some useful information through its JMX console that’d be helpful in understanding the deployed applications and doing some performance tuning. The provided information include server performance, how much memory is used, the total CPU time each thread has used etc.. How to know all this info? Open the below URL […]
Enabling JMX in JBoss To enable JMX access to JBoss, add the following arguments to JBoss VM args: -Dcom.sun.management.jmxremote The above line will enable only local monitoring. To enable remote JMX connection we need to specify the port which the JMX server will listen for remote connections. -Dcom.sun.management.jmxremote.port=9004 (or any other port number) The JMX […]
java.lang.ClassCastException: [ServletName] cannot be cast to javax.servlet.Servlet: How to resolve?
When I was using tomcat-maven-plugin to test an app I worked on in embedded tomcat , it was erroring out with the following message: INFO: Marking servlet TestWebServiceServlet as unavailable Jun 17, 2011 4:01:48 PM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /cxf threw load() exception java.lang.ClassCastException: test.ws.TestWebServiceServlet cannot be cast to javax.servlet.Servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1104) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981) at […]
JMX Console is a very useful/powerful administration console for JBossAS. I’ve rarely seen admins making full use of it. Irrespective of the usage, I’d recommend that to be kept in the JBoss deploy directory. Fine. Let’s now think towards securing it, which is not often done. Here’re the step-by-step instructions. I’ve tried this with JBossAS […]
A C3P0Registry mbean is already registered. This probably means that an application using c3p0 was undeployed, but not all PooledDataSources were closed prior to undeployment. This may lead to resource leaks over time. Please take care to close all PooledDataSources. We had this problem when we were trying to deploy multiple applications within same app […]
If you’ve just started using JBoss, this question should have nagged you to search in google. It’s simple. If you generally deploy mywebapp.war in JBOSS_HOME/server/default/deploy/ (or deploy directory in all/ or minimal/) to get your app working, just do this to deploy it as an exploded archive: Unzip it, rename the directory ‘mywebapp’ to mywebapp.war and […]