[FTP] malformed reply string

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[FTP] malformed reply string

Ravyts, Sofie
Hey,

         
        I have a problem with using the ftp client.
        I'm trying to login to a ftp server, but I get a
MalformedServerReplyException because the first reply string does not
start with a number (it is "tralpd211"?)
         
       

        * org.apache.commons.net.MalformedServerReplyException:
Could not parse response code.
        * Server Reply: tralpd211
        * at
org.apache.commons.net.ftp.FTP.__getReply(FTP.java:280)
        * at
org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:456)
        * at
org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:484)
        * at org.apache.commons.net.ftp.FTP.user(FTP.java:634)
        * at
org.apache.commons.net.ftp.FTPClient.login(FTPClient.java:622)
        * ...

         
        If I use SmartFTP to the same server smartftp can handle this,
and the commons-ftp library can't...
        Is there a way I can make the library handle these kind of
replies?
         
         
        SmartFTP output:
         
        USER sora

        tralpd211

        trapcd037 FTP server (tnftpd 20040810) ready.

        331 Password required for sora.

         

         
         
        Wkr, Sofie

Reply | Threaded
Open this post in threaded view
|

Metrics for commons DBCP

Diego Cueva
Hello:

Somebody knows how I can know the amounts of DB connections are being
used in a determinate moment.

I need this information to carry of a monitoring of my app, part of
monitoring is know how much connections are free and used.

Thanks a lot.


Att.

Diego




TODO1 SERVICES, INC. -TODO1- es la propietaria de la informaci?n contenida
en este mensaje y sus anexos, que puede tener car?cter confidencial y ha
sido enviada para uso exclusivo del destinatario intencional. Si usted ha
recibido este mensaje por error, por favor informe de ello al remitente a la
mayor brevedad y elimine este mensaje y sus anexos. Est? prohibido su uso,
distribuci?n, divulgaci?n o almacenamiento, salvo autorizaci?n escrita de
TODO1. Todo mensaje enviado y/o recibido por TODO1 es monitoreado por
motivos operativos y actuando de acuerdo con pr?cticas de negocio y de
seguridad leg?timas.

TODO1 SERVICES, INC. -TODO1- is the proprietary of the information contained
herein and its attachments, that may have confidential character and has
been sent to the intended recipient only. If you are not the intended
recipient, please contact the sender immediately by replying to this e-mail
and delete the message and its attachments. The use, forward, disclosure,
record or retention of this message for any purpose whatsoever, is strictly
prohibited, unless prior written authorization from TODO1. E-mails to and
from TODO1 are monitored for operational reasons and in accordance with
lawful business and security practices.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Metrics for commons DBCP

Pramodh Peddi
org.apache.commons.dbcp.BasicDataSource has methods like getNumActive(), getNumIdle(), etc methods.

Did I answer your question?

Pramodh.

-----Original Message-----
From: Diego Cueva [mailto:[hidden email]]
Sent: Tuesday, August 02, 2005 10:30 AM
To: 'Jakarta Commons Users List'
Subject: Metrics for commons DBCP

Hello:

Somebody knows how I can know the amounts of DB connections are being
used in a determinate moment.

I need this information to carry of a monitoring of my app, part of
monitoring is know how much connections are free and used.

Thanks a lot.


Att.

Diego




TODO1 SERVICES, INC. -TODO1- es la propietaria de la información contenida
en este mensaje y sus anexos, que puede tener carácter confidencial y ha
sido enviada para uso exclusivo del destinatario intencional. Si usted ha
recibido este mensaje por error, por favor informe de ello al remitente a la
mayor brevedad y elimine este mensaje y sus anexos. Está prohibido su uso,
distribución, divulgación o almacenamiento, salvo autorización escrita de
TODO1. Todo mensaje enviado y/o recibido por TODO1 es monitoreado por
motivos operativos y actuando de acuerdo con prácticas de negocio y de
seguridad legítimas.

TODO1 SERVICES, INC. -TODO1- is the proprietary of the information contained
herein and its attachments, that may have confidential character and has
been sent to the intended recipient only. If you are not the intended
recipient, please contact the sender immediately by replying to this e-mail
and delete the message and its attachments. The use, forward, disclosure,
record or retention of this message for any purpose whatsoever, is strictly
prohibited, unless prior written authorization from TODO1. E-mails to and
from TODO1 are monitored for operational reasons and in accordance with
lawful business and security practices.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Metrics for commons DBCP

