ports/75032: JBoss4 update.

Jonathan Chen jonc at chen.org.nz
Mon Dec 13 19:00:47 UTC 2004


>Number:         75032
>Category:       ports
>Synopsis:       JBoss4 update.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 13 19:00:46 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Chen
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD grimoire.chen.org.nz 5.3-STABLE FreeBSD 5.3-STABLE #0: Sat Nov 13 19:02:50 NZDT 2004 root at grimoire.chen.org.nz:/usr/obj/usr/src/sys/GENERIC i386
>Description:
JBoss4 updates:
	1. rcNGify startup.
	2. patch to fix table creation for autoincrement feature in Postgresql.
>How-To-Repeat:
>Fix:

Note: new file patch-serial-autoinc is created.

diff -ruN /usr/ports/java/jboss4/Makefile ./Makefile
--- /usr/ports/java/jboss4/Makefile	Sat Dec  4 16:14:15 2004
+++ ./Makefile	Tue Dec 14 07:46:38 2004
@@ -7,6 +7,7 @@
 
 PORTNAME=	${APP_TITLE:L}
 PORTVERSION=	4.0.0
+PORTREVISION=	1
 CATEGORIES=	java
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -22,17 +23,18 @@
 JAVA_VERSION=	1.4+
 
 USE_REINPLACE=	YES
+USE_RC_SUBR=	YES
 USE_BZIP2=	YES
 
 .if !defined(NOPORTDOCS)
 PORTDOCS=	*
 .endif
 
-APP_HOME?=	${PREFIX}/${PKGBASE}${PORTVERSION:R}
+APP_HOME?=	${PREFIX}/${APP_SHORTNAME}
 DOCSDIR=	${PREFIX}/share/doc/${PKGBASE}${PORTVERSION:R}
 LOG_DIR=	${APP_HOME}/log
 APP_TITLE=	JBoss
-APP_SHORTNAME=	${PORTNAME}${PORTVERSION:R:R}
+APP_SHORTNAME=	${UNIQUENAME}
 CONTROL_SCRIPT_NAME=	${APP_SHORTNAME}ctl
 CONTROL_SCRIPT=	${PREFIX}/bin/${CONTROL_SCRIPT_NAME}
 CONTROL_SCRIPT_MANPAGE_TITLE=	${CONTROL_SCRIPT_NAME:U}
@@ -66,6 +68,7 @@
 do-configure:
 	@(cd ${DAEMONCTL_DIR} && ${CP} ${DAEMONCTL_FILES} ${WRKDIR})
 	@(cd ${WRKDIR} && ${REINPLACE_CMD} \
+		-e "s|%%RC_SUBR%%|${RC_SUBR}|g;" \
 		-e "s|%%APP_HOME%%|${APP_HOME}|g;" \
 		-e "s|%%APP_SHORTNAME%%|${APP_SHORTNAME}|g;" \
 		-e "s|%%APP_TITLE%%|${APP_TITLE}|g;" \
@@ -73,8 +76,8 @@
 		-e "s|%%CONTROL_SCRIPT_MANPAGE_TITLE%%|${CONTROL_SCRIPT_MANPAGE_TITLE}|g;" \
 		-e "s|%%CONTROL_SCRIPT_NAME%%|${CONTROL_SCRIPT_NAME}|g;" \
 		-e "s|%%GROUP%%|${GROUP}|g;" \
+		-e "s|%%JAVA%%|${JAVA}|g;" \
 		-e "s|%%JAVA_CP%%|${JAVA_CP}|g;" \
-		-e "s|%%JAVA_CMD%%|bin/java|g;" \
 		-e "s|%%JAVA_HOME%%|${JAVA_HOME}|g;" \
 		-e "s|%%JAVA_MAIN%%|${JAVA_MAIN}|g;" \
 		-e "s|%%JAVA_OPTS%%|${JAVA_OPTS}|g;" \
diff -ruN /usr/ports/java/jboss4/files/daemonctl.c ./files/daemonctl.c
--- /usr/ports/java/jboss4/files/daemonctl.c	Tue Jun 22 04:42:59 2004
+++ ./files/daemonctl.c	Mon Dec 13 09:25:14 2004
@@ -24,6 +24,9 @@
 #include <sys/types.h>
 #include <sys/uio.h>
 
+#define	TRUE	1
+#define	FALSE	0
+
 /* The maximum size of the PID file, in bytes */
 #define MAX_FILE_SIZE			32
 
@@ -59,6 +62,12 @@
 static void start (int optcount, char * opts []);
 static void stop (void);
 static void restart (int optcount, char * opts []);
+static void logOutput (char *);
+
+/*
+	Globals
+ */
+static int isQuiet = FALSE;
 
 /**
  * Main function. This function is called when this program is executed.
@@ -97,7 +106,9 @@
 	jopt = 0;
 	for (i = 1; i < argc; i++)
 	{
-		if (*argv [i] == '-')
+		if (strcmp (argv [i], "-q") == 0)
+			isQuiet = TRUE;
+		else if (*argv [i] == '-')
 			jopt++;
 	}
 	if (jopt == 0)
@@ -108,7 +119,7 @@
 		jargs = malloc (sizeof (char *) * jopt);
 		for (i = 0; i < argc; i++)
 		{
-			if (*argv [i] == '-')
+			if (strcmp (argv [i], "-q") && *argv [i] == '-')
 				jargs [j++] = argv [i];
 		}
 	}
@@ -163,7 +174,7 @@
 	/* Attempt to open the PID file */
 	file = open ("%%PID_FILE%%", O_RDWR);
 	if (file < 0) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to open %%PID_FILE%% for reading and writing: ");
 		perror (NULL);
 		exit (ERR_PID_FILE_NOT_FOUND);
@@ -198,7 +209,7 @@
 	buffer = (char *) malloc ((MAX_FILE_SIZE + 1) * sizeof (char));
 	count = read (file, buffer, MAX_FILE_SIZE + 1);
 	if (count > MAX_FILE_SIZE) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: The file %%PID_FILE%% contains more than %d bytes.\n", MAX_FILE_SIZE);
 		exit (ERR_PID_FILE_TOO_LARGE);
 	}
@@ -215,12 +226,12 @@
 			/* XXX: Ignore a newline at the end of the file */
 			hadNewline = 1;
 		} else {
-			printf (" [ FAILED ]\n");
+			logOutput (" [ FAILED ]\n");
 			fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: The file %%PID_FILE%% contains an illegal character (%d) at position %d.\n", c, i);
 			exit (ERR_PID_FILE_CONTAINS_ILLEGAL_CHAR);
 		}
 	}
-	printf (" [ DONE ]\n");
+	logOutput (" [ DONE ]\n");
 
 	if (count == 0 || (count == 1 && hadNewline == 1)) {
 		return -1;
@@ -253,13 +264,13 @@
 	assert (file > 0);
 	assert (pid > 0);
 
-	printf (">> Writing PID file...");
+	logOutput (">> Writing PID file...");
 
 	lseek (file, (off_t) 0, SEEK_SET);
 	ftruncate (file, (off_t) 0);
 	nbytes = asprintf (&buffer, "%d\n", pid);
 	write (file, buffer, nbytes);
-	printf (" [ DONE ]\n");
+	logOutput (" [ DONE ]\n");
 }
 
 
@@ -314,10 +325,11 @@
 	/* Check preconditions */
 	assert (pid > 0);
 
-	printf (">> Terminating process %d...", pid);
+	if (!isQuiet)
+		printf (">> Terminating process %d...", pid);
 	result = kill (pid, SIGTERM);
 	if (result < 0) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to kill process %d: ", pid);
 		perror (NULL);
 		exit (ERR_KILL_FAILED);
@@ -327,8 +339,8 @@
     result = existsProcess (pid);
 	for (waited=0; result == 1 && waited < timeout; waited += interval)
 	{
-		printf (".");
-		fflush (NULL);
+		logOutput (".");
+		fflush (stdout);
 		sleep (interval);
     	result = existsProcess (pid);
 	}
