Can servlets/ jsp automatically run perl scripts and executables?

I'm a student and am new to to servlets and web programming in general.
I need to know if it's possible to run perl scripts and executables automatically from servlets/ jsp.
The program I am planning on creating should have a client outside a firewall that uploads perl files to a gateway machine inside the firewall, the servlet should be able to run this perl file, and then pass the resulting file as an argument to an executable, to be run by another servlet on a different server.
I've tried looking everwhere for an answer to this and am about to revert to a cgi based approach because I'm not sure if it would work so any help/ suggestions would be much appreciated.

Hallo,
I think using java Runtime will help. you can do Processes that execute shell or system commands through
Process process = Runtime.getRuntime().exec("your perl scripts here!");
Bye

Similar Messages

  • Can I run perl scripts on a iplanet App Server instead of web server

    Hello,
    We have some perl scripts running on a iWS 6.0 in DMZ (Tier1) which acess Oracle Server(Tier 3). I want to restrict machines on DMZ access Oracle server directly. Instead I want all the database calls to orignate from iPlanet App server on Tier 2. To make this happen I have to run Perl scripts on App server. Is this feasible as the J2EE iPlanet App can run only C++ or Java.. Any leads helps me lot..
    Thanks
    Sudhir Nallagangu

    According to the J2EE specs you should use EJBs and Servlets in the iAS! Running a perl script for db access sounds like good old cgi times.
    But generally it is possible to call a perl script from within iAS. But don't do it!

  • Run perl script on remote server

    Hello
    I have 2 servers, server 1 and server2.
    I have a perl script on server2 and I want to execute that perl script so my code is like
    $command= { param($p1,$p2) cmd /c test.pl $p1 $p2 }
    Invoke-Command -session $sesion -ScriptBlock $command -ArgumentList 1,2
    session is already created with server2 from server1. 
    perl script kept on server2 spawn another cmd which interacts with server3.
    When I run above code that perl script start executing but it stays in executing step for infinite time..as per observation, I have found that it stucks when it tried to spawn another cmd which interacts with server3 from server2.
    How can I handle this?

    Second hop restriction and some issue in the perl script that prevents it from honoring the error.
    Run script interactively to test results.
    Enter-PsSession $session
    Type your command and see if you see an error.
    \_(ツ)_/

  • Run Perl script in JAVA

    Can we run perl scripts in java, still supporting perl API?
    Thanks a lot for help!

    I haven't tried it but I think 6.0 supports some
    scripting.But NOT perl!Sorry, I didn't mean some Perl Scripting. I meant some scripting and I wasn't sure what languages.

  • How to run Perl script in Java program?

    Some say that the following statement can run Perl script in Java program:
    Runtime.getRuntime().exec("C:\\runPerl.pl");
    But when I run it, it'll throw IOException:
    java.io.IOException: CreateProcess: C:\runPerl.pl error=193
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:63)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:566)
    at java.lang.Runtime.exec(Runtime.java:428)
    at java.lang.Runtime.exec(Runtime.java:364)
    at java.lang.Runtime.exec(Runtime.java:326)
    at test.runPerl.main(runPerl.java:16)
    Exception in thread "main"
    Where is the problem? In fact, I do have a Perl script named "runPerl.pl" in my C:/ directory. Could anybody tell me why it can't be run? Thanks in advance.

    Hello sabre,
    First of all thanks for your reply.
    I have tried like what you mentioned.
    Eventhough, i could get the exact error message.
    I could get the Exception
    "Exception:java.lang.IllegalThreadStateException: process hasn't exited"
    <code>
    import java.io.*;
    public class Sample{
    public static void main(String args[]) {
    String s = null;
    Process p;
    try
         p = Runtime.getRuntime().exec("tar -vf sample.tar");
         //p.waitFor();
         if(p.exitValue() == 0)
              System.out.println("CommandSuccessful");
         else
              System.out.println("CommandFailure");
    catch(Exception ex)
         System.out.println("Exception:"+ex.toString());
    </code>
    In this code, i tried to run the "tar command". In this command i have given -vf instead -xvf.
    But it is throwing
    "Error opening message catalog 'Logging.cat': No such file or directory
    Exception:java.lang.IllegalThreadStateException: process hasn't exited
    CommandFailure"
    "Error opening message catalog 'Logging.cat'" what this line means ie,
    I dont know what is Logging.cat could you explain me its urgent.
    Thanks in advance.
    Rgds
    tskarthikeyan

  • Running "nightly scripts" and other behind the scenes tasks

    I keep seeing posts about how the iMac Intel runs nightly scripts and/or other tasks behind the scenes. There is no mention of this in the user manual nor does Apple warn you about not putting the computer to sleep so that these tools will run. My iMac hard drive is asleep every night (as am I...) how can I get these things to run manually? How often? And can someone point me to literature to support this info?
    Thanks much,
    HS

    522/2968
    Hi HS,
    "There is no mention of this in the user manual"
    That's because the three nightly maintenance scripts are not important at all, and don't affect Mac OS X performance.
    They are only a relic from the glorious Unix system times when it was used on rather small capacities HDs, on computers that were running non stop for months or years...
    Running them yourself manually, as a "perfectionist measure", can be done easily using the "daily, weekly & monthly" features in OnyX or Cocktail for example. All three tasks together, once a month or so, is fine. No harm (but useless) rerunning them many times.
    Litterature:
    The KB article is quite old, it shows only the default 10.2 times and commands:
    - http://docs.info.apple.com/article.html?artnum=107388
    (almost same as 10.3 and 10.4 though)
    What I really would like to learn, is whether the scripts have been modified in the Intel version of Tiger.
    Could you please (or Joseph or somebody else), in Finder, Go To (shiftcommandG) this folder:
    /private/etc/
    see if there is still the same
    /private/etc/periodic
    folder, with the three
    /private/etc/periodic/daily
    /private/etc/periodic/weekly
    and
    /private/etc/periodic/monthly
    scripts?
    (I'm asking because I don't own an Intel Mac myself).
    Next you would Go To (⇧⌘G) this folder:
    /System/Library/LaunchDaemons
    please, see if you find those three files
    /System/Library/LaunchDaemons/com.apple.periodic-daily.plist
    /System/Library/LaunchDaemons/com.apple.periodic-weekly.plist
    and
    /System/Library/LaunchDaemons/com.apple.periodic-monthly.plist
    If they are still there, you can open them (with TextEdit if your Developer Tools are not installed), and read the default times when the tasks are scheduled to run.
    Thanks in advance!
    Axl

  • Run Perl script in my Java program

    Some say that the following statement can run Perl script in Java program:
    Runtime.getRuntime().exec("C:\\runPerl.pl");
    But when I run it, it'll throw IOException:
    java.io.IOException: CreateProcess: C:\runPerl.pl error=193
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:63)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:566)
    at java.lang.Runtime.exec(Runtime.java:428)
    at java.lang.Runtime.exec(Runtime.java:364)
    at java.lang.Runtime.exec(Runtime.java:326)
    at test.runPerl.main(runPerl.java:16)
    Exception in thread "main"
    Where is the problem? In fact, I do have a Perl script named "runPerl.pl" in my C:/ directory. Why can't it be run?

    Please don't crosspost
    http://forum.java.sun.com/thread.jspa?threadID=703918

  • Automaticly run Program\Script After and MSI Installation

    Hi All,
    Today I started looking into the use of Application Model in SCCM 2012.
    It was easy to create an application by using the import MSI function, which automatically created the application, deployment type and detection rule. But I'm struggling with how to run a script afterwards, when the MSI installation was successful.
    I've looked into creating 2nd deployment type making the first deployment type as it's dependency, but it's mandatory that I also need to make an detection rule. And this is where I'm stuck ass the detection rule I want to have the same as
    for the first deployment type which will make it impossible to run because the condition will be evaluated ass already installed.
    Is there a way to avoid the detection rule? If not is if possible trigger something after the first deployment type based on the errorlevel after the MSI installation.
    My goal is to write a regkey  somewhere in HKLM\Software\<company name> after an successful installation of an application. This location we've included in our hardware inventory for reporting purposes.
    Any suggestions to achieve this goal are welcome .
    Regards,
    Daniel

    I've resolved it with using the AddDploymentTypebyMISInstallerAuto function from the Add-CMDeployment command and provided an InstallationProgram parameter to override the default InstallationProgram.
    The comman-line looks like
    Add-CMDeploymentType
    -ApplicationName <Name>
    -AutoIdentifyFromInstallationFile
    -ForceForUnknownPublisher $True `
    -InstallationFileLocation
    <MSI
    File> -MsiInstaller
    -DeploymentTypeName
    Test1 –InstallationBehaviorType InstallForSystem
    -InstallationProgram
    < Custom
    Script>
    In this way I have the detection based on the MSI GUID and the ability to use a wrapper script.

  • ANM VA - run perl script to obtain and genarate reports.

    Good day,
    We have a customer who has an ANM deployment at a site. This is a HA deployment on RedHat. The customer created a perl script to run off an external host to generate reports. This was acheievd by querying the sqldatabase (dcm_ems). ANM version is 3.2. No problems.
    An additional ANM deployment was done on another site. ANM version 4.2. This deployment is the VA edition. They would like to deploy and run the same perl script.
    Is this possible on the VA Edition? Even with the RootPatch? Not sure of the level of access the patch provides, or if it is even recommened or would then still allow for the ANM to be supported? If possible, has the sqldatabase structure changed (suppose would need this for the guy's to ammend the script)? How would we obtain the "sqluser" and "sqlpwd" info for the perl script to use?
    Appreciate any guidance or feedback.
    Thank you in advance.
    Paul.

    Hi esteemed forum members,
    Any ideas or feedback anyone?
    Thanks.
    Paul.

  • Problem in running Perl script through oracle

    Hi,
    I am facing one problem in perl script.
    " I have one perl script which is interact with sybase database.We have migrated the sybase database to oracle successfully.Now i wanna to change the perl script to interact with oracle database.
    I am using the code like that for interacting the oracle database
    Old Code with sybase database : use DBI::Sybase::GFAS;
    New code with oracle database : Use DBI::oracle::GFAS;
    When i am running the perl script,Its showing the below mentioned error:
    Can't locate DBI/oracle.pm in @INC (@INC contains: C:\oracle\product\10.2.0\db_1
    \perl\5.8.3\lib\MSWin32-x86 C:\oracle\product\10.2.0\db_1\perl\5.8.3\lib/MSWin32
    -x86-multi-thread C:\oracle\product\10.2.0\db_1\perl\5.8.3\lib C:\oracle\product
    \10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86 C:\oracle\product\10.2.0\db_1\perl\site\
    5.8.3 C:\oracle\product\10.2.0\db_1\perl\site\5.8.3\lib/MSWin32-x86-multi-thread
    C:\oracle\product\10.2.0\db_1\perl\site\5.8.3\lib C:\oracle\product\10.2.0\db_1
    \sysman\admin\scripts C:/Perl/lib C:/Perl/site/lib .) at hello.pl line 4.
    BEGIN failed--compilation aborted at hello.pl line 4.
    Anyone have any idea about this error.
    Thx in advance.

    If you look in the oracle home in the perl\site\5.8.3\lib\MSWin32-x86-multi-thread directory you will see two directories. Once is DBI and one is DBD.
    All you need in your perl program is a line 'use DBI'. It will use DBD automatically as and when required. You can specify the necessary connection information when you issue the DBI->connect statement.
    I have successfully managed to connect to Oracle databases and perform DML using the software installed by default. You don't need to download and install anything else.
    I'm no perl expert so maybe some functionality is missing using the interfaces provided by Oracle but for my needs it has sufficed.
    Hope this helps.

  • Running perl scripts off the preinstall script during a pkgadd

    Hello,
    I'm trying to build a custom package (apache2 + mysql + php + other stuff) and get stuck on some stone wall that I can't figure.
    Correct me if I'm wrong in my assumptions, and if able, could you provide a work around ? Here it is :
    - The preinstall script must be in /bin/sh , /bin/bash or any valid shell
    - Must be run by root, 'f course
    Now.. As I'm not that strong on bash/sh scripting, I tried to call a perl script off my preinstall script. Somehow my preinstall script just never call the .pl .
    This leads me to my third assumption :
    - It is impossible, not permissible to run other scripts from the preinstall script.
    Basically the perl script checks for some users in /etc/passwd + /etc/group, checks for some directories, create a custom SMF manifest, etc etc . I pretty much want the .pl script to be run.
    The script itself is well packaged, correctly inserted in the package's pkgmap, and so on.
    Any ideas ?
    Thanks,
    Jeff

    The script itself is well packaged, correctly inserted in the package's pkgmap, and so on.http://docs.sun.com/app/docs/doc/817-0406/ch3enhancepkg-10289?a=view

  • Calling the DTExec from Perl Script and need to get the Return Value (Sucess or Failure)

    I am able to execute the SSIS Package from Perl Script using DTExec. But i need to get the return code of the SSIS Execution. Is their any option available to get the Success or Failure information from Perl ?

    Exit codes returned from dtexec utility             
    When a package runs, dtexec can return an exit code. The exit code is used to populate the ERRORLEVEL variable, the value of which can then be tested in conditional statements or branching logic within a batch file. The following table lists
    the values that the dtexec utility can set when exiting.
    http://technet.microsoft.com/en-us/library/hh231187.aspx
    There's a wrinkle if the package is running in the SSIS Catalog:
    http://www.mattmasson.com/2012/02/exit-codes-dtexec-and-ssis-catalog/
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Cron running Perl script causes Out Of Memory at 63000kb

    Hi,
    I run a script to record an internet steam at set times using cron (i'm using icecream, a perl script). This runs fine when executed by 'at' or manually form the command line, but when it is started by cron it dies with the error 'Out of memory!'. The machine isn't extremely powerful but is more than capable of doing this simple task!
    From my research I understand that it may have something to do with the /etc/security/limits.conf file, though apparently changing these values often don't have the desired effects.
    The output of 'ulimit -a' is as follows (I can't see any limiting factors here):
    [aratclif@server ~]$ ulimit -a
    core file size (blocks, -c) 0
    data seg size (kbytes, -d) unlimited
    scheduling priority (-e) 20
    file size (blocks, -f) unlimited
    pending signals (-i) 1931
    max locked memory (kbytes, -l) 64
    max memory size (kbytes, -m) unlimited
    open files (-n) 1024
    pipe size (512 bytes, -p) 8
    POSIX message queues (bytes, -q) 819200
    real-time priority (-r) 0
    stack size (kbytes, -s) 8192
    cpu time (seconds, -t) unlimited
    max user processes (-u) 1931
    virtual memory (kbytes, -v) unlimited
    file locks (-x) unlimited
    [aratclif@server ~]$
    and the crond.log output when it died is here (there is nothing else of any relevance in the log - just a load of song names broadcasted by the stream!)
    (aratclif) CMDOUT (
    LED ZEPPELIN - WHOLE LOTTA LOVE [63000 K]Out of memory!)
    The command is started by my user's crontab and so the ulimit displayed by cron is the same as when executed from the command line:
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1308]: (aratclif) CMD (ulimit -a)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (core file size (blocks, -c) 0)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1309]: (CRON) EXEC FAILED (/usr/sbin/sendmail): No such file or directory
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (data seg size (kbytes, -d) unlimited)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (scheduling priority (-e) 20)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (file size (blocks, -f) unlimited)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (pending signals (-i) 1931)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (max locked memory (kbytes, -l) 64)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (max memory size (kbytes, -m) unlimited)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (open files (-n) 1024)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (pipe size (512 bytes, -p) 8)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (POSIX message queues (bytes, -q) 819200)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (real-time priority (-r) 0)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (stack size (kbytes, -s) 8192)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (cpu time (seconds, -t) unlimited)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (max user processes (-u) 1931)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (virtual memory (kbytes, -v) unlimited)
    Apr 10 23:06:01 localhost /USR/SBIN/CROND[1307]: (aratclif) CMDOUT (file locks (-x) unlimited)
    Any help would be greatly appreciated!
    Thanks!
    Last edited by ajratcliffe (2012-04-10 23:13:01)

    No, the files are all the same. It seems like just a few are causing the issue, and what's weird, is some of them are cut versions from clips that elsewhere in the timeline render fine.

  • Automatically run shell script after publishing?

    Is there any way to automatically run a  shell script  after publishing?
    I would like to do some postprocessing on the remote server.
    The remote server is not mobileme,  so a tool like iwebenhancer  will not work.
    I will appreciate all kinds of tips and tricks and suggestions.
    best regards, Gabriel.

    So the Detect Change is to detect a change in the web page that the code is embedded, right?
    The only workaround would be, if you can modify what's in the ChangeDetection window is to not automatically enter the page but put in a red note to enter the page you want to be notified about.
    So instead of this:
    You would have this:
    where the visitor would have to copy and past the URL into the field.  Obviously not automatic. But might work if you can modify what is said in the window and not have the page automatically be entered.

  • Applescript Studio Beginner - Run a script and display a window

    Hi,
    I am new to applescript studio ; I found out how to make an application displaying a window with a progress bar.
    How can I start running a script without displaying any window, and at some time in the script, run the "awake from nib" handler that will call the display of the progress bar ?
    Thanks,
    Nicolas

    Nicolas Silvestre wrote:
    How can I start running a script without displaying any window, and at some time in the script, run the "awake from nib" handler that will call the display of the progress bar ?
    The "awake from nib" handler is called automatically when your nib file gets loaded, you don't call it yourself. I suppose you could go thru the pain of putting your window into a separate nib file and then have your script load the nib file when you're ready... but that's not the easiest way to do it and you probably don't need to do this for your situation.
    All you really need to do is go into Interface Builder, select your window object and uncheck the checkbox in the "Window Attributes" pane that says "Visible At Launch". The "awake from nib" will still be called at it's normal time and your window will be loaded but it will not be displayed.
    Then you can do whatever other scripting you need to do... and when you're ready to display your window you simply call:
    show window "yourWindowsAppleScriptName"
    You can do your initial scripting at the beginning of "awake from nib" and then call "show window" at the tail end of "awake from nib" if that works for you. But you don't have to have the "show window" call in your "awake from nib"... you can call it later on in some other handler if you need to.
    Steve

Maybe you are looking for

  • Installer works once, but never again

    I created an installer using PackageMaker. This package installs my app bundle and a local copy of postgres 9.1. I also created an uninstaller that runs the Postgresql un-installer script, removes my app bundle and uses pkgutil to "forget" the receip

  • TS2662 my new magic mouse scrolling & swiping will not work

    my new magic mouse scrolling & swiping will not work. Help??

  • Adding Standard Infotype to custom Infotype

    Hi All, I got a requirment,pls let me know the procedure to do same.... I have to create Custom infotype with all fields of the given Standard Infotype ...and the custom fields given by client......... pls tell me how to procedd and do the needful. T

  • A verry complex work

    Hello I have a verry complex problem. First I will you tell what is it. I have to do an application with Oracle-Forms and the database is oracle 9i. The operation system is Open VMS. Webserver Apache 2.0 with Jinitiator OC4 (OC4 I'm not shure for the

  • General questions about ditial signatures with livecycle

    Hi, I am interested in knowing the process how a user with Adobe Livecycle ES is able to sign one or more documents with a smartcard. eg. digitally signing 10 or 100 documents with his smartcard. Is it generally possible without downloading all those