RE: Fwd: Re: Java/Linux at JavaOne

2001-06-18 Thread thanhnam_java

Dear All
Have you got the J@Whiz test program for Java 2 Platform?
Could you help me having J@Whiz?
Thank
Nam

-Original Message-
From: David Brownell [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 6:10 AM
To: Christopher Smith
Cc: [EMAIL PROTECTED]
Subject: Re: Fwd: Re: Java/Linux at JavaOne


I may have missed this ... will this be covering GCJ?

Compiled Java has some nice advantages.  Including
more natural and efficient integration with native code,
as well as faster startup and the ability to do some
aggressive ahead-of-time optimizations, and working
better with standard OS tools (RPM etc).

- Dave



--
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: JDialog not visible

2001-06-18 Thread thanhnam_java

Dear All
Have you got the J@Whiz test program for Java 2 Platform?
Could you help me having J@Whiz?
Thank
Nam

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Amol Kulkarni
Sent: Wednesday, May 23, 2001 7:51 PM
To: [EMAIL PROTECTED]
Subject: JDialog not visible


Hi,
Following is a code which i use to invoke a JDialog on Red Hat 7.0
using blackdowns jdk1.2.2. But the Dialog doesn't seem to be visible.
I see that it is being created at the status bar,but it still doesn't
show up
The same code works perfectly well on Windows NT. Can anybody tell me
the reason behind it.
Note: The following code is in an applet.
/*Code Start*/
JDialog npd=new JDialog(Dialog d,String s);
npd.show();
npd.setSize(250,250);
/*Code End*/

Q)Why there is diference between presentation of applets in windows
and linux?

Thanks and Regards
Amol






--
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: Can anyone help

2001-06-18 Thread Florent Coste

I think that the commercial edition of Together does that stuff.

regards,
Florent

vijay kukreja wrote:

> hi all,
> I'm looking for some tool which could read java source code
> or byte code and generate sequence diagrams(uml) by
> reverse engineering.
> I have class diagrams generated out of Rational rose and
> magic draw and TogetherJ.
> But i'm not able to locate a tool which generates a sequence diagram.
> Thanks in advance for your help.
> regards,
> vijay
> _
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
> --
> 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]




Compatibility problems with IBM JDK?

2001-06-18 Thread kevin1


I'm using the sun jdk for a j2ee project.  I'm interested in switching to the ibm
jdk.  They are supposed to be interchangable, no?  Can I successfully do this?
What problems would I run into?

Thanks in advance 
Kevin


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




JNI native code throws unexpected exception

2001-06-18 Thread IIS - Paul Morie locked 02/06/01

Hello all-

I am working on an application that uses the JNI to talk between
native code written in C++ and Java.  When native code called through
the JNI throws an exception, the stack will be unwound past a valid catch
statement, resulting in a call to __default_terminate() and finally to
abort().  When the same native code is called from a pure C++ program, the
error is not seen.  Additionally, the same code works without error on
Solaris and Windows NT.  I am using Sun's jdk 1.3.1 and gcc 2.95.3 and
libc 2.2-9 on a machine with Mandrake 7.1 installed.  I have written
some toy code to reproduce the error (attached).  Please examine it and 
let me know if anyone has encountered a similar problem / what workarounds
were used.

thanks,

Paul

/*
 * Paul Morie | "insert amusing quote here"  *
 *+--*
 * guy who checks | Please list me as not receiving html *
 * this account   | e-mail.  I use a real mail reader.   *
 */


class HelloWorld {
private native void print();
public static void main(String[] args) {
new HelloWorld().print();
}
static {
System.loadLibrary("HelloWorld");
}
}


#include 
#include 
#include "MyException.h"
#include "NativeMethods.h"
#include "Utility.h"
#include "HelloWorld.h"

JNIEXPORT void JNICALL Java_HelloWorld_print(JNIEnv *env, jobject obj)
{
  cout << "Hello, World.  I'm going to call an exception now" << endl;
  try {
cout << "inside try block" << endl;
throw_it();
cout << "after throw_it() in try " << endl;
  }
  catch ( MyException& E ) { throw_jni(env, "MyException", E); }
  return;
}


class MyException extends Exception {
MyException() { super(); }
}


#ifndef _MY_EXCEPTION_H_
#define _MY_EXCEPTION_H_
#include 
#include 
#include 

class MyException : public std::runtime_error {
 public:
  MyException(const char* str) : std::runtime_error(str)
  {
cout << "Running constructor" << endl;
  }
  MyException(const std::string& str) : std::runtime_error(str.c_str())
  {
cout << "Running constructor" << endl;
  }
};

#endif


#ifndef _TEST_UTILITY_H_
#define _TEST_UTILITY_H_

#include 
#include 
#include "MyException.h"

void throw_jni(JNIEnv* env, const char* name, const MyException E);

#endif



#include "Utility.h"

