Error with CGI on Tomcat
Posted by sdeshpan (sdeshpan), 30 August 2007With respect to the following link:
I am trying to set up tomcat 5.0.27 in this same way to execute CGI scripts. But when I am trying to the run the sample script given in this post, it gives the following error:
Can anyone plese help me figure out what;s wrong?
Posted by admin (Graham Ellis), 31 August 2007Not the most obvious of error message, is it? If you have followed all the rest, then I wonder what your underling OS is / is the Perl binary where the script says it should be, and the very first line the #! line - even a blank line ahead of it will cause a problem!
Posted by sdeshpan (sdeshpan), 31 August 2007on 08/31/07 at 12:38:40, Graham Ellis wrote:
I am running Tomcat 5.0.27 on a Windows XP Prof. machine. This is just a test setup to see of CGI works ok with Tomcat. Also, I am using the default CGI support JAR that comes with this version of tomcat. I followed all steps as is from the other forum post. I also checked for white spaces, I think we are ok there.
Any help is greatly appreciated!
Posted by admin (Graham Ellis), 31 August 2007If it's on Windows XP, I think you'll need to change the #! line ... even though Windows doesn't usually rely on that line but rather a file extension, I think it does within the CGI standard.
Posted by KevinAD (KevinAD), 1 September 2007on 08/31/07 at 23:45:01, Graham Ellis wrote:
It depends on the server and the sever setup. For example, apache on windows can be setup to use the shebang line (default setting) or not. But I have no experience with Tomcat so can't speak directly to the problem in this case. But the shebang line on windows is typically:
or if perl is in the command path:
Posted by sdeshpan (sdeshpan), 6 September 2007I figured this out...It was because I didn't have ActivePerl installed (smart, innit?). Once I installed it and updated the PATH environment variable, it worked fine.
But now I am facing another issue. I am trying to execute a CGI script which connects to an Oracle DB to fetch some data. When I try to run it, I am getting the following error:
Can anyone please help me figure out what I might be missing? I have already installed the DBD:: Oracle module for Perl.
Posted by admin (Graham Ellis), 7 September 2007on 09/06/07 at 18:58:41, sdeshpan wrote:
Yeah, I guess you DO need Perl to run a Perl script ... I didn't think to suggest that one!
Posted by KevinAD (KevinAD), 8 September 2007on 09/06/07 at 18:58:41, sdeshpan wrote:
How did you install DBD:racle? Did you use activestate perls PPM application?
Posted by sdeshpan (sdeshpan), 8 September 2007Kevin,
You are right...I used the PPM module to install DBD:: Oracle module...I verified the installation and it says OK.
Posted by KevinAD (KevinAD), 8 September 2007PPM is the correct way to install modules when using activestate perl. So I am not sure what the problem is. The path looks correct:
you're sure the Oracle.dll file is in the above folder?
Posted by sdeshpan (sdeshpan), 8 September 2007Yes, I verified that the Oracle.dll file is at that location. The fact that it tries for the correction file location, looks like I have all the environment variables set properly too.
I too wonder what else might be wrong!!
Posted by KevinAD (KevinAD), 8 September 2007I see plenty of qestions related to Oracle on perl forums. It seems to be a bit tricky to get setup and running. Unfortunatly I have no experience with Oracle so I have no further suggestion for you. Unless Graham has a suggestion, and his doesn't mind me posting the name of another forum, you should ask at www.perlmonks.com
remove the reference to the other forum if that is not appropriate to post here.
Posted by admin (Graham Ellis), 8 September 2007Quote:
Kevin - I'm perfectly happy with relevant links such as this.
Posted by sdeshpan (sdeshpan), 10 September 2007Thanks for all the help guys!
I was able to get past that error by a little dirty trick. I copied the OCI.dll file (and couple of other files) from ORACle_HOME/bin directory to Perl/bin and the DBD directory.
Now I seem to be going a little further where it is trying to establish a connection with the DB, but throws this error:
I checked the TNSNAMES file and I am able to successfully ping and tnsping to the <hostname>. I wonder what might still be missing!
Posted by KevinAD (KevinAD), 10 September 2007I personally have no idea. I don' t think I will be able to help you with this problem.
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho