Forum OpenACS Q&A: nsjava with acs 3.4.10

Collapse
Posted by Cheng-Yi Hsu on
Hello, Here are my environment:
aolserver 3.4.2
acs 3.4.10 with oracle 9i
nsjava 1.0.3
jdk blackdown j2sdk1.3.1
I successful compile nsjava and load into aolserver, here is what I see in server.log
02/Aug/2002:13:40:54][4834.1024][-main-] Notice: modload: 
loading '/export/home/nsadmin/bin/libnsjava.so'
[02/Aug/2002:13:40:54][4834.1024][-main-] Notice: ModuleInit: Java 
Module ENABLED
[02/Aug/2002:13:40:54][4834.1024][-main-] Notice: 
registerTclJavaFunctions: registering commands
[02/Aug/2002:13:40:54][4834.1024][-main-] Notice: registering nsjava 
namespace killer
[Opened /usr/local/j2sdk1.3.1/jre/lib/rt.jar in 8 ms]
[Opened /usr/local/j2sdk1.3.1/jre/lib/i18n.jar in 2 ms]
[Opened /usr/local/j2sdk1.3.1/jre/lib/sunrsasign.jar in 0 ms]
[Loaded java.lang.NoClassDefFoundError 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Class from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Object from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Throwable from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.Serializable 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.String from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Comparable 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.ObjectStreamField 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.String$CaseInsensitiveComparator 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Comparator 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Thread from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Runnable from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ClassLoader 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Vector from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.AbstractList 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.AbstractCollection 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Collection 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.List from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Cloneable from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Stack from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ThreadDeath 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Error from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Exception from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.RuntimeException 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.StackOverflowError 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.VirtualMachineError 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.IOException from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.FileNotFoundException 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.reflect.Method 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.reflect.AccessibleObject 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.reflect.Member 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.reflect.ReflectPermission 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.security.BasicPermission 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.security.Permission 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.security.Guard from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.ObjectStreamClass 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.ObjectStreamClass$ObjectStreamClassEntry 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.SoftReference 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.Reference 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.ObjectStreamClass$CompareClassByName 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.ObjectStreamClass$CompareMemberByName 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.LinkageError 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.OutOfMemoryError 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ThreadGroup 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded [C]
[Loaded java.lang.System from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.security.AccessController 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.security.AccessControlContext 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Collections 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Random from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Collections$EmptySet 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.AbstractSet 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Set from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Collections$EmptyList 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Collections$EmptyMap 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.AbstractMap 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Map from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Collections$ReverseComparator 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.InheritableThreadLocal 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ThreadLocal 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.Reference$Lock 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.Reference$ReferenceHandler 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.WeakReference 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.FinalReference 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.Finalizer 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.ReferenceQueue 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.ReferenceQueue$Null 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.ReferenceQueue$Lock 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.Finalizer$FinalizerThread 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.ref.PhantomReference 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Properties 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Hashtable from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Dictionary 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Hashtable$EmptyEnumerator 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Enumeration 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Hashtable$EmptyIterator 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Iterator from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Float from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Number from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Hashtable$Entry 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Map$Entry from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.io.ByteToCharConverter 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.io.Converters from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.security.action.GetPropertyAction 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.security.PrivilegedAction 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.io.CharacterEncoding 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.Locale from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Character from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.StringBuffer 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.io.ByteToCharISO8859_1 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.misc.Version from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.FileInputStream 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.InputStream from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.FileDescriptor 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.FileOutputStream 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.OutputStream 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.BufferedInputStream 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.FilterInputStream 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.PrintStream from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.FilterOutputStream 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.BufferedOutputStream 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.OutputStreamWriter 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.Writer from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.io.CharToByteConverter 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.io.CharToByteISO8859_1 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.BufferedWriter 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.misc.Launcher from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$Factory 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.net.URLStreamHandlerFactory 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$1 from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.net.URLClassLoader 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.security.SecureClassLoader 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.security.util.Debug 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.StringTokenizer 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.File from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.FileSystem from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.io.UnixFileSystem 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$2 from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.security.PrivilegedExceptionAction 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.net.URL from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.HashSet from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.HashMap from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.HashMap$EmptyHashIterator 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.HashMap$Entry 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.misc.URLClassPath 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.util.ArrayList from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.net.www.protocol.jar.Handler 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.net.URLStreamHandler 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$AppClassLoader 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$3 from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded sun.net.www.protocol.file.Handler 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Compiler from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[Loaded java.lang.Compiler$1 
from /usr/local/j2sdk1.3.1/jre/lib/rt.jar]
[02/Aug/2002:13:40:54][4834.4101][-jvm-] Notice: startJvm: setting 
main thread id: 4101
[02/Aug/2002:13:40:54][4834.1024][-main-] Notice: ModuleInit: JVM 
init succeeded!



Here is the error message:
[nsadmin@dev1 nsadmin]$ telnet 127.0.0.1 9999
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
login: nsadmin
Password: x

Welcome to tango running at /export/home/nsadmin/bin/nsd (pid 4834)
AOLserver/3.4.2 (nsd_v3_r4_p2) for linux built on Aug  2 2002 at 
13:24:30
CVS Tag: $Name: nsd_v3_r4_p2 $
tango:nscp 1> package require nsjava
0.1
tango:nscp 2> nsjava::new
Usage: nsjava::new sig ?arg arg...?
tango:nscp 3> nsjava::import
invalid command name "nsjava::import"

I can't import any java package ! Any idea ?
Collapse
Posted by Dan Wickstrom on
Thanks for the bug report. I'll take a look at it. I tried the following:

Welcome to testfts2 running at /home/nsadmin/bin/nsd (pid 916)
AOLserver/3.2+ad12 (aolserver3_2_ad12) for linux built on Jan 30 2001 at 20:36:35
CVS Tag: $Name: aolserver3_2 $
testfts2:nscp 1> package require nsjava
0.1
testfts2:nscp 2> set s [nsjava::new {String String} {hello world}]
nsjava0x76
testfts2:nscp 3> $s toString
hello world
testfts2:nscp 4> nsjava::import java.util.Hashtable
can not import class "java.util.Hashtable", it does not exist
testfts2:nscp 5> nsjava::import
java.util.Hashtable
testfts2:nscp 6> set h [nsjava::new Hashtable]
nsjava0x77
testfts2:nscp 7> $h {put Object Object} save $s
testfts2:nscp 8> [$h {get Object} save] toString
hello world
testfts2:nscp 9>

So it appears that even though an error message is received, the import is still working correctly. I'll go ahead and fix that.

Collapse
Posted by Dan Wickstrom on
I fixed this bug and checked the changes into cvs.  The fix should come out in the next release 1.0.4.  I'm currently adding an extensive test harness to catch these kinds of bugs, and I'll do the release once I'm finished - probably in another week.
Collapse
Posted by Dan Wickstrom on
By the way, does anybody have readline support working for nscp?
Collapse
Posted by Dan Wickstrom on
It occured to me that you can use shell mode in emacs, and use the builtin history recall mechanism to get a limited readline support for nscp. I map the history recall to the up/down arrows using the following emacs incantation:

(add-hook 'shell-mode-hook 
	  (function 
	   (lambda ()
	     (define-key comint-mode-map 'up 'comint-previous-input)
	     (define-key comint-mode-map 'down 'comint-next-input))))

It also works for sql mode when you're forced to use oracle and work with sqlplus

(add-hook 'sql-interactive-mode-hook
	  (function 
	   (lambda ()
	     (define-key comint-mode-map 'up 'comint-previous-input)
	     (define-key comint-mode-map 'down 'comint-next-input))))

I don't care what people say, emacs rules.