You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Ryan Dietrich <ry...@betterservers.com> on 2013/04/04 22:10:16 UTC

Plugin woes...

I have written a test plugin, but it is not being picked up by spring.

Specifically, I am looking at ApiDiscoveryServiceImpl.java

    @Inject protected List<PluggableService> _services = null;
My newly created @Component is now showing up in this list and I'm not sure why.

I'd like to add this to the wiki on plugins, but as it doesn't work anymore, I'd like to get it fixed first. 

http://pastebin.com/Yz8Yc18n



Re: Plugin woes...

Posted by Ryan Dietrich <ry...@betterservers.com>.
I was told that if I used:

@Component 

on the object that extended PluggableService I did not have to add it to componentsContext.xml ..
Side note, given that I'm using Jetty, does that even get touched? (it's in a tomcat client configuration directory)

On Apr 4, 2013, at 2:24 PM, Alex Huang <Al...@citrix.com> wrote:

> Ryan,
> 
> Did you add it to componentscontext.xml?
> 
> --Alex
> 
>> -----Original Message-----
>> From: Ryan Dietrich [mailto:ryan@betterservers.com]
>> Sent: Thursday, April 4, 2013 1:16 PM
>> To: dev@cloudstack.apache.org
>> Subject: Re: Plugin woes...
>> 
>> Oh, I should mention I did this on the 4.1 branch.
>> 
>> On Apr 4, 2013, at 2:10 PM, Ryan Dietrich <ry...@betterservers.com> wrote:
>> 
>>> I have written a test plugin, but it is not being picked up by spring.
>>> 
>>> Specifically, I am looking at ApiDiscoveryServiceImpl.java
>>> 
>>>   @Inject protected List<PluggableService> _services = null; My newly
>>> created @Component is now showing up in this list and I'm not sure why.
>>> 
>>> I'd like to add this to the wiki on plugins, but as it doesn't work anymore, I'd
>> like to get it fixed first.
>>> 
>>> http://pastebin.com/Yz8Yc18n
>>> 
>>> 
> 


Re: Plugin woes...

Posted by Rohit Yadav <bh...@apache.org>.
Good we discussed this issue. Let's make a habit to update the wikis as we
push changes around specific components especially APIs, plugins.

Cheers.

On Fri, Apr 5, 2013 at 10:57 AM, Kelven Yang <ke...@citrix.com> wrote:

> I updated following wiki to help clarify some of confusions in this area
>
> https://cwiki.apache.org/confluence/display/CLOUDSTACK/Using+Spring+in+Clou
> dStack
>
>
> Kelven
>
>
> On 4/4/13 8:45 PM, "Ryan Dietrich" <ry...@betterservers.com> wrote:
>
> >I went ahead and updated the wiki with an example.  Feel free to
> >add/remove/edit what I've written.
> >
> >-Ryan Dietrich
> >
> >On Apr 4, 2013, at 6:12 PM, Kelven Yang <ke...@citrix.com> wrote:
> >
> >> We removed auto-scanning recently and we need to update related
> >> documentation as well on guidelines to program components and
> >>add/enable a
> >> plugin into CloudStack. I'll update the wiki accordingly soon
> >>
> >> Kelven
> >
>
>

Re: Plugin woes...

Posted by Kelven Yang <ke...@citrix.com>.
I updated following wiki to help clarify some of confusions in this area

https://cwiki.apache.org/confluence/display/CLOUDSTACK/Using+Spring+in+Clou
dStack


Kelven


On 4/4/13 8:45 PM, "Ryan Dietrich" <ry...@betterservers.com> wrote:

>I went ahead and updated the wiki with an example.  Feel free to
>add/remove/edit what I've written.
>
>-Ryan Dietrich
>
>On Apr 4, 2013, at 6:12 PM, Kelven Yang <ke...@citrix.com> wrote:
>
>> We removed auto-scanning recently and we need to update related
>> documentation as well on guidelines to program components and
>>add/enable a
>> plugin into CloudStack. I'll update the wiki accordingly soon
>> 
>> Kelven
>


Re: Plugin woes...

Posted by Ryan Dietrich <ry...@betterservers.com>.
I went ahead and updated the wiki with an example.  Feel free to add/remove/edit what I've written.

-Ryan Dietrich

On Apr 4, 2013, at 6:12 PM, Kelven Yang <ke...@citrix.com> wrote:

> We removed auto-scanning recently and we need to update related
> documentation as well on guidelines to program components and add/enable a
> plugin into CloudStack. I'll update the wiki accordingly soon
> 
> Kelven


Re: Plugin woes...

Posted by Kelven Yang <ke...@citrix.com>.
We removed auto-scanning recently and we need to update related
documentation as well on guidelines to program components and add/enable a
plugin into CloudStack. I'll update the wiki accordingly soon

Kelven

On 4/4/13 2:50 PM, "Ryan Dietrich" <ry...@betterservers.com> wrote:

