dev@glassfish.java.net

Re: Adding PostConstruct to an AdminCommand

From: Kumar Jayanti <Vbkumar.Jayanti_at_Sun.COM>
Date: Tue, 06 Jul 2010 19:56:59 +0530

Jerome Dochez wrote:
> I think your postConstruct implementation is throwing an exception,
> and the command framework is tagging the implementation as invalid.
> have you checked the log ?
ok, i was trying to access an injected command parameter @Param and
call toCharArray() on it inside postConstruct(). I did not expect the
param to be null. I will double check.

regards,
kumar
>
> On 7/5/10 3:19 AM, Kumar Jayanti wrote:
>> Hi,
>>
>> I am trying to make a Class that implements AdminCommand to also
>> implement org.jvnet.hk2.component.PostConstruct. If i do this then
>> the AdminCommand is no longer recognized as an admin command. Is this
>> a Feature or a Bug or is this expected.
>>
>> For example i changed the class CreateFileUser.java
>>
>> public class CreateFileUser implements AdminCommand, PostConstruct {
>> ...
>> }
>>
>> After doing this when i try create-file-user i get the following error :
>>
>> >.\asadmin create-file-user test
>>
>> Closest matching local and remote command(s):
>> create-file-user
>> Command create-file-user failed.
>>
>>
>> regards,
>> kumar
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
>