Diego Cueva
Thanks a lot for your answer, but the result is always 0.

I am applying your suggestion in this way:

libre = Runtime.getRuntime().freeMemory();
total = Runtime.getRuntime().totalMemory();
usada = total - libre;
       
org.apache.commons.dbcp.BasicDataSource o = new
org.apache.commons.dbcp.BasicDataSource();
       
Log.logEvent("MEM T U L: "+ total + "  "+ usada+ "  "+libre+
" act="+o.getNumActive() + " idl="+o.getNumIdle());
               
But the result is always 0, this is a log extract example from a test
load:

2005-08-02 14:55:23|MEM T U L: 48746496  28956352  19790144 act=0 idl=0
2005-08-02 14:55:23|MEM T U L: 48746496  27750072  20996424 act=0 idl=0
2005-08-02 14:55:25|MEM T U L: 48746496  25458960  23287536 act=0 idl=0

I am using commons-dbcpool embedded in Hibernate, with the next
configuration:

        <!--  connection pool -->
        <property name="dbcp.maxActive">10</property>
        <property name="dbcp.whenExhaustedAction">2</property>
        <property name="dbcp.maxWait">20</property>
        <property name="dbcp.maxIdle">20</property>

        <!-- prepared statement cache -->
        <property name="dbcp.ps.maxActive">10</property>
        <property name="dbcp.ps.whenExhaustedAction">2</property>
        <property name="dbcp.ps.maxWait">20</property>
        <property name="dbcp.ps.maxIdle">20</property>

Att.
Diego

-----Original Message-----
From: Pramodh Peddi [mailto:[hidden email]]
Sent: Tuesday, August 02, 2005 14:17
To: Jakarta Commons Users List
Subject: RE: Metrics for commons DBCP

org.apache.commons.dbcp.BasicDataSource has methods like getNumActive(),
getNumIdle(), etc methods.

Did I answer your question?

Pramodh.

-----Original Message-----
From: Diego Cueva [mailto:[hidden email]]
Sent: Tuesday, August 02, 2005 10:30 AM
To: 'Jakarta Commons Users List'
Subject: Metrics for commons DBCP

Hello:

Somebody knows how I can know the amounts of DB connections are being
used in a determinate moment.

I need this information to carry of a monitoring of my app, part of
monitoring is know how much connections are free and used.

Thanks a lot.


Att.

Diego




TODO1 SERVICES, INC. -TODO1- es la propietaria de la información
contenida
en este mensaje y sus anexos, que puede tener carácter confidencial y ha
sido enviada para uso exclusivo del destinatario intencional. Si usted
ha
recibido este mensaje por error, por favor informe de ello al remitente
a la
mayor brevedad y elimine este mensaje y sus anexos. Está prohibido su
uso,
distribución, divulgación o almacenamiento, salvo autorización escrita
de
TODO1. Todo mensaje enviado y/o recibido por TODO1 es monitoreado por
motivos operativos y actuando de acuerdo con prácticas de negocio y de
seguridad legítimas.

TODO1 SERVICES, INC. -TODO1- is the proprietary of the information
contained
herein and its attachments, that may have confidential character and has
been sent to the intended recipient only. If you are not the intended
recipient, please contact the sender immediately by replying to this
e-mail
and delete the message and its attachments. The use, forward,
disclosure,
record or retention of this message for any purpose whatsoever, is
strictly
prohibited, unless prior written authorization from TODO1. E-mails to
and
from TODO1 are monitored for operational reasons and in accordance with
lawful business and security practices.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Metrics for commons DBCP

Brian Cook

It is coming up zero because your
org.apache.commons.dbcp.BasicDataSource instance is never being used.
To use org.apache.commons.dbcp.BasicDataSource you would have to have
something like :


        BasicDataSource ds = new BasicDataSource();
         ds.setDriverClassName("com.mysql.jdbc.Driver");
         ds.setUsername("userName");
         ds.setPassword("password");
         ds.setUrl(connectURI);
         Connection con = null;
       try {
         con = ds.getConnection();
       }
       catch(Exception a){  ...........  }

The problem here is that every time you create an instance
BasicDataSource you are creating an entire new pool.  So you can quickly
over run the system number of connections.  As I found out the hard way.
  If you are using JNDI then you are using the DataSource object not the
BasicDataSource object.



Diego Cueva wrote:

> Thanks a lot for your answer, but the result is always 0.
>
> I am applying your suggestion in this way:
>
> libre = Runtime.getRuntime().freeMemory();
> total = Runtime.getRuntime().totalMemory();
> usada = total - libre;
>
> org.apache.commons.dbcp.BasicDataSource o = new
> org.apache.commons.dbcp.BasicDataSource();
>        
> Log.logEvent("MEM T U L: "+ total + "  "+ usada+ "  "+libre+
> " act="+o.getNumActive() + " idl="+o.getNumIdle());
>
> But the result is always 0, this is a log extract example from a test
> load:
>
> 2005-08-02 14:55:23|MEM T U L: 48746496  28956352  19790144 act=0 idl=0
> 2005-08-02 14:55:23|MEM T U L: 48746496  27750072  20996424 act=0 idl=0
> 2005-08-02 14:55:25|MEM T U L: 48746496  25458960  23287536 act=0 idl=0
>
> I am using commons-dbcpool embedded in Hibernate, with the next
> configuration:
>
> <!--  connection pool -->
> <property name="dbcp.maxActive">10</property>
> <property name="dbcp.whenExhaustedAction">2</property>
> <property name="dbcp.maxWait">20</property>
> <property name="dbcp.maxIdle">20</property>
>
> <!-- prepared statement cache -->
> <property name="dbcp.ps.maxActive">10</property>
> <property name="dbcp.ps.whenExhaustedAction">2</property>
> <property name="dbcp.ps.maxWait">20</property>
> <property name="dbcp.ps.maxIdle">20</property>
>
> Att.
> Diego
>
> -----Original Message-----
> From: Pramodh Peddi [mailto:[hidden email]]
> Sent: Tuesday, August 02, 2005 14:17
> To: Jakarta Commons Users List
> Subject: RE: Metrics for commons DBCP
>
> org.apache.commons.dbcp.BasicDataSource has methods like getNumActive(),
> getNumIdle(), etc methods.
>
> Did I answer your question?
>
> Pramodh.
>
> -----Original Message-----
> From: Diego Cueva [mailto:[hidden email]]
> Sent: Tuesday, August 02, 2005 10:30 AM
> To: 'Jakarta Commons Users List'
> Subject: Metrics for commons DBCP
>
> Hello:
>
> Somebody knows how I can know the amounts of DB connections are being
> used in a determinate moment.
>
> I need this information to carry of a monitoring of my app, part of
> monitoring is know how much connections are free and used.
>
> Thanks a lot.
>
>
> Att.
>
> Diego
>
>
>
>
> TODO1 SERVICES, INC. -TODO1- es la propietaria de la informaci?n
> contenida
> en este mensaje y sus anexos, que puede tener car?cter confidencial y ha
> sido enviada para uso exclusivo del destinatario intencional. Si usted
> ha
> recibido este mensaje por error, por favor informe de ello al remitente
> a la
> mayor brevedad y elimine este mensaje y sus anexos. Est? prohibido su
> uso,
> distribuci?n, divulgaci?n o almacenamiento, salvo autorizaci?n escrita
> de
> TODO1. Todo mensaje enviado y/o recibido por TODO1 es monitoreado por
> motivos operativos y actuando de acuerdo con pr?cticas de negocio y de
> seguridad leg?timas.
>
> TODO1 SERVICES, INC. -TODO1- is the proprietary of the information
> contained
> herein and its attachments, that may have confidential character and has
> been sent to the intended recipient only. If you are not the intended
> recipient, please contact the sender immediately by replying to this
> e-mail
> and delete the message and its attachments. The use, forward,
> disclosure,
> record or retention of this message for any purpose whatsoever, is
> strictly
> prohibited, unless prior written authorization from TODO1. E-mails to
> and
> from TODO1 are monitored for operational reasons and in accordance with
> lawful business and security practices.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Brian Cook
Digital Services Analyst
Print Time Inc.
[hidden email]
913.345.8900


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: Metrics for commons DBCP

Diego Cueva
OK thanks:

I am going to try to retrieve the DataSource created by Hibernate, in
this way I can try to cast it to BasicDataSource.

Thanks for your time.

Att.
Diego Cueva.

-----Original Message-----
From: Brian Cook [mailto:[hidden email]]
Sent: Tuesday, August 02, 2005 15:39
To: Jakarta Commons Users List
Subject: Re: Metrics for commons DBCP


