The following comment has been added to this issue:

     Author: Steve Gibson
    Created: Mon, 7 Jun 2004 11:10 AM
       Body:
Actually, this is exacerbated by the fact that, though 
ApplicationRuntimeException extends RuntimeException, it does not pass on the 
root cause which means you still lose the rest if the stack trace.

I don't know if this is meant for compatibility with older jvms, but it would 
be nice to be able to get that trace. I modified the source of mine to pass the 
root cause on to the superclass (and set getRootCause to super.getCause() and I 
got a couple of extra levels of trace before it was truncated for me by the jvm 
(I am guessing).

I got:
2004-06-07 14:07:44,625 [main] ERROR conf.Startup - Error
org.apache.hivemind.ApplicationRuntimeException: Unable to update property 
config of object [EMAIL PROTECTED] (at 
jar:file:/C:/Documents%20and%20Settings/steveg/dev/scratch/steveg/projects/conf/hivescratch.jar!/META-INF/hivemodule.xml,
 line 27): null
        at org.apache.hivemind.util.PropertyAdaptor.write(Unknown Source)
        at org.apache.hivemind.util.ClassAdaptor.write(Unknown Source)
        at org.apache.hivemind.util.PropertyUtils.write(Unknown Source)
        at 
org.apache.hivemind.service.impl.BuilderFactory.setProperties(Unknown Source)
        at 
org.apache.hivemind.service.impl.BuilderFactory.createCoreServiceImplementation(Unknown
 Source)
        at 
org.apache.hivemind.impl.InvokeFactoryServiceConstructor.constructCoreServiceImplementation(Unknown
 Source)
        at 
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructCoreServiceImplementation(Unknown
 Source)
        at 
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewServiceImplementation(Unknown
 Source)
        at 
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructServiceImplementation(Unknown
 Source)
        at 
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualServiceImplementation(Unknown
 Source)
        at $InnerProxy_fd004b5bc9_3._service($InnerProxy_fd004b5bc9_3.java)
        at $InnerProxy_fd004b5bc9_3.start($InnerProxy_fd004b5bc9_3.java)
        at $SingletonProxy_fd004b5bb5_2.start($SingletonProxy_fd004b5bb5_2.java)
        at Main.main(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        ... 14 more
Caused by: java.lang.ClassCastException
        at Startup.setConfig(Unknown Source)
        ... 18 more

At least this gives me more to go by, though I guess I forgot to turn debug on 
in ant compiles.

---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/HIVEMIND-4?page=comments#action_35944

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/HIVEMIND-4

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: HIVEMIND-4
    Summary: Enhance logging of exceptions when setting a service property to a 
contribution
       Type: Improvement

     Status: Unassigned
   Priority: Major

    Project: HiveMind
 Components: 
             framework
   Versions:
             1.0

   Assignee: 
   Reporter: Steve Gibson

    Created: Mon, 7 Jun 2004 10:17 AM
    Updated: Mon, 7 Jun 2004 11:10 AM
Environment: hivemind-1.0.beta-1-snapshot.jar

Description:
I am guessing the source of the exception for this, so this may be a little 
vague.

If an exception is thrown due to a bug in the schema definition or a 
contribution to a configuration point, when a service using the affected 
configuration point is instantiated, a message of limited usefulness is logged 
of the form:

ERROR: <module-id>.<service-id> - Unable to update property <property-name> of 
object <service-impl-class.toString()> (at <module-descriptor-url>, line <line 
number of set-configuration>): null

To me, that suggests I am getting a NullPointerException somewhere, as I dig 
through the source and find in PropertyAdaptor:
try
    {
         _writeMethod.invoke(target, new Object[] { value });
    }
    catch (Exception ex)
    {
        throw new ApplicationRuntimeException(
            UtilMessages.writeFailure(_propertyName, target, location, ex),
            target,
            HiveMind.getLocation(location),
            ex);
    }

with UtilMessages.writeFailure containing:
return HiveMind.format(
            "PropertyAdaptor.write-failure",
            new Object[] {
                propertyName,
                target,
                HiveMind.getLocationString(location),
                cause.getMessage()});

With a NullPointerException, the cause is null, so perhaps a better approach 
would be:
cause.getMessage()!=null?cause.getMessage():cause

I will attach my test code.
I will also investigate the chain of the ApplicationRuntimeException, though 
its trace is not being logged.



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to