Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Unable to connect to remote host

Reply
Thread Tools

Unable to connect to remote host

 
 
srithota@gmail.com
Guest
Posts: n/a
 
      04-01-2005
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)roblem 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

 
Reply With Quote
 
 
 
 
Lord0
Guest
Posts: n/a
 
      04-01-2005
"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


 
Reply With Quote
 
 
 
 
Brian McCauley
Guest
Posts: n/a
 
      04-01-2005


http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> 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)roblem 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 $!.

 
Reply With Quote
 
sri
Guest
Posts: n/a
 
      04-01-2005
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

 
Reply With Quote
 
Brian McCauley
Guest
Posts: n/a
 
      04-01-2005


sri wrote:

> 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

 
Reply With Quote
 
sri
Guest
Posts: n/a
 
      04-02-2005
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

 
Reply With Quote
 
Brian McCauley
Guest
Posts: n/a
 
      04-03-2005


sri wrote:

> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot connect to the Network Host with Remote Computer =?Utf-8?B?Sk9BVC1FT04=?= Wireless Networking 1 11-01-2006 09:44 AM
Could Not Connect To SMTP Host Connection Failed -- Software caused connection abort: connect kishore@novelteam.com Java 3 11-16-2005 03:33 PM
Remote Assistance fails to connect, remote remote host name could not be resolved Peter Sale Wireless Networking 1 12-11-2004 09:09 PM
can't connect to remote host Sid Java 1 12-04-2004 08:25 AM
can't connect to remote host Sid Java 0 12-03-2004 10:01 PM



Advertisments