@@ -341,10 +353,10 @@
 		result = kill (pid, SIGKILL);
 		if (result == 0) {
 			forced = 1;
-			printf (" [ DONE ]\n");
+			logOutput (" [ DONE ]\n");
 			fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Process %d did not terminate within %%STOP_TIMEOUT%% sec. Killed.\n", pid);
 		} else if (result != ESRCH) {
-			printf (" [ FAILED ]\n");
+			logOutput (" [ FAILED ]\n");
 			fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to kill process %d: ", pid);
 			perror (NULL);
 			exit (ERR_KILL_FAILED);
@@ -352,7 +364,7 @@
 	}
 
 	if (forced == 0) {
-		printf (" [ DONE ]\n");
+		logOutput (" [ DONE ]\n");
 	}
 }
 
@@ -372,17 +384,17 @@
 	struct stat sb;
 
 	/* Open and read the PID file */
-	printf (">> Reading PID file (%%PID_FILE%%)...");
+	logOutput (">> Reading PID file (%%PID_FILE%%)...");
 	file = openPIDFile ();
 	pid = readPID (file);
 
-	printf (">> Starting %%APP_TITLE%% %%PORTVERSION%%...");
+	logOutput (">> Starting %%APP_TITLE%% %%PORTVERSION%%...");
 	if (pid != -1) {
 
 		/* Check if the process actually exists */
 		result = existsProcess (pid);
 		if (result == 1) {
-			printf (" [ FAILED ]\n");
+			logOutput (" [ FAILED ]\n");
 			fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: %%APP_TITLE%% %%PORTVERSION%% is already running, PID is %d.\n", pid);
 			exit (ERR_ALREADY_RUNNING);
 		}
@@ -391,34 +403,34 @@
 	/* Check if the JDK home directory is actually a directory */
 	result = stat ("%%JAVA_HOME%%", &sb);
 	if (result != 0) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to stat %%JAVA_HOME%%: ");
 		perror (NULL);
 		exit (ERR_STAT_JAVA_HOME);
 	}
 	if (!S_ISDIR (sb.st_mode)) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Java home directory %%JAVA_HOME%% is not a directory.\n");
 		exit (ERR_JAVA_HOME_NOT_DIR);
 	}
 
 	/* Check if the Java command is actually an executable regular file */
-	result = stat ("%%JAVA_HOME%%/%%JAVA_CMD%%", &sb);
+	result = stat ("%%JAVA%%", &sb);
 	if (result != 0) {
-		printf (" [ FAILED ]\n");
-		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to stat %%JAVA_HOME%%/%%JAVA_CMD%%: ");
+		logOutput (" [ FAILED ]\n");
+		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to stat %%JAVA%%: ");
 		perror (NULL);
 		exit (ERR_STAT_JAVA_CMD);
 	}
 	if (!S_ISREG (sb.st_mode)) {
-		printf (" [ FAILED ]\n");
-		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Java command %%JAVA_HOME%%/%%JAVA_CMD%% is not a regular file.\n");
+		logOutput (" [ FAILED ]\n");
+		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Java command %%JAVA%% is not a regular file.\n");
 		exit (ERR_JAVA_CMD_NOT_FILE);
 	}
-	result = access ("%%JAVA_HOME%%/%%JAVA_CMD%%", X_OK);
+	result = access ("%%JAVA%%", X_OK);
 	if (result != 0) {
-		printf (" [ FAILED ]\n");
-		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Java command %%JAVA_HOME%%/%%JAVA_CMD%% is not executable: ");
+		logOutput (" [ FAILED ]\n");
+		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Java command %%JAVA%% is not executable: ");
 		perror (NULL);
 		exit (ERR_JAVA_CMD_NOT_EXECUTABLE);
 	}
