You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Eric Pugh <ep...@upstate.com> on 2003/11/13 21:36:14 UTC

Why does Block.lookup throws Exception?

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...

Eric


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


RE: [merlin] merlin + datasources

Posted by Jim Alateras <ji...@comware.com.au>.
I have been able to use the test case to test the DataSourceSelector
component in isolation and that call to select works but in the context
of my application I still get an error.

I have dug a little further and have found that the NPE comes from
CompositeBlock.invoke..as indicated by the stack trace below.

java.lang.NullPointerException
        at
org.apache.avalon.activation.appliance.impl.CompositeBlock$BlockInvocati
onHandler.invoke(CompositeBlock.java:274)
        at $Proxy3.select(Unknown Source)
        at
com.choreoworks.pep.loader.PEPLoader.testDataSource(PEPLoader.java:367)
        at
com.choreoworks.pep.loader.PEPLoader.access$000(PEPLoader.java:85)
        at
com.choreoworks.pep.loader.PEPLoader$1.run(PEPLoader.java:186)

The line numbers will not match what is in CVS because I have further
instrumented the code. Basically 'service' is null after the call to
model.getExportDirective hence the call to service.getPath throws the
NPE.

            ServiceDirective service = 
              model.getExportDirective( method.getDeclaringClass() );

            String path = service.getPath();

It seems that if, in my block.xml file, I replace the "include"
directive with the corresponding "resource" and "component" elements
everything works dandy. 

i.e. this doesn't work for me

     <include name="jdbc-manager"
id="cornerstone-datasources:cornerstone-datasources-impl" version="1.0"
/>

but this does work for me (with the associated resources)

     <component name="jdbc-manager"
class="org.apache.avalon.cornerstone.blocks.datasources.DefaultDataSourc
eSelector" activation="true" />

Furthermore it seems that I am getting the same problem with components
that are imported through the "include" directive (i.e. thread manager,
socket manage etc). When a call through a proxy is made it fails, as
indicated in the stack trace above.

In summary I can work around the problem by removing all "include"
directives from my block.xml and replacing them with the equivalent xml
fragments. I hope this all makes sense ;-).

Finally, I was wondering whether anyone else has experienced a similar
problem. 

cheers
</jima>

> -----Original Message-----
> From: Stephen McConnell [mailto:mcconnell@apache.org]
> Sent: Friday, November 21, 2003 9:46 PM
> To: Avalon Developers List
> Subject: Re: [merlin] merlin + datasources
> 
> 
> 
> Jim Alateras wrote:
> 
> >>>But when this service executes I get the following error
> >>>
> >>>java.lang.NullPointerException
> >>>
> >>>
> >>>
> >>Umm .. this is a worry - you should not be getting a NPE.
> >>
> >>Any chance you could throw together a testcase?
> >>
> >>
> >>
> >How should I package the test case. Do you want a jar + config +
source
> >so you can execute the block that will show the error
> >
> 
> Jim:
> 
> I took a more careful look at the stack trace that you initially
> posted.  The NPE is being thrown under the select operation - so the
bug
> is down in the DefaultDataSourceSelector.  I've just update the
> cornerstone datasources-impl project to include an empty test case.
You
> should be able to use this to establish the NPE condition by modifying
> the config.xml and invoking selection under the test case.
> 
> Stephen.
> 
> >
> >cheers
> ></jima>
> >
> >
> >---------------------------------------------------------------------
> >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


RE: [merlin] merlin + datasources

Posted by Jim Alateras <ji...@comware.com.au>.
> Jim Alateras wrote:
> 
> >>>But when this service executes I get the following error
> >>>
> >>>java.lang.NullPointerException
> >>>
> >>>
> >>>
> >>Umm .. this is a worry - you should not be getting a NPE.
> >>
> >>Any chance you could throw together a testcase?
> >>
> >>
> >>
> >How should I package the test case. Do you want a jar + config +
source
> >so you can execute the block that will show the error
> >
> 
> Jim:
> 
> I took a more careful look at the stack trace that you initially
> posted.  The NPE is being thrown under the select operation - so the
bug
> is down in the DefaultDataSourceSelector.  I've just update th
> cornerstone datasources-impl project to include an empty test case.
You
> should be able to use this to establish the NPE condition by modifying
> the config.xml and invoking selection under the test case.

great. I'll give it a go today


cheers
</jima>


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


Re: [merlin] merlin + datasources

Posted by Stephen McConnell <mc...@apache.org>.

