Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » package installed but did not show up under the services in the Kura web UI
package installed but did not show up under the services in the Kura web UI [message #1692409] Wed, 15 April 2015 13:45 Go to next message
Sabrina anirbas is currently offline Sabrina anirbasFriend
Messages: 45
Registered: April 2015
Member
Hello,

I am new to Kura
trying to follow this tutorial:
eclipse.github.io/kura/doc/configurable_component.html

blocked on the deployement step, when I install the package on the remote target (Raspberry Pi) it did not show up under services.

Any idea of what I have missed?
Thanks in advance
Re: package installed but did not show up under the services in the Kura web UI [message #1692619 is a reply to message #1692409] Fri, 17 April 2015 00:15 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

Two things to check:

1. Are there any errors in the logs? Check both /var/log/kura.log and /var/log/kura-console.log.
2. Telnet to the OSGi console and verify your bundle is running. Do this by first logging into the remote target (ssh), then open the console by issuing the command:

telnet localhost 5002


Once you have the OSGi prompt, issue these commands:
osgi> ss
osgi> ls


Your bundle should be in the 'Active' state.

Thanks,
--Dave
Re: package installed but did not show up under the services in the Kura web UI [message #1692648 is a reply to message #1692619] Fri, 17 April 2015 07:59 Go to previous messageGo to next message
Sabrina anirbas is currently offline Sabrina anirbasFriend
Messages: 45
Registered: April 2015
Member
Thanks for your reply

No 'Error' in the log file, just INFO and Warn:
WARN o.e.k.w.s.s.SkinServlet - Resource Directory /opt/eclipse/kura/console/skin does not exist
INFO o.e.k.l.n.u.LinuxNetworkUtil - ethtool not found - setting driver to unknown

osgi> ss
70 ACTIVE org.eclipse.kura.example.configurable_1.0.0.201504151414

osgi> ls
29 Active org.eclipse.kura.example.configurableExample org.eclipse.kura.example.configurable(bid=70)

-> my bundle is in the 'Active' state but not shown under services

However I can't access to the web interface administration after launching the OSGI command, had to reboot the Raspberry Pi to access to it, is it normal?

Thanks.
Sabrina
Re: package installed but did not show up under the services in the Kura web UI [message #1693131 is a reply to message #1692648] Wed, 22 April 2015 00:18 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

After you install and start your bundle, did you refresh the web UI? It does not do this automatically, so you will need to do this to see your service listed.

Two important notes from the tutorial: 1. You must implement the ConfigurableComponent interface with your class; 2. You must expose your bundle as a service to Declarative Services [1].

If you have done these things, I would need to see parts of your code. Maybe post the relevant parts to Github.

[1] http://eclipse.github.io/kura/doc/configurable_component.html#create-component-class

Thanks,
--Dave
Re: package installed but did not show up under the services in the Kura web UI [message #1693152 is a reply to message #1693131] Wed, 22 April 2015 06:39 Go to previous messageGo to next message
Sabrina anirbas is currently offline Sabrina anirbasFriend
Messages: 45
Registered: April 2015
Member
Thanks for your help, I did the mentionned notes

Here is my code:
package org.eclipse.kura.example.configurable;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import org.eclipse.kura.configuration.ConfigurableComponent;
import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ConfigurableExample implements ConfigurableComponent {
	    private static final Logger s_logger = LoggerFactory.getLogger(ConfigurableExample.class);
	    private static final String APP_ID = "org.eclipse.kura.example.configurable.ConfigurableExample";
	    private Map<String, Object> properties;

	    protected void activate(ComponentContext componentContext) {
	        s_logger.info("Bundle " + APP_ID + " has started!");
	    }

	    protected void activate(ComponentContext componentContext, Map<String, Object> properties) {
	        s_logger.info("Bundle " + APP_ID + " has started with config!");
	        updated(properties);
	    }

	    protected void deactivate(ComponentContext componentContext) {
	        s_logger.info("Bundle " + APP_ID + " has stopped!");
	    }

	    public void updated(Map<String, Object> properties) {
	        this.properties = properties;
	        if(properties != null && !properties.isEmpty()) {
	            Iterator<Entry<String, Object>> it = properties.entrySet().iterator();
	            while (it.hasNext()) {
	                Entry<String, Object> entry = it.next();
	                s_logger.info("New property - " + entry.getKey() + " = " +
	                entry.getValue() + " of type " + entry.getValue().getClass().toString());
	            }
	        }
	    }
	}

my configuration file component.xml
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" name="org.eclipse.kura.example.configurableExample">
   <implementation class="org.eclipse.kura.example.configurable.ConfigurableExample"/>
   <service>
      <provide interface="org.eclipse.kura.example.configurable.ConfigurableExample"/>
   </service>
   <property name="service.pid" type="String" value="org.eclipse.kura.example.configurable.ConfigurableExample"/>
</scr:component>


Do you need to see other code parts?

have a nice day,
sabrina
Re: package installed but did not show up under the services in the Kura web UI [message #1693272 is a reply to message #1693152] Wed, 22 April 2015 19:12 Go to previous messageGo to next message
Alex Yuu is currently offline Alex YuuFriend
Messages: 8
Registered: April 2015
Junior Member
Try running kura in debug mode: https://dev.eclipse.org/mhonarc/lists/kura-dev/msg00143.html
The project might be throwing an error that it isn't showing you.
Re: package installed but did not show up under the services in the Kura web UI [message #1698176 is a reply to message #1693272] Thu, 11 June 2015 20:18 Go to previous messageGo to next message
Pawel Zalejko is currently offline Pawel ZalejkoFriend
Messages: 15
Registered: October 2013
Junior Member
Hi all,

Today I ran into the same problem. In order to make your configuration working, you need to introduce one small change to the component.xml. Your service must be registered under the org.eclipse.kura.configuration.ConfigurableComponent interface, not the org.eclipse.kura.example.configurable.ConfigurableExample.

Try to make this change and see what is the result:
   <service>
      <provide interface="org.eclipse.kura.configuration.ConfigurableComponent"/>
   </service>


Issue reported as: Bug 470001

Best regards,
Pawel
Re: package installed but did not show up under the services in the Kura web UI [message #1702998 is a reply to message #1692409] Mon, 27 July 2015 19:49 Go to previous messageGo to next message
John Smith is currently offline John SmithFriend
Messages: 1
Registered: July 2015
Junior Member
I too have this issue. I get the following in the Console

!ENTRY 1 0 2015-07-27 12:41:13.180
!MESSAGE [IAgent][RemoteBundleAdminImpl@b0c079] [startBundle] Bundle cannot be started: Error[code=-6000;message=Failed to start bundle: The bundle "org.eclipse.kura.example.configurable_1.0.0.201507271240 [70]" could not be resolved. Reason: Missing Constraint: Import-Package: org.eclipse.kura.configuration; version="1.0.0";details=null]
!STACK 0
org.osgi.framework.BundleException: The bundle "org.eclipse.kura.example.configurable_1.0.0.201507271240 [70]" could not be resolved. Reason: Missing Constraint: Import-Package: org.eclipse.kura.configuration; version="1.0.0"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
at org.tigris.mtoolkit.iagent.internal.rpc.RemoteBundleAdminImpl.startBundle(RemoteBundleAdminImpl.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.tigris.mtoolkit.iagent.internal.pmp.InvocationThread.run(InvocationThread.java:54)
at org.tigris.mtoolkit.iagent.internal.utils.ThreadPool$Worker.run(ThreadPool.java:179)
at java.lang.Thread.run(Thread.java:744)
Re: package installed but did not show up under the services in the Kura web UI [message #1703460 is a reply to message #1702998] Fri, 31 July 2015 17:20 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello John,

Are you getting this error from the emulator or from a physical device? If running from an emulator, which platform are you using (Linux or OSX)?

Thanks,
Dave
Re: package installed but did not show up under the services in the Kura web UI [message #1737258 is a reply to message #1698176] Wed, 06 July 2016 16:44 Go to previous messageGo to next message
Philippe Krief is currently offline Philippe KriefFriend
Messages: 8
Registered: July 2016
Junior Member
Hi Folks,

Based on the bug 47001, this is not the good answer.
Did you find the answer fixing this issue?

Thanks a lot
Re: package installed but did not show up under the services in the Kura web UI [message #1737405 is a reply to message #1737258] Thu, 07 July 2016 20:01 Go to previous message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

Bug 47001 was closed as invalid. Can you please provide the following information:

1. Kura Version
2. Target hardware (Emulator, Raspberry Pi, etc.)
3. Output of OSGi console 'ss' command
4. Output of OSGi console 'ls' command

Thanks,
--Dave
Previous Topic:DEPLOY-V2 instructions please
Next Topic:Kura No Net package
Goto Forum:
  


Current Time: Fri Apr 19 10:41:29 GMT 2024

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

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

Back to the top