Posts

Showing posts from February, 2010

ClassNotFoundException destroying a session in Tomcat

When a session was being expired (either through a timeout, or via using the Tomcat Manager to manually destroy them) that contained an EJB I was getting a ClassNotFoundException. The stack trace when killing from the manager was:
java.lang.RuntimeException: Specified calling class, net.devgrok.MyEjbRemote could not be found for WebappClassLoader delegate: false repositories: ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@70cb6009 at org.jboss.ejb3.common.lang.SerializableMethod.getClassFromName(SerializableMethod.java:311) at org.jboss.ejb3.common.lang.SerializableMethod.getClassType(SerializableMethod.java:282) at org.jboss.ejb3.common.lang.SerializableMethod.toMethod(SerializableMethod.java:233) at org.jboss.ejb3.common.lang.SerializableMethod.toMethod(SerializableMethod.java:220) at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:182) at org.jboss.ejb3.proxy.impl.…

Using RichFaces to give versioned URL's

RichFaces has some nice components that can load scripts and styles when placed anywhere in the xhtml page and automatically inserts them into the header at render time. For example a footer could say it requires stylesheet, after you've already defined a header.

The tags are pretty simple there is the style loader, loadStyle:
<afj:loadstyle src="/css/test.css"></afj:loadstyle>And the script loader, loadScript:
<afj:loadscript src="/javascript/test.js">
The src can be a path be:
Relative to the current page.Path relative to the context if starting with a slash.Or loaded by RichFaces resource framework
Using "resource:///path/to/file"Now, the problem most web developers always face is that of caching. If you disable caching then the site is slow for the user and your bandwidth is used up. If you enable caching and release a new version, how do you clear the user's and ISP's cache so they can see your changes?

RichFaces already d…

Safari removed javascript API

In the latest version of Safari (WebKit) they have removed some deprecated javascript API & tags which can cause problems with older code. This is my attempt to keep track of them so I can search through the code and change it to use a newer method.

Here is a list of what works in Firefox 3 or Internet Explorer but not Safari:

document.[form name] where [form name] matches the element <form name='[form name]'>
Replacement:Use document.getElementById() insteaddocument.embeds
Replacement:
Use document.getElementById() insteadForm element's id defaulted to their name
Replacement:
Manually specify the id<applet> tag
Replacement:
<object> tagThat's it for the moment but I'll keep updating the list as I find them.

Building your own jbossall-client.jar

The newer versions of JBoss (I'm using 5.1.0 GA) very annoyingly have all the client jars split into at least 47 separate jars! Which is a bit rude when you consider the total number of jars they expect you to copy into your tomcat/lib dir is a whopping 93.

JBoss are declined to make the client jars into a single file again as its meant to make it easier to upgrade... That's arguable but still leaves us with all these files to copy around. After searching the net I've found a rather nice solution which I have adapted below.
The way I use it is as follows. I combine all jboss*.jar files into a single jar and then copy the additional dependencies.

Create a directory an empty directory and put the build.xml in it and create a /jboss dir. Copy all jboss jboss*.jar from jboss-5.1.0.GA/client.

Create a /build.xml:
<project default="combine"> <property name="temp.dir" value="unpacked" /> <property name="lib.dir" value=&q…

Automake unable to detect vendor on RedHat EL5

After chasing down some build problems with subversion 1.6.9 on EL5 I was noticing that it was detecting the system as x86_65-unknown-linux-gnu. Worried that it would cause me later problems I started digging through the configure script. It lead me to the build/config.guess script.
After spending too long searching the net and trying to resolve the issue, I just did this:
subversion-1.6.9>cp /usr/lib/rpm/config.guess ./build/config.guessBasically overriding the one that came with the distro with redhat's hack.