Forum OpenACS Q&A: Error Making JavaBlend

Collapse
Posted by Chris Yeo on
Anyone has any idea on how to solve this error during making of
JavaBlend

db.c: In function `DbGetHandle':
db.c:709: `TclData' undeclared (first use in this function)
db.c:709: (Each undeclared identifier is reported only once
db.c:709: for each function it appears in.)
db.c:709: `tdPtr' undeclared (first use in this function)
db.c:711: too few arguments to function `NsTclGetData'
make[1]: *** [db.o] Error 1
make[1]: Leaving directory `/home/nsadmin/nsjavablend-0.0.9/src'
make: *** [all] Error 1

Any help is appreciated. Thanks.

Collapse
Posted by Don Baccus on
What version of Tcl does JavaBlend support, and which version are you compiling with?  I'm just guessing but this looks like it could be a Tcl7 vs Tcl8 kinda problem.
Collapse
Posted by Jason Tauber on
I'm having the same problem while installing nsjava-0.0.9, has anybody figured it out yet?

-Jason Tauber

Collapse
Posted by Dan Wickstrom on
I need more information.  Could you run configure and post the output?  Also what version of aolserver are you using, and what jdk are you using?
Collapse
Posted by Jason Tauber on
Here's my configure output:

stirling:/home/jason/nsjava-0.0.9# ./configure --with-aolserver-src=/home/jason/tmp/aolserver-3.4 --with-jdk=/usr/lib/ibm-java/jdk118 --with-prefix=/usr/local/aolserver/

loading cache ./config.cache
checking prefix... /usr/local
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... /home/jason/tmp/aolserver-3.4/include/ns.h
checking looking for aolserver nsd.h include file... /home/jason/tmp/aolserver-3.4/nsd/nsd.h
checking checking for java... Java found at /usr/lib/ibm-java/jdk118
checking for zip or jar files to include on CLASSPATH... "/usr/lib/ibm-java/jdk118/lib/classes.zip"
checking for the java runtime... /usr/lib/ibm-java/jdk118/bin/java
checking for the java compiler... /usr/lib/ibm-java/jdk118/bin/javac
checking for the java header program... /usr/lib/ibm-java/jdk118/bin/javah
checking for the java archive program... /usr/lib/ibm-java/jdk118/bin/jar
checking for the java debugger program... /usr/lib/ibm-java/jdk118/bin/jdb
checking for jni.h include file... /usr/lib/ibm-java/jdk118/include/jni.h.
checking for jdk version... Looks like you are using a 1.1 JVM
checking for jni_md.h include file... /usr/lib/ibm-java/jdk118/include/linux/jni_md.h
checking the jdk arch lib directory... checking how to run the C preprocessor... (cached) gcc -E
checking for unistd.h... (cached) yes
checking for working const... (cached) yes
checking for ANSI C header files... (cached) yes
checking for size_t... (cached) yes
checking for ANSI C header files... (cached) yes
checking for strerror... (cached) yes
checking for strstr... (cached) yes
checking for strlen... (cached) yes
checking platform specific compile options... linux

        NSJAVA version 0.0.9 configured successfully.

Using c-compiler:      gcc
JDK Version:          1.1
Install libnsjava.so:  /usr/local/bin
Aolserver Version:    3_0_PLUS
Aolserver include:    /home/jason/tmp/aolserver-3.4/include
Aolserver nsd include: /home/jason/tmp/aolserver-3.4/nsd
jdk include:          /usr/lib/ibm-java/jdk118/include
jdk platform include:  /usr/lib/ibm-java/jdk118/include/linux
libjava.so dir:        /usr/lib/ibm-java/jdk118/lib/linux/native_threads
java classpath:        "/usr/lib/ibm-java/jdk118/lib/classes.zip"

CFLAGS: ' -pipe -fPIC -Wall -Wno-unused -DHAVE_CMMSG=1 -DUSE_FIONREAD=1 -DHAVE_COND_EINTR=1'

LIBS:  ' -ldl -lpthread -L/usr/lib/ibm-java/jdk118/lib/linux/native_threads -ljava'

creating ./config.status
creating Makefile.global

I'm using AOLserver-3.4 and ibm-jdk-1.1.8.  The problem comes when I try to make after successfully running configure.  It reports that TclData is undeclared in the same error message as above.  I looked everywhere for it and ended up finding its struct declaration(on line 144) in the file tclinit.c inside the directory aolserver3.4/nsd.  The only problem is there does not exist a variable dbs inside TclData.  In the function DbGetHandle, nsjava tries to use TclData->dbs (on line 709), which does not exist even if it could find the definition for TclData in tclinit.c.  The output when I run make is included below if it helps.

stirling:/home/jason/nsjava-0.0.9# make
building "java"
make[1]: Entering directory `/home/jason/nsjava-0.0.9/java'
javac -g -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java ../java/nsjava/NsSet.java
javac -g -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java ../java/nsjava/NsDb.java
javac -g -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java ../java/nsjava/NsPg.java
javac -g -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java ../java/nsjava/NsLog.java
javac -g -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java ../java/nsjava/NsTcl.java
javac -g -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java ../java/nsjava/JavaMonitorLock.java
javac -g -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java test_nsjvm.java
javah -jni -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java -d ../include nsjava.NsSet
javah -jni -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java -d ../include nsjava.NsDb
javah -jni -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java -d ../include nsjava.NsPg
javah -jni -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java -d ../include nsjava.NsLog
javah -jni -classpath "/usr/lib/ibm-java/jdk118/lib/classes.zip":/home/jason/nsjava-0.0.9/java -d ../include nsjava.NsTcl
jar -c0f nsjava.jar `find nsjava -name "*.class" -print`
make[1]: Leaving directory `/home/jason/nsjava-0.0.9/java'
building "src"
make[1]: Entering directory `/home/jason/nsjava-0.0.9/src'
gcc -c -pipe -fPIC -Wall -Wno-unused -DHAVE_CMMSG=1 -DUSE_FIONREAD=1 -DHAVE_COND_EINTR=1 -DNSVERSION_3_0_PLUS -D_REENTRANT nsjava.c -I/home/jason/tmp/aolserver-3.4/include -I/home/jason/tmp/aolserver-3.4/nsd -I/usr/lib/ibm-java/jdk118/include -I/usr/lib/ibm-java/jdk118/include/linux -I../include -I. -o nsjava.o
gcc -c -pipe -fPIC -Wall -Wno-unused -DHAVE_CMMSG=1 -DUSE_FIONREAD=1 -DHAVE_COND_EINTR=1 -DNSVERSION_3_0_PLUS -D_REENTRANT log.c -I/home/jason/tmp/aolserver-3.4/include -I/home/jason/tmp/aolserver-3.4/nsd -I/usr/lib/ibm-java/jdk118/include -I/usr/lib/ibm-java/jdk118/include/linux -I../include -I. -o log.o
gcc -c -pipe -fPIC -Wall -Wno-unused -DHAVE_CMMSG=1 -DUSE_FIONREAD=1 -DHAVE_COND_EINTR=1 -DNSVERSION_3_0_PLUS -D_REENTRANT set.c -I/home/jason/tmp/aolserver-3.4/include -I/home/jason/tmp/aolserver-3.4/nsd -I/usr/lib/ibm-java/jdk118/include -I/usr/lib/ibm-java/jdk118/include/linux -I../include -I. -o set.o
gcc -c -pipe -fPIC -Wall -Wno-unused -DHAVE_CMMSG=1 -DUSE_FIONREAD=1 -DHAVE_COND_EINTR=1 -DNSVERSION_3_0_PLUS -D_REENTRANT pg.c -I/home/jason/tmp/aolserver-3.4/include -I/home/jason/tmp/aolserver-3.4/nsd -I/usr/lib/ibm-java/jdk118/include -I/usr/lib/ibm-java/jdk118/include/linux -I../include -I. -o pg.o
gcc -c -pipe -fPIC -Wall -Wno-unused -DHAVE_CMMSG=1 -DUSE_FIONREAD=1 -DHAVE_COND_EINTR=1 -DNSVERSION_3_0_PLUS -D_REENTRANT db.c -I/home/jason/tmp/aolserver-3.4/include -I/home/jason/tmp/aolserver-3.4/nsd -I/usr/lib/ibm-java/jdk118/include -I/usr/lib/ibm-java/jdk118/include/linux -I../include -I. -o db.o
db.c: In function `DbGetHandle':
db.c:709: `TclData' undeclared (first use in this function)
db.c:709: (Each undeclared identifier is reported only once
db.c:709: for each function it appears in.)
db.c:709: `tdPtr' undeclared (first use in this function)
db.c:711: too few arguments to function `NsTclGetData'
make[1]: *** [db.o] Error 1
make[1]: Leaving directory `/home/jason/nsjava-0.0.9/src'
make: *** [all] Error 1

Thanks for the help if you can offer some.  I really want to get this webmail thing working.

-Jason Tauber

Collapse
Posted by Dan Wickstrom on
The problem appears to be with aolserver 3.4.  This is the first time I've tried building nsjava with aolserver 3.4, and it failed with the same error that you have.  I should be able to come up with a fix for it pretty soon, but in the meantime, you can try one of the earlier aolserver versions.  I'm currently using aolserver3_2+ad12, and nsjava builds fine with that.

I'll post here when I have a fix for the 3.4 problem.

Collapse
Posted by Dan Wickstrom on
I fixed this build error which occurs when building with aolserver version 3.4. The new version (nsjava-0.0.10) is available at http://nsjava.sourceforge.net.