You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by kristian meier <kr...@jentro.com> on 2003/06/24 15:20:24 UTC

[merlin] exception gets swallowed in avalon lifecycle methods, or how can I get them into the debug log ?

Hi Steve,

   if I do something like this merlin just starts as without any 
complains, but should give some info when
using in the debug mode.

public void start() throws Exception
        {
            if (started)
                throw new IllegalStateException("Already started");
             if (!started) throw new Exception("force error!");
            new Thread(this).start();
            started = true;
        }



the  DefaultDeploymentService class does throw the correct exception like:
throw new DeploymentException( error, e );

how can I get them into the debug log ?

best wishes Kristian



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


Re: [merlin] exception gets swallowed in avalon lifecycle methods, or how can I get them into the debug log ?

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

kristian meier wrote:

> Hi Steve,
>
> exchanging your block.xml with the attached file will show the 
> behavior I saw before. 


ok  ... we have a problem

>
> Kristian
>
> PS: I like you little test-case, for such a little thing I was too 
> unorganized yet ;-) 


Just a copy and pase from another little test case.
(handy to have around for moments like these)

Steve.


-- 

Stephen J. McConnell
mailto:mcconnell@apache.org
http://www.osm.net

Sent via James running under Merlin as an NT service.
http://avalon.apache.org/sandbox/merlin




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


Re: [merlin] exception gets swallowed in avalon lifecycle methods, or how can I get them into the debug log ?

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

kristian meier wrote:

> Hi Steve,
>
> exchanging your block.xml with the attached file will show the 
> behavior I saw before. 


I've made an update to StandardBlock to wait for thread startup and on 
completioto check for a startup error.

Using the updated block.xml:

 <block>
   <implementation>
     <container name="nested">
       <component name="hello"
         class="org.apache.avalon.merlin.test.HelloComponent"
         activation="startup"/>
     </container>
   </implementation>
 </block>

We now have the following runtime failure:

