Re: How to print a GUI

1999-07-15 Thread Alexander Davydenko

Sitanshu Bhusan Nanda wrote:
> 
> I am using java1.1.5 in Redhat Linux 5.2. I have developed some
> applications using JDBC and Postgresql 6.4 . I have also generated some
> reports using Java AWT. My problem is how to print those GUIs(reports).
> Is there any way i can convert these GUIs to **.ps files?
> 
> --
> | ("`-''-/").___..--''"`-._ |Sitanshu Bhusan Nanda   |
> |  `6_ 6  )   `-.  ( ).`-.__.`) | At:- Pithapur  |
> |  (_Y_.)'  ._   )  `._ `. ``-..-'  |Po: Buxi Bazar  |
> |_..`--'_..-_/  /--'_.' ,'  |CUTTACK-753001  |
> |   (il), ''  (li),'  ((!.-'|Orissa, INDIA   |
> |email: [EMAIL PROTECTED]  |
> | When ever you smile others smile with ||
> | you but when you cry you cry alone.   ||
> --
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
You can try to use PSGraphics or PSGr classes. I cant remember where it
hosted,
but it seems a PSGraphics from Kaffe.

Cheers.
-- 
Alexander Davydenko |
[EMAIL PROTECTED], [EMAIL PROTECTED]   | Moscow, USSR
-
<   Powered by Linux & 220V   >


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



Re: final variables in constructors

1999-07-15 Thread Pavel Tolkachev

The answer is: according the JLF, superclass constructor is called
*before* any initialization statement in subclass. super() does not
actually run in aClass() but java compiler generates  method where
it is called before first initialization statement of aClass. The syntax
super(...) is allowed only to let class designer to point which
superclass constructor with which parameters he wants to use, not to use
super() as usual method. You can think of it another way: superclass
constructor cannot access subclass instance data members. Consider
making v static (then it will be initialized during class, not instance
initialization).

Hope this helps

All the Best
Pavel


Kontorotsui wrote:
> 
> I wonder why if I write this:
> 
> aClass extends aSuperClass
> {
>   aClass()
>   {
>  super(1);
>   }
> }
> 
> where the superclass is:
> 
> aSuperClass
> {
>   aSuperClass(int i)
>   {
> ...
>   }
> }
> 
> anything works ok.
> 
> If instead I write
> 
> aClass extends aSuperClass
> {
>   final int v = 1;
> 
>   aClass()
>   {
>  super(v);
>   }
> }
> 
> with the same superclass, I get a "Can't reference v before the superclass
> constructor has been called." error from the compiler.
> 
> I understand that in general a variable cannot be referenced before the
> superclass constructor was called, but if that variable is a final, then it's a
> constant, why does the compiler complains?
> The two pieces of code are, semanthically, the same, aren't they?
> The javac pre-processor could even substitute the constant values before
> compiling!
> 
> It's the java language that is excessively pedantic or there is something I'm
> missing?
...


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



Re: How to print a GUI

1999-07-15 Thread Justin Lawler

There is a poastscript generating class called PSGr,
i have used it with a certain degree of sucess. Although it doesn't
work in all cases.

You can get it from here:

http://users.ids.net/~mhirsch/java/

hope this helps.

Justin.


Sitanshu Bhusan Nanda wrote:

> I am using java1.1.5 in Redhat Linux 5.2. I have developed some
> applications using JDBC and Postgresql 6.4 . I have also generated some
> reports using Java AWT. My problem is how to print those GUIs(reports).
> Is there any way i can convert these GUIs to **.ps files?
>
> --
> | ("`-''-/").___..--''"`-._ |Sitanshu Bhusan Nanda   |
> |  `6_ 6  )   `-.  ( ).`-.__.`) | At:- Pithapur  |
> |  (_Y_.)'  ._   )  `._ `. ``-..-'  |Po: Buxi Bazar  |
> |_..`--'_..-_/  /--'_.' ,'  |CUTTACK-753001  |
> |   (il), ''  (li),'  ((!.-'|Orissa, INDIA   |
> |email: [EMAIL PROTECTED]  |
> | When ever you smile others smile with ||
> | you but when you cry you cry alone.   ||
> --
>
> --
> 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]



Linux-Bug with ?

1999-07-15 Thread Oktay Akbal


