Again, please specify the version of JBossCache you are using? Or the JBoss AS version. I have tested it on 1.2 release, and it works for me when getObject tries to retrieve a non-existent object.
I'm running JBoss AS 4.0.0 (build: CVSTag=JBoss_4_0_0 date=200409200418, says the startuplog trace).
Actually, I have put an object in the cache. I get the StringIndexOutOfBoundsException when I attempt to retrieve the object from the cache. The object has been put successfully in the cache by the init() method of a servlet loaded at deployment time of my ear file.
Here are my findings:
1/ I wanted to test my serializable POJOs to see if there was something wrong with them. I deployed a custom jar file with a session bean having 2 methods for putting and getting the object (and its dependant POJOs) in the JBossCache. It worked with no particular problem.
2/ But when I use an ear file (zith one EJB jar and one WAR file), the POJO class files being deployed in an EJB jar file, putting the object in the cache does not work anymore. I get a ClassNotFound exception with "No ClassLoaders found for: com.rubis.app.runtime.programs.SignalProgramCache" message.
Then, when I wrap my SignalProgramCache POJO inside a org.jboss.aop.util.MarshalledValue instance (as proposed by a post of this forum), the putObject() method succeeds (the object being put in the cache by my servlet's init method).
However, when using my application, the getObject still triggers the StringIndexOutOfBoundsException exception when I attempt to get the object from the cache.
I do not know what to do now. Can you help ?