Jim Alateras wrote:

>>>But when this service executes I get the following error
>>>
>>>java.lang.NullPointerException
>>>
>>>      
>>>
>>Umm .. this is a worry - you should not be getting a NPE.
>>
>>Any chance you could throw together a testcase?
>>
>>    
>>
>How should I package the test case. Do you want a jar + config + source
>so you can execute the block that will show the error
>

Jim:

I took a more careful look at the stack trace that you initially 
posted.  The NPE is being thrown under the select operation - so the bug 
is down in the DefaultDataSourceSelector.  I've just update the 
cornerstone datasources-impl project to include an empty test case.  You 
should be able to use this to establish the NPE condition by modifying 
the config.xml and invoking selection under the test case.

Stephen.

>
>cheers
></jima>
>
>
>---------------------------------------------------------------------
>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


RE: [merlin] merlin + datasources

Posted by Jim Alateras <ji...@comware.com.au>.
> 
> >
> >But when this service executes I get the following error
> >
> >java.lang.NullPointerException
> >
> 
> Umm .. this is a worry - you should not be getting a NPE.
> 
> Any chance you could throw together a testcase?
> 
How should I package the test case. Do you want a jar + config + source
so you can execute the block that will show the error

cheers
</jima>


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


RE: [merlin] merlin + datasources

Posted by Jim Alateras <ji...@comware.com.au>.
> >
> >3. In one of my other services, I try to use the datasource like this
> >
> >        DataSourceComponent ds =
> >(DataSourceComponent)_dsSelector.select("maindb");
> >
> 
> First off - your attempting to narrow to a component implementation
> instread of the service it exposes. I would have assumed that you
would
> resolve the DataSourceSelector service from the service manager, then
> incoke select on the returned selector.

I believe that I am already doing that

    /**
     * Servicing of the component by the container during which service 
     * dependencies declared under the component can be resolved using
the 
     * supplied service manager.
     *
     * @avalon.dependency type="com.choreoworks.sap.logger.Logger"
key="logger" 
     * @avalon.dependency
type="com.choreoworks.sap.uuid.spi.UUIDGenerator:1.0"
key="uuid-generator" 
     * @avalon.dependency
type="com.choreoworks.sap.scheduler.spi.JobScheduler:1.0"
key="job-scheduler" 
     * @avalon.dependency
type="com.choreoworks.sap.queue.spi.QueueManager:1.0"
key="queue-manager" 
     * @avalon.dependency
type="org.apache.avalon.cornerstone.services.threads.ThreadManager:1.0"
key="thread-manager" 
     * @avalon.dependency
type="org.apache.avalon.cornerstone.services.sockets.SocketManager:1.0"
key="socket-manager" 
     * @avalon.dependency
type="org.apache.avalon.cornerstone.services.datasources.DataSourceSelec
tor:1.0" key="data-source-selector" 
     *
     * @param manager - the service manager
     * @throws ServiceException
     */
    public void service(final ServiceManager manager)
    throws ServiceException {
        _scheduler = (JobScheduler)manager.lookup("job-scheduler");
        _uuidGenerator =
(UUIDGenerator)manager.lookup("uuid-generator");
        _queueManager = (QueueManager)manager.lookup("queue-manager");
        _socketManager =
(SocketManager)manager.lookup("socket-manager");
        _threadManager =
(ThreadManager)manager.lookup("thread-manager");
        _dsSelector =
(DataSourceSelector)manager.lookup("data-source-selector");
    }
> 
> >
> >But when this service executes I get the following error
> >
> >java.lang.NullPointerException
> >
> 
> Umm .. this is a worry - you should not be getting a NPE.
> 
> Any chance you could throw together a testcase?
> 

Yep I can do something over the next couple of days. 


cheers
</jima>


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


Re: [merlin] merlin + datasources

Posted by Stephen McConnell <mc...@apache.org>.

Jim Alateras wrote:

>I was wondering whether anyone can advice me on how to correctly
>configure the datasource component within merlin. This is what I have
>tried but I get an exception when I execute the block.
>
>1. In the block.xml I use the include directive 
>
><container name="pep">
>	:
>	:
>  <include name="jdbc-manager"
>id="cornerstone-datasources:cornerstone-datasources-impl" version="1.0"
>/>
>
></container>
>

OK - so the result of the above is that the container you have defined 
is exposing itself as a DataSourceSelector service.

