You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by Steve Gibson <St...@cowww.com> on 2004/06/04 22:37:31 UTC

Using Symbols in a Symbol Definition

Something I was slightly surprised at, but that could just be high
expectations.

I was today trying to define a contribution like so:


   <contribution configuration-id="hivemind.FactoryDefaults">
      <default symbol="CONFIG_FILE_DIR" value="./properties"/>
      <default symbol="GLOBAL_PROPERTIES"
value="${CONFIG_FILE_DIR}/global.properties"/>
      <default symbol="SITE_PROPERTIES"
value="${CONFIG_FILE_DIR}/site.properties"/>
   </contribution>

But I was getting this in my logs:

2004-06-04 16:27:37,944 hivemind.FactoryDefaultsSymbolSource [ERROR]
Unable to initialize service hivemind.FactoryDefaultsSymbolSource (by
invoking method initializeService on
org.apache.hivemind.service.impl.DefaultsSymbolSource, at
jar:file:/C:/dev/cowww/lib/hivemind-1.0.beta-1-snapshot.jar!/META-INF/hi
vemodule.sdl, line 104, column 25): null
2004-06-04 16:27:37,944 org.apache.hivemind.impl.RegistryImpl [ERROR] No
value available for symbol 'CONFIG_FILE_DIR' (at
file:/C:/dev/cowww/build/META-INF/hivemodule.xml, line 6, column 97).

The second error points to the line using the symbol.

Actually, one thing that could be added to the bug database is the first
log message.
This is an example of something that has really been draining
productivity from me.
If exceptions are thrown in an init method or one of the property
setters, the factory does not seem to propagate it, and a vague error is
logged by the BuilderFactory giving the correct line number, but the
cause being null. This may just be the niggling problem with
NullPointerException not having a message attached.

I will write a test case and investigate further.


Steve Gibson
Software Engineer
COWWW Software

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


RE: Using Symbols in a Symbol Definition

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Yes, you are an Ant user (as am I).

HiveMind doesn't work quite like Ant.  It evaluates symbols in strings as the contribution is being
processed (by the SchemaProcessor instance). This occurs when values in the resulting List are first
accessed, here by the FactoryDefaultsSymbolSource.  None of the values in
FactoryDefaultsSymbolSource are avaialble until all the contributions have been processed, and FDSS
has been initialized.

That NPE is problematic; it would be nice to figure out where its coming from.  I suspect its an
offshoot of trying to recursively access FDSS and that's supposed to be flagged differently (with a
more useful exception).

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com


> -----Original Message-----
> From: Steve Gibson [mailto:Steve.Gibson@cowww.com] 
> Sent: Friday, June 04, 2004 4:38 PM
> To: hivemind-dev@jakarta.apache.org
> Subject: Using Symbols in a Symbol Definition
> 
> 
> Something I was slightly surprised at, but that could just be high
> expectations.
> 
> I was today trying to define a contribution like so:
> 
> 
>    <contribution configuration-id="hivemind.FactoryDefaults">
>       <default symbol="CONFIG_FILE_DIR" value="./properties"/>
>       <default symbol="GLOBAL_PROPERTIES"
> value="${CONFIG_FILE_DIR}/global.properties"/>
>       <default symbol="SITE_PROPERTIES"
> value="${CONFIG_FILE_DIR}/site.properties"/>
>    </contribution>
> 
> But I was getting this in my logs:
> 
> 2004-06-04 16:27:37,944 hivemind.FactoryDefaultsSymbolSource [ERROR]
> Unable to initialize service hivemind.FactoryDefaultsSymbolSource (by
> invoking method initializeService on
> org.apache.hivemind.service.impl.DefaultsSymbolSource, at
> jar:file:/C:/dev/cowww/lib/hivemind-1.0.beta-1-snapshot.jar!/M
> ETA-INF/hi
> vemodule.sdl, line 104, column 25): null
> 2004-06-04 16:27:37,944 org.apache.hivemind.impl.RegistryImpl 
> [ERROR] No
> value available for symbol 'CONFIG_FILE_DIR' (at
> file:/C:/dev/cowww/build/META-INF/hivemodule.xml, line 6, column 97).
> 
> The second error points to the line using the symbol.
> 
> Actually, one thing that could be added to the bug database 
> is the first
> log message.
> This is an example of something that has really been draining
> productivity from me.
> If exceptions are thrown in an init method or one of the property
> setters, the factory does not seem to propagate it, and a 
> vague error is
> logged by the BuilderFactory giving the correct line number, but the
> cause being null. This may just be the niggling problem with
> NullPointerException not having a message attached.
> 
> I will write a test case and investigate further.
> 
> 
> Steve Gibson
> Software Engineer
> COWWW Software
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org