Invalid magic number

hi,i wrote a java standalone app to acces Notes DB without CORBA.

All is ok under WINDOWS, but on UNIX i get this error message:

Exception in thread “main” java.lang.UnsatisfiedLinkError: lsxbe_r (Not found in java.library.path)

i change the PATH and the LD_LIBRARY_PATH in the .profile file and now the lsxbe_r is found

but i get this other message

java.lang.UnsatisfiedLinkError: lsxbe_r (Could not load module /app/pkqno01a/lotus/notes/latest/ibmpow/liblsxbe_r.a.

The module has an invalid magic number.)

i use the jvm 1.5.0 on a server Release 6.5.6FP1

Any idea?

Subject: invalid magic number

hi philippe,

There are 2 things to consider if you want to run java standalone applications with Notes.

  1. It is not preferred to run standalone Notes Java Applications with a different VM than Notes does.

In your case, you should take the VM located in “/app/pkqno01a/lotus/notes/latest/ibmpow/jvm”.

This could be a probably a problem, because this is an IBM VM 1.3.x. If you need to access external code, which is not compatible with JSE2 1.3 you must take a different one.

If you must use a different (newer) VM, compile your stuff as 1.3 code. This means you must call javac with the params -source 1.3 and -target 1.3 to make your code compatible with the Notes Java packages. Changing this params should also be possible in your preferred IDE. You have to add the required Notes archives (Notes.jar, jsdk.jar, XML4j.jar and LotusXSL.jar) to your classpath. If you have compiled your code as 1.3 code, you cannot use newer language features like generic code etc.

  1. Setting the LD_LIBRARY_PATH is not enough to load needed native libraries. The Notes Java API expect that you run your code in the directory where your notes.ini is located.

I hope this helps.

Subject: RE: invalid magic number

hi stephan,thank for your response, but i used the -source 1.3 and -target 1.3 options and nothing changed.

when i run my program on a windows notes client 6.5.3 to access the same server all is ok.

Subject: RE: invalid magic number

Did you start your program with a script?

I am running very often such stand-alone programs under UNIX and Windows Environments.

May be the following script could help:

#!/bin/sh

export NOTES_DIR=/app/pkqno01a/lotus/notes/latest/ibmpow

set this value to the path where your notes.ini is located

export NOTES_DATA=/local/notesdata

export JAVA_HOME=$NOTES_DIR/jvm

export MY_CLASSPATH=$NOTES_DIR/Notes.jar:$NOTES_DIR/jsdk.jar:$NOTES_DIR/XML4j.jar:$NOTES_DIR/LotusXSL.jar:

export MY_MAINCLASS=

export MY_APPPARAMS

#Now extend the PATH and LD_LIBRARY_PATH

export PATH=$NOTES_DIR:$PATH

export LD_LIBRARY_PATH=$NOTES_DIR:$LD_LIBRARY_PATH

#change to data dir

cd $NOTES_DATA

no exec java

$JAVA_HOME/bin/java -Djava.class.path=$MY_CLASSPATH -Djava.library.path=$NOTES_DIR $MY_MAINCLASS $MY_APPPARAMS

Hope this helps!

Subject: RE: invalid magic number

thank Stefan, i will try this