Archive for the ‘Java’ Category
DWR & Spring Form Controllers
Monday, March 17th, 2008Functional Example of Declarative Caching with Spring
Friday, January 11th, 2008Source Code for Funcational Example
I recently had the dubious pleasure of working with Spring-Modules’ Declarative Caching with EHCache. The package I’m developing involves database integration through iBATIS, Spring Web Services, and caching to increase performance. I chose to use Spring Modules’ Declarative Caching because it obviously integrates well with the rest of the Spring architecture, and allows for the use of more than one caching engine, of which, I chose EHCache.
(more…)
“Portable” Package Management is Bullshit {Mostly}
Thursday, October 25th, 2007I don’t always want to code in Java. In fact, I’ve recently wanted to not program in Java and get a feel for everything else that’s neat and nifty and blah blah blah. But Java spoiled me. I got used to having my libraries distributed with my package, and having it work on other systems pretty easily. So imagine the fun times I had trying to get MySQL and SMTP support working in other languages…
(more…)
Invalid WSDD element ‘deployment’ (wanted ‘deployment’)
Friday, October 12th, 2007Ok, so I am setting up some web services using Apache Axis and Spring. Everything compiles just fine, I drop my War into tomcat and boom, I get this awesome error message:
org.apache.axis.deployment.wsdd.WSDDException: Invalid WSDD element ‘deployment’ (wanted ‘deployment’)
Now I wonder, is Tomcat confused? Does it not know what it wants? So after a little bit of poking around I isolated the problem to the wsdd file. Apparently there is a big difference between xmlns=”http://xml.apache.org/axis/wsdd” and xmlns=”http://xml.apache.org/axis/wsdd/” in the deployment tag. Once that was corrected everything worked just fine.
HTTPS, Tomcat and Load Balancers.. Oh My!
Wednesday, August 22nd, 2007During the implementation of a new servlet application on Tomcat we encountered an HTTP/HTTPS issue during redirects. The user would browse to a servlet via HTTPS, through a load balancer that handled SSL decryption, and during the execution of the servlet, they would be redirected to another URL. However, that redirect would be generated as a fully qualified HTTP address. This poses a problem. The page was originally requested as secure content, and the user is redirected to an insecure URL. Ultimately, the user sees a security warning. We figured it out by using the Tamper Data Firefox extension.
(more…)
IRC Notification Bot
Monday, August 20th, 2007This was a fun little side-project we used to relay messages into IRC from linux servers when certain events occurred. The specific case was for Tomcat restarts. We wanted to know when startup.sh and shutdown.sh were executed. This would allow the helpdesk or the NOC to be notified if Tomcat was restarted inappropriately.
I used PircBot from Jibble, configured by Spring, to take inbound messages from a server and translate it into an IRC post within one or more channels.
(more…)
Building A Better Spring Action
Sunday, August 19th, 2007One thing that still confuses me about Spring’s Action classes is the lack of implicit access to the MessageSource. If you’re using Spring’s MVC or Spring’s WebFlow, you’ve undoubtedly used a MessageSource to define localized messages and errors, but you have to go out of your way to access it. Additionally, I needed every class to have access to my Log4J configuration and the ability to print the contents of a stacktrace. So I extended the AbstractAction, FormAction, and MultiAction classes to provide these features to all of my classes:
(more…)