Re: JNI problem - unresolved symbols at RUN TIME

1999-11-20 Thread Nathan Meyers

On Fri, Nov 19, 1999 at 06:44:48PM -0500, Jacob Nikom wrote:
> I am writing JNI application called MainPanel using Java, C++ and
> a bit of C.  It compiles and links without problem, but when I run 
> it, it crushes with the message...

My guess is that you linked your shared library using gcc instead of
g++, and so it lacks a reference to the C++ library that defines
cout. If you run "ldd" on the shared library and you see no reference
to a library named libstdc++, that's the culprit. Try linking your
.so with g++.

> I always thought all symbols should be found (resolved) during the 
> linking stage. If there is no complains from the linker, there should 
> not be any complains during runtime.  Looks like it is not so, but why? 

I don't believe the linker complains about unresolved references in
shared libraries. The rationale, I guess, is that the missing piece will
come from the application or some other shared library.

Nathan


On Fri, Nov 19, 1999 at 06:44:48PM -0500, Jacob Nikom wrote:
> Hi,
> 
> I am writing JNI application called MainPanel using Java, C++ and
> a bit of C.  It compiles and links without problem, but when I run 
> it, it crushes with the message: 
> 
> prompt>java -green MainPanel pixelbuf
> Exception in thread "main" java.lang.UnsatisfiedLinkError: 
> /homes/nikom/work/libStereoImageTransform.so: 
> undefined symbol: cout
>   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>   at java.lang.ClassLoader.loadLibrary0(Compiled Code)
>   at java.lang.ClassLoader.loadLibrary(Compiled Code)
>   at java.lang.Runtime.loadLibrary0(Compiled Code)
>   at java.lang.System.loadLibrary(Compiled Code)
>   at MainPanel.(MainPanel.java:13)
> make: *** [go] Error 1
> 
> Here is the code of MainPanel.java:
> 
>   1 import java.awt.*;
>   2 import java.awt.event.*;
>   3 import javax.swing.*;
>   4 
>   5 class MainPanel extends JPanel
>   6 {
>   7 
>   8public static synchronized native void
>   9   ImageTransform(int[] x1Array, int[] y1Array, int[]
> x2Array, int[] y2Array);
>  10 
>  11static
>  12{
> -->  13  System.loadLibrary("StereoImageTransform");
>  14}
>  15 
>  16   static ImagePanel imagePanel;
>  17 
> ..
> 
> The structure of this JNI application is very simple:
>  
>   ++ 
>   | Java code  | 
>   ++ 
> |^   
> v|  
>   ++ 
>   | C wrapper  |
>   ++ 
> |^   
> v|   
>   ++ 
>   | C++ code   | 
>   ++ 
>  
> I always thought all symbols should be found (resolved) during the 
> linking stage. If there is no complains from the linker, there should 
> not be any complains during runtime.  Looks like it is not so, but why? 
> Do you have any suggestions how to fix or investigate the problem?
> 
> Thank you,
> 
> Jacob Nikom
> 
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: A Java parser

1999-11-20 Thread Daniel Barclay


> From: Kontorotsui <[EMAIL PROTECTED]>
> 
> 
> Suppose I want to do a tool that parses the java code and modifies it.
> 
> What do you advice me to use? Are there java parsers for Linux? 
> If the answer is negative, what can I use? Perl (*groan*)? 

Someone has a tool called iDoc (I think) that reads in Java code and can 
modify it and write it out.

Daniel


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: [Partially OT] A Java parser - part 2

1999-11-20 Thread Andreas Rueckert

Hi!

On Fri, 19 Nov 1999 Louis Tribble wrote:



>| You may use the Software to generate software program(s) ("Developed
>| Programs").  Sun claims no rights in or to the Developed Programs.
>
>Note especially the last sentence.

So you changed your license? I remember that Sreeni said on the mailling-list,
that you can sublicense your grammar, but not distribute it. That's why he
offered webspace on the Metamata server for those grammars.

Ciao,
Andreas



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



native threads

1999-11-20 Thread John Knutson


I know this is a known issue, but I had a question and possibly
additional information (assuming any of the JDK developers are on this
mailing list :-)...

I've been using the Ganymede server (http://www.arlut.utexas.edu/gash2),
which is written in Java, recently.  I managed to track down a problem I
was having to the native threads issue documented in the Blackdown JDK
readme file (and probably other places :-).  The odd thing is, I'm using
the IBM 1.1.8 JDK.  It made me wonder what the correlation between the
two JDKs was.  Was IBM's JDK for linux written entirely from scratch
within IBM, or did they get some help? :-)

Or perhaps the problem with waiting on threads to terminate is in the
linux libraries and not in Blackdown's (or IBM's) JRE implementation.
FWIW, I've used Blackdown JDK 1.2 and 1.1.7 for linux and IBM's JDK
1.1.8 for linux.

The comments in the 1.2 README say "very infrequent problems", but what
I'm seeing happens every time.  Basically, the Ganymede server, during
the shutdown process, tells a class that handles mail (Qsmtp, see
http://www.io.com/~maus/JavaPage.html) to stop its threads.  This is
accomplished by setting a flag and letting the run() method execute,
which then falls out and terminates.  The function that does the flag
change then waits on the thread by using the join() method.  The join()
method never returns, and if I put an isAlive() check beforehand, it
won't ever return either.  This ALWAYS happens, it's not what I'd
consider "very infrequent" :-).  The exec() method is being used in the
Ganymede server, but probably not in the same way that you've seen e.g.
what's described in the README.

It seems to work ok if I use the green threads with the Blackdown 1.2
JDK.  IBM's JDK doesn't appear to have green threads, so I may have to
go to the Blackdown JDK..




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]