Executing native library under Java - shell script problem

I am running a Java application on the command line bash shell. I have a few JAR files in the directory and a few native libraries. When I run the application using the command line, all works fine. This is the command I use:
java -classpath MyGame.jar:log4j-1.2.16.jar:jme/jme-colladabinding.jar:jme-audio.jar:jme-awt.jar:jme-collada.jar:jme-editors.jar:jme-effects.jar:jme-font.jar:jme-gamestates.jar:jme-model.jar:jme-ogrexml.jar:jme-scene.jar:jme-swt.jar:jme-terrain.jar:jme.jar:jogl/gluegen-rt.jar:jogl/jogl.jar:jorbis/jorbis-0.0.17.jar:junit/junit-4.1.jar:lwjgl/jinput.jar:lwjgl/lwjgl.jar:lwjgl/lwjgl_util.jar:lwjgl/lwjgl_util_applet.jar:swt/windows/swt.jar:jbullet/jbullet-jme.jar:jbullet/asm-all-3.1.jar:jbullet/jbullet.jar:jbullet/stack-alloc.jar:jbullet/vecmath.jar:trove-2.1.0.jar:sceneMonitor/jmejtree_jme2.jar:sceneMonitor/propertytable.jar:sceneMonitor/scenemonitor_jme2.jar:sceneMonitor/sm_properties_jme2.jar -Djava.library.path="lwjgl/native/linux" -Xmx1024m -Xms768m -ea com.mygame.MainThis works fine and the application starts up as expected. LWJGL native library is loaded in and works fine as expected.
The problem occurs when I try to run this command via the shell using a shell script. Here is my script:
#!/bin/bash
# Set the minimum and maximum heap sizes
MINIMUM_HEAP_SIZE=768m
MAXIMUM_HEAP_SIZE=1024m
if [ "$MYAPP_JAVA_HOME" = "" ] ; then
    MYAPP_JAVA_HOME=$JAVA_HOME
fi
_JAVA_EXEC="java"
if [ "$MYAPP_JAVA_HOME" != "" ] ; then
    _TMP="$MYAPP_JAVA_HOME/bin/java"
    if [ -f "$_TMP" ] ; then
        if [ -x "$_TMP" ] ; then
            _JAVA_EXEC="$_TMP"
        else
            echo "Warning: $_TMP is not executable"
        fi
    else
        echo "Warning: $_TMP does not exist"
    fi
fi
if ! which "$_JAVA_EXEC" >/dev/null ; then
    echo "Error: No Java environment found"
    exit 1
fi
_MYAPP_CLASSPATH="MyGame.jar:log4j-1.2.16.jar:jme/jme-colladabinding.jar:jme-audio.jar:jme-awt.jar:jme-collada.jar:jme-editors.jar:jme-effects.jar:jme-font.jar:jme-gamestates.jar:jme-model.jar:jme-ogrexml.jar:jme-scene.jar:jme-swt.jar:jme-terrain.jar:jme.jar:jogl/gluegen-rt.jar:jogl/jogl.jar:jorbis/jorbis-0.0.17.jar:junit/junit-4.1.jar:lwjgl/jinput.jar:lwjgl/lwjgl.jar:lwjgl/lwjgl_util.jar:lwjgl/lwjgl_util_applet.jar:swt/windows/swt.jar:jbullet/jbullet-jme.jar:jbullet/asm-all-3.1.jar:jbullet/jbullet.jar:jbullet/stack-alloc.jar:jbullet/vecmath.jar:trove-2.1.0.jar:sceneMonitor/jmejtree_jme2.jar:sceneMonitor/propertytable.jar:sceneMonitor/scenemonitor_jme2.jar:sceneMonitor/sm_properties_jme2.jar"
_VM_PROPERTIES="-Djava.library.path=\'lwjgl/native/linux\'"
_MYAPP_MAIN_CLASS="com.mygame.Main"
$_JAVA_EXEC -classpath $_MYAPP_CLASSPATH $_VM_PROPERTIES -Xmx${MAXIMUM_HEAP_SIZE} -Xms${MINIMUM_HEAP_SIZE} -ea $_MYAPP_MAIN_CLASSThe shell script is in the same directory as the JAR files (the same directory where I ran the Java command above). When I execute the shell script ( sh MyGame.sh ), I get the UnsatisfiedLinkError message:
    14-Feb-2011 19:46:28 com.wcg.game.DefaultUncaughtExceptionHandler uncaughtException
    SEVERE: Main game loop broken by uncaught exception
    java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
       at java.lang.Runtime.loadLibrary0(Runtime.java:823)
       at java.lang.System.loadLibrary(System.java:1028)
       at org.lwjgl.Sys$1.run(Sys.java:73)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
       at org.lwjgl.Sys.loadLibrary(Sys.java:82)
       at org.lwjgl.Sys.<clinit>(Sys.java:99)
       at org.lwjgl.opengl.Display.<clinit>(Display.java:130)
       at com.jme.system.lwjgl.LWJGLDisplaySystem.setTitle(LWJGLDisplaySystem.java:118)
       at com.wcg.game.WcgStandardGame.initSystem(WcgStandardGame.java:287)
       at com.wcg.game.WcgStandardGame.run(WcgStandardGame.java:185)
       at java.lang.Thread.run(Thread.java:662)I don't understand what I am doing wrong. I am executing the exact same command via a shell script and it is not working. Any ideas, solutions, most welcome.
