JavaWebServer1.1.3 build probs. Now Working
Well the problem is now fixed and the WebServer is ok.
A few teething problems on the build but all is working
Are there any problems with the Server in general that anyone
has found ?
I wish to create servlets and connections to Oracle via jdbc.
Many thanks
Matt
-
Below are the files for future ref if anyone needs them.
-
###
# @(#)Makefile.sol 1.11 97/11/06
#
# Solaris-specific makefile for building optional native library support.
# Use this as a starting point for porting to other UNIX platforms.
# REMEMBER THE TABS BETWEEN THE $ signs.
#
# Path to top of Java Web Server distribution tree
TOP = ..
# Name of the library we're making (given to System.loadLibrary)
LIBNAME = server
# Location of Java Developer's Kit (and runtime)
JAVA_HOME=
# Java runtime flags
JAVAH=$(JAVA_HOME)/bin/javah
CLASSPATH=$(TOP)/classes:$(TOP)/lib/classes.zip:$(JAVA_HOME)/classes:$(JAVA_HOME
)/lib/classes.zip
# OS and machine type
OS =genunix
ARCH = unknown
OBJ = $(OS)/$(ARCH)
# Preprocessor, compiler, linker, and related flags
CC =cc
CFLAGS =-shared -fPIC
CPPFLAGS = -I$(OS) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(OS)
LDFLAGS = #-G -h $(LIBNAME)
INSTALL = /usr/bin/install
LIBDIR =$(TOP)/lib/$(OBJ)
LIBRARY = $(OBJ)/lib$(LIBNAME).so
OBJS = $(OBJ)/server.o \
$(OBJ)/UNIXUser.o \
$(OBJ)/UNIXUserEnumeration.o \
$(OBJ)/com_sun_server_ServerProcess.o \
$(OBJ)/com_sun_server_realm_unix_UNIXUser.o \
$(OBJ)/com_sun_server_realm_unix_UNIXUserEnumeration.o
default all: $(LIBRARY)
$(LIBRARY): $(OBJS)
$(LINK.c) -o $@ $(OBJS)
$(OBJ)/server.o: server.c $(OS)/com_sun_server_ServerProcess.h
$(COMPILE.c) -o $@ server.c
$(OBJ)/UNIXUser.o: UNIXUser.c $(OS)/com_sun_server_realm_unix_UNIXUser.h
$(COMPILE.c) -o $@ UNIXUser.c
$(OBJ)/UNIXUserEnumeration.o: UNIXUserEnumeration.c \
$(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.h
$(COMPILE.c) -o $@ UNIXUserEnumeration.c
$(OBJ)/com_sun_server_ServerProcess.o: $(OS)/com_sun_server_ServerProcess.c
$(COMPILE.c) -o $@ $(OS)/com_sun_server_ServerProcess.c
$(OS)/com_sun_server_ServerProcess.c:
$(JAVAH) -d $(OS) -classpath $(CLASSPATH) -stubs
com.sun.server.ServerProcess
$(OS)/com_sun_server_ServerProcess.h:
$(JAVAH) -d $(OS) -classpath $(CLASSPATH) com.sun.server.ServerProcess
$(OBJ)/com_sun_server_realm_unix_UNIXUser.o:
$(OS)/com_sun_server_realm_unix_UNIXUser.c
$(COMPILE.c) -o $@ $(OS)/com_sun_server_realm_unix_UNIXUser.c
$(OS)/com_sun_server_realm_unix_UNIXUser.c:
$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \
-stubs com.sun.server.realm.unix.UNIXUser
$(OS)/com_sun_server_realm_unix_UNIXUser.h:
$(JAVAH) -d $(OS) -classpath $(CLASSPATH)
com.sun.server.realm.unix.UNIXUser
$(OBJ)/com_sun_server_realm_unix_UNIXUserEnumeration.o: \
$(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c
$(COMPILE.c) -o $@ $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c
$(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c:
$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \
-stubs com.sun.server.realm.unix.UNIXUserEnumeration
$(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.h:
$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \
com.sun.server.realm.unix.UNIXUserEnumeration
install: $(LIBRARY)
$(INSTALL) -d $(LIBDIR)
$(INSTALL) -c $(LIBRARY) $(LIBDIR)
clean:
rm -rf $(OS)
.INIT:
-@mkdir -p $(OBJ)
.KEEP_STATE:
---
/*
* @(#)UNIXUserEnumeration.c1.4 97/09/09
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*
* CopyrightVersion 1.0
*/
#include
#include"com_sun_server_realm_unix_UNIXUserEnumeration.h"
/*
* Native methods supporting the enumeration of user names.
*
* This uses the standard UNIX/POSIX calls for accessing
* such names. Most
Re: DB2, Linux & Java Experiences
On Thu, 22 Jul 1999, Alexander Schatten wrote: > I am searching for a database for my new project. now there are really a > lot of RDBMS systems for Linux (nearly too much!). at the moment I am > playing with mySQL, which is nice, simple, but lacks some functionality: > foreign keys, first of all. PostgreSQL seems to have other problems, now > there are certain commercial systems, that should be free for > non-commercial use. Don't know if DB2 fits this ... sure there is a time-limited evaluation period. Maybe that is enough for you, or maybe you know more about their licensing than I do. > has someone experiences with DB2 and > > -- installation DB2 comes with a nice installationprogram that sets everything up for you (with reasonable default values). It worked fine on RH5.0 but failed with segmentation fault on RH6.0 (probably glibc or the DB2 version I tested). It can be installed anyway by simply installing the rpm's, and then fixing things so they work (and I haven't really tested this much). DB2 requires pdksh to be installed (it's included with RH). > -- administration You don't have to do anything unless you don't want to ... The docs are readable (but are they included with the beta?) > -- JDBC The linux jdk doesn't seem to have any problems in this area. There are 2 JDBC drivers that come with DB2, one using a shared lib (app) and one using pure java (net). The app driver needs native threads (on solaris anyway, haven't tried it on Linux) and some environment variables set (DB2INSTANCE). The net driver needs a listener program (db2jd, which you start with db2jstrt), and nothing more. > -- connection to Access / ODBC You need to install the "Client Application Enabler" on the client machine, configure it to talk to the DB2, enable ODBC and then connect access to that ODBC. I haven't done this to DB2 running on Linux, I have done NT->Solaris. There is a newsgroup comp.databases.ibm-db2, which is probably a better place to ask DB2 related questions. /Urban -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Sending mail from an application (Pre-v2 JDK, Redhat 6.0)
[EMAIL PROTECTED] writes: > How would one go about sending e-mail from an application? I have > tried doing it via the Runtime.exec() method and running a long drawn out > 'mail' command, but the system executes it too fast and it ends up getting > garbled in the process. Any ideas? Open a socket against port 25 on a mail server and speak SMTP. (JavaMail IMHO is an overkill if you only want to send a smtp mail) -- Jan-Henrik Haukeland -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Sending mail from an application (Pre-v2 JDK, Redhat 6.0)
You don't need any extensions; Java 1.1 can do all the common URLs.
try this:
/**
send e-mail to current e-mail address;
*/
private static void sendEmail (String text) {
// missing address
if (email == null || email.length () < 1)
System.out.println ("No e-mail address specified for " + text) ;
else if (smtp == null || smtp.length () < 1)
System.out.println ("No smtp server address specified for " + text) ;
// try to send the mail
else System.out.println ("Send " + text + " to " + email + " via " + smtp) ;
try {
// establish a network connection for sending mail
URL u = new URL ("mailto:" + email) ;
URLConnection c = u.openConnection () ;
c.setDoInput (false) ;
c.setDoOutput (true) ;
System.out.println ("Sendmail connecting to " + email + " ...") ;
System.out.flush () ;
c.connect () ;
PrintWriter out =
new PrintWriter (new OutputStreamWriter (c.getOutputStream ())) ;
// set up the header
out.println ("From: ") ;
out.println ("To: " + email) ;
out.println ("Subject: Alarm from web-server") ;
out.println () ;
// add the message and close the connection, to send it
out.println (text) ;
out.close () ;
System.out.println ("E-mail sent to " + email + " for " + text) ;
System.out.flush () ;
}
catch (Exception e) {
e.printStackTrace () ;
System.out.println ("e-mail address set to null string") ;
email = "" ;
}
}
}
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: 22 July 1999 15:06
> > To: [EMAIL PROTECTED]
> > Subject: Sending mail from an application (Pre-v2 JDK, Redhat 6.0)
> >
> >
> > Hey all,
> > How would one go about sending e-mail from an
> > application? I have
> > tried doing it via the Runtime.exec() method and running a
> > long drawn out
> > 'mail' command, but the system executes it too fast and it
> > ends up getting
> > garbled in the process. Any ideas?
> >
> > Thanks,
> > Abe
> >
> > Abe L. Getchell - Systems Engineer
> > System Support Services
> > Kentucky Department of Education
> > Voice 502-564-2020x225
> > E-mail [EMAIL PROTECTED]
> > Web http://www.kde.state.ky.us/
> >
> >
> > --
> > To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> > with a subject of "unsubscribe". Trouble? Contact
> > [EMAIL PROTECTED]
> >
>
> ___
> This email is confidential and intended solely for the use of the
> individual to whom it is addressed. Any views or opinions presented are
> solely those of the author and do not necessarily represent those of
> Sema Group.
> If you are not the intended recipient, be advised that you have received this
> email in error and that any use, dissemination, forwarding, printing, or
> copying of this email is strictly prohibited.
>
> If you have received this email in error please notify the Sema Group
> Helpdesk by telephone on +44 (0) 121 627 5600.
> ___
>
>
>
>Part 1.2Type: application/ms-tnef
>Encoding: base64
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Minor jdbc question.
Ok, jdbc works for simple select statements like.. select * from col But how can you pass this statement select count(*) from col or a more complex statement. Many thanks Matt -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Minor jdbc question.
Matt Zagni wrote: > > Ok, > > jdbc works for simple select statements like.. > > But how can you pass this statement > select count(*) from col That will depend on your DBMS - JDBC is just a pipe (for the most part,) sending information to the database back end. What database system are you using? Matt Excell Chief Engineer OnLine Web Marketing -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
netscape 4.61, Java, Redhat 6.0
>I've not had that many problems with Netscape and Java. Could it really just be me? I'm running pretty basic Netscape, about the only change I made was running Fortify over the browser. Trivial applets like http://nelson.www.media.mit.edu/people/nelson/research/mas964/ps2/CircleRepetition.html are killing it. Try it yourself - run the applet, click and hold in the window and drag around awhile. (Enjoy the pretty circles). For me, after about 15 seconds of this, Netscape locks up solid. With the Redhat RPMs, it consumes 100% CPU and can't be killed except with signal 9. The Mandrake RPMs at ftp://ftp.wtfo.com/pub/linux/mandrake/6.0/Mandrake/RPMS/ are a bit better - it still locks up, but doesn't consume CPU and can be killed with the normal signal. The netscape wrapper script in the RedHat RPMs is quite complex, but doesn't seem to be doing anything with LD_LIBRARY_PATH or the Java environment. The one with Mandrake is much simpler, also doesn't set anything that seems related. It all feels to me like some bad instability between AWT and glibc2.1. (The applet I've pointed you to is quite simple Java1.0 stuff. No threads are spawned. It does a fair amount of work inside mouseDrag(), but that's all. [EMAIL PROTECTED] . . . .. . . . http://www.media.mit.edu/~nelson/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Java IDE for Linux?
Thanks for all the answers. After spending a lot of time last night testing a multitude of products, I'm going the xemacs/jde route. --G -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: netscape 4.61, Java, Redhat 6.0
Nelson Minar writes: > >I've not had that many problems with Netscape and Java. > > Could it really just be me? No. I finally had to disable Netscape 4.61 Java. I'd say 75% of all applets cause either the 100%-CPU-utilization problem or the instant-Netscape-crash problem. Best, daniel dulitz Valley Technologies, Inc. Peak Performance Real-Time DSP State College, PA -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Java IDE for Linux?
> "GP" == Guillermo Payet <[EMAIL PROTECTED]> writes: GP> Hello, GP> Can someone recommend a Java Development environment for GP> Linux? That is: an IDE to develop Java code, not necessarily GP> written in Java. I know that this is a shameless plug but we just finished showing publicly the first beta of JBuilder on Linux, scheduled to be released just after the Solaris version. It's 100% Java and runs on JDK 1.2. See http://www.inprise.com/about/press/1999/javaone.html for the announcement. --Paolo -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Problems with Java 1.2 pre-v1 on Linux
Madrid, July 23rd 1999
Hi,
I've got Java 1.2 pre-v1 installed on RedHat 6.0. While trying to
compile (javac) one version of the world-infamous HelloWorld applet
(just for trying purposes) the following error occurred:
*** panic: GC: getStickySystemClass failed: java/lang/ref/Reference
CLASSPATH may be incorrect
SIGABRT 6* abort (generated by abort(3) routine)
stackpointer=0xb5b0
Full thread dump Classic VM (Linux_JDK_1.2_pre-release-v1, native
threads):
"main" (TID:0x40cf91e0, sys_thread_t:0x804c4f8, state:R, native
ID:0x400) pr
io=5: pending=java.lang.OutOfMemoryError
Monitor Cache Dump:
Registered Monitor Dump:
utf8 hash table:
JNI pinning lock:
JNI global reference lock:
BinClass lock:
Class linking lock:
System class loader lock:
Code rewrite lock:
Heap lock:
Monitor cache lock: owner "main" (0x804c4f8) 1 entry
Thread queue lock: owner "main" (0x804c4f8) 1 entry
Dynamic loading lock:
Monitor registry: owner "main" (0x804c4f8) 1 entry
It seems curious to me the reference to the CLASSPATH var. After reading
the JDK1.2 pre-v1 documentation I assumed that there was no need for
CLASSPATH or JAVA_HOME vars at all.
BTW, the applet (which language is Spanish ;-)) is as follows:
//
// Applet HolaMundo de ejemplo
//
import java.awt.Graphics;
import java.applet.Applet;
public class HolaMundo extends Applet {
public void paint( Graphics g ) {
g.drawString( "Hola Mundo!",25,25 ) ;
}
}
Any explanation or idea?
Thanx a bunch in advance!
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
unsubscribe
-Original Message-
From: Nacho Mayorga [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 23, 1999 2:12 PM
To: Java Linux
Subject: Problems with Java 1.2 pre-v1 on Linux
Madrid, July 23rd 1999
Hi,
I've got Java 1.2 pre-v1 installed on RedHat 6.0. While trying to
compile (javac) one version of the world-infamous HelloWorld applet
(just for trying purposes) the following error occurred:
*** panic: GC: getStickySystemClass failed: java/lang/ref/Reference
CLASSPATH may be incorrect
SIGABRT 6* abort (generated by abort(3) routine)
stackpointer=0xb5b0
Full thread dump Classic VM (Linux_JDK_1.2_pre-release-v1, native
threads):
"main" (TID:0x40cf91e0, sys_thread_t:0x804c4f8, state:R, native
ID:0x400) pr
io=5: pending=java.lang.OutOfMemoryError
Monitor Cache Dump:
Registered Monitor Dump:
utf8 hash table:
JNI pinning lock:
JNI global reference lock:
BinClass lock:
Class linking lock:
System class loader lock:
Code rewrite lock:
Heap lock:
Monitor cache lock: owner "main" (0x804c4f8) 1 entry
Thread queue lock: owner "main" (0x804c4f8) 1 entry
Dynamic loading lock:
Monitor registry: owner "main" (0x804c4f8) 1 entry
It seems curious to me the reference to the CLASSPATH var. After reading
the JDK1.2 pre-v1 documentation I assumed that there was no need for
CLASSPATH or JAVA_HOME vars at all.
BTW, the applet (which language is Spanish ;-)) is as follows:
//
// Applet HolaMundo de ejemplo
//
import java.awt.Graphics;
import java.applet.Applet;
public class HolaMundo extends Applet {
public void paint( Graphics g ) {
g.drawString( "Hola Mundo!",25,25 ) ;
}
}
Any explanation or idea?
Thanx a bunch in advance!
--
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: netscape 4.61, Java, Redhat 6.0
[EMAIL PROTECTED] (Nelson Minar) writes: > >I've not had that many problems with Netscape and Java. > > Could it really just be me? I'm running pretty basic Netscape, about > the only change I made was running Fortify over the browser. Trivial > applets like > >http://nelson.www.media.mit.edu/people/nelson/research/mas964/ps2/CircleRepetition.html > are killing it. Try it yourself - run the applet, click and hold in > the window and drag around awhile. (Enjoy the pretty circles). For me, > after about 15 seconds of this, Netscape locks up solid. [...] Well, for more data, Netscape 4.61 in Red Hat 5.2 (glibc2.0) locks up solid after no more than 2 or 3 seconds manipulating that applet. It's the version downloaded from Netscape, no wrapper scripts, and I don't use LD_LIBRARY_PATH. Kill -9 is the only escape. (Side note: pretty pathetic that I've got a quick link to "killall -9 netscape" in my gnome panel. Speaks volumes about the robustness of the app.) c. -- /** Chris Woods * [EMAIL PROTECTED] * ICQ#21740987 * * ObjectNetworks LLC * Network Systems Development * * Linux OSS Java Objects Distributed Systems * * Mobile Agents Multi-Tier Enterprise Systems */ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: netscape 4.61, Java, Redhat 6.0
On Fri, 23 Jul 1999, Nelson Minar wrote: > Could it really just be me? I'm running pretty basic Netscape, about > the only change I made was running Fortify over the browser. Trivial > applets like > >http://nelson.www.media.mit.edu/people/nelson/research/mas964/ps2/CircleRepetition.html > are killing it. Try it yourself - run the applet, click and hold in > the window and drag around awhile. (Enjoy the pretty circles). For me, > after about 15 seconds of this, Netscape locks up solid. Same here, with Netscape 4.61 running on Debian unstable (potato). Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: netscape 4.61, Java, Redhat 6.0
So basically, Netscape 4.61 is whacked for Java. On Redhat 6.0, Redhat
5.2, and Debian potato. Yay!
What's frustrating is this stuff used to work. I was using Netscape
4.5 for the longest time with Java with no problems. So maybe it's a
recent Netscape bug, rather than a Linux version problem.
Is anyone running a Netscape that does work well for Java on Redhat 6.0?
Here's the source code for my simple applet that's killing Netscape.
It's just one example, I haven't found any Java to run reliably in
Netscape recently. My apologies for the ugly code, it's some of the
first Java I wrote. The paint/repaint interactions are a bit bizarre
in DoubleBufferApplet, maybe that's the source of the problem.
// mas964 ps2
// draw circles on mouse click that demonstrate repetition
import java.applet.*;
import java.awt.*;
import java.lang.Math;
import DoubleBufferApplet;
public class CircleRepetition extends DoubleBufferApplet {
public boolean mouseDrag(Event e, int x, int y) {
return mouseDown(e, x, y);
}
public boolean mouseDown(Event e, int x, int y) {
Graphics g = imageBuffer.getGraphics();
this.clearImageBuffer();
g.setColor(this.getForeground());
int maxNumCircles = 30;
int circleSizeGradations = 10;
int numCircles;
int circleSize;
float cellSize;
// y coordinate controls the number of circles drawn
numCircles = maxNumCircles * y / imageBufferSize.height + 2;
if (imageBufferSize.width > imageBufferSize.height)
cellSize = imageBufferSize.width / numCircles;
else
cellSize = imageBufferSize.height / numCircles;
// x coordinate controls how big the circles are
circleSize = (int)(cellSize * x / imageBufferSize.width) + 1;
if (circleSize < 2)
circleSize = 2;
// System.out.println("numCircles " + numCircles + " circleSize " + circleSize);
// now draw circles in a hexagonal pattern (some slop on both sides
// to handle roundoff error)
int i, j;
for (i = -1; i < numCircles+4; i++) {
for (j = -1; j < numCircles+4; j++) {
if (i % 2 == 0)
g.fillOval(Math.round(i * cellSize), Math.round(j * cellSize),
circleSize, circleSize);
else
g.fillOval(Math.round(i * cellSize),
Math.round(j * cellSize + cellSize/2),
circleSize, circleSize);
}
}
repaint();
return true;
}
public void init() {
this.setBackground(Color.white);
this.setForeground(Color.black);
super.init();
}
}
// base class for double buffered applets. Drawing is done to imageBuffer,
// an offscreen buffer that's BLTed to the frame as need be. This gives
// you less flashies and some measure of image persistence across exposes.
// (it'd be nice if we could do this for arbitrary components, but that
// would require changing the root Component class)
// Draw model:
// When drawing, don't use this.getGraphics() or paint()'s argument-
// use imageBuffer.getGraphics()
// override paint() as expected to paint, but make sure to
// call super.paint() to actually render your changes
// call this.repaint() to actually cause the drawing to show up
// (or wait for something else to call this.update())
// use this.setBackground() as you would normally
// call clearImageBuffer() to reset the entire drawing to background color
import java.applet.*;
import java.awt.*;
public class DoubleBufferApplet extends Applet {
protected Image imageBuffer;
protected Dimension imageBufferSize;
// paint - just call update. Subclass can override this, be sure to call
// super.paint() as the last step.
public void paint(Graphics g) {
this.update(g);
}
// clear the image buffer to whatever the background colour is.
public void clearImageBuffer() {
Graphics ig = imageBuffer.getGraphics();
Color oldColor = ig.getColor();
ig.setColor(this.getBackground());// clear the buffer
ig.fillRect(0, 0, imageBufferSize.width, imageBufferSize.height);
ig.setColor(oldColor);
}
// update - render the buffer onto the screen
// also handles lazy creation of the offscreen buffer
public void update (Graphics g) {
Dimension appletSize = this.size(); // read the current size
// check that the buffer is valid - if not, build one
if (imageBuffer == null ||
appletSize.width != imageBufferSize.width ||
appletSize.height != imageBufferSize.height) {
// System.out.println("Building a buffer of size " + appletSize);
imageBuffer = createImage(appletSize.width, appletSize.height);
imageBufferSize = appletSize;
this.clearImageBuffer();
}
g.drawImage(imageBuffer, 0, 0, this);
}
}
Title: Repetition Circles
Repetition Circles
You control the vertical
You control the horizontal
Bad file descriptors and other nasty things.
Hi,
I'm having some real grief with "java.io.IOException: Bad file descriptor"
messages. I'm getting these not only on data file I'm reading (cached web
docs in this case), but also on class files, which causes the
NoClassDefFoundErrors of my previous few posts. I've tried stracing it,
and here's a little excerpt. I'm very very far from a kernel and/or c
hacker, so it's entirely possible I've missed something important. I just
ran my app until one of these happened (didn't take long), did a
System.out.println about it, and matched up the URL that was printed with
the socket calls made (ie, if the URL is /bob and there is a write(18,
"GET /bob ...") call then 18 is naughty one. I then looked back in the
strace for 18 :) Isn't grep great?
There don't seem to be any system calls gone wrong... weird.
Sorry if this isn't very useful... I really want to get this fixed, since
I basically can't do any work until I can run my app. I can try to
provide more info if required.
Thanks,
dstn.
Here's the excerpt:
# Make naughty socket number 18...
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 18
setsockopt(18, SOL_SOCKET, SO_REUSEADDR, [-1], 4) = 0
#snip
fcntl(18, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(18, F_SETFL, O_RDWR|O_NONBLOCK|FASYNC) = 0
getpid()= 3177
fcntl(18, F_SETOWN, 3177) = 0
sigprocmask(SIG_BLOCK, [IO], [])= 0
sigprocmask(SIG_SETMASK, [], NULL) = 0
# connect to the SOCKS proxy server...
connect(18, {sin_family=AF_INET, sin_port=htons(1080),
sin_addr=inet_addr("9.1.40.50")},
16) = -1 EINPROGRESS (Operation now in progress)
select(19, [], [18], [], {0, 0})= 0 (Timeout)
#snip
select(19, [], [18], [], {0, 0})= 1 (out [18], left {0, 0})
connect(18, {sin_family=AF_INET, sin_port=htons(1080),
sin_addr=inet_addr("9.1.40.50")}, 16) = 0
getsockname(18, {sin_family=AF_INET, sin_port=htons(2186),
sin_addr=inet_addr("9.1.23.6")}, [16]) = 0
#snip
# make the SOCKS request...
send(18, "\4\1\0P\234b#\317dustinl\0", 16, 0) = 16
#snip
read(18, 0x418e8fd4, 8) = -1 EAGAIN (Try again)
#snip
select(19, [18], [], [], {0, 5})= 0 (Timeout)
#snip
select(19, [18], [], [], {0, 5})= 1 (in [18], left {0, 5})
#snip
select(19, [18], [], [], {0, 5})= 1 (in [18], left {0, 5})
#snip
# read the SOCKS response...
read(18, "\0Z\0\0\0\0\0\0", 8) = 8
#snip
setsockopt(18, IPPROTO_TCP1, [1], 4)= 0
#snip
# Make the HTTP request (a page about tree frogs)
send(18, "GET /fish_and_wildlife/frogs/tre"..., 165, 0) = 165
#snip
read(18, 0x418e9140, 2048) = -1 EAGAIN (Try again)
#snip
select(19, [18], [], [], {0, 5})= 1 (in [18], left {0, 5})
#snip
select(19, [18], [], [], {0, 5})= 1 (in [18], left {0, 5})
#snip
# Read the HTTP response (500 bytes total)
read(18, "HTTP/1.1 200 OK\r\nDate: Fri, 23"..., 2048) = 500
brk(0x89eb000) = 0x89eb000
brk(0x89ef000) = 0x89ef000
brk(0x89f3000) = 0x89f3000
brk(0x89f7000) = 0x89f7000
ioctl(18, FIONREAD, [0])= 0
ioctl(18, FIONREAD, [0])= 0
# Exception is thrown here.
# System.out.println the exception
write(1, "Cache: Uh oh: java.io.IOException: Bad file descriptor") = 54
-- Dustin Lang, [EMAIL PROTECTED]--
(java developer, linux guy, freak with rainbow hair)
User, n.: a particularly slow and unreliable input/
output device that is attached by default to the
standard input and output streams.
(stolen from a Gamelan article, author unknown)
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: netscape 4.61, Java, Redhat 6.0
Nelson Minar wrote: > > So basically, Netscape 4.61 is whacked for Java. On Redhat 6.0, Redhat > 5.2, and Debian potato. Yay! > > What's frustrating is this stuff used to work. I was using Netscape > 4.5 for the longest time with Java with no problems. So maybe it's a > recent Netscape bug, rather than a Linux version problem. > > Is anyone running a Netscape that does work well for Java on Redhat 6.0? Yeah... 4.6 from Red Hat's updates directory (your applet runs fine). Are these problems only appearing under 4.61? Nathan -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Revisited: Sending mail from an application (Pre-v2 JDK, Redhat 6.0)
Hey guys, Thanks for all of your help! I can now send e-mail from Java apps... almost. =) I download, installed, and used the JavaMail extensions, but am now having another problem. The machine that this app is running on does not have sendmail on it and by default it is trying to connect to the localhost to send the e-mail. What is the property I need to set in the Properties object to point this too another server? I have tried setting 'mailhost' and 'host', both which I have found in other samples, but they don't seem to work. Any idea's? Thanks, Abe Abe L. Getchell - Systems Engineer System Support Services Kentucky Department of Education Voice 502-564-2020x225 E-mail [EMAIL PROTECTED] Web http://www.kde.state.ky.us/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Java IDE for Linux?
> My preference is XEmacs (http://www.xemacs.org/) with JDE > (http://sunsite.auc.dk/jde/) and the JDK. > I apologize that this is off-topic, but I just showed this combination to my boss and he asked if there was a similar (X)Emacs dev environment for Perl. Anyone know if there is and if so where I can find it? Thanks, -Tim -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re:Revisited: Sending mail from an application (Pre-v2 JDK, Redhat 6 .0)
Hi (not answing your next question yet), I don't think that you need to use JavaMail for just sending mail. It over kills. I have written a program for sending mail from any apps/servlets (like formmail) with source. Send me off-list if you want it so I can send to you. Steve Nguyen C.E.O. KBMail Software & Service Provider http://www.kbmail.com "Plan - Do - Review --> Success" Original message From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Revisited: Sending mail from an application (Pre-v2 JDK, Redhat 6 .0) Date: Fri, 23 Jul 1999 16:09:42 -0400 -- Hey guys, Thanks for all of your help! I can now send e-mail from Java apps... almost. =) I download, installed, and used the JavaMail extensions, but am now having another problem. The machine that this app is running on does not have sendmail on it and by default it is trying to connect to the localhost to send the e-mail. What is the property I need to set in the Properties object to point this too another server? I have tried setting 'mailhost' and 'host', both which I have found in other samples, but they don't seem to work. Any idea's? Thanks, Abe Abe L. Getchell - Systems Engineer System Support Services Kentucky Department of Education Voice 502-564-2020x225 E-mail [EMAIL PROTECTED] Web http://www.kde.state.ky.us/ -- 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]
Invalid DatagramSocket option
Hi, I have an applet that performs a multicast function on a Linux machine. The browser used is Netscape communicator 4.51. The applet is a signed applet and has passed the "Multicast" privilege checking when the applet is executed. Right after the privilege checking, the applet attempts to instantiate a MulticastSocket with the following code: DatagramSocket socket = new MulticastSocket(); At this point, a SocketException occurrs. The Stack traces are: invalid DatagramSocket option at java.net.PlainDatagramSocketImpl.setOption (PlainDatagramSocketImpl.java:156) at java.net.MulticastCreate (MulticastSocket.java:111) at java.net.DatagramSocket. (DatagramSocket.java:115) at java.net.DatagramSocket. (DatagramSocket.java:101) at java.net.MulticastSocket. (MulticastSocket.java:92) at inria.net.MulticastSession.run (MulticastSession.java:205) -- applet code at java.lang.Thread.run (Thread.java:504) Note: The same applet running with Netscape communicator 4.51 under Windows is OK. Can someone tell me what's the cause of this problem? Thanks. Larry Hsiao Foresyte Technologies, Inc. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: netscape 4.61, Java, Redhat 6.0
At 11:58 AM -0400 07/23/99, Nelson Minar wrote: >Could it really just be me? I'm running pretty basic Netscape, about >the only change I made was running Fortify over the browser. Trivial >applets like > >http://nelson.www.media.mit.edu/people/nelson/research/mas964/ps2/CircleRepetition.html >are killing it. Try it yourself - run the applet, click and hold in >the window and drag around awhile. (Enjoy the pretty circles). For me, >after about 15 seconds of this, Netscape locks up solid. No problem here. Netscape communicator 4.61 from Redhat rpm on RedHat 6.0 with updates from (updates|rawhide).redhat.com Netscape do locks up from time to time. Your applet just fail to do it this time ;-) Cheers, Paul -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: netscape 4.61, Java, Redhat 6.0
> Nelson Minar writes: > > >I've not had that many problems with Netscape and Java. > > > > Could it really just be me? > > No. I finally had to disable Netscape 4.61 Java. I'd say 75% of all > applets cause either the 100%-CPU-utilization problem or the > instant-Netscape-crash problem. Have you tried libc5 version ?? Its crashing too, but looks more stable with java. -- 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: Jrun on linux and apachie?
Brent Allsop wrote: > > Folks, > > I'm attempting to get java server pages and java servlets > running on a remote Linux box (Redhat 6.0) with apache. I only have > access to this linux box via telnet, no X or any graphics. > > What's the best JVM to use for something like this? It looks > as if they all require a windowing system to run. > > Has anyone else done anything like this? Yes, no problem. I use Live Software's JRunPro with the Blackdown JVM (JDK1.2prev2) and Apache on a headless server sitting in a hosting company's shelf some several hundred miles away. Just use it... JRunPro has a command-line installer as well as a Swing-based one, and besides there's alternatives like JServ/GNUJSP and iASP. The JVM only wants X if you're trying to run GUI applications. There's no problem with running command-line applications and servlets. (In any case, there is also the fact that X means you can run any GUI applications over the network onto your local workstation. I've had to do this a couple of times with the abovementioned server, and it's slow with that much latency, but it works.) -- Rachel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: netscape 4.61, Java, Redhat 6.0
Paul Ho writes: > No problem here. Netscape communicator 4.61 from Redhat rpm on > RedHat 6.0 with updates from (updates|rawhide).redhat.com Interesting. So 4.61 seems not to be the (only) culprit. However, 4.5, 4.6, and 4.61 all had nasty Java problems for me, under both RedHat 5.2 with updates and RedHat 6.0 with (some) updates. 4.61 is definitely worse than 4.5, and 4.6 was definitely worse than 4.5, but I don't recall whether 4.6 was worse than 4.61. Best, daniel dulitz Valley Technologies, Inc. Peak Performance Real-Time DSP State College, PA -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Revisited: Sending mail from an application (Pre-v2 JDK, Redhat 6 .0)
Steve Nguyen wrote: > Hi (not answing your next question yet), > > I don't think that you need to use JavaMail for just sending mail. It over kills. I >have written a program for sending mail from any apps/servlets (like formmail) with >source. Send me off-list if you want it so I can send to you. > > Steve Nguyen > C.E.O. > KBMail Software & Service Provider > http://www.kbmail.com > > "Plan - Do - Review --> Success" > > Original message > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: Revisited: Sending mail from an application (Pre-v2 JDK, Redhat 6 > .0) > Date: Fri, 23 Jul 1999 16:09:42 -0400 > -- > > Hey guys, > Thanks for all of your help! I can now send e-mail from Java > apps... almost. =) I download, installed, and used the JavaMail extensions, > but am now having another problem. The machine that this app is running on > does not have sendmail on it and by default it is trying to connect to the > localhost to send the e-mail. What is the property I need to set in the > Properties object to point this too another server? I have tried setting > 'mailhost' and 'host', both which I have found in other samples, but they > don't seem to work. Any idea's? > > Thanks, > Abe > > Abe L. Getchell - Systems Engineer > System Support Services > Kentucky Department of Education > Voice 502-564-2020x225 > E-mail [EMAIL PROTECTED] > Web http://www.kde.state.ky.us/ > > -- > 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] for a simple javascript solution check this out1 its got some crappola in it but look at it or check out perl! with email::valid to check out email address for correctness! Title: EMAIL: message
Re: Invalid DatagramSocket option
Is your kernel multicast aware? cabbey at home dot net <*> http://members.home.net/cabbey I want a binary interface to the brain! Today's opto-mechanical digital interfaces are just too slow! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: netscape 4.61, Java, Redhat 6.0
I'm not having the lockup problem either... althought in general netscape locks up a fair amount.. its fun, I get the realiability of windows ported to the linux platform... Anyhow, that's my two-cents. Paul Ho wrote: > At 11:58 AM -0400 07/23/99, Nelson Minar wrote: > >Could it really just be me? I'm running pretty basic Netscape, about > >the only change I made was running Fortify over the browser. Trivial > >applets like > > >http://nelson.www.media.mit.edu/people/nelson/research/mas964/ps2/CircleRepetition.html > >are killing it. Try it yourself - run the applet, click and hold in > >the window and drag around awhile. (Enjoy the pretty circles). For me, > >after about 15 seconds of this, Netscape locks up solid. > > No problem here. Netscape communicator 4.61 from Redhat rpm on RedHat 6.0 with > updates from (updates|rawhide).redhat.com > > Netscape do locks up from time to time. Your applet just fail to do it this time ;-) > > Cheers, > Paul > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- [ Riyad Kalla ] [ InterAccess Corporation ] [ University of Arizona ] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Keyboard listener doesn't work with appletviewer.
I can't get keyboard input to work with the jdk117_3 appletviewer. MouseListener works but not KeyListener, but it does in netscape. Thanks, Bri _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