If anyone got my earlier messages to this topic
please excuse. But I never got the mails back and
they did not show up in the archive so I assume
something went wrong.

Hello !

I think there is a Bug in the implementation of the conditional
(ternary) operator in the latest jdk1.2 for linux.

Given the following code:

class test{
public static void main(String[] args) {
int x=6;
double d=7.7;
if (x>d) System.out.println("true");
else System.out.println("false");
System.out.println( (x>d)?99.9:9);
}
} 

the correct output is:

false
9.0

as tested with jdk1.2.2 for win32; jdk1.1.7 for linux

jdk1.2-v2 (glibc2.0.7) gives me:

false
99.9

(tested on SuSe-Linux 6.1 )

Could someone please confirm this ?


Oktay Akbal.



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



Re: Linux-Bug with ?

1999-07-15 Thread Juergen Kreileder

> Oktay Akbal writes:

Oktay> I think there is a Bug in the implementation of the conditional
Oktay> (ternary) operator in the latest jdk1.2 for linux.

It's a known bug in the JIT compiler (sunwjit).  Turn the JIT off and
it will work.


Juergen

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


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



Re: Linux-Bug with ?

1999-07-15 Thread Stef Epardaud

On Thu, Jul 15, 1999 at 11:13:19AM +0200, Juergen Kreileder wrote:
> > Oktay Akbal writes:
> 
> Oktay> I think there is a Bug in the implementation of the conditional
> Oktay> (ternary) operator in the latest jdk1.2 for linux.
> 
> It's a known bug in the JIT compiler (sunwjit).  Turn the JIT off and
> it will work.
> 
> 
> Juergen
>

wow, this IS scary! who knows where in our code these kind of bugs can
mess up the results ?

btw: the following is also wrong:

int x=6;
double d=7.7;
System.out.println( (x>d) );
> true

with the JIT on and JDK1.2 .
when will (will it?) this be fixed ? 
i mean is there a date set for this fix ?


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



Re: Linux-Bug with ?

1999-07-15 Thread Nick Lawson

This sounds like a HUGE bug !
Is it just in the Blackdown JDK 1.2, or also in Suns JDK ?
Is there a fix ?
Are there others like this ?
Where is a good place to look for such hi-impact bugs ?
Nick

Juergen Kreileder wrote:

> > Oktay Akbal writes:
>
> Oktay> I think there is a Bug in the implementation of the conditional
> Oktay> (ternary) operator in the latest jdk1.2 for linux.
>
> It's a known bug in the JIT compiler (sunwjit).  Turn the JIT off and
> it will work.
>
> Juergen
>
> --
> Juergen Kreileder, Blackdown Java-Linux Porting Team
> http://www.blackdown.org/java-linux.html
>
> --
> 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]



-Xrunhprof:cpu=times gives a segfault.

1999-07-15 Thread Kontorotsui


Hello,
if I run java -Xrunhprof:cpu=times I get a segfault, same if I use
cpu=old, anything works perfectly with cpu=samples.

I have JDK1.2 on a SuSE 6.1. It's my system or this happens to everybody?

---
Andrea "Kontorotsui" Controzzi - MALE Student of Computer Science at 
University of Pisa  -  Italy  -  E-mail: [EMAIL PROTECTED]
My home page: http://www.cli.di.unipi.it/~controzz/intro.html

