Unable to connect to remote host

S

srithota

I'm running CGI program (written using perl) with Tomcat.
Cgi program written in perl has a telnet operation. It is trying to
connect to a port on a remote host. When i run the perl script as a
standalone, it works perfectly. when i try to run the same script with
tomcat server i am getting the following error.

Mar 31, 2005 9:37:21 PM org.apache.catalina.core.ApplicationContext log
INFO: cgi: runCGI (stderr):problem creating socket: Unknown error at
C:/Perl/sit
e/lib/AOLserver/CtrlPort.pm line 125

ctrlport.pm is the perl module and line 125 in the module is my $t =
Net::Telnet->new(%options);


METHOD

############################################################
sub new {
############################################################
my ($class, @options) = @_;

my %options = (
Timeout => 20,
Port => '3456',
Host => 'localhost',
Prompt => '/Ok/',
User => '',
Password => '',
@options);


Any suggestion or solution ?


Thanks.
Sri
 
L

Lord0

"I'm running CGI program (written using perl) with Tomcat.
Cgi program written in perl has a telnet operation. It is trying to
connect to a port on a remote host. When i run the perl script as a
standalone, it works perfectly. when i try to run the same script with
tomcat server i am getting the following error."

I have had a similar problems. i.e. run perl script standalone is fine. Run
under Tomcat broken. I think this could be to do with Tomcats security
settings and how it interacts with the OS, in this case Perl. You maybe want
to post on a java/tomcat group and see what get. BTW if you find an answer
let me know eh? :)

Lord0
 
B

Brian McCauley

I'm running CGI program (written using perl) with Tomcat.
Cgi program written in perl has a telnet operation. It is trying to
connect to a port on a remote host. When i run the perl script as a
standalone, it works perfectly. when i try to run the same script with
tomcat server i am getting the following error.

Mar 31, 2005 9:37:21 PM org.apache.catalina.core.ApplicationContext log
INFO: cgi: runCGI (stderr):problem creating socket: Unknown error at
C:/Perl/sit
e/lib/AOLserver/CtrlPort.pm line 125

ctrlport.pm is the perl module and line 125 in the module is my $t =
Net::Telnet->new(%options);

I suggest you look for the line that's carp()ing with the message
"problem creating socket" and include $^E alongside $!.
 
S

sri

Thanks for the response Brian. The error is araising at this line

my $t = Net::Telnet->new(%options);

You want me to add :

$^E my $t = Net::Telnet->new(%options); $!

What does these charcters do... ?

Thank you
Sri
 
B

Brian McCauley

sri said:
Thanks for the response Brian.

Please quote some context when replying as I did.
The error is araising at this line

my $t = Net::Telnet->new(%options);

No it is not, that's just where Net::Telnet has chosen to report it.

perldoc Carp
You want me to add :

$^E my $t = Net::Telnet->new(%options); $!

No, I want you do do what I said.

Find the line in Net::Telnet that is carp()ing with the message you are
seeing. You'll probably find it's already including $!, you should
insert $^E alongside.
What does these charcters do... ?

They are two of Perl's special variables, the ones that report the most
recent low-level OS error. For details:

perldoc perlvar
 
S

sri

Thanks for the tip..

I insterted $^E alongside $!. It gave me much more info....

Error is "The requested service provider could not be loaded or
initialized" . I googled this error and found that its something to do
with winsock. I could not find a solution though. Do you have any
suggestion?

Thanks for your help !!

- Srini
 
B

Brian McCauley

sri said:
I insterted $^E alongside $!. It gave me much more info....

Error is "The requested service provider could not be loaded or
initialized" . I googled this error and found that its something to do
with winsock. I could not find a solution though. Do you have any
suggestion?

Sounds most likely to be some subtle problem with the Windows security
model. This is not something I know much about.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top