>Ok, it works now.  I just had to add:
>
>  <bean id="timeOfDayManagerImpl"
>class="com.cloud.test.TimeOfDayManagerImpl"> </bean>
>
>to client/tomcatconf/componentContext.xml.in
>
>I'll wait for Kelven to update the xml in 4.1, and then I'll pretty up my
>example plugin and update the wiki.
>
>Thank you all for your assistance.
>
>-Ryan Dietrich
>
>On Apr 4, 2013, at 3:00 PM, Alex Huang <Al...@citrix.com> wrote:
>
>> Ryan,
>> 
>> I believe it's something Kelven added recently.  Auto-Scanning via
>>@Component has been disabled.  There are numerous reasons why
>>auto-scanning is bad.  Take for example the case of someone extending a
>>component with the @Component annotation, they don't want to modify the
>>parent class at all but they only want their component to be loaded but
>>because of auto-scanning both gets loaded.  There are other cases of
>>this.  A declarative description is much better.
>> 
>> We apologize for the inconvenience this change has caused for you.
>>Kelven should be able to give you better instructions on how to add it
>>properly in the latest 4.1 branch.
>> 
>> --Alex


Re: Plugin woes...

Posted by Ryan Dietrich <ry...@betterservers.com>.
Ok, it works now.  I just had to add: 

  <bean id="timeOfDayManagerImpl" class="com.cloud.test.TimeOfDayManagerImpl"> </bean>

to client/tomcatconf/componentContext.xml.in

I'll wait for Kelven to update the xml in 4.1, and then I'll pretty up my example plugin and update the wiki.

Thank you all for your assistance.

-Ryan Dietrich

On Apr 4, 2013, at 3:00 PM, Alex Huang <Al...@citrix.com> wrote:

> Ryan,
> 
> I believe it's something Kelven added recently.  Auto-Scanning via @Component has been disabled.  There are numerous reasons why auto-scanning is bad.  Take for example the case of someone extending a component with the @Component annotation, they don't want to modify the parent class at all but they only want their component to be loaded but because of auto-scanning both gets loaded.  There are other cases of this.  A declarative description is much better.
> 
> We apologize for the inconvenience this change has caused for you.  Kelven should be able to give you better instructions on how to add it properly in the latest 4.1 branch.
> 
> --Alex

RE: Plugin woes...

Posted by Alex Huang <Al...@citrix.com>.
Ryan,

I believe it's something Kelven added recently.  Auto-Scanning via @Component has been disabled.  There are numerous reasons why auto-scanning is bad.  Take for example the case of someone extending a component with the @Component annotation, they don't want to modify the parent class at all but they only want their component to be loaded but because of auto-scanning both gets loaded.  There are other cases of this.  A declarative description is much better.

We apologize for the inconvenience this change has caused for you.  Kelven should be able to give you better instructions on how to add it properly in the latest 4.1 branch.

--Alex

> -----Original Message-----
> From: Ryan Dietrich [mailto:ryan@betterservers.com]
> Sent: Thursday, April 4, 2013 1:31 PM
> To: dev@cloudstack.apache.org
> Subject: Re: Plugin woes...
> 
> I had this working yesterday and never touched componentContext.xml ... I
> did a git pull this morning, and everything broke.  I'm going off the current
> documentation and some notes that Rohit++ sent me.
> The current documentation does not mention anything about
> componentContext.xml:
> 
> https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+API+
> Development
> 
> On Apr 4, 2013, at 2:27 PM, Kelven Yang <ke...@citrix.com> wrote:
> 
> > I have organized the componentContext.xml to be in plugin friendly
> > style, I'll add a updated document for this as well. will commit to
> > 4.1 today
> >
> > Kelven
> >
> > On 4/4/13 1:24 PM, "Alex Huang" <Al...@citrix.com> wrote:
> >
> >> Ryan,
> >>
> >> Did you add it to componentscontext.xml?
> >>
> >> --Alex
> >>
> >>> -----Original Message-----
> >>> From: Ryan Dietrich [mailto:ryan@betterservers.com]
> >>> Sent: Thursday, April 4, 2013 1:16 PM
> >>> To: dev@cloudstack.apache.org
> >>> Subject: Re: Plugin woes...
> >>>
> >>> Oh, I should mention I did this on the 4.1 branch.
> >>>
> >>> On Apr 4, 2013, at 2:10 PM, Ryan Dietrich <ry...@betterservers.com>
> >>> wrote:
> >>>
> >>>> I have written a test plugin, but it is not being picked up by spring.
> >>>>
> >>>> Specifically, I am looking at ApiDiscoveryServiceImpl.java
> >>>>
> >>>>   @Inject protected List<PluggableService> _services = null; My
> >>>> newly created @Component is now showing up in this list and I'm not
> >>>> sure
> >>> why.
> >>>>
> >>>> I'd like to add this to the wiki on plugins, but as it doesn't work
> >>> anymore, I'd
> >>> like to get it fixed first.
> >>>>
> >>>> http://pastebin.com/Yz8Yc18n
> >>>>
> >>>>
> >>
> >


Re: Plugin woes...