I am running Linux Mint Debian 201012, Linux mint 2.6.32-5-amd64 #1 SMP Thu Nov 25 18:02:11 UTC 2010 x86_64 GNU/Linux. JDK is 1.6.0_22 64-bit. I have 64-bit .so files in the correct place too.
Thanks
Riz

Thanks for the replies guys/gals.
I have modified the script and echoed my command that should be running under the shell script, it is:
java -classpath WcgFramework.jar:WcgPocSwordplay.jar:log4j-1.2.16.jar:jme/jme-colladabinding.jar:jme-audio.jar:jme-awt.jar:jme-collada.jar:jme-editors.jar:jme-effects.jar:jme-font.jar:jme-gamestates.jar:jme-model.jar:jme-ogrexml.jar:jme-scene.jar:jme-swt.jar:jme-terrain.jar:jme.jar:jogl/gluegen-rt.jar:jogl/jogl.jar:jorbis/jorbis-0.0.17.jar:junit/junit-4.1.jar:lwjgl/jinput.jar:lwjgl/lwjgl.jar:lwjgl/lwjgl_util.jar:lwjgl/lwjgl_util_applet.jar:swt/windows/swt.jar:jbullet/jbullet-jme.jar:jbullet/asm-all-3.1.jar:jbullet/jbullet.jar:jbullet/stack-alloc.jar:jbullet/vecmath.jar:trove-2.1.0.jar:sceneMonitor/jmejtree_jme2.jar:sceneMonitor/propertytable.jar:sceneMonitor/scenemonitor_jme2.jar:sceneMonitor/sm_properties_jme2.jar -Djava.library.path="lwjgl/native/linux" -Xmx1024m -Xms768m -ea com.mygame.MainI am more confident that now the shell script should be fine (I am a shell script noob) because this very command if I copy from terminal and paste into the terminal, runs the application no problem at all. But I am amazed that it is still not working. I must be doing something obviously wrong. :-(
I used the code as suggested:
_VM_PROPERTIES='-Djava.library.path="lwjgl/native/linux"'I am stumped!? :-(
Thanks for help.

Similar Messages

  • Problem with loading native library in java version "1.5.0_05"

    My application uses a native coded drawing. With java version 1.4.xx it was working just fine but with java 1.5.xx it gives the following error at the time of loading native library:
    java.lang.UnsatisfiedLinkError: /home/abyzov/tmp/friend32-1.6.02/libfriend.so:
    /home/abyzov/tmp/friend32-1.6.02/libfriend.so: undefined symbol: XtWindowToWidget
    I assumed that java loads all necessary X-libraries at start up but it seems to be not true for version 1.5.xx. Does anybody now about this kind of problems? Should I report it as a bug?

    I have this exact same problem. I developed an application all along using 1.4.2_08 to be exact no problems. I was forced to switch to 1.5.0_06, now when I try to run the app I get:
    java.lang.UnsatisfiedLinkError: <path to library>/libcomlib.so: <path to library>/libcomlib.so: undefined symbol: yp_get_default_domain
    I have tried compiling it in both 1.4.2_8 and 1.5.0_06 and it compiles perfectly but when I run with 1.5.0_06 it messes up.
    If you found the problem with this or anyone else has any advice please let me know.

  • Do shell script problem in Applescript

    Hi,
    I am an Applescript novice and have been trying to write a code to go to a particular folder, look for all files in the folder tree with extension .m2v and run an executable file to decode them. My problem is that when I run my code (containing do shell script), it searches through all files and folders on Mac HD and starts decoding .m2v files elsewhere that I don't want.
    Eventually it runs out of space (.m2v file decoding takes a lot of space), because it is dumping all decoded .yuv files onto the HD.
    When I run the command on Terminal, it executes the decoding perfectly and stores the decoded files in the same folder.
    Please help me about what's going on.
    My code is something like:
    tell application "Finder"
    set DestinationFolder to "xxxxxx:xxxx:xxxx"
    set NumFolders to (get count of folders under Destination folder)
    repeat for SomeVar from 1 to NumFolders
    set FolderinQuestion to folder SomeVar of DestinationFolder
    -- Tried tell application "Terminal" here, but did not know --how to export the FolderinQuestion variable from Finder to --Terminal
    do shell script " \" cd \" & (POSIX path of (result as text));
    for file in `find $pwd \"*.mov\"`
    do
    /usr/local/bin/decode file
    done"
    end repeat
    end tell
    I would greatly appreciate some guidance.

    The root of the problem is that you're trying to quote the cd command for some reason:
    <pre class=command>do shell script " \" cd \" & (POSIX path of (result as text));
    ...</pre>
    In addition to that you're including the & (POSIX path of (result as text)) as part of the shell command whereas this should be OUTSIDE of the quotes in order to get evaluated
    If you work that through you'll end up with a shell command that looks like:
    <pre class=command>" cd " & (POSIX path of (result as text))</pre>
    If you try to run that in a terminal you'll get a cd : command not found error and that's why the rest of it appears to fail.
    The solution to that one is simple - just don't bother quoting the cd and put the POSIX path stuff outside of the quotes to get it evaluated at runtime:
    <pre class=command>do shell script "cd " & quoted form of POSIX path of (FolderInQuestion as text)) & ";
    # rest of shell commands here"</pre>
    Now, as for the rest of the script there are a few things I would change.
    First, unless you need to know the index, don't do:
    >repeat for SomeVar from 1 to NumFolders
    set FolderinQuestion to folder SomeVar of DestinationFolder
    the issue is that the number of folders to process may change during the script's execution (other processes may create or remove folders). This will, at best, cause some folders to be skipped and, at worst, cause the script to fail.
    If you're iterating through a list, the best option is to just:
    <pre class=command>repeat with FolderInQuestion in (folders of DestinationFolder)
    ...</pre>
    This automatically sets the iterator (in this case, FolderInQuestion, to the first item in the list and increments it for each iteration through the loop.
    Secondly, in your shell script itself, scrub the entire do/done loop. You're already using find, so have that do the hard work using the -exec switch:
    <pre class=command>find path -name "*.mov" -exec /usr/local/bin/decode {} \;</pre>
    In find's case, {} is substituted with the current file's path.
    Putting this together you'd get:
    <pre class=command>tell application "Finder"
    set DestinationFolder to "xxxxxx:xxxx:xxxx"
    repeat with folderInQuestion in (get folders of folder DestinationFolder)
    do shell script "cd " & quoted form of POSIX path of folderInQuestion & "; find . -name \"*.mov\" -exec /usr/bin/decode {} \\;"
    end repeat
    end tell</pre>
    Note that I've used 'quoted form of POSIX path' - this takes care of any shell-unsafe characters like spaces in the path name. I've also used \\; for the -exec switch - this is so that AppleScript passes the \ to the shell command rather than using it for its own escaping.
    But you're not done yet!
    There's still one fatal flaw in this process - and that is the fact that find by default, is recursive - it will walk through every directory that it finds.
    This means that if you start at the top folder and iterate through, find will find all .mov files and decode them. Your script then cd's to the first subdirectory and repeats the process - decoding all the .mov files in that directory and all its subdirectories even though they've ALREADY been decoded.
    The upshot is that you only need to run one loop starting at the top level. You don't need to iterate through all the subdirectories since find will do that for you.
    In addition to that, there might not be a need to use cd at all since the first argument to find is the directory to start searching in. Unless there's some reason that you need to start decode from the top level directory (e.g. is that where it saves the files?), you can drop the whole repeat loop altogether and just run with:
    <pre class=command>set startFolder to (choose folder)
    do shell script "find " & quoted form of posix path of startFolder & " -name \"*.mov\" -exec /usr/bin/decode {} \\;"</pre>
    That's the entire script - a radical compression of your original.

  • Rel 12 - How to create a new APPS connection from custom Java/Shell Script

    Hi,
    I am looking to write a custom JAVA code / Shell Script which needs to establish a connection to execute a PL/SQL API on Rel 12 db.
    The challenge is to be able to connect without specifying APPS Password anywhere (just like Oracle Apps does it).
    This Shell script / Java code is not called from within Apps hence I need to establish a brand new connection along the lines of using ....
    WebAppsContext ctx = new WebAppsContext(System.getProperty("JTFDBCFILE"));
    OracleConnection conn = (OracleConnection)ctx.getJDBCConnection();
    like in 11i world or possibly using APPLSYSPUB username
    I need help / direction in how to do this in a Rel 12 env. I understnad there are lot of architecture changes and if someone can provide a generic code snipped it will be great.
    I need to keep this as closely aligned to Rel 12 coding and security standards as possible.
    This code will reside in $XXCUSTOM_TOP/bin file or under XXCUSTOM.oracle.apps.java....... if its Java.
    Pls help.
    Cheers
    -- VK.

    Hi,
    Have you looked at Oracle produced dbc file and its contents? That might help. It is under $FND_TOP/secure. It uses GWYUID=APPLSYSPUB/PUB. I am hoping that the APPS_JDBC_URL would help too.
    Regards,

  • Run java shell script on Linux

    Hi I am just trying to convert a Windows batch file to a unix shell script to run a java application, but it so long since Ive used UNIX I cant really remember how to do it.
    My script contains
    #!/bin/sh
    java  -jar lib/testapp.jarThese are my failed attempts to run it, not too sure what the differences are but I think the 3rd one is the only one to actually find my shell script.
    [root@]# testapp.sh
    -bash:  testapp.sh: command not found
    [root@]# ./ testapp.sh
    : bad interpreter: No such file or directory
    [root@]# .  testapp.sh
    Unable to access jarfile lib/testapp.jarif I just do this at the command line it works fine
    [root@]#java  -jar lib/testapp.jar

    #1
    [root@]# testapp.sh
    -bash:  testapp.sh: command not found
    #2
    [root@]# ./ testapp.sh
    : bad interpreter: No such file or directory
    #3
    [root@]# .  testapp.sh
    Unable to access jarfile lib/testapp.jar#1 is because the command (testapp.sh) is not found on the PATH. Under Unix the current directory . is not included automatically in the PATH: it has to be excplicitly specified, and this is a good thing. Also make sure it has the x (executable) switch on: chmod +x  testapp.sh
    #2 is because you had an extra space in what should have been
    ./testapp.sh #3 there you could "inline" the script but the file lib/testapp.jar was appearently not found. Is lib really under the working directory or in other some place?

  • Ananomous block inside shell script problem

    I am having problem using / inside the anonymous block...
    I have a shell script which is somethinglike this.
    $ORACLE_HOME/bin/sqlplus -s << EOF
    --set head off;
    --set feedback off;
    set serverout on;
    Cursor c1 is
    select --------
    Begin
    for x in c1 loop
        Begin
          <do something>
        End;
    End Loop;
    End;
    End;
    EOF
    mail -s -----If i don't use / certian things are not executed.
    If i use exit instead of /, then it will not reach the end ie., the mail part.
    can somebody guide me ??

    sb92075 wrote:
    sunil_dba wrote:
    I am having problem using / inside the anonymous block...anonymous blocks begin with
    DECLARE
    which posted code seems to be lackingOr also a BEGIN if no variables, constants or user types are declared.

  • Executing crystal reports through a shell script

    We are currently in the processing of building a POC using Crystal reports and was hoping to find a way to execute canned crystal reports via a shell script. The reason being we wanted to schedule the executing of the report through our scheduler where we would build in the dependencies.
    Does anyone have a simple example on how to do that.

    What sort of shell script? Can you provide more info?
    The only CR SDK is for .NET and Java.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Specify native library in java command line

    My application is :
    1. packed into 1 jar file
    2. use sqljdbc4.jar
    2. use a native library: "Microsoft SQL Server JDBC Driver 3.0".(use it in Ecplise and it works fine)
    3. run by this command: "java -jar myapp.jar".
    java version is jdk1.6.0_23
    btw: I config all the class paths in the manifest.mf file
    My application is failed to run, since it cannot find the native library. How/where to specify the native library location?

    -Djava.library.path

  • Simple shell script problem...

    I am trying to get a list of directories on a remote machine, compare them with the directories on the local machine and copy any that dont match on the local machine to a backup folder. Heres my code but i am a newbie and i cant get my shell script to read from a file. The for loop never executes so i am guessing i am not reading the file correctly - see below.
    #!/bin/ksh
    ssh -l removeserver 192.168.xxx.xxx ls /remote/server/directory/ > /store/remote/directory/listing/motapp1files.txt
    newfile=''
    $newfile < /store/remote/directory/listing/motapp1files.txt
    for file in $newfile;
    do echo $file
    if [ ! -d local/machine/directories/$file/ ]; then
    echo "this folder doesnt exist on on remote server "; echo $file;
    fi
    done

    Re-inventing the wheel perhaps. Look into rsync. Great program!
    I used it in FreeBSD to do a very similar task.

  • Execute stored procedure from Unix shell script

    My current method of executing stored procedures (wpl_1 and wpl_2) from a unix shell script is as follows:
    <<wpl.sh>>
    sqlplus user/password @/home/oracle/scripts/wpl.sql
    <<wpl.sql>>
    set serveroutput on size 1000000
    set timing on
    execute wpl_1('0000010676','~')
    execute wpl_2('0000010676','~')
    execute wpl_1('0000010236','FIX')
    execute wpl_2('0000010236','FIX')
    exit
    Question: Is it possible to combine the two scripts (unix and oracle) together?

    A little rusty on this, but this may work:
    My current method of executing stored procedures
    (wpl_1 and wpl_2) from a unix shell script is as
    follows:
    <<wpl.sh>>sqlplus user/password @/home/oracle/scripts/wpl.sql << EOF
    set serveroutput on size 1000000
    set timing on
    execute wpl_1('0000010676','~')
    execute wpl_2('0000010676','~')
    execute wpl_1('0000010236','FIX')
    execute wpl_2('0000010236','FIX')
    exit
    EOF
    >
    Question: Is it possible to combine the two scripts
    (unix and oracle) together?

  • Sqlldr ops$user/password in a shell script - problem

    Hello All:
    i run the sqlldr command from a unix shell script that has
    sqlldr ops$user/password@alias control='/path1/control.ctl' log='/path2/log.log'
    I am geeting invalid user/password because of the $ sign in the username. What is the workaround for this? How to handle this in the script?
    I tried single quote, USERID= unsuccessfully. Any ideas?
    Thanks
    San~

    Hello,
    Single quote should work fine , can you post your shell script specially couple of line and try connecting from command line.
    $ sqlplus 'test$user'/*****
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Apr 14 14:36:04 2009
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine optionsRegards
    Edited by: OrionNet on Apr 14, 2009 2:38 PM

  • Execute txkWfClone.sh in a shell script

    We have a requirement that needs txkWfClone.sh to run inside a shell script (unix). We need to pass the username/password in the shell script. Basically we need to run this as a silent process.
    Any suggestions on how to accomplish that?

    900441 wrote:
    We have a requirement that needs txkWfClone.sh to run inside a shell script (unix). We need to pass the username/password in the shell script. Basically we need to run this as a silent process.
    Any suggestions on how to accomplish that?Yes.
    How to Change the System Name in Workflow? [ID 387337.1]
    Txkwfclone.Sql Script Is Receiving The Parameters In Incorrect Order [ID 880264.1]
    You may also view the script and you will find if any parameters need to be passed.
    Thanks,
    Hussein

  • Executing set of procedures from Shell script.

    Hi,
    I've set of procedures which i need to pass a parameter from the os ..like this.
    For table XXX ...i need to call
    a Procedure XXX ('parameter as file name ')..
    So i've a test.sql file which is calling
    EXEC XXX(&1);
    The Shell script file will be like this...
    sqlplus username/password @test.sql
    Like this i need to call 10 tbles.
    so 10 sql file and 10 shell script file.
    And also i need to scedhule the *.sh file.
    Is that a right way ....? or any other method to achive this ????
    IT'S URGENT...
    Thanks

    Hi,
    Make a file proc.txt containing the name of the proc :
    proc1
    proc2
    proc3
    A second file for the tables names tables.txt containing :
    table1
    table2
    table3
    And the shell will be :
    #!/bin/bash
    TAB=tab.txt
    PROC=proc.txt
    for THE_TABLE in `cat $TAB`
    do
    for THE_PROC in `cat $PROC`
    do
    sqlplus system/manager <<!
    exec $THE_PROC ;
    exit ;
    done
    done
    Fred
    ~
    ~

  • Rman shell script problem

    Hello,
    While running the following rman commands directly from the shell , its work fine :
    $ rman CATALOG=catman/man@rman TARGET=/
    RMAN> run {
    2>   allocate channel 'dev_1' type 'sbt_tape'
    3>   parms  'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=bz,OB2BARLIST=bz_archive,OB2BARHOSTNAME=bz)';
    4>   allocate channel 'dev_2' type 'sbt_tape'
    5>   parms  'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=bz,OB2BARLIST=bz_archive,OB2BARHOSTNAME=bz)';
    6>   restore archivelog from time "to_date('2011-02-14 08:31:55','YYYY-MM-DD HH24:MI:SS')" until time 'SYSDATE';
    7>     }
    allocated channel: dev_1
    channel dev_1: sid=323 devtype=SBT_TAPE
    channel dev_1: Data Protector A.06.11/243
    allocated channel: dev_2
    channel dev_2: sid=438 devtype=SBT_TAPE
    channel dev_2: Data Protector A.06.11/243
    Starting restore at 2011-02-14 19:01:38
    ....When trying to run it as shell script :
    #!/bin/ksh
    ssh -l oracle 172.22.xx.xx . /software/oracle/.profile ;
    export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
    rman CATALOG=catman/man@rman TARGET=/
    run {
       allocate channel 'dev_1' type 'sbt_tape'
       parms  'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=bz,OB2BARLIST=bz_archive,OB2BARHOSTNAME=bz)';
       allocate channel 'dev_2' type 'sbt_tape'
       parms  'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=bz,OB2BARLIST=bz_archive,OB2BARHOSTNAME=bz)';
       restore archivelog from time "to_date('2011-02-14 08:31:55','YYYY-MM-DD HH24:MI:SS')" until time 'SYSDATE';
       }The script succeded to connect to rman but it stuck hir:
    $ ./yoav.sh  
    Recovery Manager: Release 10.2.0.4.0 - Production on Mon Feb 14 20:13:41 2011
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    connected to target database: BZ (DBID=3044220964)
    connected to recovery catalog database
    RMAN> Any suggestion why it stuck ?
    Thanks

    It is stucked because RMAN it waiting input on STDIN and you don't give anything as input to STDIN.
    Try to use
    $ rman CATALOG=catman/man@rman TARGET=/ <<EOF
    <your RMAN script>
    EOFor try to use RMAN command file like a SQL file:
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/setup001.htm#sthref206
    Edited by: P. Forstmann on 14 févr. 2011 20:05

  • Calling a native library from Java

    Hello,
    I'm trying to call a native method (windows dll) from a web service implemented in Java. I've confirmed that the class I've created to call the native method works when used outside of my web service (ie. in a standard Java application). However, when I try to use the class in the web service, an exception is thrown when
    System.loadLibrary("MyLibrary");
    is executed. The exception thrown is:
    InvocationTargetException
    JAXRPCSERVLET28: Missing port information
    Does any one have any suggestions as to what might be causing this error?
    Thanks

    There are basically 3 steps to calling a native method from your Java code.
    1. Create a C/C++ stub function that will translate between your Java call and the native C method.
    2. Create the dll that exports the stub function.
    3. Invoke the System.loadLibrary("myDllName") method.
    Here's what I did to learn how to use the JNI.
    I first created the class that would be calling the dll:
    public class CallDll
    /** Creates a new instance of CallDll */
    public CallDll()
    static
    //LVtoJava is my dll name.
    System.loadLibrary("LVtoJava");
    //AddDll is the name of the function I'm exporting from my Dll
    //It does not have to be static
    public native static double AddDll(int func, double x, double y);
    I then used the javah utility in the jdk/bin directory to create the C stub header file. Once you have the generated stub header file, you can create an implementation file, and compile it into a dll.
    //My C++ stub, generated by javah utility
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class LabViewDll_CallDll */
    #ifndef IncludedLabViewDll_CallDll
    #define IncludedLabViewDll_CallDll
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: LabViewDll_CallDll
    * Method: AddDll
    * Signature: (IDD)D
    JNIEXPORT jdouble JNICALL Java_LabViewDll_CallDll_AddDll
    (JNIEnv *, jclass, jint, jdouble, jdouble);
    #ifdef __cplusplus
    #endif
    #endif
    You may want to note the stub function's signature and how it decorates the function name that you created from your Java class. Do not modify it, as the format is required by the JNI. The javah utility appends the fully qualified package name and the word Java, separated by underscores, to your original function name. You do not need to change the name in your Java class.
    All the other special key words in the function's signature are defined in the jni.h or the jni_md.h (if your using windows).
    You may want to refer to the JNI documention on Sun's website. The book I learned out of is the Core Java Volume 2, published by Sun Microsystems Press. It goes through the details of invoking your first native function and I've found it to be a good reference.
    Hope this helps,
    PS. I seemed to have found the issue with calling my dll from a web service. My dll is actually calling another dll and that seems to be the source of my problems. When I removed the call to the 2nd dll, everything worked fine. So now I need to figure out why the 2nd dll call is an issue.
    Any suggestions?

Maybe you are looking for

  • InDesign CS4 - Helvetica Neue and Mountain Lion

    Hi there, Can anyone please help? I recently updated from Snow Leopard to Mountain Lion. Since I made this transition I have had a problem with exporting HELVETICA NEUE to a PDF from CS4. This used to work perfectly fine on Snow Leopard from CS4 so I

  • Problem in STMS

    Dear All, Recently we have upgraded our Development and Quality System from ECC6 to EHP5. After upgradation I have delete QAS STMS configuration from DEV system and add again as I have shift QAS server to another server (Host name changed) QAS is add

  • None of any of the pictures on Facebook can be opened and seen on the website, I have absolutely no problem on Safari, but I would much rather use Firefox..What the heck is going on????

    About a week ago, I had no problem clicking on pictures to open them to bigger size.....As of about 4 days ago - If I try to open a picture on Facebook, it shows the comments but no picture..I don't know what is going on!!! It works fine on Safari, b

  • Calculation to split data in a field

    Hi Can anyone help me with a calculation I need (if it is possible!) I have a field (Subjective) an example of the data is "I420-PrimaryCareTrustsInc" Im want to take the data from the 6th chararcter and add a space before every letter that is in cap

  • Change the status of Sales Order

    Hi, I have a scenario wheirin I need to forcefully change the status of a sales order to complete eventhough the delivery / invoice is not complete. Reason is because the user has stopped to take further deliveries. I already have 3 deliveries / invo