Unable to connect to remote host

Discussion in 'Perl Misc' started by srithota@gmail.com, Apr 1, 2005.

  1. Guest

    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
     
    , Apr 1, 2005
    #1
    1. Advertising

  2. Lord0 Guest

    "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
     
    Lord0, Apr 1, 2005
    #2
    1. Advertising

  3. 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):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 $!.
     
    Brian McCauley, Apr 1, 2005
    #3
  4. sri Guest

    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
     
    sri, Apr 1, 2005
    #4
  5. 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
     
    Brian McCauley, Apr 1, 2005
    #5
  6. sri Guest

    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
     
    sri, Apr 2, 2005
    #6
  7. 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.
     
    Brian McCauley, Apr 3, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marisha
    Replies:
    0
    Views:
    1,238
    Marisha
    Mar 27, 2006
  2. Sid
    Replies:
    0
    Views:
    456
  3. Sid
    Replies:
    1
    Views:
    478
    Andrew Thompson
    Dec 4, 2004
  4. Replies:
    3
    Views:
    40,659
    Roedy Green
    Nov 16, 2005
  5. Replies:
    2
    Views:
    326
Loading...

Share This Page