>
>2. In the config.xml I have the following
>
><targets>
>  <target path="/pep/jdbc-manager/manager">
>    <configuration>
>      <data-sources>
>        <data-source name="maindb"
>class="org.apache.avalon.excalibur.datasource.JdbcDataSource">
>          <pool-controller min="5" max="10" />
>          <driver>org.gjt.mm.mysql.Driver</driver>
>          <dburl>jdbc:mysql:/localhost/test</dburl>
>          <user>mysql</user>
>          <password>mysql</password>
>          <auto-commit>true</auto-commit>
>        </data-source>
>      </data-sources>
>    </configuration>
>  </target>
>   :
>   :
></targets>
>
>3. In one of my other services, I try to use the datasource like this
>
>        DataSourceComponent ds =
>(DataSourceComponent)_dsSelector.select("maindb");
>

First off - your attempting to narrow to a component implementation 
instread of the service it exposes. I would have assumed that you would 
resolve the DataSourceSelector service from the service manager, then 
incoke select on the returned selector.

>
>But when this service executes I get the following error
>
>java.lang.NullPointerException
>

Umm .. this is a worry - you should not be getting a NPE.

Any chance you could throw together a testcase?

Stephen.

-- 

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


[merlin] merlin + datasources

Posted by Jim Alateras <ji...@comware.com.au>.
I was wondering whether anyone can advice me on how to correctly
configure the datasource component within merlin. This is what I have
tried but I get an exception when I execute the block.

1. In the block.xml I use the include directive 

<container name="pep">
	:
	:
  <include name="jdbc-manager"
id="cornerstone-datasources:cornerstone-datasources-impl" version="1.0"
/>

</container>

2. In the config.xml I have the following

<targets>
  <target path="/pep/jdbc-manager/manager">
    <configuration>
      <data-sources>
        <data-source name="maindb"
class="org.apache.avalon.excalibur.datasource.JdbcDataSource">
          <pool-controller min="5" max="10" />
          <driver>org.gjt.mm.mysql.Driver</driver>
          <dburl>jdbc:mysql:/localhost/test</dburl>
          <user>mysql</user>
          <password>mysql</password>
          <auto-commit>true</auto-commit>
        </data-source>
      </data-sources>
    </configuration>
  </target>
   :
   :
</targets>

3. In one of my other services, I try to use the datasource like this

        DataSourceComponent ds =
(DataSourceComponent)_dsSelector.select("maindb");

But when this service executes I get the following error

java.lang.NullPointerException
        at
org.apache.avalon.activation.appliance.impl.DefaultBlock$BlockInvocation
Handler.invoke(DefaultBlock.java:996)
        at $Proxy3.select(Unknown Source)
        at
com.choreoworks.pep.loader.PEPLoader.testDataSource(PEPLoader.java:359)
        at
com.choreoworks.pep.loader.PEPLoader.start(PEPLoader.java:184)
        at
org.apache.avalon.activation.appliance.impl.DefaultAppliance.applyStart(
DefaultAppliance.java:998)
        at
org.apache.avalon.activation.appliance.impl.DefaultAppliance.access$1400
(DefaultAppliance.java:112)
        at
org.apache.avalon.activation.appliance.impl.DefaultAppliance$StandardFac
tory.newInstance(DefaultAppliance.java:1294)
        at
org.apache.avalon.activation.lifestyle.impl.SingletonLifestyleHandler.re
freshReference(SingletonLifestyleHandler.java:138
)
        at
org.apache.avalon.activation.lifestyle.impl.SingletonLifestyleHandler.re
solve(SingletonLifestyleHandler.java:88)
        at
org.apache.avalon.activation.appliance.impl.DefaultAppliance.resolve(Def
aultAppliance.java:566)
        at
org.apache.avalon.activation.appliance.impl.DefaultAppliance.deploy(Defa
ultAppliance.java:508)
        at
org.apache.avalon.activation.appliance.impl.DefaultBlock.deploy(DefaultB
lock.java:623)
        at
org.apache.avalon.activation.appliance.impl.BlockThread.run(BlockThread.
java:111)


Can anyone see any problems with my usage?

Has anyone used excalibur-datasource/cornerstone-datasources within
merlin?


cheers
</jima>


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


Re: Why does Block.lookup throws Exception?

Posted by Stephen McConnell <mc...@apache.org>.

Stephen McConnell wrote:

