Forum OpenACS Q&A: problem with nsjava version 1.0.4

Collapse
Posted by Ola Hansson on
Dan, since you've been hanging out here lately, I'll just post this here.

(Sorry I couldn't resist imitating your post😉)

I ran into an error message when I tried to configure nsjava, but I can't seem find the problem.

This is what I got:

apt-get install jdk1.1-native-dev
tar -xvzf nsjava-1.0.4.tar.gz
cd nsjava-1.0.4
export PATH=$PATH:/usr/lib/jdk1.1/bin

./configure --prefix=/usr/local/aolserver 
--with-aolserver-src=/usr/local/src/aolserver/aolserver

debian:/usr/local/src/nsjava-1.0.4# ./configure 
--prefix=/usr/local/aolserver 
--with-aolserver-src=/usr/local/src/aolserver/aolserver
loading cache ./config.cache
checking prefix... /usr/local/aolserver
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking looking for aolserver ns.h include file... 
/usr/local/src/aolserver/aolserver/include/ns.h
checking looking for aolserver nsd.h include file... 
/usr/local/src/aolserver/aolserver/nsd/nsd.h
checking for javac... (cached) /usr/bin/javac
checking for jdk version... grep: /usr/lib/jdk1.1/include: Is a 
directory
Looks like you are using a 1.2 JVM.

	NSJAVA version 1.0.4 configured successfully.

Using c-compiler:      gcc
JDK Version:           1.2
Install libnsjava.so:  /usr/local/aolserver/bin
Aolserver Version:     3_0_PLUS
Aolserver include:     /usr/local/src/aolserver/aolserver/include
Aolserver nsd include: /usr/local/src/aolserver/aolserver/nsd
jdk include:           /usr/lib/jdk1.1/include
/usr/lib/j2sdk1.3/include
jdk platform include:  /usr/lib/jdk1.1/include/linux
/usr/lib/j2sdk1.3/include/linux
libjava.so dir:        /usr/lib/jdk1.1/lib/ia32/native_threads
/usr/lib/j2re1.3/lib/i386
libhpi.so dir:         /usr/lib/j2re1.3/lib/i386/native_threads
hpi lib:               libhpi.so
libjvm.so dir:         /usr/lib/j2re1.3/lib/i386/classic
jvm lib:               libjvm.so
java classpath:        
RPATH:                 /usr/lib/jdk1.1/lib/ia32/native_threads
/usr/lib/j2re1.3/lib/i386:/usr/lib/j2re1.3/lib/i386/native_threads:/usr/lib/j2re1.3/lib/i386/classic

CFLAGS:  '-DUSING_JDK1_2'

LDFLAGS: '-L/usr/lib/jdk1.1/lib/ia32/native_threads
/usr/lib/j2re1.3/lib/i386 -ljava 
-L/usr/lib/j2re1.3/lib/i386/native_threads -lhpi 
-L/usr/lib/j2re1.3/lib/i386/classic -ljvm '

creating ./config.status
creating Makefile.global
sed: file conftest.s1 line 9: Unterminated `s' command
debian:/usr/local/src/nsjava-1.0.4#

debian:/usr/local/src/nsjava-1.0.4# make
building "java"
make[1]: Entering directory `/usr/local/src/nsjava-1.0.4/java'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/src/nsjava-1.0.4/java'
building "src"
make[1]: Entering directory `/usr/local/src/nsjava-1.0.4/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/src/nsjava-1.0.4/src'
debian:/usr/local/src/nsjava-1.0.4#
Collapse
Posted by Dan Wickstrom on
It appears that the configure script generated an error trying to process one of the temporary conftest files.  Try running "autoconf" in the /usr/local/src/nsjava-1.0.4 directory, and then try re-running configure again.  What release of debian are you using?
Collapse
Posted by Ola Hansson on
I'm running "unstable" on kernel 2.4.18. The jdk is Blackdown I think.
debian:/usr/local/src/nsjava-1.0.4# autoconf 
debian:/usr/local/src/nsjava-1.0.4# ./configure --prefix=/usr/local/aolserver --with-aolserver-src=/usr/local/src/aolserver/aolserver
checking prefix... /usr/local/aolserver
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking looking for aolserver ns.h include file... /usr/local/src/aolserver/aolserver/include/ns.h
checking looking for aolserver nsd.h include file... /usr/local/src/aolserver/aolserver/nsd/nsd.h
checking for javac... /usr/bin/javac
checking for jdk version... grep: /usr/lib/jdk1.1/include: Is a directory
Looks like you are using a 1.2 JVM.

	NSJAVA version 1.0.4 configured successfully.

Using c-compiler:      gcc
JDK Version:           1.2
Install libnsjava.so:  /usr/local/aolserver/bin
Aolserver Version:     3_0_PLUS
Aolserver include:     /usr/local/src/aolserver/aolserver/include
Aolserver nsd include: /usr/local/src/aolserver/aolserver/nsd
jdk include:           /usr/lib/jdk1.1/include
/usr/lib/j2sdk1.3/include
jdk platform include:  /usr/lib/jdk1.1/include/linux
/usr/lib/j2sdk1.3/include/linux
libjava.so dir:        /usr/lib/jdk1.1/lib/ia32/native_threads
/usr/lib/j2re1.3/lib/i386
libhpi.so dir:         /usr/lib/j2re1.3/lib/i386/native_threads
hpi lib:               libhpi.so
libjvm.so dir:         /usr/lib/j2re1.3/lib/i386/classic
jvm lib:               libjvm.so
java classpath:        
RPATH:                 /usr/lib/jdk1.1/lib/ia32/native_threads
/usr/lib/j2re1.3/lib/i386:/usr/lib/j2re1.3/lib/i386/native_threads:/usr/lib/j2re1.3/lib/i386/classic

CFLAGS:  '-DUSING_JDK1_2'

LDFLAGS: '-L/usr/lib/jdk1.1/lib/ia32/native_threads
/usr/lib/j2re1.3/lib/i386 -ljava -L/usr/lib/j2re1.3/lib/i386/native_threads -lhpi -L/usr/lib/j2re1.3/lib/i386/classic -ljvm '

configure: creating ./config.status
config.status: creating Makefile.global
sed: file /tmp/csRnABlL/subs-1.sed line 38: Unterminated `s' command
sed: file /tmp/csRnABlL/subs-2.sed line 3: Extra characters after command
debian:/usr/local/src/nsjava-1.0.4#
Collapse
Posted by Dan Wickstrom on
Try running it with the jdk explicitly specified: --with-jdk=/usr/lib/jdk1.1
Collapse
Posted by Ola Hansson on
Yes, that solved it. Thanks a lot Dan!
Collapse
Posted by Dan Wickstrom on
Okay, good.  It looks like I need to cleanup the configure script so it doesn't default to using environment variables.  Just out of curiosity, do you have a JAVA_HOME environment variable set?
Collapse
Posted by Ola Hansson on
Nope, I don't. If I may bother you again, can you tell me if I can run Java servlets from nsjava/AOLserver or not? Also do you know/recomment any opensource Java Webmail solutions that are IMAP capable that I might try?

Thanks.

Collapse
Posted by Dan Wickstrom on
Technically, the answer is no, but I have loaded a JigSaw server into nsjava and used it to try out webdav support from aolserver (jigsaw should also provide servlet support), and I think someone mentioned that they had run tomcat from nsjava.

In essence, nsjava is a tcl extension module that allows you to load java libraries and access them from tcl.  nsjava isn't currently integrated with aolserver's http connection interface, so it's not possible to provide direct servlet support from nsjava.  At some point, I will probably try adding servlet support, since so many java packages are designed for use with servlets.  Adding servlet support will make re-use of java packages much easier.