how to build with external jars

26 views
Skip to first unread message

Farkas Levente

unread,
Sep 26, 2008, 5:37:51 AM9/26/08
to gstream...@googlegroups.com
hi,
how can i build gstreamer-java without the internal jar files ie.
jna.jar, junit4.jar, swt.jar? i'd like to use the system installed jar
files during build (since this requires if i'd like to include it in
fedora or redhat), but i've got error not to find the jna packages even
if i do:
CLASSPATH=/usr/share/java/jna.jar:/usr/share/java/junit4.jar:/usr/lib/eclipse/swt-gtk-3.2.1.jar
ant
how can i set ant's classpath or how can i force ant to use my jars?
thanks in advance.
yours.

--
Levente "Si vis pacem para bellum!"

Wayne Meissner

unread,
Sep 26, 2008, 6:00:39 AM9/26/08
to gstream...@googlegroups.com
That might take some nasty surgery to build.xml.

I think you just need to define a "-post-init" target, and in that,
reset the javac.classpath property. You could also change the
file.reference.jna.jar and file.reference.swt.jar properties to point
to the external ones.

Probably do it via an ant conditional, based on a property you set on
the command line.
ant -Doverride.javac.classpath=/usr/share/java/jna.jar:...

Similarly for javac.test.classpath

2008/9/26 Farkas Levente <lfa...@lfarkas.org>:

Farkas Levente

unread,
Sep 26, 2008, 7:55:32 AM9/26/08
to gstream...@googlegroups.com
Wayne Meissner wrote:
> That might take some nasty surgery to build.xml.
>
> I think you just need to define a "-post-init" target, and in that,
> reset the javac.classpath property. You could also change the
> file.reference.jna.jar and file.reference.swt.jar properties to point
> to the external ones.

ok now i patch the project.properties and put:
--------------------------------------------
file.reference.jna.jar=/usr/share/java/jna.jar
file.reference.junit-4.4.jar=/usr/share/java/junit4.jar
file.reference.swt.jar=/usr/lib/eclipse/swt-gtk-3.2.1.jar
...
run.jvmargs=-Djna.library.path=/usr/lib:/usr/lib/gstreamer-0.10
--------------------------------------------
into it, and it's compiles clean.
but the tests still failed with
--------------------------------------------
-do-test-run:
[junit] Testsuite: org.gstreamer.BinTest
[junit] #
[junit] # An unexpected error has been detected by Java Runtime
Environment:
[junit] #
[junit] # SIGSEGV (0xb) at pc=0x4841b3d4, pid=1628, tid=1604496
[junit] #
[junit] # Java VM: OpenJDK Server VM (1.6.0_0-b11 mixed mode linux-x86)
[junit] # Problematic frame:
[junit] # C 0x4841b3d4
[junit] #
[junit] # An error report file with more information is saved as:
[junit] # /home/lfarkas/rpm/BUILD/gstreamer-java-0.8/hs_err_pid1628.log
[junit] #
[junit] # If you would like to submit a bug report, please visit:
[junit] # http://icedtea.classpath.org/bugzilla
[junit] #
[junit] Test org.gstreamer.BinTest FAILED (crashed)
--------------------------------------------
any tip what else can be change?
i attached the log file mentioned above.

> Probably do it via an ant conditional, based on a property you set on
> the command line.
> ant -Doverride.javac.classpath=/usr/share/java/jna.jar:...