Founder and Admiral of Hoshi no Senshi (italian Leiji Matsumoto's fan group).
Creator of It.Arti.Cartoni (italian anime newsgroup) and proud member of...

+-+
|.  * .   |
|   .__ . .   |
|oq  |po   _ _|
|  /  #==>>>==#,-' (_)\   |
|  |  ,-|~\\   ///_ ,()  ,_}  |
|  |  |/|~]]] /// ,-~'  .,~   /   \|  .   |
|  |\_|_|_\_\~~~~'   \   (/|. |
| ./~ \___/   [m] \   \__//   |
| _bo..__ //   `-,.~~ |
|  _-~ 0o.__( .   |
| \  o  . |
|  .  (_)00   |
|. \~~~*,,,* ~00  |
|~0 . |
|   ~~~---~~  |
|   .*|
+-+
| An e-mail network of Space Cruiser Yamato and   | 
|  StarBlazers Fans   |
+-+


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



Re: Linux-Bug with ?

1999-07-15 Thread Juergen Kreileder

> Nick Lawson writes:

Nick> This sounds like a HUGE bug !

Well, it's a pre-release and the bug is mentioned on the known-bugs
page.

Nick> Is it just in the Blackdown JDK 1.2, or also in Suns JDK ?

The Sparc Solaris version is OK.

Nick> Is there a fix ?

Not yet.  We can't fix it because we don't have the source code for
sunwjit, but I'm sure we get a fix from Sun soon.

Nick> Are there others like this ?
Nick> Where is a good place to look for such hi-impact bugs ?

http://www.blackdown.org/java-linux/jdk1.2-status/known-bugs.html


Juergen


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



Re: -Xrunhprof:cpu=times gives a segfault.

1999-07-15 Thread Juergen Kreileder

> Kontorotsui  writes:

Kontorotsui> If I run java -Xrunhprof:cpu=times I get a segfault,
Kontorotsui> same if I use cpu=old, anything works perfectly with
Kontorotsui> cpu=samples.

Kontorotsui> I have JDK1.2 on a SuSE 6.1. It's my system or this
Kontorotsui> happens to everybody?

I haven't seen any segfaults with it.
Note that 'times' doesn't show cpu times with pre 1 & 2, it will work
with the next release.


Juergen

PS: Please fix your signature. See RFC 1855 (Netiquette Guidelines) ;-)

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


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



JNI/Linux pointers?

1999-07-15 Thread Robb Shecter

Hi,

Does anybody have any pointers to using JNI on Linux?  I'm starting a
project where I'll be hacking pine to access a running Java process.

Thanks!
- Robb


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



Re: final variables in constructors

1999-07-15 Thread David D. Lucas

Kontorotsui wrote:
> 
> aClass extends aSuperClass
> {
>   final int v = 1;
> 
>   aClass()
>   {
>  super(v);
>   }
> }

First off, my understanding of the question is why doesn't v exist when
passed into super. "super" is not a method call like everything else. 
It is a special keyword and a way to specify constructor
initialization.  What it tells the compiler is to use the contructor
that takes an integer in the aSuperClass.  Construction then takes place
from the highest top parent down to the concrete child.  In your case,
the type is right, but v does not exist yet until aSuperClass
initializes. The "final" keyword tells the runtime that this value will
not be changed once it is set.  So the one person who mentioned using a
"static int v = 1", is probably the way you want to go.

Hope that helps,
Dave


-- 

++
| David Lucas  mailto:[EMAIL PROTECTED]|
| Lucas Software Engineering   (614) 260-5970|
| Unix,C++,Java,Client/Server,CORBA  |
++
| GPS Location:  40 deg 00' 51" N,  82 deg 38' 11" W |
| IMHC: "Jesus Christ is the way, the truth, and the life."  |
| IMHC: "I know where I am; I know where I'm going." |
++

Notes:
IMHO: in my humble opinion   IMHC: in my humble conviction 
PGP Key Block:  finger [EMAIL PROTECTED]
All trademarks above are those of their respective owners.


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



Java2D Servlets on Linux

1999-07-15 Thread Robbie Baldock

I'm still trying to get Java2D to work on Linux.  My latest strategy is
to run my GIF generation program as a servlet.  

What I'm doing is firing up Xvfb to simulate an X environment but then
of course I need to set the DISPLAY environment variable for the servlet
and I'm unclear as to how I should do this.  

At the moment I'm calling this in my servlet's init():

Runtime.getRuntime().exec("DISPLAY=localhost:1.1");
Runtime.getRuntime().exec("export DISPLAY");

Which I suspect is the wrong way to do it as this should be done before
the servlet starts.  So the question is, how do I set this environment
variable just for the servlet?

I don't know if this is related but the servlet is generating an error
message in the JServ logs:

java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:124)
at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:63)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1009)

Which is giving me concern as it doesn't seem to have anything to do
with my attempts to set the DISPLAY variable...

Any suggestions on this would be greatly appreciated.


Robbie


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



Re: JNI/Linux pointers?

1999-07-15 Thread jools enticknap


Hi
>
>Does anybody have any pointers to using JNI on Linux?  I'm starting a
>project where I'll be hacking pine to access a running Java process.
>

JNI on Linux is much the same on all platforms( more or less:).
If you want a good book on JNI I suggest you try 'Essential JNI' by Rob 
Gordon. It's a very good book. The ISBN is 0-13-679895-0.