>
> Eric:
>
> Have taken a look at the component build.  For the configuration 
> component and the mimetype component you need to include a parent 
> project defintion that includes a resource definition to copy the 
> block.xml into the appropriate directory (otherwise the unit test will 
> locate the block.xml).  I have attached a merlin-project.xml and a 
> maven.xml that I put into my the /fulcrum/configuration and 
> /fulcrum/mimetype directories, updated the <extend> tag in the impl 
> subdirectories and everything works fine.
>
> Was not able to build security or osworkflow (details included in 
> earlier email).
>
> Finally - it looks like there may be something odd going on inside the 
> turbine 2.4 build as its trying to resolve 2.4 while building 2.4. In 
> particular jakarta-turbine-2/extensions/torque is trying to download 
> 2.4-dev as part of the build and 2.4-dev does not appear to exist, and 
> 2.4-dev is the main build target. Feels like something recursive? 


Just a note - seems that the default goal assumes that 2.4-dev is built 
but does not build it if it isn't.
Doing a maven jar:install in jakarta-turbine-2 seems to be getting me to 
the point where I can see the errors you concerned about. Ok - I'm still 
digging.

Cheers, Steve.

>
>
> Stephen.
>
>
>
> Eric Pugh wrote:
>
>> 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
>>
>>
>>  
>>
>
>------------------------------------------------------------------------
>
><project default="fulcrum:build" xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:util="jelly:util" xmlns:ant="jelly:ant">
>
>  <goal name="fulcrum:build" description="Build Fulcrum.">
>    <maven:reactor basedir="${basedir}"
>      includes="**/project.xml"
>      excludes="target/**,project.xml"
>      goals="jar:install"
>      banner="Installing:"
>      ignoreFailures="false" />
>  </goal>
>
>  <goal name="fulcrum:clean" description="Build Fulcrum." prereqs="clean">
>    <maven:reactor basedir="${basedir}"
>      includes="**/project.xml"
>      excludes="target/**,project.xml"
>      goals="clean:clean"
>      banner="Installing:"
>      ignoreFailures="false" />
>  </goal>
>
></project>
>  
>
>------------------------------------------------------------------------
>
><?xml version="1.0"?>
><project>
>  <pomVersion>3</pomVersion>
>  <groupId>fulcrum</groupId>
>  <organization>
>    <name>Apache Software Foundation</name>
>    <url>http://jakarta.apache.org/</url>
>    <logo>/images/jakarta-logo-blue.gif</logo>
>  </organization>
>  <inceptionYear>2000</inceptionYear>
>  <package>org.apache.fulcrum</package>
>  <gumpRepositoryId>jakarta</gumpRepositoryId>
>  <shortDescription>Component Repository</shortDescription>
>  <description>Fulcrum is a component repository for Turbine.</description>
>  <url>http://jakarta.apache.org/turbine/fulcrum/${pom.artifactId}/</url>
>  <issueTrackingUrl>http://issues.apache.org/scarab/servlet/scarab/</issueTrackingUrl>
>  <siteAddress>jakarta.apache.org</siteAddress>
>  <siteDirectory>/www/jakarta.apache.org/turbine/fulcrum/</siteDirectory>
>  <distributionDirectory>/www/jakarta.apache.org/builds/jakarta-turbine-fulcrum/</distributionDirectory>
>  <repository>
>    <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-turbine-fulcrum</connection>
>    <url>http://cvs.apache.org/viewcvs/jakarta-turbine-fulcrum/</url>
>  </repository>
>  <mailingLists>
>    <mailingList>
>      <name>Turbine User List</name>
>      <subscribe>turbine-user-subscribe@jakarta.apache.org</subscribe>
>      <unsubscribe>turbine-user-unsubscribe@jakarta.apache.org</unsubscribe>
>      <archive>http://archives.apache.org/eyebrowse/SummarizeList?listName=turbine-user@jakarta.apache.org</archive>
>    </mailingList>
>    <mailingList>
>      <name>Turbine Developer List</name>
>      <subscribe>turbine-dev-subscribe@jakarta.apache.org</subscribe>
>      <unsubscribe>turbine-dev-unsubscribe@jakarta.apache.org</unsubscribe>
>      <archive>http://archives.apache.org/eyebrowse/SummarizeList?listName=turbine-dev@jakarta.apache.org</archive>
>    </mailingList>
>  </mailingLists>
>  <developers>
>    <developer>
>      <name>Geir Magnusson Jr.</name>
>      <id>geirm</id>
>      <email>geirm@optonline.net</email>
>      <organization>Independent (DVSL Maven)</organization>
>    </developer>
>    <developer>
>      <name>Quinton McCombs</name>
>      <id>quintonm</id>
>      <email>quintonm@bellsouth.net</email>
>      <organization>NequalsOne</organization>
>      <roles>
>        <role>Java Developer</role>
>      </roles>
>    </developer>
>    <developer>
>      <name>John McNally</name>
>      <id>jmcnally</id>
>      <email>jmcnally@collab.net</email>
>      <organization>CollabNet</organization>
>    </developer>
>    <developer>
>      <name>Martin Poeschl</name>
>      <id>mpoeschl</id>
>      <email>mpoeschl@marmot.at</email>
>      <organization>Tucana</organization>
>    </developer>
>    <developer>
>      <name>Eric Pugh</name>
>      <id>epugh</id>
>      <email>epugh@upstate.com</email>
>    </developer>
>    <developer>
>      <name>Daniel Rall</name>
>      <id>dlr</id>
>      <email>dlr@finemaltcoding.com</email>
>      <organization>CollabNet, Inc.</organization>
>    </developer>
>    <developer>
>      <name>Henning P. Schmiedehausen</name>
>      <id>henning</id>
>      <email>hps@intermeta.de</email>
>      <organization>INTERMETA - Gesellschaft fuer Mehrwertdienste mbH</organization>
>    </developer>
>    <developer>
>      <name>Jon Scott Stevens</name>
>      <id>jon</id>
>      <email>jon@latchkey.com</email>
>      <organization>CollabNet, Inc.</organization>
>    </developer>
>    <developer>
>      <name>Jason van Zyl</name>
>      <id>jvanzyl</id>
>      <email>jason@zenplex.com</email>
>      <organization>Zenplex</organization>
>    </developer>
>  </developers>
>  <contributors>
>    <contributor>
>      <name>Dan Diephouse</name>
>      <id>dandiep</id>
>      <email>dan@envoisolutions.com</email>
>      <organization>Envoi solutions</organization>
>      <roles>
>        <role>Developer</role>
>      </roles>
>    </contributor>
>    <contributor>
>       <name>Pete Kazmier</name>
>       <id>kaz</id>
>       <email></email>
>       <organization></organization>
>       <roles>
>         <role>Developer</role>
>       </roles>
>    </contributor>
>    <contributor>
>      <name>Kasper Nielsen</name>
>      <id>kasper</id>
>      <email>apache@kav.dk</email>
>      <organization></organization>
>      <roles>
>        <role>Developer</role>
>      </roles>
>    </contributor>
>    <contributor>
>       <name>James Taylor</name>
>       <id>jtaylor</id>
>       <email>james@jamestaylor.org</email>
>       <organization></organization>
>       <roles>
>         <role>Developer</role>
>       </roles>
>    </contributor>
>  </contributors>
>
>
>  <build>
>    <sourceDirectory>${basedir}/src/java/</sourceDirectory>
>    <unitTestSourceDirectory>${basedir}/src/test/</unitTestSourceDirectory>
>    <unitTest>
>      <includes>
>        <include>**/*Test.*</include>
>        <include>**/*TestCase.*</include>
>      </includes>
>      <excludes>
>        <include>**/Abstract*.*</include>
>      </excludes>
>      <resources>
>        <resource>
>          <directory>${basedir}/src/java</directory>
>          <includes>
>            <include>**/*.x*</include>
>          </includes>
>        </resource>
>        <resource>
>          <directory>${basedir}/conf</directory>
>          <targetPath>BLOCK-INF</targetPath>
>          <includes>
>            <include>block.xml</include>
>          </includes>
>        </resource>
>      </resources>
>    </unitTest>
>    <integrationUnitTestPatterns></integrationUnitTestPatterns>
>    <resources>
>      <resource>
>        <directory>${basedir}/conf</directory>
>        <targetPath>BLOCK-INF</targetPath>
>        <includes>
>          <include>block.xml</include>
>        </includes>
>      </resource>
>      <resource>
>        <directory>${basedir}/src/java</directory>
>        <includes>
>          <include>**/*.x*</include>
>        </includes>
>      </resource>
>    </resources>
>    <jars></jars>
>  </build>
> 
></project>
>
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>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


