Skip to main content



      Home
Home » Eclipse Projects » Kura » Kura error : The type javax.microedition.io.StreamConnection cannot be resolved(Error shown for gpio module)
Kura error : The type javax.microedition.io.StreamConnection cannot be resolved [message #1764126] Thu, 25 May 2017 08:09 Go to next message
Eclipse UserFriend
Hi.

I have a problem with javax.microedition.io.StreamConnection.

I wrote module for gpio comunnication inspired by your serial example, but one line shows error :

CommConnection conn;


if (this.conn != null) {
                        try {
                            this.conn.close(); //this line shows error
                            logger.info("Connection closed");
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                        this.conn = null;


When I export project like deployable plug - ins and fragments, in log I have:

this.conn.close();
^^^^^^^^^^^^^^^^^
The type javax.microedition.io.StreamConnection cannot be resolved. It is indirectly referenced from required .class files

I tried with adding bluecove-2.1.0.jar to build path, but still no change.

Whole method that contains error line :

	public void doPublish() {

        try {
            if (this.mCloudClient != null) {
                KuraPayload payload = new KuraPayload();          
                payload.addMetric("counter", counter);
                this.mCloudClient.publish("sound", payload, 0, false);
                this.counter++;
                if (this.counter == 4) {
                    if (this.conn != null) {
                        try {
                            this.conn.close();
                            logger.info("Connection closed");
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                        this.conn = null;
                    }
                }
            }
        } 
        catch (Exception e) {
            e.printStackTrace();
        }   
    }
Re: Kura error : The type javax.microedition.io.StreamConnection cannot be resolved [message #1764128 is a reply to message #1764126] Thu, 25 May 2017 10:12 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

Please refer to this documentation [1]. In particular, review the "Export the Bundle" section. There is a step where you must tell Eclipse to include the Class files in the build.

[1] http://eclipse.github.io/kura/dev/serial-example.html

Thanks,
--Dave
Re: Kura error : The type javax.microedition.io.StreamConnection cannot be resolved [message #1764171 is a reply to message #1764128] Fri, 26 May 2017 06:36 Go to previous messageGo to next message
Eclipse UserFriend
Yes, but when I check Use class files compiled in the workspace option, then bundle is created, but it does nothing. :-/.
Ultrasonic sensor HC-SR04 is connected on GPIO.
When I use python script that I wrote, I get good values. But when I try with deployment package, nothing shows.

[Updated on: Fri, 26 May 2017 08:26] by Moderator

Re: Kura error : The type javax.microedition.io.StreamConnection cannot be resolved [message #1764185 is a reply to message #1764171] Fri, 26 May 2017 09:25 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

Can you please check /var/log/kura-console.log and /var/log/kura.log for errors? Also, check the 'ss' and 'ls' commands on the OSGi console to make sure the component is properly resolved.

Out of curiosity, if the sensor is connected via GPIO, why not use the GPIOService?

Thanks,
--Dave
Re: Kura error : The type javax.microedition.io.StreamConnection cannot be resolved [message #1764589 is a reply to message #1764185] Wed, 31 May 2017 10:22 Go to previous messageGo to next message
Eclipse UserFriend
GPIOService? I reffered on kura.example.gpio, and I am getting good values in the console. As soon as I add code for Cloud connection, it all goes down, and it looks like package isn't active at all.And I can't figure out what the problem is. Above in my first post is publishing method.

/var/kura/kura.log : http://prntscr.com/fe9jkr

Re: Kura error : The type javax.microedition.io.StreamConnection cannot be resolved [message #1764590 is a reply to message #1764185] Wed, 31 May 2017 10:23 Go to previous messageGo to next message
Eclipse UserFriend
GPIOService? I reffered on kura.example.gpio, and I am getting good values in the console. As soon as I add code for Cloud connection, it all goes down, and it looks like package isn't active at all.And I can't figure out what the problem is. Above in my first post is publishing method.

/var/kura/kura.log : http://prntscr.com/fe9jkr

Re: Kura error : The type javax.microedition.io.StreamConnection cannot be resolved [message #1764728 is a reply to message #1764590] Thu, 01 June 2017 13:12 Go to previous message
Eclipse UserFriend
Did you check the OSGi console with the 'ss' and 'ls' commands? Do you have your code hosted publicly somewhere (i.e. Github) so I can take a look?
Previous Topic:Kura Installation on Rasbberry pi 3
Next Topic:Host a Web Server
Goto Forum:
  


Current Time: Sun Jul 20 15:40:03 EDT 2025

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

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

Back to the top