Or you could try the Java Tutorial, under specialized Trails there is a 
section on JNI.

The Java Tutorial can be found at :-
   http://java.sun.com/docs/books/tutorial/index.html


Or if you're interested I have written a Java to C++ program which produces 
C++ code which maps from a Java class. If you want the parser please drop me 
a line and I'll send you the code.

It only the second version, but it's not too bad :-)

--Jools



__
Get Your Private, Free Email at http://www.hotmail.com


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



Java2D Servlets on Linux

1999-07-15 Thread Gregory Steuck

> "Robbie" == Robbie Baldock <[EMAIL PROTECTED]> writes:

Robbie> At the moment I'm calling this in my servlet's init():

Robbie> Runtime.getRuntime().exec("DISPLAY=localhost:1.1");
Robbie> Runtime.getRuntime().exec("export DISPLAY");

Robbie> Which I suspect is the wrong way to do it as this should be
Robbie> done before the servlet starts.  So the question is, how do
Robbie> I set this environment variable just for the servlet?

What you need to do is set DISPLAY variable for JVM (servlets have no
idea what environment variables are). So, as somebody already pointed
out, Xvfb must be running _before_ starting up your servlet engine.
Then you should set DISPLAY variable and start servlet engine having
this var set. Something like this should do:

#!/bin/sh
Xvfb :1 & # maybe you don't need last &
DISPLAY=:1 you_servlet_engine_start_command

Bye
Greg

P.S. Your approach with using Runtime.exec is wrong.


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



Re: Linux-Bug with ?

1999-07-15 Thread Albrecht Kleine

> > Nick Lawson writes:
> 
> Nick> This sounds like a HUGE bug !

> Not yet.  We can't fix it because we don't have the source code for
> sunwjit, but I'm sure we get a fix from Sun soon.



You could consider using TYA JIT. TYA doesn't have the mentioned bug.
 (Maybe others, but there's always a good chance 
  to fix them quickly because it's open source software!)

ftp://gonzalez.cyberus.ca/pub/Linux/java/tya14.tgz

Cheers,
Albrecht


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



Re: Java2D Servlets on Linux

1999-07-15 Thread Nathan Meyers

Robbie Baldock wrote:
> 
> I'm still trying to get Java2D to work on Linux.  My latest strategy is
> to run my GIF generation program as a servlet.
> 
> What I'm doing is firing up Xvfb to simulate an X environment but then
> of course I need to set the DISPLAY environment variable for the servlet
> and I'm unclear as to how I should do this.
> 
> At the moment I'm calling this in my servlet's init():
> 
> Runtime.getRuntime().exec("DISPLAY=localhost:1.1");
> Runtime.getRuntime().exec("export DISPLAY");
> 
> Which I suspect is the wrong way to do it as this should be done before
> the servlet starts.  So the question is, how do I set this environment
> variable just for the servlet?

No, this won't work. What it's doing is starting up a subshell, setting
the environment in that subshell, and then that subshell is going away
without doing any real work. In fact, these two calls are starting up
(and then not really using) two different subshells.

Environment variables are associated with Unix processes and passed to
child processes. You can't really set one "just for the servlet", you
need to set it for the Unix process under which the servlet is running -
meaning the JVM. Unfortunately, Java doesn't let you get to the Unix
environment variables without writing your own native code (platform
independence and such rot), so you have to do it in the environment from
which the JVM is launched. The details depend on how it's launched: if
from a shell script, you can set the environment in the shell script
(DISPLAY=, etc.); if from a C/C++ program, you can call setenv() from
the program... or change the environment from which *that* program is
launched. I hope this makes some sense... it should once you've made
sense of the relationship between Unix processes and environment.

Down in the bowels of X clients, it's possible to open any display you
want to, not necessarily the one specified in the environment. Maybe
there's some method to pass this request to Java for which I haven't
found any documentation.


> I don't know if this is related but the servlet is generating an error
> message in the JServ logs:
> 
> java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:124)
> at
> java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:63)
> at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1009)
> 
> Which is giving me concern as it doesn't seem to have anything to do
> with my attempts to set the DISPLAY variable...

You're right, that's not the message you'd see with an unset DISPLAY
variable. That class should be in rt.jar... I wonder why you're not
finding it.