Posted by Ryan Dietrich <ry...@betterservers.com>.
I had this working yesterday and never touched componentContext.xml
… I did a git pull this morning, and everything broke.  I'm going off the current documentation and some notes that Rohit++ sent me.
The current documentation does not mention anything about componentContext.xml:

https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+API+Development

On Apr 4, 2013, at 2:27 PM, Kelven Yang <ke...@citrix.com> wrote:

> I have organized the componentContext.xml to be in plugin friendly style,
> I'll add a updated document for this as well. will commit to 4.1 today
> 
> Kelven
> 
> On 4/4/13 1:24 PM, "Alex Huang" <Al...@citrix.com> wrote:
> 
>> Ryan,
>> 
>> Did you add it to componentscontext.xml?
>> 
>> --Alex
>> 
>>> -----Original Message-----
>>> From: Ryan Dietrich [mailto:ryan@betterservers.com]
>>> Sent: Thursday, April 4, 2013 1:16 PM
>>> To: dev@cloudstack.apache.org
>>> Subject: Re: Plugin woes...
>>> 
>>> Oh, I should mention I did this on the 4.1 branch.
>>> 
>>> On Apr 4, 2013, at 2:10 PM, Ryan Dietrich <ry...@betterservers.com>
>>> wrote:
>>> 
>>>> I have written a test plugin, but it is not being picked up by spring.
>>>> 
>>>> Specifically, I am looking at ApiDiscoveryServiceImpl.java
>>>> 
>>>>   @Inject protected List<PluggableService> _services = null; My newly
>>>> created @Component is now showing up in this list and I'm not sure
>>> why.
>>>> 
>>>> I'd like to add this to the wiki on plugins, but as it doesn't work
>>> anymore, I'd
>>> like to get it fixed first.
>>>> 
>>>> http://pastebin.com/Yz8Yc18n
>>>> 
>>>> 
>> 
> 


Re: Plugin woes...

Posted by Kelven Yang <ke...@citrix.com>.
I have organized the componentContext.xml to be in plugin friendly style,
I'll add a updated document for this as well. will commit to 4.1 today

Kelven

On 4/4/13 1:24 PM, "Alex Huang" <Al...@citrix.com> wrote:

>Ryan,
>
>Did you add it to componentscontext.xml?
>
>--Alex
>
>> -----Original Message-----
>> From: Ryan Dietrich [mailto:ryan@betterservers.com]
>> Sent: Thursday, April 4, 2013 1:16 PM
>> To: dev@cloudstack.apache.org
>> Subject: Re: Plugin woes...
>> 
>> Oh, I should mention I did this on the 4.1 branch.
>> 
>> On Apr 4, 2013, at 2:10 PM, Ryan Dietrich <ry...@betterservers.com>
>>wrote:
>> 
>> > I have written a test plugin, but it is not being picked up by spring.
>> >
>> > Specifically, I am looking at ApiDiscoveryServiceImpl.java
>> >
>> >    @Inject protected List<PluggableService> _services = null; My newly
>> > created @Component is now showing up in this list and I'm not sure
>>why.
>> >
>> > I'd like to add this to the wiki on plugins, but as it doesn't work
>>anymore, I'd
>> like to get it fixed first.
>> >
>> > http://pastebin.com/Yz8Yc18n
>> >
>> >
>


RE: Plugin woes...

Posted by Alex Huang <Al...@citrix.com>.
Ryan,

Did you add it to componentscontext.xml?

--Alex

> -----Original Message-----
> From: Ryan Dietrich [mailto:ryan@betterservers.com]
> Sent: Thursday, April 4, 2013 1:16 PM
> To: dev@cloudstack.apache.org
> Subject: Re: Plugin woes...
> 
> Oh, I should mention I did this on the 4.1 branch.
> 
> On Apr 4, 2013, at 2:10 PM, Ryan Dietrich <ry...@betterservers.com> wrote:
> 
> > I have written a test plugin, but it is not being picked up by spring.
> >
> > Specifically, I am looking at ApiDiscoveryServiceImpl.java
> >
> >    @Inject protected List<PluggableService> _services = null; My newly
> > created @Component is now showing up in this list and I'm not sure why.
> >
> > I'd like to add this to the wiki on plugins, but as it doesn't work anymore, I'd
> like to get it fixed first.
> >
> > http://pastebin.com/Yz8Yc18n
> >
> >


Re: Plugin woes...

Posted by Ryan Dietrich <ry...@betterservers.com>.
Oh, I should mention I did this on the 4.1 branch.

On Apr 4, 2013, at 2:10 PM, Ryan Dietrich <ry...@betterservers.com> wrote:

> I have written a test plugin, but it is not being picked up by spring.
> 
> Specifically, I am looking at ApiDiscoveryServiceImpl.java
> 
>    @Inject protected List<PluggableService> _services = null;
> My newly created @Component is now showing up in this list and I'm not sure why.
> 
> I'd like to add this to the wiki on plugins, but as it doesn't work anymore, I'd like to get it fixed first. 
> 
> http://pastebin.com/Yz8Yc18n
> 
>