RE: Why does Block.lookup throws Exception?

Posted by Eric Pugh <ep...@upstate.com>.
Thanks Stephen,

I think I updated the build..  Thanks for the Reactor code, as multiproject
is failing frequently due to out of memory errors..  I was enjoying all the
benefits of multiplugin, but until the memory holes are patched, I think
just using the reactor directly is the way to go.

I have committed an updated project.xml that includes the copying of the
block.xml file.  I believe the same project.xml can be used by the not yet
merlinized components as well as the merlinized components.

As far as the Turbine 2.4 build, yes, the
jakarta-turbine-2/extensions/torque build requires 2.4.  Under the reactor
it should realize that the torque extension requires 2.4, and therefore
build it first, and then the torque extension.  I am trying to get the
torque code into it's own build so that when I am ready to replace it with
the fulcrum security, it will be more of a drop in replacement.  Also, the
torque code forced some ugly build steps on the turbine core!  I can foresee
other turbine specific code that would go in extensions as well.

At this point I have the block.xml loading up both the sample Hello
component as well as the Mimetype component!

Eric



> -----Original Message-----
> From: Stephen McConnell [mailto:mcconnell@apache.org]
> Sent: Friday, November 14, 2003 12:46 AM
> To: Avalon Developers List
> Subject: Re: Why does Block.lookup throws Exception?
>
>
>
> Eric:
>
> Have taken a look at the component build.  For the configuration
> component and the mimetype component you need to include a parent
> project defintion that includes a resource definition to copy the
> block.xml into the appropriate directory (otherwise the unit
> test will
> locate the block.xml).  I have attached a merlin-project.xml and a
> maven.xml that I put into my the /fulcrum/configuration and
> /fulcrum/mimetype directories, updated the <extend> tag in the impl
> subdirectories and everything works fine.
>
> Was not able to build security or osworkflow (details included in
> earlier email).
>
> Finally - it looks like there may be something odd going on
> inside the
> turbine 2.4 build as its trying to resolve 2.4 while building 2.4. In
> particular jakarta-turbine-2/extensions/torque is trying to download
> 2.4-dev as part of the build and 2.4-dev does not appear to
> exist, and
> 2.4-dev is the main build target. Feels like something recursive?
>
> Stephen.
>
>
>
> Eric Pugh wrote:
>
> >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
> >
> >
> >
> >
>
> --
>
> 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