@@ -426,7 +438,7 @@
 	/* Change directory */
 	result = chdir ("%%APP_HOME%%");
 	if (result < 0) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to access directory %%APP_HOME%%: ");
 		perror (NULL);
 		exit (ERR_CHDIR_TO_APP_HOME);
@@ -435,7 +447,7 @@
 	/* See if the JAR file exists */
 	result = access ("%%APP_HOME%%/%%JAR_FILE%%", R_OK);
 	if (result < 0) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to access JAR file %%APP_HOME%%/%%JAR_FILE%%: ");
 		perror (NULL);
 		exit (ERR_ACCESS_JAR_FILE);
@@ -444,7 +456,7 @@
 	/* Open the stdout log file */
 	stdoutLogFile = open ("%%STDOUT_LOG%%", O_WRONLY);
 	if (stdoutLogFile < 0) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to open %%STDOUT_LOG%% for writing: ");
 		perror (NULL);
 		exit (ERR_STDOUT_LOGFILE_OPEN);
@@ -454,7 +466,7 @@
 	/* Open the stderr log file */
 	stderrLogFile = open ("%%STDERR_LOG%%", O_WRONLY);
 	if (stderrLogFile < 0) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to open %%STDERR_LOG%% for writing: ");
 		perror (NULL);
 		exit (ERR_STDERR_LOGFILE_OPEN);
@@ -464,7 +476,7 @@
 	/* Split this process in two */
 	pid = fork ();
 	if (pid == -1) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to fork: ");
 		perror (NULL);
 		exit (ERR_FORK_FAILED);
@@ -489,7 +501,7 @@
 		 */
 		argv = malloc (sizeof (char *) * (optcount + 5));
 		argc = 0;
-		argv [argc++] = "%%JAVA_HOME%%/%%JAVA_CMD%%";
+		argv [argc++] = "%%JAVA%%";
 		for (i = 0; i < optcount; i++)
 			argv [argc++] = opts [i];
 		argv [argc++] = "-cp";
@@ -503,7 +515,7 @@
 		perror (NULL);
 	} else
 	{
-		printf (" [ DONE ]\n");
+		logOutput (" [ DONE ]\n");
 		writePID (file, pid);
 	}
 }
@@ -519,11 +531,11 @@
 	int pid;
 
 	/* Open and read the PID file */
-	printf (">> Reading PID file (%%PID_FILE%%)...");
+	logOutput (">> Reading PID file (%%PID_FILE%%)...");
 	file = openPIDFile ();
 	pid = readPID (file);
 