It is coming up zero because your
org.apache.commons.dbcp.BasicDataSource instance is never being used.
To use org.apache.commons.dbcp.BasicDataSource you would have to have
something like :


        BasicDataSource ds = new BasicDataSource();
         ds.setDriverClassName("com.mysql.jdbc.Driver");
         ds.setUsername("userName");
         ds.setPassword("password");
         ds.setUrl(connectURI);
         Connection con = null;
       try {
         con = ds.getConnection();
       }
       catch(Exception a){  ...........  }

The problem here is that every time you create an instance
BasicDataSource you are creating an entire new pool.  So you can quickly

over run the system number of connections.  As I found out the hard way.

  If you are using JNDI then you are using the DataSource object not the

BasicDataSource object.



Diego Cueva wrote:

> Thanks a lot for your answer, but the result is always 0.
>
> I am applying your suggestion in this way:
>
> libre = Runtime.getRuntime().freeMemory();
> total = Runtime.getRuntime().totalMemory();
> usada = total - libre;
>
> org.apache.commons.dbcp.BasicDataSource o = new
> org.apache.commons.dbcp.BasicDataSource();
>        
> Log.logEvent("MEM T U L: "+ total + "  "+ usada+ "  "+libre+
> " act="+o.getNumActive() + " idl="+o.getNumIdle());
>
> But the result is always 0, this is a log extract example from a test
> load:
>
> 2005-08-02 14:55:23|MEM T U L: 48746496  28956352  19790144 act=0
idl=0
> 2005-08-02 14:55:23|MEM T U L: 48746496  27750072  20996424 act=0
idl=0
> 2005-08-02 14:55:25|MEM T U L: 48746496  25458960  23287536 act=0
idl=0

>
> I am using commons-dbcpool embedded in Hibernate, with the next
> configuration:
>
> <!--  connection pool -->
> <property name="dbcp.maxActive">10</property>
> <property name="dbcp.whenExhaustedAction">2</property>
> <property name="dbcp.maxWait">20</property>
> <property name="dbcp.maxIdle">20</property>
>
> <!-- prepared statement cache -->
> <property name="dbcp.ps.maxActive">10</property>
> <property name="dbcp.ps.whenExhaustedAction">2</property>
> <property name="dbcp.ps.maxWait">20</property>
> <property name="dbcp.ps.maxIdle">20</property>
>
> Att.
> Diego
>
> -----Original Message-----
> From: Pramodh Peddi [mailto:[hidden email]]
> Sent: Tuesday, August 02, 2005 14:17
> To: Jakarta Commons Users List
> Subject: RE: Metrics for commons DBCP
>
> org.apache.commons.dbcp.BasicDataSource has methods like
getNumActive(),

> getNumIdle(), etc methods.
>
> Did I answer your question?
>
> Pramodh.
>
> -----Original Message-----
> From: Diego Cueva [mailto:[hidden email]]
> Sent: Tuesday, August 02, 2005 10:30 AM
> To: 'Jakarta Commons Users List'
> Subject: Metrics for commons DBCP
>
> Hello:
>
> Somebody knows how I can know the amounts of DB connections are being
> used in a determinate moment.
>
> I need this information to carry of a monitoring of my app, part of
> monitoring is know how much connections are free and used.
>
> Thanks a lot.
>
>
> Att.
>
> Diego
>
>
>
>
> TODO1 SERVICES, INC. -TODO1- es la propietaria de la información
> contenida
> en este mensaje y sus anexos, que puede tener carácter confidencial y
ha
> sido enviada para uso exclusivo del destinatario intencional. Si usted
> ha
> recibido este mensaje por error, por favor informe de ello al
remitente

> a la
> mayor brevedad y elimine este mensaje y sus anexos. Está prohibido su
> uso,
> distribución, divulgación o almacenamiento, salvo autorización escrita
> de
> TODO1. Todo mensaje enviado y/o recibido por TODO1 es monitoreado por
> motivos operativos y actuando de acuerdo con prácticas de negocio y de
> seguridad legítimas.
>
> TODO1 SERVICES, INC. -TODO1- is the proprietary of the information
> contained
> herein and its attachments, that may have confidential character and
has

> been sent to the intended recipient only. If you are not the intended
> recipient, please contact the sender immediately by replying to this
> e-mail
> and delete the message and its attachments. The use, forward,
> disclosure,
> record or retention of this message for any purpose whatsoever, is
> strictly
> prohibited, unless prior written authorization from TODO1. E-mails to
> and
> from TODO1 are monitored for operational reasons and in accordance
with

> lawful business and security practices.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Brian Cook
Digital Services Analyst
Print Time Inc.
[hidden email]
913.345.8900



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]