Archive for October, 2007
Plesk, Apache, Tomcat and multiple hosts
Friday, October 5th, 2007 by DenisHIn addition to having problems with JNDI not working properly, I’ve also been bashing my head against Plesk–that is supposedly “designed to simplify the management and administration of web sites”.
It’s the interaction between Plesk and Tomcat that’s the particular problem and how both of them negotiate dealing with multiple domains (or rather don’t deal with it). (more…)
JNDI problems with Tomcat 5.5.15
Friday, October 5th, 2007 by DenisHI’ve recently been having difficulty getting JNDI lookup for MySQL connection pools working on our public server.
This proved very difficult to track down as all the stuff that I could find on the web said that I had to have:
- commons-dbcp-1.2.1.jar
- commons-pool-1.2.jar
- mysql-connector-java-3.1.6-bin.jar
(or the latest appropriate versions)
Unfortunately this didn’t work and my little test JSP (using the JSTL sql tags) just gave me the error: DataSource invalid:
“java.sql.SQLException: No suitable driver.
However, next I tried connecting to MySQL directly using Class.forName(""com.mysql.jdbc.Driver") and that worked. So the problem wasn’t in loading the driver. (more…)
Outputting stack traces in a JSP using JSTL
Wednesday, October 3rd, 2007 by DenisHIf you’re writing a JSP using the JSTL tag <c:catch var=”myError”> … </c:catch> then I’m sure that you know that the next thing to do is to check after the closing catch tag to see if myError is empty. If not you can output some useful error message having successfully caught any exception. However, sometimes it’s useful to actually output the stack trace (when debugging a site for example). It turns out not to be difficult to do this. Simply copy in the following:
<c:if test="${not empty myError}">
<p class="error">An error occured: <c:out value="${myError}"/></p>
<pre>
<c:forEach var="stackTraceElem" items="${myError.stackTrace}">
<c:out value="${stackTraceElem}"/><br/>
</c:forEach>
Subscribe to news from Isocra