void throw_jni(JNIEnv* env, const char* name, const MyException E) {
  jclass cls = env->FindClass(name);
  if (!cls) { return; }
  env->ThrowNew(cls, E.what());
}



#ifndef _NATIVE_METHODS_H_
#define _NATIVE_METHODS_H_

#include 
#include "MyException.h"

void throw_it()
{
  cout << "inside throw_it() " << endl;
  throw MyException("test");
  cout << "nothrow" << endl;
  return;
}

#endif



additionally...

2001-06-18 Thread IIS - Paul Morie locked 02/06/01

Additionally, here is the output when I try to run the example code:

$> java -native -Djava.library.path=. HelloWorld
Hello, World.  I'm going to call an exception now
inside try block
inside throw_it() 
Running constructor
Abort

Paul

/*
 * Paul Morie | "insert amusing quote here"  *
 *+--*
 * guy who checks | Please list me as not receiving html *
 * this account   | e-mail.  I use a real mail reader.   *
 */


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




forgot a header...

2001-06-18 Thread IIS - Paul Morie locked 02/06/01

I forgot to include the machine generated header for the native method in
previos posts...

paul

/*
 * Paul Morie | "insert amusing quote here"  *
 *+--*
 * guy who checks | Please list me as not receiving html *
 * this account   | e-mail.  I use a real mail reader.   *
 */


/* DO NOT EDIT THIS FILE - it is machine generated */
#include 
/* Header for class HelloWorld */

#ifndef _Included_HelloWorld
#define _Included_HelloWorld
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class: HelloWorld
 * Method:print
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_HelloWorld_print
  (JNIEnv *, jobject);

#ifdef __cplusplus
}
#endif
#endif



Re: JNI native code throws unexpected exception

2001-06-18 Thread Markus Suing

Hi Paul,

I had a similar problem.

This is a known bug from sun' bug databse (no 4389172). Besides suns
says that it is not a bug.

quote from the bug database entry :
"...
 Evaluation 

The JNI specification makes no guarantees about whether certain C++
language
features, like C++ exceptions and RTTI, are valid in the context of
native
code. These C++ language features typically require all modules in the
system to be
compiled with the features enabled, and typically require run-time
support.
In this case there is likely poor interaction between gcc's run-time
library
and the host platform's standard library used by the VM. This is not a
problem we can fix.
..."

I was using gcc2.95.2 jdk1.3 on SuSE Linux 7.1 and my program would
always abort when a c++
exception was thrown.
When I switched to jre1.3.1 the problem disapeared.
But you have to call the VM in native mode (option '-native').

If that doesn't work then maybe you should additionally try to use
gcc2.95.2.
This is the compiler which was used to build the blackdown jdk - as far
as I know.
I was in contact with another developer who faced the same problem and
got it fixed
by shifting the c++ - compiler.

Regards, Markus.


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




Re: additionally...

2001-06-18 Thread Juergen Kreileder

On Mon, 18 Jun 2001, [EMAIL PROTECTED] wrote:

> Additionally, here is the output when I try to run the example code:
> 
> $> java -native -Djava.library.path=. HelloWorld
> Hello, World.  I'm going to call an exception now
> inside try block
> inside throw_it() 
> Running constructor
> Abort

With our JDK I get:

,
| % java -Djava.library.path=. HelloWorld
| Hello, World.  I'm going to call an exception now
| inside try block
| inside throw_it() 
| Running constructor
| Exception in thread "main" java.lang.NoSuchMethodError: MyException: method 
|(Ljava/lang/String;)V not found
| at HelloWorld.print(Native Method)
| at HelloWorld.main(HelloWorld.java:4)
`

And after adding the missing constructor to MyException I get the
expected output:

,
| % java -Djava.library.path=. HelloWorld
| Hello, World.  I'm going to call an exception now
| inside try block
| inside throw_it() 
| Running constructor
| Exception in thread "main" MyException: test
| at HelloWorld.print(Native Method)
| at HelloWorld.main(HelloWorld.java:4)
`


Juergen

-- 
Juergen Kreileder, Blackdown Java-Linux Team
http://www.blackdown.org/java-linux.html


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




Re: additionally...

2001-06-18 Thread Dimitris Vyzovitis

On Mon, 18 Jun 2001, IIS - Paul Morie locked 02/06/01 wrote:

> Additionally, here is the output when I try to run the example code:
> 
> $> java -native -Djava.library.path=. HelloWorld
> Hello, World.  I'm going to call an exception now
> inside try block
> inside throw_it() 
> Running constructor
> Abort

This is a known gcc 2.9x bug - it doesn't deal with exceptions from shared 
libraries. 3.0 is supposed to have fixed this, but I haven't tried yet.

A way to fix it may be to statically link the gcc libraries into your 
(libgcc, crt1 and their friends) shared library - the magic of -Bstatic 
and -Ur in ld may do the trick, but I am not sure if it will work.

-- dimitris
   mailto:[EMAIL PROTECTED]



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