Hi,
I had a problem with turbine, log message like: "Class
org.apache.turbine.services.webmacro.TurbineWebMacroService is unavailable.
Check your jars and classes."
This class was definitely in my classpath! It took me some time to figure
out that Webmacro itself was missing in my classpath...
Why are you not passing the original exception message on to the log-file?
I think this could save people some headaches (and you some questions...)
Just my 2 cents,
ingo.
BaseInitableBroker.java
===================================
/**
* Retrieves an instance of an Initable from the repository.
*
* If the requested class is not present in the repository, it is
* instantiated and passed a reference to the broker, saved and
* then returned.
*
* @param className The name of the class to be instantiated.
* @exception InstantiationException, if the requested class can't
* be instantiated.
*/
protected Initable getInitableInstance( String className )
throws InstantiationException
{
Initable initable = (Initable)initables.get(className);
if(initable == null)
{
// Used to indicate error condition.
String msg = null;
try
{
initable = (Initable)Class.forName(className).newInstance();
}
catch( NoClassDefFoundError e)
{
- msg = "Class "+className+" is unavailable. Check your jars
and classes.";
+ msg = "NoClassDefFoundError while trying to instantiate
"+className+"; message is: "e". Check your jars and classes.";
}
catch( ClassNotFoundException e)
{
- msg = "Class "+className+" is unavailable. Check your jars
and classes.";
+ msg = "ClassNotFoundException while trying to instantiate
"+className+"; message is: "e". Check your jars and classes.";
}
catch( ClassCastException e )
{
msg = "Class "+className+" doesn't implement Initable.";
}
catch( Exception e )
{
msg = "Failed to instantiate "+className+":\n"+e.getMessage();
}
if(msg != null)
{
throw new InstantiationException(msg);
}
initable.setInitableBroker(this);
initables.put(className, initable);
}
return initable;
}
}
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]