Forum OpenACS Q&A: nsjava error

Collapse
Posted by Andrew Smith on
Hi,

   I am trying to make use of webmail package of openacs 3.2.4.
I am using Redhat Linux 7.1 with Postgres Sql 7.1.3 and AOL3.2

   I have followed most the instructions on webmail installation that
I could find.

   I have downloaded and installed nsjava from sourceforge. 

The bin dir of my aolserver now contains 

libnsjava.so,nsjava.jar,activation.jar,mail.jar,mailapi.jar,imap.jar

The classpath in the server.tcl file contains

 ns_param   ClassPath
"/usr/local/jdk/jdk118_v3/lib/classes.zip:/usr/local/aol32/bin/nsjava.jar:/usr/local/aol32/bin/activation.jar:/usr/local/aol32/bin/mail.jar:/web/server/www/webmail/java"

And The modules 

ns_section "ns/server/${server}/modules"
        ns_param   nssock          ${bindir}/nssock.so
        ns_param   nslog           ${bindir}/nslog.so
        ns_param   nsperm          ${bindir}/nsperm.so 
#       ns_param   nscgi           ${bindir}/nscgi.so 
        ns_param   nsjava          ${bindir}/libnsjava.so


I have compiled the java files under /web/server/www/webmail/java
directory with no errors.

But still when I try to send a mail on page message-send-3.tcl . I get
the error 

"
Database Error
An error occured while we attempted to compose your message: 

                invalid command name "nsjava"

webmaster@yourdomain.com
"

Any help would be greatly appreciated
Thanks in advance
Collapse
2: Response to nsjava error (response to 1)
Posted by Andrew Smith on

On message-send-3.tcl page I used 

ns_java MessageComposer::compose_message $outgoing_msg_id $tmpfile

but still it gave me same error

I then tried using 

exec java MessageComposer::compose_message $outgoing_msg_id $tmpfile

It gave me different error

"
Database Error

An error occured while we attempted to compose your message: 

       Can't find class MessageComposer::compose_message
        
webmaster@yourdomain.com

"

I then modified it to 


exec java MessageComposer $outgoing_msg_id $tmpfile


Then it gave me different error

"
Database Error

An error occured while we attempted to compose your message: 

 In class MessageComposer: void main(String argv[]) is not defined

webmaster@yourdomain.com

"


Any help would be appreciated
Thanks
Collapse
3: Response to nsjava error (response to 1)
Posted by Jonathan Ellis on
(I answered in the other thread you posted to.)
Collapse
4: Response to nsjava error (response to 1)
Posted by Jonathan Ellis on
do you have the EnableJava param under the right module? e.g.
ns_section "ns/server/${server}/module/nsjava"
        ns_param    EnableJava      on
Collapse
5: Response to nsjava error (response to 1)
Posted by Andrew Smith on

Hi 

 You were right. I modules section had acspg as the server directory.
I corrected it and java was successfully loaded 

 But when I tried to send mail it gave me this error


[21/Mar/2002:10:45:47][13011.7176][-conn0-] Error: JavaEvalCmd: error in command format
[21/Mar/2002:10:45:47][13011.7176][-conn0-] Notice: error: JavaEvalCmd: error in command format 
Args: 
ns_java
MessageComposer
11
/web/server/www/webmail/tmp/.wm_msgGRpUIy

------------------------

The ns_java command was

ns_java MessageComposer $outgoing_msg_id $tmpfile


Collapse
6: Response to nsjava error (response to 1)
Posted by Andrew Smith on

Sorry the command was wrong I then corrected it to 

 ns_java MessageComposer::compose_message $outgoing_msg_id $tmpfile

I then added path of libnsjava.so to LD_LIBRARY_PATH because java was giving me an error that the file could not be found.

Then when I tried to send message I got this error

java.lang.NoClassDefFoundError: nsjava/NsLog
        at 
[21/Mar/2002:11:10:46][13011.16392][-conn3-] Error: JavaEvalCmd:  Java exception occured: 
[21/Mar/2002:11:10:46][13011.16392][-conn3-] Notice: error: JavaEvalCmd:  Java exception occured:  
Args: 
ns_java
MessageComposer::compose_message
11
/web/server/www/webmail/tmp/.wm_msgLmyR6S

Collapse
7: Response to nsjava error (response to 1)
Posted by Jonathan Ellis on
you have nsjava.jar in your classpath, but is it where it's being looked for?  you have to move it in by hand.
Collapse
8: Response to nsjava error (response to 1)
Posted by Andrew Smith on

I restarted the aolserver and then tried again . This time it sent mail with out error.

But it did not come to my inbox. I searched for that mail and found it under 

/var/qmail/queue/mess/5/100699

I have done the part of alias and queue as mentioned in the webmail doc 

The content of my /var/qmail/users/assign file is 

+webmail-:postgres:505:505:/usr/local/aol32/qmail/alias:-::
.

=============

rcpthosts is

server.com

==============

virtualdomains is 

webmail.server.com:webmail-wm


===============

server.ini file under parameters

 ns_param AliasDirectory "/usr/local/aol32/qmail/alias"
 ns_param QueueDirectory "/usr/local/aol32/server/server/queue/"


Collapse
9: Response to nsjava error (response to 1)
Posted by Jonathan Ellis on
can't help you with qmail; I'm a postfix guy. :)