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

Hi again,

 

I have been reading something that could help me with my problem,

 

https://www.blogger.com/comment.g?blogID=3096964353090017094&postID=2373378248586402445&page=1

 

 

Since I am compiling my classes in Windows XP, using Eclipse, and exporting the jars in order to be installed in Equinox framework on UBUNTU (in console way), the different environment between the UBUNTU JVM and Equinox JVM could be the guilty of my problem. Am I wrong? How could I match the JVM from Equinox so that use the same JVM of UBUNTU, because of in UBUNTU was tested without Equinox and the Java applications which used LIRC packages worked fine.

 

Any idea?

 

Thanks

 

 

 

De: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-bounces@xxxxxxxxxxx] En nombre de David Conde
Enviado el: jueves, 20 de agosto de 2009 12:26
Para: 'Equinox development mailing list'
Asunto: RE: [equinox-dev] Using LIRc library in Equinox

 

Hi again, and thank you very much for your ideas,

 

I have been for trying to solve this problem for 5 days and I do not get the solution.

 

I am going to explain the steps in order to show what I have been doing so that perhaps it would be possible to find a mistake in my process.

 

I am working compiling my classes in Eclipse in Windows XP and exporting my bundles with the options Export from Eclipse, so that I get a .jar. Then I use this jar files and put them in another machine working in Ubuntu, where I launch Equinox.jar framework in CONSOLE MODE.

 

Firstly I tried to relate LIRC packages with the bundle which uses these packages through I got the LIRC packages source from JLIRC website, creating a new bundle and exporting these packages so that other bundles which want to use LIRC classes can do it (by importing these packages)

 

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

 

In order to solve this problem I have also tried to wrap LIRC packages in a new bundle, and adding Require-Bundle header to the manifest in those bundles which need to use LIRC classes.

 

I add libjunixsocket.so and junixsocket.c to the root where I have my jar files (bundles jar files), also I am launching the Equinox by console with the next command: -vmargs âDjava.library.path=path_where_libjunixsocket.so is.

 

It is odd because the first time that I launch the framework without having the bundle which uses LIRC packages installed, I got when I start this bundle: java.lang.exceptionininitializererror: in the class org.lirc.socket.UnixSocket and other times I got java.lang.UnsatisfiedLinkError: Canât load library: /org/lirc/socket/libjunixsocket.so. but if I have installed this bundle and I launch again Equinox framework I continue having ava.lang.NoClassDefFoundError: Could not initialize class org.lirc.socket. UnixSocketImpl.

 

It is strange because I have tried with a simple example in Java without OSGI and the LIRC application worked fine.

 

Any idea?


Thanks

 

 

De: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-bounces@xxxxxxxxxxx] En nombre de Thomas Watson
Enviado el: martes, 18 de agosto de 2009 15:01
Para: Equinox development mailing list
Asunto: 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

PNG image

PNG image