From owner-freebsd-java@FreeBSD.ORG Sun Jun 19 12:45:27 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E4D216A41C for ; Sun, 19 Jun 2005 12:45:27 +0000 (GMT) (envelope-from mj-mailinglist@gmx.de) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 7D7E643D1D for ; Sun, 19 Jun 2005 12:45:26 +0000 (GMT) (envelope-from mj-mailinglist@gmx.de) Received: (qmail 11922 invoked by uid 0); 19 Jun 2005 12:45:25 -0000 Received: from 85.74.60.17 by www38.gmx.net with HTTP; Sun, 19 Jun 2005 14:45:25 +0200 (MEST) Date: Sun, 19 Jun 2005 14:45:25 +0200 (MEST) From: "Martin Jakob" To: freebsd-java@freebsd.org MIME-Version: 1.0 X-Priority: 3 (Normal) X-Authenticated: #1630361 Message-ID: <3659.1119185125@www38.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: RFC: New port for using Tomcat with jakarta-commons-daemon (jscv) X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2005 12:45:27 -0000 Hi, I hope this is the correct list to post this message, because it has tomcat as its main topic, but well, its also about creating/improving a port, so... Since i had to start tomcat with different jdks and/or startup-parameters, i sat down and tried to use the jscv from http://jakarta.apache.org/commons/daemon/jsvc.html I found the port from Herve Quiroz, extended it a bit and added a rcNG tomcat.sh controll-script. The port works quite well on my test system, so maybe its usefull for other people as well. I tested it with jdk1.4.2, jdk1.5.0, jakarta-tomcat-5.0 and the new jakarta-tomcat-5.5.9 port. Just changing the variables in rc.conf and restart the daemon switches the used jdk (and other parameters). I am sure there are more glitches in the port, but here are some points where i need input and ideas from other people: - the name "jakarta-tomcat-daemon" is not an official name, i used it for the tests. Any better ideas? - the patch "patch-jsvc-unix.c" its more or less a hack to show the complete path of the process in ps. I added this, so that i could use the builtin rcNG functions for stop/restart/status. Maybe someone with better knowledge of C can comment on this hack? - dependencies at the moment there are no tomcat dependencies regarded in the Makefile. - shutdown time it really takes some time after /usr/local/etc/rc.d/tomcat.sh (stop|restart) is executed to stop/restart the process. Again, any ideas what could cause this? Credits: Based on the ports/scripts from Herve Quiroz and clement (apache2) So, now have fun with this port :) --Martin --- BEGIN SHAR FILE # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # . # ./files # ./files/patch-configure # ./files/tomcat.sh # ./files/patch-jsvc-unix.c # ./Makefile # ./distinfo # ./pkg-descr # ./pkg-message # echo c - . mkdir -p . > /dev/null 2>&1 echo c - ./files mkdir -p ./files > /dev/null 2>&1 echo x - ./files/patch-configure sed 's/^X//' >./files/patch-configure << 'END-of-./files/patch-configure' X$FreeBSD$ X XPatch to have configure script recognize FreeBSD 5.x and 6.x X X--- src/native/unix/configure.orig Wed Dec 22 18:53:10 2004 X+++ src/native/unix/configure Wed Dec 22 18:53:30 2004 X@@ -2583,7 +2583,7 @@ X CFLAGS="$CFLAGS -DOS_SYSV -DDSO_DLFCN -Kthread" X LDFLAGS="-Kthread $LDFLAGS -ldl" X ;; X- freebsd4.?) X+ freebsd[456].?) X CFLAGS="$CFLAGS -DOS_FREEBSD -DDSO_DLFCN -D_THREAD_SAFE -pthread" X LDFLAGS="-pthread $LDFLAGS" X supported_os="freebsd" END-of-./files/patch-configure echo x - ./files/tomcat.sh sed 's/^X//' >./files/tomcat.sh << 'END-of-./files/tomcat.sh' X#!/bin/sh X# X# $FreeBSD$ X# X X# PROVIDE: tomcat X# REQUIRE: NETWORKING SERVERS X# BEFORE: DAEMON X# KEYWORD: shutdown X X# X# Add the following lines to /etc/rc.conf to enable tomcat: X# tomcat_enable (bool): Set to "NO" by default. X# Set it to "YES" to enable tomcat X### Optional X# tomcat_tcuser (str): User to run tomcat as, Default to "www" X# the used jsvc program has its own method X# to change the user, so use the variable name X# "tcuser" instead of the rcNG-"user" variable X# tomcat_javahome (str): Set to "/usr/local/jdk1.4.2" by default. X# tomcat_jvmtype (str): What JavaVM Type to use, server or client X# Default to "server" X# tomcat_catalinahome (string): Home directory of the Tomcat installation X# defaults to "/usr/local/jakarta-tomcat5.0" X# X# tomcat_catalinaopts (str): Setting system properties X# eg. "-Djava.awt.headless=true" etc. X# X# tomcat_javaopts (str): Setting non-standard options regarding X# the JVM. X# eg. "-Xms128m -Xmx128m", "-Xdebug" etc. X# X X. /etc/rc.subr X Xname="tomcat" Xrcvar=`set_rcvar` X Xtomcat_tcpidfile="/var/run/tomcat.pid" X X[ -z "$tomcat_enable" ] && tomcat_enable="NO" X[ -z "$tomcat_tcuser" ] && tomcat_tcuser="www" X[ -z "$tomcat_javahome" ] && tomcat_javahome="/usr/local/jdk1.4.2" X[ -z "$tomcat_jvmtype" ] && tomcat_jvmtype="server" X[ -z "$tomcat_catalinahome" ] && tomcat_catalinahome="/usr/local/jakarta-tomcat5.0" X Xload_rc_config $name X X# export these explizit Xexport LD_LIBRARY_PATH="$tomcat_javahome/jre/lib/i386/$tomcat_jvmtype:$tomcat_javahome/jre/lib/i386" X Xcommand="/usr/local/sbin/tomcat" Xarguments="-jvm $tomcat_jvmtype \ X -errfile /dev/null \ X -outfile $tomcat_catalinahome/logs/catalina.out \ X -pidfile $tomcat_tcpidfile \ X -user $tomcat_tcuser \ X -home $tomcat_javahome \ X -Dcatalina.home=$tomcat_catalinahome \ X -Djava.io.tmpdir=$tomcat_catalinahome/temp \ X -cp $tomcat_javahome/lib/tools.jar:$tomcat_catalinahome/bin/commons-daemon.jar:$tomcat_catalinahome/bin/bootstrap.jar" X Xbootclassfile="org.apache.catalina.startup.Bootstrap" X Xif [ -n "$tomcat_catalinaopts" ]; then X arguments="$arguments $tomcat_catalinaopts" Xfi X Xif [ -n "$tomcat_javaopts" ]; then X arguments="$arguments $tomcat_javaopts" Xfi X Xcommand_args="$arguments $bootclassfile" X Xrun_rc_command "$1" END-of-./files/tomcat.sh echo x - ./files/patch-jsvc-unix.c sed 's/^X//' >./files/patch-jsvc-unix.c << 'END-of-./files/patch-jsvc-unix.c' X--- src/native/unix/native/jsvc-unix.c.orig Sat Jun 18 15:27:16 2005 X+++ src/native/unix/native/jsvc-unix.c Sat Jun 18 15:27:55 2005 X@@ -601,6 +601,13 @@ X uid_t uid=0; X gid_t gid=0; X X+#ifdef OS_FREEBSD X+ /* to use the rcNG infrastructure properly (stopping the process), X+ it is necessary, to get atleast the processname/path X+ via the ps command. So set this via setproctitle() */ X+ setproctitle("%s", argv[0]); X+#endif /* ifdef OS_FREEBSD */ X+ X /* Parse command line arguments */ X args=arguments(argc,argv); X if (args==NULL) return(1); END-of-./files/patch-jsvc-unix.c echo x - ./Makefile sed 's/^X//' >./Makefile << 'END-of-./Makefile' X# New ports collection makefile for: Jakarta Tomcat Daemon X# Date created: May 18, 2005 X# Whom: mj@freebsd.local X# X# $FreeBSD$ X# X XPORTNAME= tomcat-daemon XPORTVERSION= 1.0.1 XCATEGORIES= sysutils java XMASTER_SITES= ${MASTER_SITE_APACHE_JAKARTA} XMASTER_SITE_SUBDIR= commons/daemon/source XPKGNAMEPREFIX= jakarta- XDISTNAME= daemon-${PORTVERSION} X XMAINTAINER= ports@FreeBSD.org XCOMMENT= Start Jakarta Tomcat as a Unix Daemon X XGNU_CONFIGURE= yes XUSE_GMAKE= yes XNATIVE_WRKSRC= ${WRKSRC}/src/native/unix XCONFIGURE_WRKSRC= ${NATIVE_WRKSRC} X XUSE_JAVA= yes XJAVA_VERSION= 1.3+ X XCONTROL_PROGRAM=jsvc XTOMCAT_SERVICE=tomcat X XPLIST_FILES= sbin/${TOMCAT_SERVICE} \ X etc/rc.d/"${TOMCAT_SERVICE}.sh" X X.include X XCONFIGURE_ARGS+= --with-java="${JAVA_HOME}" X Xdo-build: X cd ${NATIVE_WRKSRC}/native; ${SETENV} ${MAKE_ENV} ${GMAKE} X Xdo-install: X @${ECHO_CMD} "=> Installing ${TOMCAT_SERVICE} in ${PREFIX}/sbin/" X @${INSTALL_PROGRAM} ${NATIVE_WRKSRC}/${CONTROL_PROGRAM} ${PREFIX}/sbin/${TOMCAT_SERVICE} X @${ECHO_CMD} "=> Installing ${PREFIX}/etc/rc.d/${TOMCAT_SERVICE}.sh startup script." X @${INSTALL_SCRIPT} -m 555 ${FILESDIR}/"${TOMCAT_SERVICE}.sh" ${PREFIX}/etc/rc.d/"${TOMCAT_SERVICE}.sh" X Xpost-install: X @${ECHO_CMD} "" X @${CAT} ${PKGMESSAGE} X X.include END-of-./Makefile echo x - ./distinfo sed 's/^X//' >./distinfo << 'END-of-./distinfo' XMD5 (daemon-1.0.1.tar.gz) = df3eb5aafa53ca530843a09d40b8a1c0 XSIZE (daemon-1.0.1.tar.gz) = 301023 END-of-./distinfo echo x - ./pkg-descr sed 's/^X//' >./pkg-descr << 'END-of-./pkg-descr' XRun Tomcat as Unix daemon. X XWWW: http://jakarta.apache.org/commons/daemon/ END-of-./pkg-descr echo x - ./pkg-message sed 's/^X//' >./pkg-message << 'END-of-./pkg-message' XTo run tomcat server from startup, add tomcat_enable="YES" Xin your /etc/rc.conf or /etc/rc.conf.local XExtra options can be found in startup script. END-of-./pkg-message exit From owner-freebsd-java@FreeBSD.ORG Mon Jun 20 11:01:52 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B067D16A42A for ; Mon, 20 Jun 2005 11:01:52 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C70443D4C for ; Mon, 20 Jun 2005 11:01:52 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j5KB1q9o011440 for ; Mon, 20 Jun 2005 11:01:52 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j5KB1pRN011434 for freebsd-java@freebsd.org; Mon, 20 Jun 2005 11:01:51 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 20 Jun 2005 11:01:51 GMT Message-Id: <200506201101.j5KB1pRN011434@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-java@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2005 11:01:52 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2002/05/13] ports/38018 java www/jakarta-tomcat4: make passing of JVM f [2002/05/13] ports/38020 java www/jakarta-tomcat4: stop tomcat via java o [2004/05/01] java/66151 java JBuilderX (sun jvm 1.4.1 builtin) crashes f [2004/07/13] java/68972 java unpack crashes during make install of lin o [2004/09/22] ports/72014 java Eclipse doesn't work (SigBus 10) if it ha o [2004/12/06] ports/74760 java java/javavmwrapper messes up amavisd-new f [2004/12/21] ports/75348 java Tomcat port overwrites server.xml config o [2005/01/24] java/76631 java any port linux-*-jdk12 will core dump if o [2005/03/04] ports/78396 java Java 1.4 fails to compile under FreeBSD 4 o [2005/05/17] java/81176 java Java Webstart does not work o [2005/06/13] java/82183 java Cannot install Java 1.5, lots of missing 11 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- f [2003/09/16] ports/56928 java jce-aba port should install to $JAVA_HOME f [2003/11/21] ports/59571 java improvements of www/jakarta-tomcat4[1] Ma o [2004/08/11] java/70292 java jdk14 compile problem f [2004/11/24] ports/74344 java [proposal] tomcat41ctl: support for passi o [2004/12/16] ports/75143 java There is no way to specify jvm parameters 5 problems total. From owner-freebsd-java@FreeBSD.ORG Tue Jun 21 16:49:40 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D11116A41C for ; Tue, 21 Jun 2005 16:49:40 +0000 (GMT) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (glewis.dsl.xmission.com [166.70.56.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81B1C43D58 for ; Tue, 21 Jun 2005 16:49:38 +0000 (GMT) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) by misty.eyesbeyond.com (8.13.3/8.13.3) with ESMTP id j5LGnaD9092813; Tue, 21 Jun 2005 10:49:36 -0600 (MDT) (envelope-from glewis@eyesbeyond.com) Received: (from glewis@localhost) by misty.eyesbeyond.com (8.13.3/8.13.3/Submit) id j5LGnZTn092812; Tue, 21 Jun 2005 10:49:35 -0600 (MDT) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Tue, 21 Jun 2005 10:49:35 -0600 From: Greg Lewis To: Oliver Fross Message-ID: <20050621164935.GA92763@misty.eyesbeyond.com> References: <20050618233845.GA62998@oof.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050618233845.GA62998@oof.org> User-Agent: Mutt/1.4.2.1i Cc: freebsd-java@freebsd.org Subject: Re: JDK 1.5 from ports w/ threading problem solved X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 16:49:40 -0000 Hi Oliver, On Sat, Jun 18, 2005 at 04:38:45PM -0700, Oliver Fross wrote: > On FreeBSD 5.4 i386, I've had problems with multiple threaded > applications under JDK 1.5.0, and have solved them using a patch and the > ports version of jdk15. This was discussed in May, 2005 on this mailing > list [1] and I am just confirming & documenting. > > For anyone wishing to repeat this success, the steps are quite > simple: > > * Get the jdk15 port, PORTREVISION=2 from cvsup or just from [2] > * I used jdk-1_5_0-src-scsl.zip & jdk-1_5_0-bin-scsl.zip from Sun [3] > * Get the eyesbeyond patch: I used Patchset 1 from Greg Lewis [4] > * Patch sources according to Arne Juul [1] [5] > * make install! > > Thanks to Greg Lewis as always, and Arne Juul this time! > > Have others had similar success? Should this get added to the port > by a committer? Or maybe Greg has this planned for patchset 2? It will be in patchset 2, but it should be added to the port prior to that. Thanks for reminding me! -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org From owner-freebsd-java@FreeBSD.ORG Tue Jun 21 18:33:13 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D80F716A41C for ; Tue, 21 Jun 2005 18:33:13 +0000 (GMT) (envelope-from landonf@threerings.net) Received: from mail.earth.threerings.net (mail.earth.threerings.net [64.81.51.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id A589743D58 for ; Tue, 21 Jun 2005 18:33:13 +0000 (GMT) (envelope-from landonf@threerings.net) Received: from [192.168.50.11] (timor.sea.earth.threerings.net [192.168.50.11]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mail.earth.threerings.net (Postfix) with ESMTP id 931686121 for ; Tue, 21 Jun 2005 11:34:03 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v622) To: freebsd-java@freebsd.org Message-Id: Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-4--662330866" From: Landon Fuller Date: Tue, 21 Jun 2005 11:33:09 -0700 Content-Transfer-Encoding: 7bit X-Pgp-Agent: GPGMail 1.0.2 X-Mailer: Apple Mail (2.622) Subject: [PATCH] jdk1.4.2, getsockname(), and ECONNRESET X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 18:33:14 -0000 --Apple-Mail-4--662330866 Content-Type: multipart/mixed; boundary=Apple-Mail-3--662330884 --Apple-Mail-3--662330884 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed In j2se/src/solaris/native/sun/nio/ch/Net.c, getsockname() is called to=20= determine the local address and port of a socket. Under both Linux and Solaris, getsockname() will only fail if invalid=20 arguments are provided. If getsockname() returns an error, Java throws=20= a java.lang.Error. On FreeBSD, getsockname() will also return an error with errno set to=20 ECONNRESET if the connection has been reset by the peer. Consequently,=20= Java throws a java.lang.Error. The only way to handle this without an API change is to check for=20 ECONNRESET; In the attached patch, if errno is set to=A0ECONNRESET we=20 fill in the sockaddr structure with a port of 0, an IP of INADDR_ANY,=20 and clear out the error. Also, any comments on the thread-safe resolver patch? Thanks, -landonf --Apple-Mail-3--662330884 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="getsockname-1.diff" Content-Disposition: attachment; filename=getsockname-1.diff Only in getsockname: cscope.out diff -ru bsdjdk/j2se/src/solaris/native/sun/nio/ch/Net.c getsockname/j2se/src/solaris/native/sun/nio/ch/Net.c --- bsdjdk/j2se/src/solaris/native/sun/nio/ch/Net.c Fri May 13 18:04:33 2005 +++ getsockname/j2se/src/solaris/native/sun/nio/ch/Net.c Sun May 29 01:32:32 2005 @@ -118,8 +118,30 @@ SOCKADDR sa; int sa_len = SOCKADDR_LEN; if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) { +#ifdef _BSD_SOURCE + /* + * XXXBSD: + * ECONNRESET is specific to the BSDs. We can not return an error, + * as the calling Java code with raise a java.lang.Error given the expectation + * that getsockname() will never fail. According to the Single UNIX Specification, + * it shouldn't fail. As such, we just fill in generic values. + */ + if (errno == ECONNRESET) { + struct sockaddr_in *sin; + sin = (struct sockaddr_in *) &sa; + bzero(sin, sizeof(*sin)); + sin->sin_len = sizeof(struct sockaddr_in); + sin->sin_family = AF_INET; + sin->sin_port = htonl(0); + sin->sin_addr.s_addr = INADDR_ANY; + } else { + handleSocketError(env, errno); + return -1; + } +#else /* _BSD_SOURCE */ handleSocketError(env, errno); return -1; +#endif /* _BSD_SOURCE */ } return NET_GetPortFromSockaddr((struct sockaddr *)&sa); } @@ -131,8 +153,30 @@ int sa_len = SOCKADDR_LEN; int port; if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) { +#ifdef _BSD_SOURCE + /* + * XXXBSD: + * ECONNRESET is specific to the BSDs. We can not return an error, + * as the calling Java code with raise a java.lang.Error with the expectation + * that getsockname() will never fail. According to the Single UNIX Specification, + * it shouldn't fail. As such, we just fill in generic values. + */ + if (errno == ECONNRESET) { + struct sockaddr_in *sin; + sin = (struct sockaddr_in *) &sa; + bzero(sin, sizeof(*sin)); + sin->sin_len = sizeof(struct sockaddr_in); + sin->sin_family = AF_INET; + sin->sin_port = htonl(0); + sin->sin_addr.s_addr = INADDR_ANY; + } else { + handleSocketError(env, errno); + return NULL; + } +#else /* _BSD_SOURCE */ handleSocketError(env, errno); return NULL; +#endif /* _BSD_SOURCE */ } return NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port); } --Apple-Mail-3--662330884-- --Apple-Mail-4--662330866 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Darwin) iD8DBQFCuF1nlplZCE/15mMRAlrDAJ9rqNEWNaX6iAmWW4AQEZUVz4lX1gCfVig7 +Kz1+xJm32a/fQVBsibMm2Y= =tLoZ -----END PGP SIGNATURE----- --Apple-Mail-4--662330866-- From owner-freebsd-java@FreeBSD.ORG Tue Jun 21 21:01:28 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D31C916A41C for ; Tue, 21 Jun 2005 21:01:28 +0000 (GMT) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (glewis.dsl.xmission.com [166.70.56.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A0B643D49 for ; Tue, 21 Jun 2005 21:01:28 +0000 (GMT) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) by misty.eyesbeyond.com (8.13.3/8.13.3) with ESMTP id j5LL1QWB096349; Tue, 21 Jun 2005 15:01:26 -0600 (MDT) (envelope-from glewis@eyesbeyond.com) Received: (from glewis@localhost) by misty.eyesbeyond.com (8.13.3/8.13.3/Submit) id j5LL1PE0096348; Tue, 21 Jun 2005 15:01:25 -0600 (MDT) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Tue, 21 Jun 2005 15:01:25 -0600 From: Greg Lewis To: Landon Fuller Message-ID: <20050621210125.GA96069@misty.eyesbeyond.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: freebsd-java@freebsd.org Subject: Re: [PATCH] jdk1.4.2, getsockname(), and ECONNRESET X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 21:01:29 -0000 Hi Landon, On Tue, Jun 21, 2005 at 11:33:09AM -0700, Landon Fuller wrote: > In j2se/src/solaris/native/sun/nio/ch/Net.c, getsockname() is called to > determine the local address and port of a socket. > > Under both Linux and Solaris, getsockname() will only fail if invalid > arguments are provided. If getsockname() returns an error, Java throws > a java.lang.Error. > On FreeBSD, getsockname() will also return an error with errno set to > ECONNRESET if the connection has been reset by the peer. Consequently, > Java throws a java.lang.Error. > > The only way to handle this without an API change is to check for > ECONNRESET; In the attached patch, if errno is set to?ECONNRESET we > fill in the sockaddr structure with a port of 0, an IP of INADDR_ANY, > and clear out the error. On Linux and/or Solaris, what happens when you call getsockname() on a socket that has had the connection reset by the peer? In particular, is it compatible with what your patch does or are we introducing a new scenario that the socket code for applications must handle? > Also, any comments on the thread-safe resolver patch? My bad, I haven't gotten to testing it yet :(. One concern was that you mention the routines you're using are thread safe under 5.4 and better and I wondered if there was an impact on 4.x users? I will try and get this tested soon, as I want it in the next patchset. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org From owner-freebsd-java@FreeBSD.ORG Wed Jun 22 10:28:06 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB2B816A41C for ; Wed, 22 Jun 2005 10:28:06 +0000 (GMT) (envelope-from herve.quiroz@esil.univ-mrs.fr) Received: from arabica.esil.univ-mrs.fr (arabica.esil.univ-mrs.fr [139.124.41.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55AB243D48 for ; Wed, 22 Jun 2005 10:28:05 +0000 (GMT) (envelope-from herve.quiroz@esil.univ-mrs.fr) Received: from arabica.esil.univ-mrs.fr (localhost [127.0.0.1]) by arabica.esil.univ-mrs.fr (8.13.3/8.13.3) with ESMTP id j5MAS4Ua083301; Wed, 22 Jun 2005 12:28:04 +0200 (CEST) (envelope-from herve.quiroz@esil.univ-mrs.fr) Received: (from rv@localhost) by arabica.esil.univ-mrs.fr (8.13.3/8.13.3/Submit) id j5MAS3Y7083300; Wed, 22 Jun 2005 12:28:03 +0200 (CEST) (envelope-from herve.quiroz@esil.univ-mrs.fr) X-Authentication-Warning: arabica.esil.univ-mrs.fr: rv set sender to herve.quiroz@esil.univ-mrs.fr using -f Date: Wed, 22 Jun 2005 12:28:03 +0200 From: Herve Quiroz To: Martin Jakob Message-ID: <20050622102803.GA18218@arabica.esil.univ-mrs.fr> Mail-Followup-To: Martin Jakob , freebsd-java@freebsd.org References: <3659.1119185125@www38.gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3659.1119185125@www38.gmx.net> User-Agent: Mutt/1.4.2.1i Cc: freebsd-java@freebsd.org Subject: Re: RFC: New port for using Tomcat with jakarta-commons-daemon (jscv) X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 10:28:06 -0000 Hi Martin, [ I'm just recovering for some big mail issue so I hope I didn't miss any follow-up to your message ] Thanks for your contribution. I have yet to test your patch, but from what I've seen so far (the shar arhcive), I think it would be better to have two separate ports: jakarta-commons-daemon (the general library) upon which would depend jakarta-tomcat-daemon (or whichever the name would be). Anyway, your current port provides a good base to work on. There are several other approaches to the "Tomcat launcher and run-time argument passing" that have been suggested or implemented so far. I am not a true user of Tomcat myself, so I can't really comment on their respective ease of use, and viability. So I would be glad if all people concerned by such issue could report on the various approaches so far. IMHO, the point is that we need a separate port to implement this Tomcat launcher so that we don't replicate the work in each Tomcat port. Moreover, having such a separation (tomcat / tomcat-launcher) would allow for several kinds of launcher to be part of the ports tree, in case we would not agree on a particular one. I will test your patch and comment on it ASAP. Herve FYI, PRs related to this issue: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/38018 http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/38020 http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/59571 http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/74344 http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/75143 Please report if any is missing from the list... On Sun, Jun 19, 2005 at 02:45:25PM +0200, Martin Jakob wrote: > Hi, > > I hope this is the correct list to post this message, because it has tomcat > as > its main topic, but well, its also about creating/improving a port, so... > > Since i had to start tomcat with different jdks and/or startup-parameters, > i sat down and tried to use the jscv from > http://jakarta.apache.org/commons/daemon/jsvc.html > I found the port from Herve Quiroz, extended it a bit and added a rcNG > tomcat.sh controll-script. > > The port works quite well on my test system, so maybe its usefull for other > people as well. I tested it with jdk1.4.2, jdk1.5.0, jakarta-tomcat-5.0 and > the new jakarta-tomcat-5.5.9 port. Just changing the variables in rc.conf > and > restart the daemon switches the used jdk (and other parameters). > > I am sure there are more glitches in the port, but here are some points > where i need input and ideas from other people: > > - the name > "jakarta-tomcat-daemon" is not an official name, i used it for the tests. > Any better ideas? > > - the patch "patch-jsvc-unix.c" > its more or less a hack to show the complete path of the process in ps. I > added > this, so that i could use the builtin rcNG functions for > stop/restart/status. > Maybe someone with better knowledge of C can comment on this hack? > > - dependencies > at the moment there are no tomcat dependencies regarded in the Makefile. > > - shutdown time > it really takes some time after /usr/local/etc/rc.d/tomcat.sh (stop|restart) > is > executed to stop/restart the process. Again, any ideas what could cause > this? > > Credits: > Based on the ports/scripts from Herve Quiroz and clement (apache2) > > So, now have fun with this port :) > > --Martin From owner-freebsd-java@FreeBSD.ORG Wed Jun 22 19:35:30 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55D4016A41C for ; Wed, 22 Jun 2005 19:35:30 +0000 (GMT) (envelope-from xtremejames183@msn.com) Received: from hotmail.com (bay11-f32.bay11.hotmail.com [64.4.39.32]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4423E43D1F for ; Wed, 22 Jun 2005 19:35:30 +0000 (GMT) (envelope-from xtremejames183@msn.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 22 Jun 2005 12:35:30 -0700 Message-ID: Received: from 196.203.249.222 by by11fd.bay11.hotmail.msn.com with HTTP; Wed, 22 Jun 2005 19:35:29 GMT X-Originating-IP: [196.203.249.222] X-Originating-Email: [xtremejames183@msn.com] X-Sender: xtremejames183@msn.com From: "Mrad James Deane" To: freebsd-java@freebsd.org Date: Wed, 22 Jun 2005 21:35:29 +0200 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed X-OriginalArrivalTime: 22 Jun 2005 19:35:30.0113 (UTC) FILETIME=[8C68AB10:01C57761] Subject: cannot install jdk : linuxprocfs probelm X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 19:35:30 -0000 hi , i'm installing jdk14(native) for my freebsd 5.4 release but after recompiling kernel with comapt_linux and installing lixux base sun linux jdk and all necessary tool i've got this problem : the make problem tell me to mount the linprocfs to strart compiling with the to command : kldload linprocfs and mount -t linprocfs linprocfs compat/linux/proc , i do the command and i have : Operation not permitted : i done this in root user : please help , thanks _________________________________________________________________ MSN Messenger : discutez en direct avec vos amis ! http://www.msn.fr/msger/default.asp From owner-freebsd-java@FreeBSD.ORG Fri Jun 24 12:04:46 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F61416A41C for ; Fri, 24 Jun 2005 12:04:46 +0000 (GMT) (envelope-from achill@matrix.gatewaynet.com) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5C8643D1D for ; Fri, 24 Jun 2005 12:04:44 +0000 (GMT) (envelope-from achill@matrix.gatewaynet.com) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id j5OBpUBS012649 for ; Fri, 24 Jun 2005 14:51:30 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id j5OBpTXw012645 for ; Fri, 24 Jun 2005 14:51:30 +0300 Date: Fri, 24 Jun 2005 14:51:29 +0300 (EEST) From: Achilleus Mantzios To: freebsd-java@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT Subject: Wierd problem in linux 2.4.18-bf2.4, Java Blackdown-1.4.2-rc1 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 12:04:46 -0000 Ok its linux a problem, but i think it would be interesting to you. 1st off, this problem does not occur in FreeBSD 5.4-STABLE, with java 1.4.2p7. (Kudos to FreeBSD java team!!!) The situation is as follows: >From a jsp i call java.lang.Process proc = Runtime.getRuntime().exec("/usr/local/sbin/uucico_command"); proc.waitFor(); /usr/local/sbin/uucico_command has as follows: ------------------------------------------------------------ #!/bin/sh /bin/rm -f /var/lock/LCK..ttyS* /usr/local/var/lib/pgsql/dbmirror/AsyncMirrorWithSpecialTables.pl /usr/local/var/lib/pgsql/dbmirror/OFFICE.conf /usr/local/sbin/gpsavg epochsecs=`date +'%s'` pushd /usr/local/var/XML_TO_OFFICE/ tar cfj As_AND_Ds_$epochsecs.tar.bz2 A*.xml D*.xml \rm -f A*.xml D*.xml popd /usr/bin/bzip2 /usr/local/var/XML_TO_OFFICE/* export PGUSER=postgres export PGPASSWORD="" vessel_name=`/usr/local/pgsql/bin/psql -A -q -t -h localhost dynacom -c "select replace(lower(name),' ','_') from vessels limit 1"` VESSEL_NAME=`/usr/local/pgsql/bin/psql -A -q -t -h localhost dynacom -c "select replace(name,' ','_') from vessels limit 1"` uucp -r /usr/local/var/XML_TO_OFFICE/*.bz2 uucphub\!/usr/local/var/XML_FROM_VESSELS/$VESSEL_NAME/. /bin/rm -fr /usr/local/var/XML_TO_OFFICE/* /bin/rm -fr /var/spool/uucppublic/outbound > /dev/null 2>&1 /bin/rm -fr /var/spool/uucppublic/inbound > /dev/null 2>&1 outbound=`/usr/bin/wc -c /var/spool/uucp/uucphub/D./* 2>/dev/null | tail -1 | awk '{print $1}'` outbound=${outbound:=0} echo $outbound > /var/spool/uucppublic/outbound 2>/dev/null uucp -r -g 0 /var/spool/uucppublic/outbound uucphub\!/var/spool/uucppublic/$vessel_name.inbound \rm -fr /var/spool/uucp/.Status/uucphub uucp_acct_id=`/usr/local/sbin/dyna_psql $outbound 2>/dev/null` /usr/local/sbin/dyna_log_uucp_acct_update $uucp_acct_id uucico -x 4 -f -s uucphub uucpsc=`/bin/cat /var/spool/uucp/.Status/uucphub | /usr/bin/awk '{print $1}'` uucpsc=${uucpsc:=99} #logger -p uucp.info "NOTICE!!! acctid="$uucp_acct_id "uucpsc="$uucpsc /usr/local/j2sdk1.4.2/bin/java -cp "/usr/local/jboss-3.0.3/server/default/SMA_UUCP.jar:/usr/local/pgsql/share/java/postgresql.jar:/usr/local/jboss-3.0.3/client/log4j.jar" com.gatewaynet.uucp.LogUUCPAcct $uucp_acct_id $uucpsc /usr/local/j2sdk1.4.2/bin/java -cp "/usr/local/jboss-3.0.3/server/default/SMA_UUCP.jar:/usr/local/pgsql/share/java/postgresql.jar:/usr/local/jboss-3.0.3/client/log4j.jar:/usr/local/jboss-3.0.3/server/default/lib/activation.jar:/usr/local/jboss-3.0.3/server/default/lib/mail.jar" com.gatewaynet.uucp.SendCollected pushd /usr/local/var/XML_FROM_OFFICE/ for ASDS in As_AND_Ds*.tar.bz2; do tar xfj $ASDS; rm -f $ASDS; done popd /usr/bin/bunzip2 /usr/local/var/XML_FROM_OFFICE/*.bz2 ############################################ ### The command below is the problematic one ############################################ /usr/local/jboss-3.0.3/server/default/readoff /etc/cron.daily/compstatus & ------------------------------------------------------------ now the problematic /usr/local/jboss-3.0.3/server/default/readoff has as follows ------------------------------------------------------------ #!/bin/sh export CLASSPATH="/usr/local/jboss-3.0.3/server/default/SMA_PER.jar:/usr/local/jboss-3.0.3/server/default/xerces.jar:/usr/local/jboss-3.0.3/client/jbossall-client.jar:/usr/local/jboss-3.0.3/client/log4j.jar:/usr/local/pgsql/share/java/postgresql.jar" /usr/local/j2sdk1.4.2/bin/java -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl com.gatewaynet.periodic.ReadXmlFromOffice ------------------------------------------------------------ whereas ReadXmlFromOffice.java has as follows: ------------------------------------------------------------ /* * Created on 19 Ìáñ 2004, 11:55:47 ðì * */ package com.gatewaynet.periodic; import java.io.File; import java.io.FileOutputStream; import java.io.PrintStream; import java.sql.PreparedStatement; import java.util.Arrays; import java.util.Comparator; import org.w3c.dom.Node; /** * @author achill4 * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class ReadXmlFromOffice { private static String XMLFROMDIR = "/usr/local/var/XML_FROM_OFFICE"; private static String XMLTODIR = "/usr/local/var/XML_TO_OFFICE"; private static String FILEDIR = "/usr/local/var/FILES_FROM_OFFICE"; static private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("dynacom.RXML"); /** * */ public ReadXmlFromOffice() { super(); // TODO Auto-generated constructor stub } public static void main(String[] args) { java.sql.Connection con=null; try { javax.naming.InitialContext ic = new javax.naming.InitialContext(); Class.forName("org.postgresql.Driver"); con = java.sql.DriverManager.getConnection("jdbc:postgresql://localhost/dynacom","postgres",""); con.setAutoCommit(false); PreparedStatement vslidst = con.prepareStatement("select id from vessels limit 1"); java.sql.ResultSet vslidrs = vslidst.executeQuery(); if (!vslidrs.next()) throw new Exception("No vessel in database. Contact IT DEPT."); int thisvesselvslid = vslidrs.getInt(1); vslidrs.close(); vslidst.close(); con.commit(); javax.xml.parsers.DocumentBuilderFactory builderFactory =javax.xml.parsers.DocumentBuilderFactory.newInstance(); builderFactory.setValidating(false); javax.xml.parsers.DocumentBuilder builder =builderFactory.newDocumentBuilder(); builder.setErrorHandler(new com.gatewaynet.web.util.xml.MyErrorHandler()); File xmldir = new File(XMLFROMDIR); File[] xmlfiles = xmldir.listFiles(); Arrays.sort(xmlfiles,new DirComparator()); String[] xerrors = new String[xmlfiles.length]; String lastdone=null; int numxerrors=0; int xmli; for (xmli = 0; xmli < xmlfiles.length; xmli++) { File xmlfile = xmlfiles[xmli]; try { String xmlfilename =xmlfile.getName(); if (!xmlfilename.endsWith(".xml") && !xmlfilename.endsWith(".XML")) continue; org.w3c.dom.Document document = builder.parse(xmlfile); org.w3c.dom.Element rootel = document.getDocumentElement(); org.w3c.dom.NamedNodeMap attrs = rootel.getAttributes(); String xidstr=null; String vslidstr=null; org.w3c.dom.Attr attr; attr = (org.w3c.dom.Attr) attrs.getNamedItem("xid"); xidstr = attr.getValue(); attr = (org.w3c.dom.Attr) attrs.getNamedItem("vslid"); vslidstr = attr.getValue(); org.w3c.dom.Node curnd; org.w3c.dom.NodeList nodes = rootel.getChildNodes(); String appname=null; String apptbl_tmp=null; String gao=null; String idstr=null; String SQL=null; String comment=null; String filename=null; String file_base64=null; String unixcommand=null; for (int i = 0; i < nodes.getLength(); i++) { curnd = nodes.item(i); if (curnd.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) { if (((org.w3c.dom.Element) curnd).getTagName().equals("appname")) appname = ((org.w3c.dom.Text) curnd.getFirstChild()).getData(); if (((org.w3c.dom.Element) curnd).getTagName().equals("apptbl_tmp")) apptbl_tmp = ((org.w3c.dom.Text) curnd.getFirstChild()).getData(); if (((org.w3c.dom.Element) curnd).getTagName().equals("id")) idstr = ((org.w3c.dom.Text) curnd.getFirstChild()).getData(); if (((org.w3c.dom.Element) curnd).getTagName().equals("gao")) gao = ((org.w3c.dom.Text) curnd.getFirstChild()).getData(); if (((org.w3c.dom.Element) curnd).getTagName().equals("sql")) { Node sqlnode = curnd.getFirstChild(); if (sqlnode != null) SQL = ((org.w3c.dom.CDATASection) curnd.getFirstChild()).getData(); } if (((org.w3c.dom.Element) curnd).getTagName().equals("comment")) { Node commentnode = curnd.getFirstChild(); if (commentnode != null) comment = ((org.w3c.dom.Text) curnd.getFirstChild()).getData(); } /** * file transfer kai unix commands */ if (((org.w3c.dom.Element) curnd).getTagName().equals("filename")) { Node filenamenode = curnd.getFirstChild(); if (filenamenode != null) filename = ((org.w3c.dom.Text) curnd.getFirstChild()).getData(); } if (((org.w3c.dom.Element) curnd).getTagName().equals("filecontent")) { Node filecontentnode = curnd.getFirstChild(); if (filecontentnode != null) file_base64 = ((org.w3c.dom.CDATASection) curnd.getFirstChild()).getData(); } if (((org.w3c.dom.Element) curnd).getTagName().equals("unixcommand")) { Node unixcommandnode = curnd.getFirstChild(); if (unixcommandnode != null) unixcommand = ((org.w3c.dom.CDATASection) curnd.getFirstChild()).getData(); } } } if (xidstr == null) throw new Exception("xid is null"); int xid = Integer.parseInt(xidstr); if (vslidstr == null) throw new Exception("vslid is null"); int vslid = Integer.parseInt(vslidstr); if (gao == null) throw new Exception("gao is null"); if (vslid != thisvesselvslid && !gao.equals("FLTRAN") && !gao.equals("UNXCOM")) throw new Exception("This Transaction is for Another Vessel. Contact IT DEPT."); logger.info("Processing file "+xmlfilename); if (gao.equals("ACKNOW")) { PreparedStatement st = con.prepareStatement("update xadmin set state='ARC' where xid=?"); st.setInt(1,xid); int rc = st.executeUpdate(); if (rc != 1) throw new Exception("Error updating xadmin to ARC."); st.close(); } else if (gao.equals("CANCEL")) { PreparedStatement st = con.prepareStatement("update xadmin set state='CAN',comment=? where xid=?"); st.setString(1,comment); st.setInt(2,xid); int rc = st.executeUpdate(); if (rc != 1) throw new Exception("Error updating xadmin to ARC."); st.close(); } else if (gao.equals("REPLIC")) { logger.info("IN REPLIC for file "+xmlfilename); // EDW MAS ENDIAFEREI MONO TO SQL. java.sql.Statement st2 = con.createStatement(); logger.info("IN REPLIC after createStatement for file "+xmlfilename); if (SQL != null) st2.execute(SQL); logger.info("IN REPLIC after execute for file "+xmlfilename); st2.close(); } else if (gao.equals("FLTRAN")) { if (filename == null) throw new Exception("File name in file transfer cannot be null. Contact IT DEPT."); if (file_base64 == null) throw new Exception("File content in file transfer cannot be null. Contact IT DEPT."); byte[] filecontent = Base64.decode(file_base64.toCharArray()); File outfile = new File(FILEDIR+"/"+filename); FileOutputStream fout = new FileOutputStream(outfile); fout.write(filecontent); fout.close(); } else if (gao.equals("UNXCOM")) { if (unixcommand == null) throw new Exception("Command in unix command cannot be null. Contact IT DEPT."); // PROSOXH SE size(unixcommands)/1024 > (getconf ARG_MAX) Process proc = Runtime.getRuntime().exec(new String[] {"sh","-c",unixcommand}); FileOutputStream fout = new FileOutputStream(new File(XMLTODIR+"/"+xmlfile.getName().replaceAll(".xml","")+".out")); PrintStream out = new PrintStream(fout); java.io.InputStream procout = proc.getInputStream(); out.println("=============="); out.println("Output (if any)"); out.println("=============="); int c; while ((c=procout.read()) >=0) { out.write(c); //System.out.write(c); //System.out.flush(); } java.io.InputStream procerr = proc.getErrorStream(); out.println("=============="); out.println("Error (if any)"); out.println("==============="); while ((c=procerr.read()) >=0) { out.write(c); //System.out.write(c); //System.out.flush(); } } else throw new Exception("GAO "+gao+" not supported. CONTACT IT DEPT."); con.commit(); boolean isdeled = xmlfile.delete(); if (!isdeled) throw new Exception("Error deleting file. Xaction Aborted."); System.out.println("OK with file "+xmlfile.getName()); lastdone=xmlfile.getName(); } catch (Exception xmle) { System.out.println("Error : "+xmle.getMessage()+": with file "+xmlfile.getName()); logger.error("Error : "+xmle.getMessage()+": with file "+xmlfile.getName()); //xmle.printStackTrace(); con.rollback(); xerrors[numxerrors++]="--------------------------"+"Error with "+xmlfile.getName()+"--------------------------\n"+ xmle.getMessage()+"\n"+"---------------------------------------------------------------------"; xmlfile.delete(); } } // end for if (lastdone != null) { FileOutputStream fout = new FileOutputStream(new File(XMLTODIR+"/lastdone.mon")); PrintStream out = new PrintStream(fout); out.println("Last XML was "+lastdone); } if (numxerrors!=0) { FileOutputStream fout = new FileOutputStream(new File(XMLTODIR+"/xerror.mon")); PrintStream out = new PrintStream(fout); int run; for (run=0;run X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2BEEE16A41C for ; Fri, 24 Jun 2005 14:04:57 +0000 (GMT) (envelope-from achill@matrix.gatewaynet.com) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id A156D43D48 for ; Fri, 24 Jun 2005 14:04:55 +0000 (GMT) (envelope-from achill@matrix.gatewaynet.com) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id j5ODpgBS012844 for ; Fri, 24 Jun 2005 16:51:42 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id j5ODpfkF012840 for ; Fri, 24 Jun 2005 16:51:42 +0300 Date: Fri, 24 Jun 2005 16:51:41 +0300 (EEST) From: Achilleus Mantzios To: freebsd-java@freebsd.org In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT Subject: Re: Wierd problem in linux 2.4.18-bf2.4, Java Blackdown-1.4.2-rc1 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 14:04:57 -0000 O Achilleus Mantzios Ýãñáøå óôéò Jun 24, 2005 : > Ok its linux a problem, but i think it would be interesting to you. > > 1st off, this problem does not occur in FreeBSD 5.4-STABLE, > with java 1.4.2p7. (Kudos to FreeBSD java team!!!) > > The situation is as follows: > > >From a jsp i call > > java.lang.Process proc = > Runtime.getRuntime().exec("/usr/local/sbin/uucico_command"); > proc.waitFor(); > > /usr/local/sbin/uucico_command has as follows: > ------------------------------------------------------------ > #!/bin/sh > /bin/rm -f /var/lock/LCK..ttyS* > /usr/local/var/lib/pgsql/dbmirror/AsyncMirrorWithSpecialTables.pl > /usr/local/var/lib/pgsql/dbmirror/OFFICE.conf > /usr/local/sbin/gpsavg > epochsecs=`date +'%s'` > pushd /usr/local/var/XML_TO_OFFICE/ > tar cfj As_AND_Ds_$epochsecs.tar.bz2 A*.xml D*.xml > \rm -f A*.xml D*.xml > popd > /usr/bin/bzip2 /usr/local/var/XML_TO_OFFICE/* > export PGUSER=postgres > export PGPASSWORD="" > vessel_name=`/usr/local/pgsql/bin/psql -A -q -t -h localhost dynacom -c > "select replace(lower(name),' ','_') from vessels limit 1"` > VESSEL_NAME=`/usr/local/pgsql/bin/psql -A -q -t -h localhost dynacom -c > "select replace(name,' ','_') from vessels limit 1"` > uucp -r /usr/local/var/XML_TO_OFFICE/*.bz2 > uucphub\!/usr/local/var/XML_FROM_VESSELS/$VESSEL_NAME/. > /bin/rm -fr /usr/local/var/XML_TO_OFFICE/* > /bin/rm -fr /var/spool/uucppublic/outbound > /dev/null 2>&1 > /bin/rm -fr /var/spool/uucppublic/inbound > /dev/null 2>&1 > outbound=`/usr/bin/wc -c /var/spool/uucp/uucphub/D./* 2>/dev/null | tail > -1 | awk '{print $1}'` > outbound=${outbound:=0} > echo $outbound > /var/spool/uucppublic/outbound 2>/dev/null > uucp -r -g 0 /var/spool/uucppublic/outbound > uucphub\!/var/spool/uucppublic/$vessel_name.inbound > \rm -fr /var/spool/uucp/.Status/uucphub > uucp_acct_id=`/usr/local/sbin/dyna_psql $outbound 2>/dev/null` > /usr/local/sbin/dyna_log_uucp_acct_update $uucp_acct_id > uucico -x 4 -f -s uucphub > uucpsc=`/bin/cat /var/spool/uucp/.Status/uucphub | /usr/bin/awk '{print > $1}'` > uucpsc=${uucpsc:=99} > #logger -p uucp.info "NOTICE!!! acctid="$uucp_acct_id "uucpsc="$uucpsc > /usr/local/j2sdk1.4.2/bin/java -cp > "/usr/local/jboss-3.0.3/server/default/SMA_UUCP.jar:/usr/local/pgsql/share/java/postgresql.jar:/usr/local/jboss-3.0.3/client/log4j.jar" > com.gatewaynet.uucp.LogUUCPAcct $uucp_acct_id $uucpsc > /usr/local/j2sdk1.4.2/bin/java -cp > "/usr/local/jboss-3.0.3/server/default/SMA_UUCP.jar:/usr/local/pgsql/share/java/postgresql.jar:/usr/local/jboss-3.0.3/client/log4j.jar:/usr/local/jboss-3.0.3/server/default/lib/activation.jar:/usr/local/jboss-3.0.3/server/default/lib/mail.jar" > com.gatewaynet.uucp.SendCollected > pushd /usr/local/var/XML_FROM_OFFICE/ > for ASDS in As_AND_Ds*.tar.bz2; do tar xfj $ASDS; rm -f $ASDS; done > popd > /usr/bin/bunzip2 /usr/local/var/XML_FROM_OFFICE/*.bz2 > ############################################ > ### The command below is the problematic one > ############################################ > /usr/local/jboss-3.0.3/server/default/readoff > /etc/cron.daily/compstatus & > ------------------------------------------------------------ > > now the problematic /usr/local/jboss-3.0.3/server/default/readoff has as > follows > ------------------------------------------------------------ > #!/bin/sh > export > CLASSPATH="/usr/local/jboss-3.0.3/server/default/SMA_PER.jar:/usr/local/jboss-3.0.3/server/default/xerces.jar:/usr/local/jboss-3.0.3/client/jbossall-client.jar:/usr/local/jboss-3.0.3/client/log4j.jar:/usr/local/pgsql/share/java/postgresql.jar" > > /usr/local/j2sdk1.4.2/bin/java > -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl > com.gatewaynet.periodic.ReadXmlFromOffice > ------------------------------------------------------------ > > whereas ReadXmlFromOffice.java has as follows: > ------------------------------------------------------------ > /* > * Created on 19 Ìáñ 2004, 11:55:47 ðì > * > */ > package com.gatewaynet.periodic; > > import java.io.File; > import java.io.FileOutputStream; > import java.io.PrintStream; > import java.sql.PreparedStatement; > import java.util.Arrays; > import java.util.Comparator; > > import org.w3c.dom.Node; > > > /** > * @author achill4 > * > * To change the template for this generated type comment go to > * Window>Preferences>Java>Code Generation>Code and Comments > */ > > public class ReadXmlFromOffice { > > private static String XMLFROMDIR = > "/usr/local/var/XML_FROM_OFFICE"; > private static String XMLTODIR = "/usr/local/var/XML_TO_OFFICE"; > > private static String FILEDIR = > "/usr/local/var/FILES_FROM_OFFICE"; > > static private org.apache.log4j.Logger logger = > org.apache.log4j.Logger.getLogger("dynacom.RXML"); > > /** > * > */ > public ReadXmlFromOffice() { > super(); > // TODO Auto-generated constructor stub > } > > public static void main(String[] args) { > java.sql.Connection con=null; > try { > javax.naming.InitialContext ic = new > javax.naming.InitialContext(); > Class.forName("org.postgresql.Driver"); > con = > java.sql.DriverManager.getConnection("jdbc:postgresql://localhost/dynacom","postgres",""); > con.setAutoCommit(false); > > PreparedStatement vslidst = > con.prepareStatement("select id from vessels limit 1"); > java.sql.ResultSet vslidrs = > vslidst.executeQuery(); > if (!vslidrs.next()) throw new Exception("No > vessel in database. Contact IT DEPT."); > int thisvesselvslid = vslidrs.getInt(1); > vslidrs.close(); > vslidst.close(); > con.commit(); > > javax.xml.parsers.DocumentBuilderFactory > builderFactory =javax.xml.parsers.DocumentBuilderFactory.newInstance(); > builderFactory.setValidating(false); > > javax.xml.parsers.DocumentBuilder builder > =builderFactory.newDocumentBuilder(); > builder.setErrorHandler(new > com.gatewaynet.web.util.xml.MyErrorHandler()); > > File xmldir = new File(XMLFROMDIR); > File[] xmlfiles = xmldir.listFiles(); > Arrays.sort(xmlfiles,new DirComparator()); > String[] xerrors = new String[xmlfiles.length]; > String lastdone=null; > int numxerrors=0; > int xmli; > for (xmli = 0; xmli < xmlfiles.length; xmli++) { > File xmlfile = xmlfiles[xmli]; > try { > String xmlfilename > =xmlfile.getName(); > if (!xmlfilename.endsWith(".xml") > && !xmlfilename.endsWith(".XML")) continue; > org.w3c.dom.Document document = > builder.parse(xmlfile); > org.w3c.dom.Element rootel = > document.getDocumentElement(); > org.w3c.dom.NamedNodeMap attrs = > rootel.getAttributes(); > String xidstr=null; > String vslidstr=null; > org.w3c.dom.Attr attr; > attr = (org.w3c.dom.Attr) > attrs.getNamedItem("xid"); > xidstr = attr.getValue(); > attr = (org.w3c.dom.Attr) > attrs.getNamedItem("vslid"); > vslidstr = attr.getValue(); > > org.w3c.dom.Node curnd; > > org.w3c.dom.NodeList nodes = > rootel.getChildNodes(); > > String appname=null; > String apptbl_tmp=null; > String gao=null; > String idstr=null; > String SQL=null; > String comment=null; > > String filename=null; > String file_base64=null; > > String unixcommand=null; > > for (int i = 0; i < > nodes.getLength(); i++) { > curnd = nodes.item(i); > if (curnd.getNodeType() == > org.w3c.dom.Node.ELEMENT_NODE) { > if > (((org.w3c.dom.Element) curnd).getTagName().equals("appname")) > appname = > ((org.w3c.dom.Text) curnd.getFirstChild()).getData(); > > if > (((org.w3c.dom.Element) curnd).getTagName().equals("apptbl_tmp")) > apptbl_tmp > = ((org.w3c.dom.Text) curnd.getFirstChild()).getData(); > > if > (((org.w3c.dom.Element) curnd).getTagName().equals("id")) > idstr = > ((org.w3c.dom.Text) curnd.getFirstChild()).getData(); > > if > (((org.w3c.dom.Element) curnd).getTagName().equals("gao")) > gao = > ((org.w3c.dom.Text) curnd.getFirstChild()).getData(); > > if > (((org.w3c.dom.Element) curnd).getTagName().equals("sql")) { > Node > sqlnode = curnd.getFirstChild(); > if > (sqlnode != null) SQL = ((org.w3c.dom.CDATASection) > curnd.getFirstChild()).getData(); > } > > if > (((org.w3c.dom.Element) curnd).getTagName().equals("comment")) { > Node > commentnode = curnd.getFirstChild(); > if > (commentnode != null) comment = ((org.w3c.dom.Text) > curnd.getFirstChild()).getData(); > } > /** > * file transfer > kai unix commands > */ > if > (((org.w3c.dom.Element) curnd).getTagName().equals("filename")) { > Node > filenamenode = curnd.getFirstChild(); > if > (filenamenode != null) filename = ((org.w3c.dom.Text) > curnd.getFirstChild()).getData(); > } > > if > (((org.w3c.dom.Element) curnd).getTagName().equals("filecontent")) { > Node > filecontentnode = curnd.getFirstChild(); > if > (filecontentnode != null) file_base64 = ((org.w3c.dom.CDATASection) > curnd.getFirstChild()).getData(); > } > > if > (((org.w3c.dom.Element) curnd).getTagName().equals("unixcommand")) { > Node > unixcommandnode = curnd.getFirstChild(); > if > (unixcommandnode != null) unixcommand = ((org.w3c.dom.CDATASection) > curnd.getFirstChild()).getData(); > } > > > } > } > > if (xidstr == null) throw new > Exception("xid is null"); > int xid = > Integer.parseInt(xidstr); > if (vslidstr == null) throw new > Exception("vslid is null"); > int vslid = > Integer.parseInt(vslidstr); > > if (gao == null) throw new > Exception("gao is null"); > if (vslid != thisvesselvslid && > !gao.equals("FLTRAN") && !gao.equals("UNXCOM")) throw new Exception("This > Transaction is for Another Vessel. Contact IT DEPT."); > > logger.info("Processing file > "+xmlfilename); > > if (gao.equals("ACKNOW")) { > PreparedStatement st = > con.prepareStatement("update xadmin set state='ARC' where xid=?"); > st.setInt(1,xid); > int rc = > st.executeUpdate(); > if (rc != 1) throw new > Exception("Error updating xadmin to ARC."); > st.close(); > } > else if (gao.equals("CANCEL")) { > PreparedStatement st = > con.prepareStatement("update xadmin set state='CAN',comment=? where > xid=?"); > st.setString(1,comment); > st.setInt(2,xid); > int rc = > st.executeUpdate(); > if (rc != 1) throw new > Exception("Error updating xadmin to ARC."); > st.close(); > } > else if (gao.equals("REPLIC")) { > logger.info("IN REPLIC for > file "+xmlfilename); > // EDW MAS ENDIAFEREI MONO > TO SQL. > java.sql.Statement st2 = > con.createStatement(); > logger.info("IN REPLIC > after createStatement for file "+xmlfilename); > if (SQL != null) > st2.execute(SQL); > logger.info("IN REPLIC > after execute for file "+xmlfilename); > st2.close(); > } > else if (gao.equals("FLTRAN")) { > if (filename == null) > throw new Exception("File name in file transfer cannot be null. Contact IT > DEPT."); > if (file_base64 == null) > throw new Exception("File content in file transfer cannot be null. Contact > IT DEPT."); > byte[] filecontent = > Base64.decode(file_base64.toCharArray()); > File outfile = new > File(FILEDIR+"/"+filename); > FileOutputStream fout = > new FileOutputStream(outfile); > fout.write(filecontent); > fout.close(); > } > else if (gao.equals("UNXCOM")) { > if (unixcommand == null) > throw new Exception("Command in unix command cannot be null. Contact IT > DEPT."); > // PROSOXH SE > size(unixcommands)/1024 > (getconf ARG_MAX) > Process proc = > Runtime.getRuntime().exec(new String[] {"sh","-c",unixcommand}); > > FileOutputStream fout = > new FileOutputStream(new > File(XMLTODIR+"/"+xmlfile.getName().replaceAll(".xml","")+".out")); > > PrintStream out = new > PrintStream(fout); > > java.io.InputStream > procout = proc.getInputStream(); > > > out.println("=============="); > out.println("Output (if > any)"); > > out.println("=============="); > > int c; > while ((c=procout.read()) > >=0) { > out.write(c); > > //System.out.write(c); > > //System.out.flush(); > } > > java.io.InputStream > procerr = proc.getErrorStream(); > > > out.println("=============="); > out.println("Error (if > any)"); > > out.println("==============="); > > while ((c=procerr.read()) > >=0) { > out.write(c); > > //System.out.write(c); > > //System.out.flush(); > } > > } > else throw new Exception("GAO > "+gao+" not supported. CONTACT IT DEPT."); > > con.commit(); > boolean isdeled = > xmlfile.delete(); > if (!isdeled) throw new > Exception("Error deleting file. Xaction Aborted."); > System.out.println("OK with file > "+xmlfile.getName()); > > lastdone=xmlfile.getName(); > > } > catch (Exception xmle) { > System.out.println("Error : > "+xmle.getMessage()+": with file "+xmlfile.getName()); > logger.error("Error : > "+xmle.getMessage()+": with file "+xmlfile.getName()); > //xmle.printStackTrace(); > con.rollback(); > > > xerrors[numxerrors++]="--------------------------"+"Error with > "+xmlfile.getName()+"--------------------------\n"+ > > xmle.getMessage()+"\n"+"---------------------------------------------------------------------"; > xmlfile.delete(); > } > } // end for > if (lastdone != null) { > FileOutputStream fout = new > FileOutputStream(new File(XMLTODIR+"/lastdone.mon")); > PrintStream out = new PrintStream(fout); > out.println("Last XML was "+lastdone); > } > if (numxerrors!=0) { > FileOutputStream fout = new > FileOutputStream(new File(XMLTODIR+"/xerror.mon")); > PrintStream out = new PrintStream(fout); > int run; > for (run=0;run out.println(xerrors[run]); > } > > } > } > catch (Exception pce) { > System.out.println("A General XML Error Occured: > "+pce.getMessage()); > logger.error("A General XML Error Occured: > "+pce.getMessage()); > } > finally { > if (con != null) try {con.close();} > catch(Exception fe){} > } > } > > } > > class DirComparator implements Comparator { > public DirComparator () { > } > > public int compare(Object obj, Object obj1) { > File f = (File) obj; > File f1 = (File) obj1; > String str = f.getName(); > String str1 = f1.getName(); > int i,i1; > //System.out.println("str="+str); > //System.out.println("str1="+str1); > if (str.charAt(0) < str1.charAt(0)) return -1; > else if (str.charAt(0) > str1.charAt(0)) return 1; > try { > i = Integer.parseInt(str.substring(1,str.indexOf('.'))); > //System.out.println("i="+i); > } > catch (Exception e) { > return 1; > } > try { > i1 = > Integer.parseInt(str1.substring(1,str1.indexOf('.'))); > //System.out.println("i1="+i1); > } > catch (Exception e) { > return -1; > } > if (i < i1 ) return -1; > else if (i==i1) return 0; > else return 1; > } > > public boolean equals(Object obj) { > return false; > } > } > > ------------------------------------------------------------ > > > Now the really wierd problem. > > When the /usr/local/jboss-3.0.3/server/default/readoff is run from > the shell it has never stalled, behaved strange or failed. > > Also when the /usr/local/sbin/uucico_command is run from the shell > it has never failed, or *caused* > /usr/local/jboss-3.0.3/server/default/readoff to stall. > > BUT, when i run /usr/local/sbin/uucico_command from the JSP, > then i experience a stall of the > /usr/local/jboss-3.0.3/server/default/readoff script, > and only if there are many (where many varies from > run to run, but generally more than lets say 10) xml files > to be processed in /usr/local/var/XML_FROM_OFFICE/. > > The java program in readoff processes *some* XML files, and then stalls > for no apparent reason. > > The solution was to replace > the last 2 lines > > /usr/local/jboss-3.0.3/server/default/readoff > /etc/cron.daily/compstatus & > > with > > echo /usr/local/bin/afteruucico | at now > > where /usr/local/bin/afteruucico is just > > #!/bin/sh > /usr/local/jboss-3.0.3/server/default/readoff > /etc/cron.daily/compstatus > > In other words, > i have a JSP calling a script, which calls another script which > executes a java program. > > The java programm does some processing and then sleeps for > no reason without finishing, without spitting out any Exceptions. > > When i magically "jump out" of the initial java environment (jboss/JSP), > with the *at* command, then the readoff script and its ReadXmlFromOffice > java programm all work fine. > > Any thoughts would be great. > > I checked ulimit,etc, with no apparent clue. > > This problem kinda haunted me last night, and i just > wanna kill it, instead of pretending i found a workaround. > > The only "excuse" i can think of, is that it runs in Linux, > which i am not extremely familiar with. > > If you need more feedback, or if any ambitious volunteer > wants to hunt this down, i am happy to help. > > P.S. > > The jboss dir in FreeBSD, is a morningly tbz from the linux > machine, so no tricks there. > > Problem track, the same happens if instead of /usr/local/jboss-3.0.3/server/default/readoff command ANY command produces fairly enuf large ammount of stdout,stderr. For instance if the bunzip command just before readoff produces large stderr (of the type "bunzip2: Output file foo already exists."), then bunzip2 stalls as well. -- -Achilleus From owner-freebsd-java@FreeBSD.ORG Fri Jun 24 22:02:36 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2006C16A41C; Fri, 24 Jun 2005 22:02:36 +0000 (GMT) (envelope-from cjia@cse.unl.edu) Received: from cse-mail.unl.edu (cse-mail.unl.edu [129.93.165.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6FB643D49; Fri, 24 Jun 2005 22:02:35 +0000 (GMT) (envelope-from cjia@cse.unl.edu) Received: from [129.93.176.247] (pcp064958pcs.unl.edu [129.93.176.247]) (authenticated bits=0) by cse-mail.unl.edu (8.13.1/8.13.1) with ESMTP id j5OM2TCg012928 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Fri, 24 Jun 2005 17:02:30 -0500 (CDT) Message-ID: <42BC8310.9040501@cse.unl.edu> Date: Fri, 24 Jun 2005 17:02:56 -0500 From: Neo Jia User-Agent: Mozilla Thunderbird 1.0.2-6 (X11/20050513) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-java@freebsd.org, freebsd-amd64@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.49 on 129.93.165.11 Cc: Subject: How to build JDK15 on AMD64 with FreeBSD? X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 22:02:36 -0000 All, These days, I tried to build the JDK15 on AMD64 with Fedora Core 3, but failed. And I happened to find out that in these two mailing lists, there were many people who had successfully built it with FreeBSD. I hope I could get some detailed information about the building procedure. Do you also use the source code from SUN SCSL or another version maintained by FreeBSD.org? What is the requirement I should meet to build it on FreeBSD, such as the version of FreeBSD? Do I still need GCC 3.2.2? Sorry about so many questions at the first time. Your instructions will be greatly appreciated! Thanks, Neo -- I would remember that if researchers were not ambitious probably today we haven't the technology we are using! From owner-freebsd-java@FreeBSD.ORG Sat Jun 25 07:33:24 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B8FF16A41C for ; Sat, 25 Jun 2005 07:33:24 +0000 (GMT) (envelope-from soheil.h.y@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5223543D1D for ; Sat, 25 Jun 2005 07:33:24 +0000 (GMT) (envelope-from soheil.h.y@gmail.com) Received: by wproxy.gmail.com with SMTP id i24so45501wra for ; Sat, 25 Jun 2005 00:33:23 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=RVirLCBUSjG6C5v+359mbknFYXMgqz1yRWN7S4hdiE0ZZZU5TYSw8tWAoCdt4Q14/r1/m9LaYBXX3Thu1xh05Ue6M/7wW4oDc9KSdq4t7rE9zlhVp/9bWBP1HC074Pm4e8Y+m1WgBxdSIxfAuX0zOt1q3qCd25JA4O6jNYG0TRU= Received: by 10.54.5.47 with SMTP id 47mr2298993wre; Sat, 25 Jun 2005 00:33:23 -0700 (PDT) Received: by 10.54.86.7 with HTTP; Sat, 25 Jun 2005 00:33:23 -0700 (PDT) Message-ID: <4c90b7720506250033323d18b7@mail.gmail.com> Date: Sat, 25 Jun 2005 12:03:23 +0430 From: Soheil Hassas Yeganeh To: freebsd-java@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: J2EE 1.4 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Soheil Hassas Yeganeh List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2005 07:33:24 -0000 Dear All, How can I install the J2EE 1.4 on my FreeBSD 5.4 ? There is no entry in the port tree. Thanx From owner-freebsd-java@FreeBSD.ORG Sat Jun 25 13:19:21 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85D6216A41C; Sat, 25 Jun 2005 13:19:21 +0000 (GMT) (envelope-from till@f111.hadiko.de) Received: from spamhost.rz.uni-karlsruhe.de (spamhost.rz.uni-karlsruhe.de [129.13.185.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 375F143D1F; Sat, 25 Jun 2005 13:19:21 +0000 (GMT) (envelope-from till@f111.hadiko.de) Received: from f111.hadiko.de (hadif111.hadiko.uni-karlsruhe.de [172.20.42.141]) by spamhost.rz.uni-karlsruhe.de with esmtp (Exim 4.43 #1) id 1DmAZ3-0001yc-04 ; Sat, 25 Jun 2005 15:19:19 +0200 Received: from lap.f111.hadiko.de ([10.0.0.220]) by f111.hadiko.de (8.12.9/8.12.9) with ESMTP id j5PDJFxq065489; Sat, 25 Jun 2005 13:19:16 GMT (envelope-from till@f111.hadiko.de) To: "Neo Jia" , freebsd-java@freebsd.org, freebsd-amd64@freebsd.org References: <42BC8310.9040501@cse.unl.edu> Message-ID: Date: Sat, 25 Jun 2005 15:19:14 +0200 From: "Till Riedel" Organization: Hadiko Content-Type: text/plain; format=flowed; delsp=yes; charset=us-ascii MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <42BC8310.9040501@cse.unl.edu> User-Agent: Opera M2/8.01 (FreeBSD, build 1204) X-Spam-Report: -3.3 ALL_TRUSTED Did not pass through any untrusted hosts 0.0 BAYES_50 BODY: Bayesian spam probability is 40 to 60% [score: 0.4382] -0.0 ALL_CAMPUS Received by smtp.rz from campus X-Spam-Status: no, hits=-3.3 required=5.0 X-Spam-Level: --- X-Scan-Server: spamhost X-Scan-Signature: 4b4e315e07894f13c13f341ff8335f3b Cc: Subject: Re: How to build JDK15 on AMD64 with FreeBSD? X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2005 13:19:21 -0000 On Sat, 25 Jun 2005 00:02:56 +0200, Neo Jia wrote: I > hope I could get some detailed information about the building procedure. > Do you also use the source code from SUN SCSL or another version > maintained by FreeBSD.org? What is the requirement I should meet to > build it on FreeBSD, such as the version of FreeBSD? Do I still need GCC > 3.2.2? I build jdk-1.5.0p1_2 from the ports tree on a 5.4-RELEASE (gcc 3.4.2). At some point compilation failed because of too long command line. To work around I executed the failing command on the shell and restarted make. till From owner-freebsd-java@FreeBSD.ORG Sat Jun 25 21:23:27 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 47A6616A41C; Sat, 25 Jun 2005 21:23:27 +0000 (GMT) (envelope-from cjia@cse.unl.edu) Received: from cse-mail.unl.edu (cse-mail.unl.edu [129.93.165.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F9D243D4C; Sat, 25 Jun 2005 21:23:26 +0000 (GMT) (envelope-from cjia@cse.unl.edu) Received: from [129.93.176.247] (pcp064958pcs.unl.edu [129.93.176.247]) (authenticated bits=0) by cse-mail.unl.edu (8.13.1/8.13.1) with ESMTP id j5PLNJIP010524 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sat, 25 Jun 2005 16:23:20 -0500 (CDT) Message-ID: <42BDCB62.1030602@cse.unl.edu> Date: Sat, 25 Jun 2005 16:23:46 -0500 From: Neo Jia User-Agent: Mozilla Thunderbird 1.0.2-6 (X11/20050513) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Till Riedel References: <42BC8310.9040501@cse.unl.edu> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.49 on 129.93.165.11 Cc: freebsd-amd64@freebsd.org, freebsd-java@freebsd.org Subject: Re: How to build JDK15 on AMD64 with FreeBSD? X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2005 21:23:27 -0000 Till, Thank you for your information. One question about your build, do you make any modification on the SUN JAVA SCSL? I am afraid that you cannot pass the sanity checking with the gcc 3.4.2? And the default GCC used by 5.4-RELEASE is 3.4.2, right? Thanks, Neo Till Riedel wrote: > On Sat, 25 Jun 2005 00:02:56 +0200, Neo Jia wrote: > I > >> hope I could get some detailed information about the building >> procedure. Do you also use the source code from SUN SCSL or another >> version maintained by FreeBSD.org? What is the requirement I should >> meet to build it on FreeBSD, such as the version of FreeBSD? Do I >> still need GCC 3.2.2? > > I build jdk-1.5.0p1_2 from the ports tree on a 5.4-RELEASE (gcc 3.4.2). > At some point compilation failed because of > too long command line. To work around I executed the failing command > on the shell and restarted make. > > till > _______________________________________________ > freebsd-java@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-java > To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org" -- I would remember that if researchers were not ambitious probably today we haven't the technology we are using!