Nathan


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



Servlets + JSP on linux

1999-07-15 Thread Tim Reilly


Can someone please give me a hand here?  I need (1) to get a servlet to
pass some data to a JSP page via a Bean, and then (2) "hit" that JSP page
to get back a nicely formatted HTML page to send back to the user.  To
accomplish this, I am using the following tools:

Blackdown JDK   1.1.7 v3
Apache  1.3.6
Apache JServ1.0
GnuJSP  0.9.10

Since GnuJSP implements v 0.91 of the JSP, I know that I need the
following classes to accomplish goals (1) and (2) above:

com.sun.server.http.HttpServiceResponse
and
com.sun.server.http.HttpServiceRequest

My suspicion is that they're included in Sun's jwdk 1.0, however I can
only download jswdk1.0-ea from Sun's website, which includes JSP 1.0 and
(I think) is *not* backwards compatible with earlier versions of the spec.
I've been struggling with this for weeks now, and haven't had any luck
yet.

Any help or explanation is greatly appreciated,

-Tim


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



RE: a filesystem standard for the JDK

1999-07-15 Thread R.W. Shore

FYI: the standard for the production versions of the JDK
under Solaris 2.x are the following:

o Real directory is /usr/javax.y (example: /usr/java1.1 or
whatever)
o Symbolic link to the real directory from /usr/java
o Various symbolic links in /usr/bin to things like
/usr/java/bin/java, /usr/java/bin/javac, ... I haven't
checked carefully for all the links created by the install.

-Original Message-
From: Paolo Ciccone [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 14, 1999 13:35
To: Nelson Minar
Cc: [EMAIL PROTECTED]
Subject: Re: a filesystem standard for the JDK


> "NM" == Nelson Minar <[EMAIL PROTECTED]> writes:

NM> Has anyone worked up a filesystem standard for the
JDK on
NM> linux? I've seen it installed all over the place on
different
NM> Linux systems. Maybe we can come up with a standard
place to
NM> put everything and make the world safe for RPMs and
.debs
NM> everywhere.

NM> Is there a sensible Solaris standard? Anyone want to
work on
NM> this with me?

That's a great idea, I'd like to participate. At Borland we
are
working on the Solaris version of JBuilder and we could not
find a
defined JDK standard location.

--Paolo



--
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: Linux-Bug with ?

1999-07-15 Thread Zdenek Kabelac

> You could consider using TYA JIT. TYA doesn't have the mentioned bug.
>  (Maybe others, but there's always a good chance 
>   to fix them quickly because it's open source software!)
> 
> ftp://gonzalez.cyberus.ca/pub/Linux/java/tya14.tgz

Hi

I've tried this one.
I would like to mention, that on my system with blackdown's java 1.2 
I had to put libtya.so directly into jdk1.2/jre/lib/i386/libtya.so
because it was the only place, where the java was looking for it.
I don't know whose this bug is, but definitely setting LD_LIBRARY_PATH
to whatever you want doesn't help you.

Also it seems to me, there is no way to execute OpenGL java3d with
this compiler - am I right ?

-- 
  Given enough time and money, Microsoft will eventually "invent" Unix.
   George Bonser   Thomas Lakofski
No chance.  They only have a finite number of monkeys.
   Zdenek Kabelachttp://www.fi.muni.cz/~kabi/   [EMAIL PROTECTED]


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



Re: Java2D Servlets on Linux

1999-07-15 Thread Robbie Baldock

Nathan Meyers wrote:

> No, this won't work. 

I didn't think it would!

> Environment variables are associated with Unix processes and passed to
> child processes. You can't really set one "just for the servlet", you need
> to set it for the Unix process under which the servlet is running -
> meaning the JVM. 

But isn't this a bit crap?  I mean, does this mean that all java 
processes running on a Linux box (whether they be servlets or 
applications) have to share the same DISPLAY settings?!

>> java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment
>> at java.lang.Class.forName0(Native Method)
> You're right, that's not the message you'd see with an unset DISPLAY
> variable. That class should be in rt.jar... I wonder why you're not
> finding it.

Mmm indeed!  Oh dear, this process seems to be a never-ending 
journey of fixing one problem and then crashing into another brick 
wall!

Can't wait for the final release of 1.2...!


Robbie



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



Re: Java2D Servlets on Linux

1999-07-15 Thread Nathan Meyers

Robbie Baldock wrote:
> 
> Nathan Meyers wrote:
> 
> > No, this won't work.
> 
> I didn't think it would!
> 
> > Environment variables are associated with Unix processes and passed to
> > child processes. You can't really set one "just for the servlet", you need
> > to set it for the Unix process under which the servlet is running -
> > meaning the JVM.
> 
> But isn't this a bit crap?  I mean, does this mean that all java
> processes running on a Linux box (whether they be servlets or
> applications) have to share the same DISPLAY settings?!

Not all processes. But all applications running under a particular JVM.

Standalone apps tend to run under their own JVM, servlets all run under
one JVM (a cause of huge time and resource savings). Given your
particular problem, it sounds like this may not be such a bad fit...
unless you've got a compelling need to be opening *different* X servers
from your various servlets. Basically, what happens is your first use of
the AWT opens a connection to the X server, and all graphical activity
from all servlets use that server.

It's a bit crap, but not total crap. It's possible, though not common,
for an X application to open and use more than one display. Java, in its
lowest-common-denominator GUI model, denies you this model -- slightly
annoying. It also denies you any avenue, other than an environment
variable you can't control from Java, for specifying the display you
want to use: that *is* crap.


> 
> >> java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment
> >> at java.lang.Class.forName0(Native Method)
> > You're right, that's not the message you'd see with an unset DISPLAY
> > variable. That class should be in rt.jar... I wonder why you're not
> > finding it.
> 
> Mmm indeed!  Oh dear, this process seems to be a never-ending
> journey of fixing one problem and then crashing into another brick
> wall!

I'll be tackling some servlet projects in a few weeks... I may have more
insight then into why the AWT interface to X seems to be AWOL. Of
course, there's probably someone reading this who already knows the
answer :-).

Nathan


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



Re: Java2D Servlets on Linux

1999-07-15 Thread Chris Abbey

>> >> java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment
>> >> at java.lang.Class.forName0(Native Method)
>> > You're right, that's not the message you'd see with an unset DISPLAY
>> > variable. That class should be in rt.jar... I wonder why you're not
>> > finding it.
>> 
>> Mmm indeed!  Oh dear, this process seems to be a never-ending
>> journey of fixing one problem and then crashing into another brick
>> wall!
>
>I'll be tackling some servlet projects in a few weeks... I may have more
>insight then into why the AWT interface to X seems to be AWOL. Of
>course, there's probably someone reading this who already knows the
>answer :-).

