Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » no error message but kura does not construct/initialise component(when there is a configuration issue with a component or it's xml, there is no logging or error messages to help a developer)
no error message but kura does not construct/initialise component [message #1708103] Sun, 13 September 2015 10:06 Go to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
Hi all,

I came across this last week when I accidentally named a method 'acitvate' which was supposed to never be called. It was a place-holder for what I would later put in an 'activate' method however at the time I was assuming it was ok to have an un-published/referenced method named 'activate'.

Problem was that it was 'default' access, not protected/public. although my Component.xml had no reference to the 'activate' method this didn't matter (i later learned that kura tries to call activate even if the xml does not specify an activate method).

The component never loaded, and no error messages appear in the logs. I finally realised my mistake when I removed the method and everything worked again.

I am now part way through solving what I guess is a similar issue (a component not starting up) and again there is no message in the logs to help me. Of three components, only 2 start up.

Why does kura fail without any logging when a component is explicitly specified via manifest.mf?

Is there any way to debug why the component is not loading?

thanks. p.

[Updated on: Sun, 13 September 2015 10:07]

Report message to a moderator

Re: no error message but kura does not construct/initialise component [message #1708104 is a reply to message #1708103] Sun, 13 September 2015 10:43 Go to previous messageGo to next message
Amit Kumar Mondal is currently offline Amit Kumar MondalFriend
Messages: 108
Registered: March 2015
Location: Munich, Germany
Senior Member

Hi Paul,

As far as I understood, your OSGi service component is not getting registered. I believe it's due to some malconfiguration in the Component Definition. I confronted the same issue. I would suggest you to start OSGi console and run ls to list all the registered service components. Check if your component is listed there.

1. If it is listed, check its status. It would be either ACTIVE or Unsatisfied. If it's active then your component is working fine and if not then try to execute COMP <component id> to see more details regarding that component.

2. If your component is not listed then try to restart the bundle manually using STOP and START command. You will encounter BundleException with the configuration related issue.

I hope it helps.

Thanks and Regards,


Amit Kumar Mondal
Email: admin@amitinside.com
Skype: arsenalnerk Blog: blog.amitinside.com

[Updated on: Sun, 13 September 2015 10:44]

Report message to a moderator

Re: no error message but kura does not construct/initialise component [message #1708107 is a reply to message #1708104] Sun, 13 September 2015 12:57 Go to previous messageGo to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
Thanks Amit,

this is good info! yes it was unsatisfied, and after more digging I found it because my constructor was private! stupid me, it was a hang over from when i was testing with it as an 'old-school' singleton.

i do feel however, the platform should throw an exception detailing the reason a component is 'unresolved' for example.

I have logged a bug accordingly.
Re: no error message but kura does not construct/initialise component [message #1708108 is a reply to message #1708107] Sun, 13 September 2015 13:25 Go to previous messageGo to next message
Amit Kumar Mondal is currently offline Amit Kumar MondalFriend
Messages: 108
Registered: March 2015
Location: Munich, Germany
Senior Member

Hi Paul,

The contract for an OSGi service component yields that it must have a public default constructor. I always develop applications using Maven and if you develop OSGi Bundles and Declarative Service Components using Maven, you would be notified with the proper error message if you don't have a public constructor in your Service Component.

http://s7.postimg.org/mhx5fgldn/Screen_Shot_2015_09_13_at_9_28_41_pm.png


Thanks and Regards,


Amit Kumar Mondal
Email: admin@amitinside.com
Skype: arsenalnerk Blog: blog.amitinside.com

[Updated on: Sun, 13 September 2015 16:01]

Report message to a moderator

Re: no error message but kura does not construct/initialise component [message #1709649 is a reply to message #1708108] Wed, 30 September 2015 03:05 Go to previous messageGo to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
Amit,

Is maven the only option for intelligently building OSGi components with validation?
Re: no error message but kura does not construct/initialise component [message #1709781 is a reply to message #1709649] Thu, 01 October 2015 05:06 Go to previous messageGo to next message
Amit Kumar Mondal is currently offline Amit Kumar MondalFriend
Messages: 108
Registered: March 2015
Location: Munich, Germany
Senior Member

Hi Paul,

So far I checked several OSGi toolings (Eclipse PDE, bndtools) and they do show you any error in Component Descriptor File (xml file) if you have created an erroneous service component but none of them will show any error regarding the Service Component Java File like if any public default constructor is missing, bind or unbind methods are missing etc. Maven Felix Plugin, on the other hand, does track all these errors and warnings.

Thanks and Regards,


Amit Kumar Mondal
Email: admin@amitinside.com
Skype: arsenalnerk Blog: blog.amitinside.com
Re: no error message but kura does not construct/initialise component [message #1712445 is a reply to message #1709781] Sun, 25 October 2015 02:00 Go to previous messageGo to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
I am currently stuck in this problem again!

From what I can tell, I have a perfectly implemented OSGi plugin with two components, but kura shows them as "Unsatisfied" when doing an "ls".

I find it baffling that kura's logging will spit out ever detail regarding testing DNS, serving the web-console etc, but cannot tell you what is going on when installing a plugin!

I'm sure I've done something slightly wrong, but it is a real pain trying to figure out what when you get zero feedback.
Re: no error message but kura does not construct/initialise component [message #1712454 is a reply to message #1712445] Sun, 25 October 2015 07:07 Go to previous message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
After some time I found my compiler was compiling to J1.8. I thought I'd checked that...

have also learnt the osgi command "comp" which in this case wasn't helping but is the most useful way to debug "Unsatisfied" components.

[Updated on: Sun, 25 October 2015 10:38]

Report message to a moderator

Previous Topic:bndtools/eclipse - how to create a deployment package (dp)
Next Topic:Add multiple users to WebUI
Goto Forum:
  


Current Time: Thu Apr 25 15:36:19 GMT 2024

Powered by FUDForum. Page generated in 0.03422 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top