ant
-Doverride.javac.classpath="/usr/share/java/jna.jar:/usr/share/java/junit4.jar:/usr/lib/eclipse/swt-gtk-3.2.1.jar"
not working:-(

> Similarly for javac.test.classpath

neither this.

hs_err_pid1628.log.bz2

Tal Shalif

unread,
Sep 26, 2008, 8:34:26 AM9/26/08
to gstream...@googlegroups.com
I would check either the JNA under /usr/share/java/jna.jar is the same as the one shipped with gstreamer-java.

Out of curiousity - does Open JDK run gstreamer-java code successfully, when ran from the command line?

2008/9/26 Farkas Levente <lfa...@lfarkas.org>



--
Tal Shalif
+81-90-9688-2696

Wayne Meissner

unread,
Sep 26, 2008, 8:56:26 AM9/26/08
to gstream...@googlegroups.com
From looking at the log file, it looks like exactly the same problem
you were having a while back on fedora, that I thought you had solved?

Before doing anything else, I suggest trying to build JNA from source
and run its unit tests on fedora, using the external libffi:

ant -Ddynlink.native=true clean test

It is possible something is broken in either the way libffi or jna is
compiled for fedora, given the binaries from jna work fine.

> ant
> -Doverride.javac.classpath="/usr/share/java/jna.jar:/usr/share/java/junit4.jar:/usr/lib/eclipse/swt-gtk-3.2.1.jar"
> not working:-(
>
>> Similarly for javac.test.classpath
>
> neither this.

No, those properties don't work yet - I was saying you might have to
add support for something like them to build.xml so they would work.

However, it appears that simply setting javac.classpath and
javac.test.classpath on the ant command line overrides them fine.

Colin Walters

unread,
Sep 26, 2008, 9:11:14 AM9/26/08
to gstreamer-java
On Sep 26, 7:55 am, Farkas Levente <lfar...@lfarkas.org> wrote:
>
> Environment:
>     [junit] #
>     [junit] #  SIGSEGV (0xb) at pc=0x4841b3d4, pid=1628, tid=1604496

Can you check if doing:

setenforce 0

makes it work?

Farkas Levente

unread,
Sep 26, 2008, 9:14:52 AM9/26/08
to gstream...@googlegroups.com

selinux is disabled on the build host:-(
i'll search for my earlier post and how to fix it on monday...

Colin Walters

unread,
Sep 26, 2008, 9:21:16 AM9/26/08
to gstreamer-java
On Sep 26, 9:14 am, Farkas Levente <lfar...@lfarkas.org> wrote:
>
> selinux is disabled on the build host:-(
> i'll search for my earlier post and how to fix it on monday...

You figured it out just now? I remember a post on fedora-java-list
but looking at it now I don't see it resolved.

Can you try to reduce this to a simpler test case, say without
gstreamer-java if we suspect JNA is the issue?

Colin Walters

unread,
Sep 26, 2008, 9:26:18 AM9/26/08
to gstreamer-java
On Sep 26, 9:21 am, Colin Walters <cgwalt...@gmail.com> wrote:
>
> You figured it out just now?  I remember a post on fedora-java-list
> but looking at it now I don't see it resolved.
>
> Can you try to reduce this to a simpler test case, say without
> gstreamer-java if we suspect JNA is the issue?

By the way, I should mention that I've been patching JNA in Fedora to
add features for JGIR (http://live.gnome.org/JGIR); those patches are
now almost all upstream, but it's possible if you're building versus
rawhide you might be hitting an accidentally introduced bug or
incompatibility. If you can get me instructions to reproduce
(preferably on a Fedora 9 host) I can take a look.

Farkas Levente

unread,
Sep 26, 2008, 6:11:43 PM9/26/08
to gstream...@googlegroups.com

it was on this list also:
http://groups.google.com/group/gstreamer-java/browse_thread/thread/c94885fa91a22f7/6548f16bf7a4737c?hl=en&lnk=gst&q=levente#6548f16bf7a4737c
and the same problem disappear there too:-(
i try to find it on monday step-by-step...

Farkas Levente

unread,
Sep 29, 2008, 10:23:25 AM9/29/08
to gstream...@googlegroups.com, Colin Walters

ok now the conclusion gstreamer-java:
- on fedora-9:
build (with the test so probably run) with the included and the
system jna-3.0.2-7.fc9.i386, junit and swt too.
- on redhat/centos-5:
- fedora's jna-3.0.2-7.fc9.i386 rebuild and installed then it's
compile but test failed with SIGSEGV so probably it's a jna
problem:-(
any tip why it's not working on rhel?
- with the included jar's it's build and test only failed because of
the too old gstreamer installed on the system (but it can be solved
as i recompile newer gstreamer).

any help would be useful:-)
since i wanna build these rpm on centos too...

Farkas Levente

unread,
Sep 29, 2008, 10:47:11 AM9/29/08
to gstream...@googlegroups.com, Colin Walters

another strange thing it's not build on fedora-10, here is the build:
http://koji.fedoraproject.org/koji/taskinfo?taskID=849892
it has a newer jna-3.0.4-5.svn700.fc10 and according to the buildlog:
http://koji.fedoraproject.org/koji/getfile?taskID=849892&name=build.log
it seems to build but tests failed with such errors:
-----------------------------------------------------------
[junit] Testcase: testElementAddedCallback(org.gstreamer.BinTest):
Caused an ERROR
[junit] Callback argument class org.gstreamer.Bin requires custom
type conversion
[junit] java.lang.IllegalArgumentException: Callback argument class
org.gstreamer.Bin requires custom type conversion
[junit] at
com.sun.jna.CallbackReference.<init>(CallbackReference.java:121)
[junit] at
com.sun.jna.CallbackReference.getFunctionPointer(CallbackReference.java:235)
[junit] at com.sun.jna.Function.convertArgument(Function.java:405)
[junit] at com.sun.jna.Function.invoke(Function.java:206)
[junit] at com.sun.jna.Library$Handler.invoke(Library.java:204)
[junit] at $Proxy26.g_signal_connect_data(Unknown Source)
[junit] at org.gstreamer.GObject.g_signal_connect(GObject.java:321)
[junit] at
org.gstreamer.GObject$SignalCallback.<init>(GObject.java:327)
[junit] at org.gstreamer.GObject.connect(GObject.java:370)
[junit] at org.gstreamer.GObject.connect(GObject.java:360)
[junit] at org.gstreamer.Bin.connect(Bin.java:245)
[junit] at
org.gstreamer.BinTest.testElementAddedCallback(BinTest.java:119)
-----------------------------------------------------------

Wayne Meissner

unread,
Sep 29, 2008, 3:17:54 PM9/29/08
to gstream...@googlegroups.com
That looks like a bug introduced in JNA 3.0.6. I just tried running
the unit tests with the latest version and they fail in the same way.


2008/9/30 Farkas Levente <lfa...@lfarkas.org>:

Wayne Meissner

unread,
Sep 29, 2008, 3:27:28 PM9/29/08
to gstream...@googlegroups.com
Ok, this one should be fixed, and is in kenai mercurial.

2008/9/30 Farkas Levente <lfa...@lfarkas.org>:

Farkas Levente

unread,
Sep 30, 2008, 8:45:50 AM9/30/08
to gstream...@googlegroups.com
fixed in jna or fixed in gstreamer-java?
if in gstreamer-java then it's high time for 1.0 now:-)
and i'll send the latest spec file too..

Colin Walters

unread,
Oct 1, 2008, 2:54:59 PM10/1/08
to gstreamer-java
On Sep 30, 8:45 am, "Farkas Levente" <lfar...@lfarkas.org> wrote:
> fixed in jna or fixed in gstreamer-java?
> if in gstreamer-java then it's high time for 1.0 now:-)
> and i'll send the latest spec file too..

So we're good on Fedora 9 now, but not RHEL5? Not sure about the
latter - have you looked at the differences in libffi version etc.?

Wayne Meissner

unread,
Oct 1, 2008, 7:16:11 PM10/1/08
to gstream...@googlegroups.com
2008/9/30 Farkas Levente <lfa...@lfarkas.org>:

> fixed in jna or fixed in gstreamer-java?

Both. JNA changed the way type mappers were configured for Callbacks,
which I fixed in gstreamer-java, and there was a bug in JNA wrt String
members of Structure.

So you need the latest gstreamer-java from mercurial and JNA 3.0.7

Farkas Levente

unread,
Oct 2, 2008, 6:01:17 AM10/2/08
to gstream...@googlegroups.com, Colin Walters

so Colin as you're the jna fedora maintainer would you update the jna at
least in koji?
and Wayne could you make a 0.9 release? i attached the up-to-date spec
file for 0.9.
and then i can test it on fedora 9, 10 and rhel/centos-5.
anyway libffi version on rhel: libffi-3.0.1-1.el5 while on fedora-9:
libffi-3.0.5-1.fc9.i386.

gstreamer-java.spec

Colin Walters

unread,
Oct 2, 2008, 10:49:02 AM10/2/08
to gstreamer-java
On Oct 2, 6:01 am, Farkas Levente <lfar...@lfarkas.org> wrote:
>
> so Colin as you're the jna fedora maintainer would you update the jna at
> least in koji?

Built for F-9:
https://koji.fedoraproject.org/koji/buildinfo?buildID=65096
I didn't create a Bodhi update though.

Farkas Levente

unread,
Oct 2, 2008, 10:56:34 AM10/2/08
to gstream...@googlegroups.com, Colin Walters

it's 3.0.4, but Wayne said it's only in 3.0.7!
is there a reason you not step to the latest upstream?

Colin Walters

unread,
Oct 2, 2008, 12:20:04 PM10/2/08
to Farkas Levente, gstream...@googlegroups.com

Ignore the 3.0.4 - it's actually a SVN snapshot.

Farkas Levente

unread,
Oct 6, 2008, 5:01:52 PM10/6/08
to gstream...@googlegroups.com, Colin Walters

ok. then please update the release tag to 3.0.7 at the next build (and
push it to f9 and f10 too).
i modify the gstreamer-java spec file to requires >= 3.0.7.

i now test it again with these jna and the current mercurial
gstreamer-java together and the results (using the system jars not the
included ones):

fedora:
- OK on f9 (it's build and the test also runs with a few warning),
- OK on f10 (it's build and the test also runs with a few warning),
- OK on f11 (it's build and the test also runs with a few warning),

rhel/centos-5:
i've to rebuild all gstreamer packages included in fedora,
because gstreamer-java requires newer version then the system ones:
gstreamer-0.10.20-1
gstreamer-plugins-base-0.10.19-2
gstreamer-plugins-good-0.10.8-9
which also requires:
flac-1.2.1-4
at the same time rebuild (cause it's requires by gstreamer-java):
jna-3.0.4-9.svn729
but even then gstreamer-java tests failed segfault, so i rebuild:
libffi-3.0.5-1
and and after then jna again with this libffi, and after that the
current mercurial gstreamer-java build and the test also runs with a few
warning on rhel too:-))))

all rpm for fedora and rhel/centos can be found at:
http://www.lfarkas.org/linux/packages/

so i check in the new spec file ready to 1.0 (commented the
fedora/rhel/centos specific patch to use system jar files).

Reply all
Reply to author
Forward
0 new messages