Note that this is NoClassDefFoundError and not ClassNotFoundException.
This is a subtle and note very well documented (imnsho). Technically:
the former means that the class was found once, and now is not while
the latter means that the class just doesn't exist in the classpath.
In practice: I've seen NoClassDefFoundError for other linkage errors...
for example: I ask for class X (load class), which needs class Y (load
class from class), class Y needs something inorder to be loaded (static
initializer relies on making rmi call to a server that isn't up - don't
laugh! I've seen it coded and they don't understand why it is bad...).
Whatever class Y needs fails (with an exceptionInInitiailizerError) and
causes class load from class to fail, which in turn causes class load
to fail with the (wrong damn excpetion) NoClassDefFoundError. I have
seen this on 117. I wouldn't doubt it on 12. would someone with access
to the source for this class take a look at  and see what kind
of exceptions it could generate? Especially in the case that there is
no Xserver? Actually if anyone here is the class file hacker sort you
can put the entire method into a protection block, almost if you had
coded it like this... 

try{
//entire contents of clinit
}catch (Throwable t) {
 t.printStackTrace();
 throw t;
}

(yes, I know it ain't easy... but it is doable! better tooling for
class file manipulation would help immensly.) -=Chris

!NEW!-=> <*> cabbey at home dot net  http://members.home.net/cabbey/ <*>
"What can Microsoft do? They certainly can't program around us." - Linus

-BEGIN GEEK CODE BLOCK-   Version:3.12   http://www.geekcode.com
GCS$/IT/PA$ d(-) s++:+ a-- C+++$ UL UA++$ P++ L++ E- W++ N+ o? K? !P
w---(+)$ O- M-- V-- Y+ PGP+ t--- 5++ X+ R tv b+ DI+++ D G e++ h(+) r@ y?
--END GEEK CODE BLOCK--


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