Why Java hosting costs so much?
First question, which may arise in your mind is ,despite of being a Java developer & a big fan of Java, why have I hosted my own site on a php host?. The only reason is cost.Java is too much costly when it comes to hosting a privately-held/budget-aware website, now days hosting a site is a matter of around 1.5 to 6 dollar, but its for php or .Net not for Java,One could get a fairly good shared hosting package for around 1.5-6$ per month for php .Net, but when it comes to Java, its unbelivable.
Why so?
This is because Shared hosting is not suitable for Java, Its difficult for multiple users to share JVM and even Servers.
Because if JVM is shared between multiple applications, if one application creates some problem (like memory leak) others will also have to suffer.
Some Java changes require a restart of the server. That means that you cannot have multiple users sharing the same server.
problem with logging:
Java has introduced logging in version 1.4, limitation of JDK / J2SE Logging, is its inability to have per-web application logging. All the logging configurations are at a virtual machine level and in a shared hosting machine, the host does not give you control over the virtual machine configuration. so java.util.logging may create a major problem when you go for shared hosting
Java community is aware of this fact and have started a JSR to over come this problem
JSR 121: Application Isolation API Specification
http://jcp.org/en/jsr/detail?id=121
So currently PHP is the only option for small budget sites
