Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [equinox-dev] Using LIRc library in Equinox

I am aware of the following Bundle-NativeCode bugs in PDE. You may have stumbled into another one. Please open a bug against PDE.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=285229
https://bugs.eclipse.org/bugs/show_bug.cgi?id=284784

Another option is to just put the library at the root directory of your bundle. Equinox will search for it by default without and Bundle-NativeCode header. (Note this is legacy behavior of Eclipse and not OSGi spec'ed behavior).

Tom



Inactive hide details for "David Conde" ---08/18/2009 06:57:47 AM---Hi again,"David Conde" ---08/18/2009 06:57:47 AM---Hi again,


From:

"David Conde" <dconde@xxxxxxxx>

To:

"'Equinox development mailing list'" <equinox-dev@xxxxxxxxxxx>

Date:

08/18/2009 06:57 AM

Subject:

RE: [equinox-dev] Using LIRc library in Equinox




Hi again,

I have got the Libjunixsocket.so and put it in the classpath path, but it is
does not work, either I have tried putting this library into the bundle,
using BUndle Native-Code in the Manifest, but I am not able to export from
Eclipse when I use this.

The idea is I have a LIRC packages, which were wraping into a bundle with
the Eclipse option, New Project--> Plug-in Projects--> Plug-in from existing
JAR archives. I use this bundle LIRCbundle as required bundle in my main
bundle.

I guess I would have to put the native libraries (Junixsocket.so) into to my
LIRCBundle, using the Bundle Native-Code header. The problem is that when I
use this I am not able to export the bundle without any problema shown.

Any idea?

Thanks

-----Mensaje original-----
De: equinox-dev-bounces@xxxxxxxxxxx [
mailto:equinox-dev-bounces@xxxxxxxxxxx]
En nombre de David Conde
Enviado el: lunes, 17 de agosto de 2009 13:01
Para: 'Equinox development mailing list'
Asunto: RE: [equinox-dev] Using LIRc library in Equinox

Hi Mark,

I have tried wrapping the LIRC.jar libraries in a bundle, and adding like
Required-Bundle in the different Bundles' Manifest where they use this
classes. The problem is that I continue getting the same Exception.

I have looking the source code from LIRC packages and I found a static code
where I guess LIRC packages use JNI libraries, what Do I have to do with
this?


public class UnixSocketImpl {

static {
// Loads the JNI library from the directory of this class
String libname = System.mapLibraryName("junixsocket");
// uses getFile() instead of getPath() as getPath() is not
available in JDK1.2.2
String libpath =
UnixSocketImpl.class.getResource(libname).getFile();
System.load(libpath);
}
....

}

How should I treat this code in order to adapt with OSGI? I mean, I have
tried launch a simple application using LIRC libraries and it worked fine,
but when I tried to use LIRC packages from OSGI I get :

java.lang.NoClassDefFoundError: Could not initialize class
org.lirc.socket.UnixSocketImpl.
....

I tried with -vmargs -Djava.library.path=path_to_lirc_libs

But nothing new appears

Perhaps, the question is easier, how do I have to do when I have JNI classes
in my bundles?

Thank you in advance



-----Mensaje original-----
De: equinox-dev-bounces@xxxxxxxxxxx [
mailto:equinox-dev-bounces@xxxxxxxxxxx]
En nombre de Mark Hoffmann
Enviado el: viernes, 14 de agosto de 2009 14:38
Para: Equinox development mailing list
Asunto: RE: [equinox-dev] Using LIRc library in Equinox

Hi,

just an idea. Maybe jlirc works with JNI? Maybe you have to give the library
path to the VM similar to subclipse?
Like: -vmargs -Djava.library.path=path_to_lirc_libs

Mark

"David Conde" <dconde@xxxxxxxx> schrieb am 14.08.2009 14:23:22:
>
> The problem can be because OSGI does not recognize the LIRC daemon,
> because I have tried to introduce all the classes from LIRC packages
> in my bundle and I have the same result. I do not know if I have to
> do something special to relate the OSGI framework with the LIRC
> daemon in Ubuntu, or include some libraries. I do not know much about
> LIRC but I think that is a daemon which takes data from remote
> control and then send this information to a socket, so I think my
> bundle just should interact with a “socket”, but there
> are an API to use LIRC in Java called JLIRC which I think should be
> enough.
>
> Any idea will help me.
>
> Thanks
>
> De:equinox-dev-bounces@xxxxxxxxxxx [
mailto:equinox-dev-bounces@
> eclipse.org]  *En nombre de *David Conde
>  *Enviado el:* viernes, 14 de agosto de 2009 11:50
>  *Para:* 'Equinox development mailing list'
>  *Asunto:* [equinox-dev] Using LIRc library in Equinox
>
> Hi,
>
> I am trying to use LIRC libraries in order to use remote controls in
> my bundles running on Equinox.
>
> For this task, I download de JLIRC source and put it all together in
> a new bundle called RemoteLIRC, then I exported the next packages:
>
> -org.lirc
>
> -org.lirc.socket
>
> -org.lirc.ui
>
> -org.lirc.utils
>
> Then I imported these packages in another bundle called Remote
> Manager which use some of the classes defined in these packages.
>
> I did not get any error in compilation time with Eclipse but when I
> tried to launch Remote Manager by console I got a java.lang.
> NoClassDefFoundError: Could not initialize class org.lirc.socket.
> UnixSocketImpl
>
> I do not know If I am putting right the LIRC packages or is it a
> problem from sockets?
>
> Any Idea?
>
> Thank you in advance
> _______________________________________________ equinox-dev mailing
> list equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/
>
> equinox-dev

-- 
Mark Hoffmann
e-Mail: mark.hoffmann@xxxxxx
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter
http://movieflat.web.de

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


GIF image

GIF image


Back to the top