Archive

Archive for July, 2005

ClassCastException When Compiling JSP

July 31st, 2005
Comments Off

Tomcat is unable to compile any of the JSPs in my application (Struts
1.2.7, JDK 5, Tomcat 5.5.9) because of a ClassCastException when
loading up of the Struts TLDs. The app works fine in Resin, but I have to deploy to Tomcat.

There are two stack traces. The one that actually presents the
problem is listed second. The HTTP 500 error message contains:

org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:591)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)

The reason the JSP isn’t found is because a ClassCastException was
thrown during compile. Here’s the exception from the logs:

ERROR: 2005-07-30 23:52:50,067: StandardWrapperValve:
Servlet.service() for servlet default threw exception
java.lang.ClassCastException: org.apache.struts.taglib.html.MessagesTei
at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:420)
at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162)

As I said earlier, the WAR file works fine in Resin. I’ve tried
putting the struts.jar into $CATALINA_HOME/common/lib and the problem persists.

Has anybody else seen this? Got a fix?

[UPDATED] The fix is here.

nick Uncategorized

IDEA Live Templates - part 2

July 28th, 2005

Some time ago I posted a blog entry about IDEA’s Live Templates feature. I just found this, a collection of Live Templates on the IntelliJ wiki. Enjoy!

(While cool, Live Templates still pale in comparison to tempo.el, the templating library for EMACS.)

nick Uncategorized

Java Blog Software

July 27th, 2005

I’m looking for a Java-based blog application that supports multiple users and roles per blog. Some people should have manager, or admin access, while others should be able to comment, and a third group should be able to post new blog entries. Roller doesn’t support it, and the few other options I’ve found don’t either. Anybody have suggestions?

nick Uncategorized

TilesRequestProcessor

July 25th, 2005
Comments Off

If you’re using Tiles in your Struts apps, you’ll need to set the TilesRequestProcessor class in your struts-config.xml in order to treat Tiles definitions like global forwards:


<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

That’s probably been around for a while and I just noticed it.

nick Uncategorized

First thoughts on Wicket

July 20th, 2005

I’ve been using Wicket for a few weeks on a new application and, unfortunately, my opinions are mixed. It’s possible that I’m still having trouble getting past how Struts does things, but getting anything working in Wicket has been a challenge.

I really like that Wicket doesn’t require any configuration and everything is in the code. And I do mean everything. You’re not allowed to put any logic in the markup.

Not being able to express yourself in the markup also means that you don’t get to reuse any of the knowledge you may have picked up with other frameworks: JSTL, OGNL, scriptlets, Struts tags, Velocity, etc. You have to relearn everything the Wicket way, which isn’t a bad thing really, it just takes a while.

Wicket’s documentation needs work. There is a wiki, but it’s sparse. The example apps are good, but mostly undocumented and they don’t cover the use cases I need. The mailing list is very helpful and the javadoc is excellent, which is good because you need to know a lot of classes before you get started.

Is Wicket better than Tapestry? It’s certainly simpler, but just as frustrating at times. Is Wicket better than Struts? I can’t answer that. I’ve been using Struts for years and nothing is outside of my grasp with it. I like Wicket and I hope that the upcoming 1.1 release improves the user documentation. For now, I’ll keep beating my head against a wall.

nick Uncategorized

Mobiles capture blast aftermath

July 8th, 2005

MySQL User Group Meeting

July 6th, 2005

The next Chicago MySQL User Group meeting will be on July 11th at Uncommon Grounds, by Wrigley. The details are here.

nick Uncategorized

Chicago To Ban Smoking?

July 5th, 2005

From The Economist Cities Guide for Chicago:

On June 29th, a group of aldermen from Chicago’s city council introduced a measure that would ban smoking inside most public places in Chicago. The ban, if enacted, would be among the most strict in America, forbidding puffing not just in restaurants and bars, but also in bingo parlours, limousines, outdoor sport stadiums and on train platforms. The only indoor refuges for smokers would be private homes, hotels, motels and retail tobacco shops, provided patrons didn’t exhale too forcefully. Smokers would even be banned from indulging within 25 feet of an enclosed area where smoking is banned.

This goes well beyond the city’s 1988 anti-smoking measure, which banned smoking in most public buildings and mandated smoke-free areas in restaurants, but said nothing about bars. But the landscape has changed: seven states and more than 1,900 municipalities—including the smart Chicago suburbs of Evanston, Skokie, Wilmette and Highland Park—have some form of ban on smoking in public places. More than 2,000 of Chicago’s 6,700 restaurants are already smoke-free, and the number of non-smoking seats in restaurants has grown by about 90% since 2000.

nick Uncategorized

A Weekend With Wicket

July 5th, 2005

I blogged about Tapestry, got comments about Wicket, and promised to download and mess with it over the weekend. I downloaded the base archive, the extensions and the examples. Here’s my question: how can you have an examples download without source code? There was a separate examples download with source, but why would I possibly need that?

To make matters worse, I was without net access all weekend, so I wasn’t able to get the other bundles to determine what the examples were actually doing. It’s possible that I just missed something - it was a holiday weekend and I was more concerned with golf than code.

Another thing I’d like to see from Wicket, other than better documentation (but who doesn’t need that?), is a simple line drawing of the components and how they interact. I’m a visual person and pictures help.

Hopefully I’ll have more to say about Wicket later this week.

nick Uncategorized