Re: Why does Block.lookup throws Exception?

Posted by Stephen McConnell <mc...@apache.org>.
Eric:

Have taken a look at the component build.  For the configuration 
component and the mimetype component you need to include a parent 
project defintion that includes a resource definition to copy the 
block.xml into the appropriate directory (otherwise the unit test will 
locate the block.xml).  I have attached a merlin-project.xml and a 
maven.xml that I put into my the /fulcrum/configuration and 
/fulcrum/mimetype directories, updated the <extend> tag in the impl 
subdirectories and everything works fine.

Was not able to build security or osworkflow (details included in 
earlier email).

Finally - it looks like there may be something odd going on inside the 
turbine 2.4 build as its trying to resolve 2.4 while building 2.4. In 
particular jakarta-turbine-2/extensions/torque is trying to download 
2.4-dev as part of the build and 2.4-dev does not appear to exist, and 
2.4-dev is the main build target. Feels like something recursive?

Stephen.



Eric Pugh wrote:

>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
>
>
>  
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/                               |
|------------------------------------------------|




RE: Why does Block.lookup throws Exception?

Posted by Eric Pugh <ep...@upstate.com>.
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


RE: Why does Block.lookup throws Exception?

Posted by Eric Pugh <ep...@upstate.com>.
Also,

I am currently loading a block with a container called 'tutorial' which was
the easist way to load the Appliance for this: appliance:/tutorial/hello...

However, what I think should be happening is that the block.xml in
merlin-hello-tutorial.jar should be auto imported under the name
'tutorial/hello' while the block for turbine should have a container called
'turbine' so any thing would be defined as 'turbine/mimetype'.  I looked,
and the block for fulcrum-mimetype-impl-1.0-alpha-4.jar (mouthful!) has a
container called 'test' which I think is wrong..

The mimetype code for fulcrum based on what you did is all checked in by the
way..

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


Re: Why does Block.lookup throws Exception?

Posted by Stephen McConnell <mc...@apache.org>.

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


RE: Why does Block.lookup throws Exception?

Posted by Eric Pugh <ep...@upstate.com>.
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..

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")

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..  Not sure though..  Right now I
just get back a null..

I can commit the code if that helps..

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


Re: Why does Block.lookup throws Exception?

Posted by Stephen McConnell <mc...@apache.org>.

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