$ merlin target\*.jar -execute

  [INFO   ] (nested.hello): starting
  [ERROR  ] (sys): Root block installation failure.
  -------------------------------------------------------------------
  Exception: org.apache.avalon.merlin.kernel.KernelException
  Message: Root block deployment failure.

  Cause: org.apache.avalon.merlin.block.BlockException
  Message: Composite deployment failure in: [block://]

  Cause: org.apache.avalon.assembly.locator.LocatorException
  Message: Internal implementation deployment failure in block: 
[block://nested/]

  Cause: org.apache.avalon.merlin.block.BlockException
  Message: Composite deployment failure in: [block://nested/]

  Cause: org.apache.avalon.assembly.locator.LocatorException
  Message: Singleton object access failure in: [appliance://nested/hello]

  Cause: org.apache.avalon.assembly.lifestyle.LifestyleException
  Message: Unable to create new instance for appliance: 
[appliance://nested/hello]

  Cause: org.apache.avalon.assembly.lifecycle.DeploymentException
  Message: Component deployment failure in appliance: 
[appliance://nested/hello]

  Cause: java.lang.IllegalStateException
  Message: force-error


Cheers, Steve.

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org
http://www.osm.net

Sent via James running under Merlin as an NT service.
http://avalon.apache.org/sandbox/merlin




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


Re: [merlin] exception gets swallowed in avalon lifecycle methods, or how can I get them into the debug log ?

Posted by kristian meier <kr...@jentro.com>.
Hi Steve,

exchanging your block.xml with the attached file will show the behavior 
I saw before.

Kristian

PS: I like you little test-case, for such a little thing I was too 
unorganized yet ;-)

Stephen McConnell wrote:

>
>
> kristian meier wrote:
>
>> Hi Steve,
>>
>>   if I do something like this merlin just starts as without any 
>> complains, but should give some info when
>> using in the debug mode.
>>
>> public void start() throws Exception
>>        {
>>            if (started)
>>                throw new IllegalStateException("Already started");
>>             if (!started) throw new Exception("force error!");
>>            new Thread(this).start();
>>            started = true;
>>        }
>
>
>
> If your not seeing a complaint, chances are that you component is not 
> declaring that it implements startable.  Attached is a little test 
> case that demonstrates the sort of complaints you should be seeing:
>
> $ maven jar
>
> You should see a bunch a build messages then the folowing runtime 
> deployment test.
>
> merlin:deploy:
>    [echo] Merlin block deployment.
>    [echo] From jar: 
> F:\dev\avalon-sandbox\merlin-test\forced-error/target/merlin-test-forced-error- 
>
> 1.0.jar
> [INFO   ] (hello): starting
> [ERROR  ] (sys): Root block installation failure.
> -------------------------------------------------------------------
> Exception: org.apache.avalon.merlin.kernel.KernelException
> Message: Unable to deploy block.
> Block: /
>
> Cause: org.apache.avalon.merlin.block.BlockException
> Message: Could not establish a subsidiary appliance: 
> [appliance://hello] in block: [block://]
>
> Cause: org.apache.avalon.assembly.locator.LocatorException
> Message: Resolution failure in appliance: [appliance://hello]
>
> Cause: org.apache.avalon.assembly.locator.LocatorException
> Message: Singleton object access failure.
>
> Cause: org.apache.avalon.assembly.lifestyle.LifestyleException
> Message: Unable to create new instance for appliance: [appliance://hello]
>
> Cause: org.apache.avalon.assembly.lifecycle.DeploymentException
> Message: Component deployment failure in appliance: [appliance://hello]
>
> Cause: java.lang.IllegalStateException
> Message: force-error
> -------------------------------------------------------------------
>
> Cheers, Stece.
>
>>
>>
>>
>> the  DefaultDeploymentService class does throw the correct exception 
>> like:
>> throw new DeploymentException( error, e );
>>
>> how can I get them into the debug log ?
>>
>> best wishes Kristian
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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] exception gets swallowed in avalon lifecycle methods, or how can I get them into the debug log ?

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

kristian meier wrote:

> Hi Steve,
>
>   if I do something like this merlin just starts as without any 
> complains, but should give some info when
> using in the debug mode.
>
> public void start() throws Exception
>        {
>            if (started)
>                throw new IllegalStateException("Already started");
>             if (!started) throw new Exception("force error!");
>            new Thread(this).start();
>            started = true;
>        }


If your not seeing a complaint, chances are that you component is not 
declaring that it implements startable.  Attached is a little test case 
that demonstrates the sort of complaints you should be seeing:

$ maven jar

You should see a bunch a build messages then the folowing runtime 
deployment test.

merlin:deploy:
    [echo] Merlin block deployment.
    [echo] From jar: 
F:\dev\avalon-sandbox\merlin-test\forced-error/target/merlin-test-forced-error-
1.0.jar
[INFO   ] (hello): starting
[ERROR  ] (sys): Root block installation failure.
-------------------------------------------------------------------
Exception: org.apache.avalon.merlin.kernel.KernelException
Message: Unable to deploy block.
Block: /

Cause: org.apache.avalon.merlin.block.BlockException
Message: Could not establish a subsidiary appliance: [appliance://hello] 
in block: [block://]

Cause: org.apache.avalon.assembly.locator.LocatorException
Message: Resolution failure in appliance: [appliance://hello]

Cause: org.apache.avalon.assembly.locator.LocatorException
Message: Singleton object access failure.

Cause: org.apache.avalon.assembly.lifestyle.LifestyleException
Message: Unable to create new instance for appliance: [appliance://hello]

Cause: org.apache.avalon.assembly.lifecycle.DeploymentException
Message: Component deployment failure in appliance: [appliance://hello]

Cause: java.lang.IllegalStateException
Message: force-error
-------------------------------------------------------------------

Cheers, Stece.

>
>
>
> the  DefaultDeploymentService class does throw the correct exception 
> like:
> throw new DeploymentException( error, e );
>
> how can I get them into the debug log ?
>
> best wishes Kristian
>
>
>
> ---------------------------------------------------------------------
> 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
http://www.osm.net

Sent via James running under Merlin as an NT service.
http://avalon.apache.org/sandbox/merlin