avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Pugh" <ep...@upstate.com>
Subject RE: Why does Block.lookup throws Exception?
Date Thu, 13 Nov 2003 21:28:35 GMT
I am committing now..  I actually realized my unit test for the
MerlinComponentService had the same issue, so maybe you can look at it
instead..

/src/conf/test/merlin is the merlin config stuff.

/src/test/org/apache/turbine/services/avaloncomponent is the path to the
unit test..


We need IRC!

Eric

> -----Original Message-----
> From: Stephen McConnell [mailto:mcconnell@apache.org]
> Sent: Thursday, November 13, 2003 10:26 PM
> To: Avalon Developers List
> Subject: Re: Why does Block.lookup throws Exception?
>
>
>
>
> Eric Pugh wrote:
>
> >That would be great, because I assume that Merlin will
> hollar if there is a
> >config error etc, I basically catch teh Exception and throw a
> >NestableRuntimeException.
> >
>
> Yep - asssumption is correct.
>
> >
> >Next question..
> >
> >How do I get the darn mimetype component to load..
> >
> >
> ><container name="fulcrum">
> >   <classloader>
> >     <classpath>
> >       <repository>
> >         <resource id="fulcrum:fulcrum-mimetype-api"
> version="1.0-alpha-4"/>
> >         <resource id="fulcrum:fulcrum-mimetype-impl"
> >version="1.0-alpha-4"/>
> >       </repository>
> >     </classpath>
> >   </classloader>
> >   <component name="mimetype"
> >class="org.apache.fulcrum.mimetype.DefaultMimeTypeService"/>
> >
> ></container>
> >
> >Notice I bumped the versions, you need to build locally and
> deploy..   When
> >I do a lookup, I do this:
> >(MimeTypeService)merlin.lookup("fulcrum/mimetype")
> >
>
> Don't have the code in front of me just at the moment but you
> should be
> using "/fulcrum/mimetype" (i.e. an absolute path).  Remember
> that your
> invoking this from the root container - unlike the testcase where you
> can conviniently use a relative reference to the test container.
>
> >
> >I also tried
> >(MimeTypeService)merlin.lookup("mimetype")
> >
> >Part of me feels like though that the block info included in
> the impl jar
> >should mean I don't need to declare this..
> >
>
> You don't need to do this.  If the <component> is declared
> Merlin will
> default to activating component on container deployment.
>
> >Not sure though..  Right now I
> >just get back a null..
> >
>
> That's not good.  You should actually be getting an
> IlegalArgumentException.
>
> >
> >I can commit the code if that helps..
> >
>
> Yep - what's the directory path that your committing to?
>
> Stephen.
>
> >
> >Eric
> >
> >
> >
> >>-----Original Message-----
> >>From: Stephen McConnell [mailto:mcconnell@apache.org]
> >>Sent: Thursday, November 13, 2003 9:46 PM
> >>To: Avalon Developers List
> >>Subject: Re: Why does Block.lookup throws Exception?
> >>
> >>
> >>
> >>
> >>Eric Pugh wrote:
> >>
> >>
> >>
> >>>Hi all,
> >>>
> >>>I am working on integrating the Merlinized Fulcrum Mimetype
> >>>
> >>>
> >>component, and
> >>
> >>
> >>>noticed that this throws an exception:
> >>>
> >>>Block root = m_kernel.getRootBlock();
> >>>       return root.locate(path);
> >>>
> >>>Why doesn't it throw a MerlinException or ComponentException?  Or
> >>>RuntimeException?  It seems like just Exception isn't very
> useful...
> >>>
> >>>
> >>>
> >>I agree.
> >>
> >>There is a NoProviderDefinitionException declared in the
> >>activation API.
> >>I think this will cover the majority of concerns.  I'll do
> >>some playing
> >>around and see what we can come up with.
> >>
> >>Stephen.
> >>
> >>
> >>
> >>>Eric
> >>>
> >>>
> >>>-----------------------------------------------------------
> ----------
> >>>To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> >>>For additional commands, e-mail: dev-help@avalon.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>--
> >>
> >>Stephen J. McConnell
> >>mailto:mcconnell@apache.org
> >>
> >>|------------------------------------------------|
> >>| Magic by Merlin                                |
> >>| Production by Avalon                           |
> >>|                                                |
> >>| http://avalon.apache.org/merlin                |
> >>| http://dpml.net/                               |
> >>|------------------------------------------------|
> >>
> >>
> >>
> >>
> >>
> >>------------------------------------------------------------
> ---------
> >>To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> >>For additional commands, e-mail: dev-help@avalon.apache.org
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> >For additional commands, e-mail: dev-help@avalon.apache.org
> >
> >
> >
> >
>
> --
>
> Stephen J. McConnell
> mailto:mcconnell@apache.org
>
> |------------------------------------------------|
> | Magic by Merlin                                |
> | Production by Avalon                           |
> |                                                |
> | http://avalon.apache.org/merlin                |
> | http://dpml.net/                               |
> |------------------------------------------------|
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> For additional commands, e-mail: dev-help@avalon.apache.org


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


Mime
View raw message