-	printf (">> Checking if %%APP_TITLE%% %%PORTVERSION%% is running...");
+	logOutput (">> Checking if %%APP_TITLE%% %%PORTVERSION%% is running...");
 
 	/* If there is a PID, see if the process still exists */
 	if (pid != -1) {
@@ -536,11 +548,11 @@
 
 	/* If there is no running process, produce an error */
 	if (pid == -1) {
-		printf (" [ FAILED ]\n");
+		logOutput (" [ FAILED ]\n");
 		fprintf (stderr, "%%CONTROL_SCRIPT_NAME%%: %%APP_TITLE%% %%PORTVERSION%% is currently not running.\n");
 		exit (ERR_NOT_RUNNING);
 	}
-	printf (" [ DONE ]\n");
+	logOutput (" [ DONE ]\n");
 
 	/* Terminate the process */
 	killProcess (pid);
@@ -560,4 +572,15 @@
 {
 	stop ();
 	start (optcount, opts);
+}
+
+/**
+	Output log to stdout.
+ */
+static void
+logOutput (
+ char * string)
+{
+	if (!isQuiet)
+		printf (string);
 }
diff -ruN /usr/ports/java/jboss4/files/patch-serial-autoinc ./files/patch-serial-autoinc
--- /usr/ports/java/jboss4/files/patch-serial-autoinc	Thu Jan  1 12:00:00 1970
+++ ./files/patch-serial-autoinc	Mon Dec 13 18:38:38 2004
@@ -0,0 +1,86 @@
+$FreeBSD$
+
+This patch allows JBoss to correctly create tables when
+using the auto-increment feature with Postgresql.
+
+diff -r -u ./server/src/etc/conf/default/standardjbosscmp-jdbc.xml /tmp/jboss-4.0.0-src/server/src/etc/conf/default/standardjbosscmp-jdbc.xml
+--- ./server/src/etc/conf/default/standardjbosscmp-jdbc.xml	Thu Sep 16 03:48:58 2004
++++ /tmp/jboss-4.0.0-src/server/src/etc/conf/default/standardjbosscmp-jdbc.xml	Sun Dec  5 22:21:18 2004
+@@ -1169,7 +1169,7 @@
+          <row-locking-template>SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE</row-locking-template>
+          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
+          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
+-         <auto-increment-template>?1</auto-increment-template>
++         <auto-increment-template>?1 serial</auto-increment-template>
+          <alias-header-prefix>t</alias-header-prefix>
+          <alias-header-suffix>_</alias-header-suffix>
+          <alias-max-length>32</alias-max-length>
+@@ -1296,7 +1296,7 @@
+          <row-locking-template>SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE</row-locking-template>
+          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
+          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
+-         <auto-increment-template>?1</auto-increment-template>
++         <auto-increment-template>?1 serial</auto-increment-template>
+          <alias-header-prefix>t</alias-header-prefix>
+          <alias-header-suffix>_</alias-header-suffix>
+          <alias-max-length>32</alias-max-length>
+@@ -1423,7 +1423,7 @@
+          <row-locking-template/>
+          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
+          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
+-         <auto-increment-template>?1 IDENTITY</auto-increment-template>
++         <auto-increment-template>?1 ?2 ?3 IDENTITY</auto-increment-template>
+          <add-column-template>ALTER TABLE ?1 ADD COLUMN ?2 ?3</add-column-template>
+          <drop-column-template>ALTER TABLE ?1 DROP COLUMN ?2</drop-column-template>
+          <alias-header-prefix>t</alias-header-prefix>
+@@ -1717,7 +1717,7 @@
+               <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
+          -->
+          <fk-constraint-template>ALTER TABLE ?1 ADD INDEX (?3), ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
+-         <auto-increment-template>?1 auto_increment</auto-increment-template>
++         <auto-increment-template>?1 ?2 ?3 auto_increment</auto-increment-template>
+          <alter-column-template>ALTER TABLE ?1 MODIFY ?2 ?3</alter-column-template>
+          <alias-header-prefix>t</alias-header-prefix>
+          <alias-header-suffix>_</alias-header-suffix>
+@@ -1857,7 +1857,7 @@
+          <row-locking-template>SELECT ?1 FROM ?2 with (updlock) WHERE ?3 ORDER BY ?4</row-locking-template>
+          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
+          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
+-         <auto-increment-template>?1 IDENTITY</auto-increment-template>
++         <auto-increment-template>?1 ?2 ?3 IDENTITY</auto-increment-template>
+          <alter-column-template>ALTER TABLE ?1 ALTER COLUMN ?2 ?3</alter-column-template>
+          <alias-header-prefix>t</alias-header-prefix>
+          <alias-header-suffix>_</alias-header-suffix>
+@@ -1989,7 +1989,7 @@
+          <row-locking-template>SELECT ?1 FROM ?2 with (xlock) WHERE ?3 ORDER BY ?4</row-locking-template>
+          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
+          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
+-         <auto-increment-template>?1 IDENTITY</auto-increment-template>
++         <auto-increment-template>?1 ?2 ?3 IDENTITY</auto-increment-template>
+          <alias-header-prefix>t</alias-header-prefix>
+          <alias-header-suffix>_</alias-header-suffix>
+          <alias-max-length>32</alias-max-length>
+diff -r -u ./server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStartCommand.java /tmp/jboss-4.0.0-src/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStartCommand.java
+--- ./server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStartCommand.java	Tue Sep 14 09:23:02 2004
++++ /tmp/jboss-4.0.0-src/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCStartCommand.java	Sun Dec  5 22:04:56 2004
+@@ -916,14 +916,18 @@
+       // apply auto-increment template
+       if(type.getAutoIncrement()[0])
+       {
+-         String columnClause = SQLUtil.getCreateTableColumnsClause(type);
+          JDBCFunctionMappingMetaData autoIncrement =
+             manager.getMetaData().getTypeMapping().getAutoIncrementTemplate();
+          if(autoIncrement == null)
+          {
+             throw new IllegalStateException("auto-increment template not found");
+          }
+-         String[] args = new String[]{columnClause};
++         String[] args = new String[]
++							{
++								type.getColumnNames () [0],
++								type.getSQLTypes () [0],
++								type.getNotNull () [0] ? " not null " : ""
++							};
+          autoIncrement.getFunctionSql(args, sqlBuffer);
+       }
+       else
diff -ruN /usr/ports/java/jboss4/files/startup.sh ./files/startup.sh
--- /usr/ports/java/jboss4/files/startup.sh	Tue Jun 22 04:42:59 2004
+++ ./files/startup.sh	Mon Dec 13 10:22:23 2004
@@ -7,29 +7,40 @@
 # $FreeBSD: ports/java/jboss4/files/startup.sh,v 1.1 2004/06/21 16:42:59 vanilla Exp $
 #
 
+# PROVIDE: %%APP_SHORTNAME%%
+# REQUIRE: NETWORKING SERVERS
 
-# Set some variables
-MYSELF=`basename $0`
-JAVA_OPTS="%%JAVA_OPTS%%"
-
-case "$1" in
-	start)
-		echo -n ' '
-		truncate -s 0 %%PID_FILE%%
-		chown %%USER%%:%%GROUP%% %%PID_FILE%%
-		chmod 600 %%PID_FILE%%
-		su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% ${JAVA_OPTS} start" >/dev/null && echo -n '%%APP_SHORTNAME%%'
-		;;
-	stop)
-		echo -n ' '
-		chown %%USER%%:%%GROUP%% %%PID_FILE%%
-		chmod 600 %%PID_FILE%%
-		su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% stop" >/dev/null 2>&1 ; echo -n '%%APP_SHORTNAME%%'
-		;;
-	*)
-		echo ""
-		echo "Usage: ${MYSELF} { start | stop }"
-		echo ""
-		exit 64
-		;;
-esac
+# Add the following lines to /etc/rc.conf to enable %%APP_SHORTNAME%%:
+# %%APP_SHORTNAME%%_enable (bool):		Set to "NO" by default.
+#				Set it to "YES" to enable %%APP_SHORTNAME%%
+# %%APP_SHORTNAME%%_flags (str):		Set to "-server" by default.
+#				Extra JVM flags.
+#
+. %%RC_SUBR%%
+
+name="%%APP_SHORTNAME%%"
+rcvar=`set_rcvar`
+
+start_cmd="%%APP_SHORTNAME%%_start"
+restart_cmd="%%APP_SHORTNAME%%_restart"
+pidfile="%%PID_FILE%%"
+procname="%%JAVA%%"
+
+[ -z "$%%APP_SHORTNAME%%_enable" ]	&& %%APP_SHORTNAME%%_enable="NO"
+[ -z "$%%APP_SHORTNAME%%_flags" ]	&& %%APP_SHORTNAME%%_flags="-server"
+
+%%APP_SHORTNAME%%_start ()
+{
+	checkyesno %%APP_SHORTNAME%%_enable &&
+		%%CONTROL_SCRIPT%% -q ${%%APP_SHORTNAME%%_flags} start &&
+		echo -n " %%APP_SHORTNAME%%"
+}
+
+%%APP_SHORTNAME%%_restart ()
+{
+	checkyesno %%APP_SHORTNAME%%_enable &&
+		%%CONTROL_SCRIPT%% -q ${%%APP_SHORTNAME%%_flags} restart
+}
+
+load_rc_config $name
+run_rc_command "$1"
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list