Re: [io] OutOfMemory exception in IOUtils.toByteArray

2016-03-08 Thread James Carman
Do you need the entire thing in memory? What are you trying to do? You
typically can't do much with Errors (which don't extend Exception, but
Throwable) as it means a catastrophic event for the JVM.

On Tue, Mar 8, 2016 at 7:50 AM Zishan J.  wrote:

> Hello,
>
> I am using Commons.io.IOUtils library in my android application. I have
> received this error:
>
> Fatal Exception: java.lang.OutOfMemoryError
>at org.apache.commons.io.output.ByteArrayOutputStream.needNewBuffer
>at org.apache.commons.io.IOUtils.toByteArray
>at com.alhuda.qih.DownloadCompleteReceiver.onReceive
>
> I have tried to catch with IOException but no luck. Is there any way to
> handle this exception, so I can show the user-friendly message instead of
> getting the application crashed?
>
> Regards,
> Zishan J.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


Re: [configuration] Apache Commons Configuration Version 2

2015-05-12 Thread James Carman
So, here we struggle with the notion that our releases have to be perfect
before we let them go into the wild. We seem to have this almost coddling
philosophy that we have to protect our users against themselves at all
costs. Perhaps Java 9 and jigsaw will alleviate us from this burden and
we can stop quibbling over such things in the future. Yes, jar hell is a
pain, and our approach to handling it within the Java SE single-classloader
environment (and maven) is unique and effective, but we can't let
hypotheticals stand in the way of our progress. If (and this is a big if as
Ralph points out) some downstream project decides to use an alpha release
as their basis and publish to the world, it's egg on their face, not ours.

While we sit around arguing over how to design our hairdryer so that it is
waterproof in case some idiot takes it in the bath, someone else is busy
coming up with a way people can clean themselves without water (thought I
was done with my metaphor huh).
On Sun, May 10, 2015 at 4:24 PM Phil Steitz phil.ste...@gmail.com wrote:

 On 5/10/15 9:10 AM, James Carman wrote:
  As do people who try to blow dry their hair while they are in the
 bathtub,
  but they don't stop making hairdryers. They put a sticker on the cord
 which
  tells people not to do it.

 The problem is jar hell resulting from o.a.c.foox getting out in
 the wild before the x API is stable.  For Commons components, that's
 more like letting someone bring a hairdryer to a Roman bath.

 Phil
  On Sun, May 10, 2015 at 10:25 AM sebb seb...@gmail.com wrote:
 
  On 9 May 2015 at 21:07, Ralph Goers ralph.go...@dslextreme.com wrote:
  You can publish an alpha or a beta and still change the API. That
 really
  isn’t locked in until the first official GA release.
 
  In theory, perhaps, at least with an alpha release.
 
  However how many people take note of the alpha/beta status of the code?
 
  Any project that depends on an alpha/beta release ought itself to be
  labelled as alpha/beta - does that happen?
  If not, then downstream projects may get a nasty shock.
 
  Ralph
 
  On May 7, 2015, at 3:44 AM, sebb seb...@gmail.com wrote:
 
  Yes, it might cause a problem to publish an RC.
 
  Any publication to Maven Central effectively freezes the current
 public
  API.
  If a problem is then found, generally the only solution that avoids
  jar hell is to release a new version with different package name and
  different Maven coords - i.e. effectively a different product.
  This will not be a drop-in replacement, and will require source code
  changes by anyone using it.
 
  On 7 May 2015 at 03:54, DiFrango, Ronald (CONT)
  ronald.difra...@capitalone.com wrote:
  Yeah, I would prefer to avoid the snap-shot repo, so if nothing else
  I'll build a version locally and upload it to our local Nexus.
  One question, if this is close, would it hurt to pulish an RC into
  Maven Central?
  -Original Message-
  From: sebb [mailto:seb...@gmail.com]
  Sent: Wednesday, May 06, 2015 9:20 PM
  To: Commons Users List
  Subject: Re: [configuration] Apache Commons Configuration Version 2
 
  You should also be able to get it from the ASF snapshot repo.
 
  However note that such artifacts may change or disappear at any time,
  so should only be used for testing.
  On 6 May 2015 at 20:07, Oliver Heger oliver.he...@oliver-heger.de
  wrote:
  Hi Ron,
 
  Am 06.05.2015 um 03:38 schrieb DiFrango, Ronald (CONT):
  Oliver,
 
  I guess I could build it from source and store it in our local
 Nexus
  until a release version is built.
  this is of course possible. I do not expect major or breaking
 changes
  until the final release.
 
  Thanks for your feedback, this is indeed motivating :-)
 
  Oliver
 
  Ron DiFrango
 
  -Original Message-
  From: DiFrango, Ronald (CONT) [mailto:
 ronald.difra...@capitalone.com
  ]
  Sent: Tuesday, May 05, 2015 4:23 PM
  To: Commons Users List
  Subject: RE: [configuration] Apache Commons Configuration Version 2
 
  Oliver,
 
  I figured it would be something like that and that's understandable
  as is the time-table.  We definitely like the feature set of 2.x as it
  supports many of the uses cases more naturally than 1.x so would like to
  move forward with it.
  But I can't unless it's in maven central.
 
  Thanks,
 
  Ron
 
 
  -Original Message-
  From: Oliver Heger [mailto:oliver.he...@oliver-heger.de]
  Sent: Tuesday, May 05, 2015 4:20 PM
  To: Commons Users List
  Subject: Re: [configuration] Apache Commons Configuration Version 2
 
  Hi Ron,
 
  Am 05.05.2015 um 22:09 schrieb DiFrango, Ronald (CONT):
  All,
 
  Is Apache commons configuration in maven central or some other
  repo?  I'm using Gradle and pointing to an internal Nexus repo that is a
  proxy for Maven central and I can't resolve it as follows:
  compile group: 'org.apache.commons', name:
  'commons-configuration2', version: '2.0-alpha2'
 
  because it is only an alpha release, this version has not been
  deployed to a public Maven

Re: [DBCP] Apparent deadlock related to getConnection

2015-04-14 Thread James Carman
You may want to consider something like Spring's JdbcTemplate class to
avoid a lot of this.

On Sunday, April 12, 2015, Shawn Heisey apa...@elyograg.org wrote:

 On 4/12/2015 12:43 PM, Phil Steitz wrote:
  On 4/12/15 10:31 AM, Shawn Heisey wrote:
  http://apaste.info/6pX
 
  Several methods, getSingleObject, getResultSet, closeResultSet,
  doUpdate can abandon connections on exception paths.  You should
  insert finally blocks in these methods to ensure that connections
  are closed.

 I have modified the code to put close operations in finally blocks in
 getSingleObject, doUpdate, and getColumnSet, and I have done the same
 thing on all uses of the other two methods, with the close method called
 in a finally block.

 The updated version of the Database class is here:

 http://apaste.info/6XU

 I've engaged in some renaming.  The getResultSet method is now called
 createConnectionAndResultSet, and the closeResultSet method is now
 closeAllFromResultSet.

  They don't have to be slow to deadlock, if you hit the right timing
  and the following kind of scenario:
 
  Thread 1 grab the lock and hold it while waiting to get a connection
  (what the thread you showed in the ticket is doing)
  Threads 2, ..., n try to get the lock before returning connections
  they hold
 
  Key is to get a full thread dump and see which threads are waiting
  on / holding which locks.

 If the finally changes I've made do not fix the problem, I will gather
 a new full thread dump for analysis.  You've given me an idea of some
 additional bad coding that I can look for, so thank you.  I've tried to
 make all synchronized code use the database in a self-contained manner,
 but I might have made mistakes.

 Thanks,
 Shawn


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org javascript:;
 For additional commands, e-mail: user-h...@commons.apache.org
 javascript:;




Re: [POOL2] Pooling mutable objects

2015-02-09 Thread James Carman
Premature optimization.  UUIDs aren't slow.

On Monday, February 9, 2015, Matthew Hall mh...@mhcomputing.net wrote:

 On Sun, Feb 08, 2015 at 11:07:59AM +0100, Michael Osipov wrote:
  How would you propose to use it?
  I would still need a random number or do you recomment to use a static
 one
  and simply increment during the lifetime of the application?
 
  If so, thing might cause trouble in the future because I would probably
  store the session information in a database for analysis issues and woudl
  have collisions.
 
  Michael

 Then you either have to use real big random's like UUID and accept it'd be
 slow, or derive the numeric values from a native DB counter (for example, a
 Redis counter, or a PostgreSQL sequence data type).

 Matthew.

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org javascript:;
 For additional commands, e-mail: user-h...@commons.apache.org
 javascript:;




Re: [POOL2] Pooling mutable objects

2015-02-08 Thread James Carman
You aren't guaranteed for them not to collide.  So, yes, it could happen.

On Saturday, February 7, 2015, Michael Osipov 1983-01...@gmx.net wrote:

 Am 2015-02-06 um 17:14 schrieb James Carman:

 Try UUID.randomUUID().toString() rather than RandomStringUtils if you
 really want unique keys.


 Aren't both pseudo random?

 I won't have more than 30 sessions in parallel. Do you think that a
 collision might happen?

 Michael


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




Re: [POOL2] Pooling mutable objects

2015-02-08 Thread James Carman
Or not implement them at all since this is exactly what the Object class
will do for you.

On Sunday, February 8, 2015, sebb seb...@gmail.com wrote:

 Why don't you just implement equals() and hashCode() as noted here [1] ?

 This will allow the use of Pool2 and guarantee that different
 instances are treated as different, regardless of mutabiity.

 No need to generate unique ids for each instance.

 Pool2 needs an equals() method that returns true for objects that
 really are equal.

 Also equals() and hashCode() must be stable for a given object, and
 objects which are the same under equals() must have the same
 hashCode().

 These are standard requirements for using a HashMap (which is what
 Pool2 uses currently).

 [1]
 https://issues.apache.org/jira/browse/POOL-283?focusedCommentId=14307637page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14307637


 On 8 February 2015 at 12:12, James Carman ja...@carmanconsulting.com
 javascript:; wrote:
  You aren't guaranteed for them not to collide.  So, yes, it could happen.
 
  On Saturday, February 7, 2015, Michael Osipov 1983-01...@gmx.net
 javascript:; wrote:
 
  Am 2015-02-06 um 17:14 schrieb James Carman:
 
  Try UUID.randomUUID().toString() rather than RandomStringUtils if you
  really want unique keys.
 
 
  Aren't both pseudo random?
 
  I won't have more than 30 sessions in parallel. Do you think that a
  collision might happen?
 
  Michael
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 javascript:;
  For additional commands, e-mail: user-h...@commons.apache.org
 javascript:;
 
 

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org javascript:;
 For additional commands, e-mail: user-h...@commons.apache.org
 javascript:;




Re: [POOL2] Pooling mutable objects

2015-02-06 Thread James Carman
Or just let your IDE generate the methods.


On Fri, Feb 6, 2015 at 9:05 AM, William Speirs wspe...@apache.org wrote:
 I'd think adding a UUID then overriding equals and hashCode would do the
 trick. To aid you in doing this, commons-lang has EqualsBuilder [1] and
 HashCodeBuilder [2], I highly recommend using them.

 Bill-


 [1]
 https://commons.apache.org/proper/commons-lang/javadocs/api-3.3.2/org/apache/commons/lang3/builder/EqualsBuilder.html

 [2]
 https://commons.apache.org/proper/commons-lang/javadocs/api-3.3.2/org/apache/commons/lang3/builder/HashCodeBuilder.html

 On Fri, Feb 6, 2015 at 9:00 AM, Michael Osipov 1983-01...@gmx.net wrote:

 Hi folks,

 I am developing a session pool for an HTTP backend which is requested with
 the fabulous HttpClient.

 The session object is this:

 public class RawSession {

 private CookieStore cookieStore;
 private String logId;
 private MutableInt requestId;
 private String clientId;
 private String serverId;

 }

 There won't be any setters but as you see, the cookie store and mutable
 int might change.
 Additionally, I did not implement any custom equals and hashCode methods.

 I have searched the docs and the found and did not find any clear answer
 which says
 that pooled objects have to be immutable. Though, I have found POOL-283
 and POOL-284 which
 led me to the conclusion that this is a problem because the objects are
 stored in a map
 which relies on equals and hashCode.

 Does this ultimately mean that I have to override equals and hashCode and
 provide some internal,
 immutable value something like a UUID? Alternatively, I could retrieve the
 JSESSIONID from the
 cookie store and use this as a unique value.

 Thanks,

 Michael

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Re: [POOL2] Pooling mutable objects

2015-02-06 Thread James Carman
Try UUID.randomUUID().toString() rather than RandomStringUtils if you
really want unique keys.

On Fri, Feb 6, 2015 at 10:54 AM, Michael Osipov 1983-01...@gmx.net wrote:
 This is what I did:
 this.internalId = RandomStringUtils.randomAlphanumeric(8);

 Some Eclipse magic:
 @Override
 public int hashCode() {
 final int prime = 31;
 int result = 1;
 result = prime * result + ((internalId == null) ? 0 : 
 internalId.hashCode());
 return result;
 }

 @Override
 public boolean equals(Object obj) {
 if (this == obj)
 return true;
 if (obj == null)
 return false;
 if (getClass() != obj.getClass())
 return false;
 RawSession other = (RawSession) obj;
 if (internalId == null) {
 if (other.internalId != null)
 return false;
 } else if (!internalId.equals(other.internalId))
 return false;
 return true;
 }

 Gesendet: Freitag, 06. Februar 2015 um 16:47 Uhr
 Von: James Carman ja...@carmanconsulting.com
 An: Commons Users List user@commons.apache.org
 Betreff: Re: [POOL2] Pooling mutable objects

 Or just let your IDE generate the methods.


 On Fri, Feb 6, 2015 at 9:05 AM, William Speirs wspe...@apache.org wrote:
  I'd think adding a UUID then overriding equals and hashCode would do the
  trick. To aid you in doing this, commons-lang has EqualsBuilder [1] and
  HashCodeBuilder [2], I highly recommend using them.
 
  Bill-
 
 
  [1]
  https://commons.apache.org/proper/commons-lang/javadocs/api-3.3.2/org/apache/commons/lang3/builder/EqualsBuilder.html
 
  [2]
  https://commons.apache.org/proper/commons-lang/javadocs/api-3.3.2/org/apache/commons/lang3/builder/HashCodeBuilder.html
 
  On Fri, Feb 6, 2015 at 9:00 AM, Michael Osipov 1983-01...@gmx.net wrote:
 
  Hi folks,
 
  I am developing a session pool for an HTTP backend which is requested with
  the fabulous HttpClient.
 
  The session object is this:
 
  public class RawSession {
 
  private CookieStore cookieStore;
  private String logId;
  private MutableInt requestId;
  private String clientId;
  private String serverId;
 
  }
 
  There won't be any setters but as you see, the cookie store and mutable
  int might change.
  Additionally, I did not implement any custom equals and hashCode methods.
 
  I have searched the docs and the found and did not find any clear answer
  which says
  that pooled objects have to be immutable. Though, I have found POOL-283
  and POOL-284 which
  led me to the conclusion that this is a problem because the objects are
  stored in a map
  which relies on equals and hashCode.
 
  Does this ultimately mean that I have to override equals and hashCode and
  provide some internal,
  immutable value something like a UUID? Alternatively, I could retrieve the
  JSESSIONID from the
  cookie store and use this as a unique value.
 
  Thanks,
 
  Michael
 
  -
  To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
  For additional commands, e-mail: user-h...@commons.apache.org
 
 

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Apache common pooling 2

2015-02-03 Thread James Carman
On Tue, Feb 3, 2015 at 5:07 PM, Matthew Huckaby
matthew.huck...@gmail.com wrote:

 JC Perhaps you'd be more interested in a cache rather than a pool?

 If the intention is to share an SFTP session/client reference between
 threads, check-in and check-out could be important.


I was assuming that the true intent was to really share the instances
between threads.  If that's the case, then a cache might be more
appropriate.  However, as you point out, it's probably not wise to
share those connections with SFTP anyway, so pooling really is what
you want.  You're going to have to do some form of serialization of
the messages/requests (whatever they're called) going across that
connection.  May as well let commons-pool do it for you by
borrow/return pattern.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Apache common pooling 2

2015-02-03 Thread James Carman
Perhaps you'd be more interested in a cache rather than a pool?

On Tue, Feb 3, 2015 at 3:20 PM, Syed Mudassir syed.mudas...@gaiatv.in
wrote:

  Guys,
   I have a question.
   I am using GenericKeyedObjectPool for pooling SFTP sessions.  Suppose I
 have one session in the pool.
   Can this session be shared among multiple threads at the same time?
   I mean suppose if there are four threads running parallely, can this
 session be used at the same time by all the four threads simultaneously?
   If it is possible, any sample code to get it done?
 --



Re: commons pool benchmark issue

2013-09-30 Thread James Carman
Perhaps you would care to share your implementation with Commons Pool
and help make the library better?

On Mon, Sep 30, 2013 at 3:58 AM, Daniel Wu daniel.y@gmail.com wrote:
 Hi Thomas,

 Thanks a lot. For now, I have to use my own implementation which is 50 times 
 faster than CP but lack of many features from CP.
 Looking forward to CP 2.x release, and I don't like invent my own wheels.

 --
 Daniel Wu
 Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


 On Monday, September 30, 2013 at 3:27 PM, Mark Thomas wrote:

 On 30/09/2013 03:35, Daniel Wu wrote:
  Without the pool, it's lightning fast. JProfiler shows most of the time is 
  consumed on locking, thread dump also shows the pool always waits.
  I tried to timing the pool operations, the results proved the JProfiler 
  reports
 
  e,g. with 50 threads, the log shows
  Average Response Time:0.06
  Average Borrow Time:0.04
  Average Return Time:0.02
 
  So, the time are consumed with StringBuilder and GC is negligible, most of 
  the time are wasted in pool locking.
 
  With 100 threads, the log shows
  Average Response Time:1.24
  Average Borrow Time:0.90
  Average Return Time:0.34
 
  The more threads try to content with the pool, the slower the pool is.
 
  I kind of believe CP is just slow.

 In environments where there is more than one core/processor available
 and there is a high rate of borrow/return events then pool 1.x is slow
 and it will get worse the more cores/processors that there are available.

 Pool 2 was designed to address those performance issues.

 1.5.x and 1.6.x are better than earlier 1.x versions but 2.x should be a
 significant improvement.

 Mark

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org 
 (mailto:user-unsubscr...@commons.apache.org)
 For additional commands, e-mail: user-h...@commons.apache.org 
 (mailto:user-h...@commons.apache.org)





-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [dbcp] GenericObjectPool.borrowObject: Timeout waiting for idle object

2013-09-29 Thread James Carman
Try running FindBugs on your code (using something like Sonar or an
IDE plugin).  The rules you're going to be looking for would be these:

http://findbugs.sourceforge.net/bugDescriptions.html#ODR_OPEN_DATABASE_RESOURCE


On Sun, Sep 29, 2013 at 12:41 PM, Phil Steitz phil.ste...@gmail.com wrote:
 On 9/29/13 7:13 AM, Bosio Andrea wrote:

 Hello all,

 I’m getting the following exception, using commons-dbcp-1.4.

 Caused by: java.util.NoSuchElementException: Timeout waiting for
 idle object

 at
 org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1144)
 ~[commons-pool-1.5.5.jar:1.5.5]

 at
 org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
 ~[commons-dbcp-1.4.jar:1.4]

 ... 62 common frames omitted

 Connections are managed by spring. These are the dbcp config
 parameters:

 poolPreparedStatements=true

 defaultAutoCommit=false

 driverClassName=oracle.jdbc.driver.OracleDriver

 validationQuery=select 0 from dual

 initialSize=1

 maxActive=15

 maxIdle=15

 maxWait=6

 removeAbandoned=false

 removeAbandonedTimeout=300

 On the database (oracle) I see no active connections when the
 problem occurs, and sometimes a few inactive connections (5
 connections).

 I got an heap dump, and found that the ConnectionPool object
 (instance of org.apache.commons.pool.impl.GenericObjectPool)
 numActive variable value is 15, so I understand that the
 connection pool thinks that there are 15 active connections.

 I can’t understand why this happen, because on the database there
 aren’t so many connections.

 On the heap dump, another thing is strange: the ConnectionPool
 object variable “pool”, which as far I understand is the list of
 the connections managed by the pool, contains no element!


 The most likely explanation for this is that connections checked out
 from the pool are being abandoned by client threads - i.e., never
 returned via the close() method. The first thing to check is that on
 all code execution paths (including exceptions), the connections
 borrowed from the pool are being closed. You can turn on abandoned
 connection removal and logging to verify that this is not happening.
 If turning on abandoned connection removal makes the problem go
 away, you should still find and fix the code paths that abandon
 connections.

 Unless client threads are being interrupted, this will not likely
 fix anything, but you can try upgrading to version 1.5.7 of Commons
 Pool.

 Phil

 Bye,
 Andrea



 Andrea Bosio
 Manager

 Technology Reply
 Via Cardinal Massaia, 71
 10147 - Torino - ITALY
 phone: +39 011 29100
 mobile: +39 348 9504513
 a.bo...@reply.it
 www.reply.it

 Technology Reply


 

 --
 The information transmitted is intended for the person or entity
 to which it is addressed and may contain confidential and/or
 privileged material. Any review, retransmission, dissemination or
 other use of, or taking of any action in reliance upon, this
 information by persons or entities other than the intended
 recipient is prohibited. If you received this in error, please
 contact the sender and delete the material from any computer.


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Apache Commons Pool performance issue

2013-09-05 Thread James Carman
Try printing out the location from the ProtectionDomain's CodeSource of one
of the classes in pool.

On Thursday, September 5, 2013, Phil Steitz wrote:

 On 9/5/13 9:58 AM, Programmer wrote:
  Thanks for the reply guys.
 
  I use 1.6 JAR in my classpath. Is there anyway I can verify the 'when
  exhausted action' at run time?

 As Mark said, based on the line numbers in the stack trace, it is
 pretty certain that you are in fact running 1.3.  Moreover, the
 exhausted action *must* be block to get to the line where the thread
 in the trace is waiting.

 Phil
 
 
 
  --
  View this message in context:
 http://apache-commons.680414.n4.nabble.com/Apache-Commons-Pool-performance-issue-tp4653614p4653619.html
  Sent from the Commons - User mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: user-unsubscr...@commons.apache.orgjavascript:;
  For additional commands, e-mail: user-h...@commons.apache.orgjavascript:;
 
 


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org javascript:;
 For additional commands, e-mail: user-h...@commons.apache.orgjavascript:;




Re: Apache Commons Pool performance issue

2013-09-05 Thread James Carman
No problem.  That's a very useful little trick for figuring out class
loading issues.

On Thursday, September 5, 2013, Programmer wrote:

 Thanks for the tip James. I was able to trace the class to
 com.bea.core.apache.commons.pool_1.3.0.jar :)



 --
 View this message in context:
 http://apache-commons.680414.n4.nabble.com/Apache-Commons-Pool-performance-issue-tp4653614p4653626.html
 Sent from the Commons - User mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org javascript:;
 For additional commands, e-mail: user-h...@commons.apache.orgjavascript:;




Re: Apache Commons in a Cloud IDE

2013-08-12 Thread James Carman
Any thoughts of granting some of us a license to this? :)


On Mon, Aug 12, 2013 at 5:26 PM, Eric Cavazos ecava...@codenvy.com wrote:
 We have done a tutorial on using Apache Commons with Codenvy here:
 http://docs.codenvy.com/tutorials/apache-commons-file-upload/

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [proxy] Remove Remoting Providers in 2.x...

2013-07-29 Thread James Carman
Well, I wanted a broader audience, since it would impact users (if
there are any).

On Mon, Jul 29, 2013 at 7:10 AM, Benedikt Ritter brit...@apache.org wrote:
 Hi James,

 I guess this was supposed to go to the dev ML?

 Benedikt


 2013/7/28 James Carman jcar...@savoirtech.com

 All,

 I would doubt the remoting providers are really used by anyone, but we
 should probably ask before removing them.  We currently support the
 following remoting protocols:

 - Burlap
 - Hessian
 - Jax-RPC
 - RMI
 - Session Beans

 Are there any objections to removing them?  These technologies are
 somewhat outdated.

 Thanks,

 James
 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 --
 http://people.apache.org/~britter/
 http://www.systemoutprintln.de/
 http://twitter.com/BenediktRitter
 http://github.com/britter

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [proxy] Remove Remoting Providers in 2.x...

2013-07-29 Thread James Carman
I did not intent to send it twice at all! :)  I actually sent it from
two different accounts.  It didn't go through the first time, because
the first account is not registered (someone must have moderated it
through, though).

On Mon, Jul 29, 2013 at 7:21 AM, Benedikt Ritter brit...@apache.org wrote:
 Okay so you intended to send it to the dev ML and the user ML once? Because
 it appears that you've send it to the user ML twice instead ;-)

 Benedikt


 2013/7/29 James Carman ja...@carmanconsulting.com

 Well, I wanted a broader audience, since it would impact users (if
 there are any).

 On Mon, Jul 29, 2013 at 7:10 AM, Benedikt Ritter brit...@apache.org
 wrote:
  Hi James,
 
  I guess this was supposed to go to the dev ML?
 
  Benedikt
 
 
  2013/7/28 James Carman jcar...@savoirtech.com
 
  All,
 
  I would doubt the remoting providers are really used by anyone, but we
  should probably ask before removing them.  We currently support the
  following remoting protocols:
 
  - Burlap
  - Hessian
  - Jax-RPC
  - RMI
  - Session Beans
 
  Are there any objections to removing them?  These technologies are
  somewhat outdated.
 
  Thanks,
 
  James
  -
  To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
  For additional commands, e-mail: user-h...@commons.apache.org
 
 
 
 
  --
  http://people.apache.org/~britter/
  http://www.systemoutprintln.de/
  http://twitter.com/BenediktRitter
  http://github.com/britter

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 --
 http://people.apache.org/~britter/
 http://www.systemoutprintln.de/
 http://twitter.com/BenediktRitter
 http://github.com/britter

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[proxy] Remove Remoting Providers in 2.x...

2013-07-28 Thread James Carman
All,

I would doubt the remoting providers are really used by anyone, but we should 
probably ask before removing them.  We currently support the following remoting 
protocols:

- Burlap
- Hessian
- Jax-RPC
- RMI
- Session Beans

Are there any objections to removing them?  These technologies are somewhat 
outdated.

Thanks,

James



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [fileupload] Cancel FileUpload when FileSizeMax is exceeded

2013-01-29 Thread James Carman
Are you defining the FacesServlet in your web.xml?  The FileUploadFilter sits 
in front of the FacesServlet.  Perhaps you can put the multipart configuration 
on it?

On Jan 28, 2013, at 7:03 AM, ku...@dakosy.de wrote:

 Hi James,
 
 I'am working with a filter (FileUploadFilter) and not with servlets 
 directly. This FileUploadFilter implements the javax.servlet.Filter 
 interface.
 
 Best Regards
 - 
 
 
 
 Von:James Carman jcar...@carmanconsulting.com
 An: Commons Users List user@commons.apache.org
 Datum:  28.01.2013 12:09
 Betreff:Re: [fileupload] Cancel FileUpload when FileSizeMax is 
 exceeded
 
 
 
 The container itself has to stop this.  Have you tried this:
 
 http://www.ryanchapin.com/fv-b-4-667/Adding-MultipartConfig-Configuration-to-web-xml-in-JBoss-6-x-for-a-Servlet-3-0-File-Upload-Servlet.html
 
 
 See if that helps. 
 
 On Jan 25, 2013, at 6:18 AM, ku...@dakosy.de wrote:
 
 Hi All,
 
 I have a JSF application which runs in JBoss 6.1 which uses internal the 
 
 Tomcat Servlet container.
 I want to prevent too large file uploads and have set the property 
 fileSizeMax to 10MB within the class FileUploadBase. It works, the 
 file 
 upload throws an FileSizeLimitExceededException for all files larger 
 than 
 10MB.
 But the main problem is, that the whole file will be transferred over 
 the 
 network. I have found this out by checking the network traffic.
 
 How can I interrupt the file transfer when the max size is exceeded 
 without transferring the whole file? I assume that the file will be 
 transferred in multiple packages because of the web form attribute 
 enctype
 =multipart/form-data.
 
 Best regards 
 Anton
 
 


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [fileupload] Cancel FileUpload when FileSizeMax is exceeded

2013-01-28 Thread James Carman
The container itself has to stop this.  Have you tried this:

http://www.ryanchapin.com/fv-b-4-667/Adding-MultipartConfig-Configuration-to-web-xml-in-JBoss-6-x-for-a-Servlet-3-0-File-Upload-Servlet.html

See if that helps.  

On Jan 25, 2013, at 6:18 AM, ku...@dakosy.de wrote:

 Hi All,
 
 I have a JSF application which runs in JBoss 6.1 which uses internal the 
 Tomcat Servlet container.
 I want to prevent too large file uploads and have set the property 
 fileSizeMax to 10MB within the class FileUploadBase. It works, the file 
 upload throws an FileSizeLimitExceededException for all files larger than 
 10MB.
 But the main problem is, that the whole file will be transferred over the 
 network. I have found this out by checking the network traffic.
 
 How can I interrupt the file transfer when the max size is exceeded 
 without transferring the whole file? I assume that the file will be 
 transferred in multiple packages because of the web form attribute enctype
 =multipart/form-data.
 
 Best regards 
 Anton



Re: [fileupload] Cancel FileUpload when FileSizeMax is exceeded

2013-01-28 Thread James Carman
I know what you're using.  Filters still use the servlet API to do their work.  
Try setting that setting they were talking about in your JBoss server.  

On Jan 28, 2013, at 7:03 AM, ku...@dakosy.de wrote:

 Hi James,
 
 I'am working with a filter (FileUploadFilter) and not with servlets 
 directly. This FileUploadFilter implements the javax.servlet.Filter 
 interface.
 
 Best Regards
 - 
 
 
 
 Von:James Carman jcar...@carmanconsulting.com
 An: Commons Users List user@commons.apache.org
 Datum:  28.01.2013 12:09
 Betreff:Re: [fileupload] Cancel FileUpload when FileSizeMax is 
 exceeded
 
 
 
 The container itself has to stop this.  Have you tried this:
 
 http://www.ryanchapin.com/fv-b-4-667/Adding-MultipartConfig-Configuration-to-web-xml-in-JBoss-6-x-for-a-Servlet-3-0-File-Upload-Servlet.html
 
 
 See if that helps. 
 
 On Jan 25, 2013, at 6:18 AM, ku...@dakosy.de wrote:
 
 Hi All,
 
 I have a JSF application which runs in JBoss 6.1 which uses internal the 
 
 Tomcat Servlet container.
 I want to prevent too large file uploads and have set the property 
 fileSizeMax to 10MB within the class FileUploadBase. It works, the 
 file 
 upload throws an FileSizeLimitExceededException for all files larger 
 than 
 10MB.
 But the main problem is, that the whole file will be transferred over 
 the 
 network. I have found this out by checking the network traffic.
 
 How can I interrupt the file transfer when the max size is exceeded 
 without transferring the whole file? I assume that the file will be 
 transferred in multiple packages because of the web form attribute 
 enctype
 =multipart/form-data.
 
 Best regards 
 Anton
 
 


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [compress] uncompress utility?

2012-12-20 Thread James Carman
You could perhaps use Commons VFS.  It supports all the file types you
mention and gives you a common API to deal with.

On Thu, Dec 20, 2012 at 1:30 AM, Ryan McKinley ryan...@gmail.com wrote:
 I'm looking at options for how to take an archive file (zip,gz,tar,etc) and
 extract it to the file system.  (like running unzip file.zip -d folder)

 I see org.apache.commons.compress.archivers.Lister, but I don't see any
 obvious (general) way to write this to disk.

 Any suggestions for how to best approach this?  The application needs to be
 cross platform and many systems will not have reasonable system tools to
 rely on.

 Thanks
 Ryan

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Where is OGNL's realy project site, apache or github or other?

2012-11-01 Thread James Carman
We have not released OGNL since it found its way to Apache Commons:

http://svn.apache.org/repos/asf/commons/proper/ognl/tags/

The first Apache-released version will be 4.0.  Feel free to download
the source and build it.  Let us know if you experience any issues
with it.  If you would like to contribute, we always welcome
contributions.  Thanks for supporting OGNL!

On Thu, Nov 1, 2012 at 10:45 PM, Maliwei mlw5...@gmail.com wrote:
 First, I come to http://commons.apache.org/ognl/, but I can't see any 
 download page for version that have been realeased, such as ognl 3.0.5.

 Further more, I goto the 
 http://commons.apache.org/ognl/source-repository.html , then got the source 
 code through svn, but I see the main package is org.apache.commons.ognl .




 Best Regards
 Ma Liwei

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [io] Are FileUtils and IOUtils thread safe?

2012-10-01 Thread James Carman
Would you have two different threads attempting to write to the same file?

On Mon, Oct 1, 2012 at 12:55 PM, Yungwei Chen yung...@resolvity.com wrote:
 Specifically FileUtils.writeStringToFile(file, data, encoding, false), which 
 in turn calls IOUtils.write().
 Thanks.

 -Original Message-
 From: Daniel Pitts [mailto:coloraura@gmail.com]
 Sent: Saturday, September 29, 2012 1:10 AM
 To: Commons Users List
 Subject: Re: [io] Are FileUtils and IOUtils thread safe?

 On 9/28/12 8:20 PM, Yungwei Chen wrote:
 Hi,

 I would like to know if FileUtils and IOUtils are thread safe. Thanks.
 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org

 Thread safe in what way? Which methods? What are your use-cases?

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [javaflow] Working with dynamic proxies

2012-06-11 Thread James Carman
InvocationHandlers don't implement the interface.  You'd have to have the
proxy instance itself.

Sent from tablet device.  Please excuse typos and brevity.
On Jun 11, 2012 4:55 AM, George Georgovassilis g.georgovassi...@gmail.com
wrote:

 Hello list,

 I am trying to suspend a call where the stack goes through a dynamic proxy.
 When resumed, I get a ClassCastException which tries to cast the
 InvocationHandler of the proxy to the interface it is proxying. Classes are
 prepared with the ant-task, both bcel and asm modes fail.Can this be done
 and all and yes, then how?



Re: [vfs] How to resolve a share path to a FileObject

2012-06-11 Thread James Carman
Do you have all of the dependencies you need?  Turn up logging to see
what providers VFS is loading.  In trunk it looks like the SMB stuff
is in the sandbox.  It requires JCIFS, it looks like.  Do you have
that?

On Mon, Jun 11, 2012 at 8:28 AM, ldp l.dellipa...@reply.it wrote:
 I get the same error

 --
 View this message in context: 
 http://apache-commons.680414.n4.nabble.com/How-to-resolve-a-share-path-to-a-FileObject-tp4634909p4634915.html
 Sent from the Commons - User mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[DBCP] BasicManagedDataSource and Spring...

2012-04-27 Thread James Carman
I'm trying to use a BasicManagedDataSource inside FuseESB/ServiceMix
using Spring's transaction management and Aries' provided transaction
manager.  I'm setting the transactionManager property of the BMDS, but
I don't see my transactions actually committing.  I see in:

https://issues.apache.org/jira/browse/DBCP-361

that BMDS won't work with Spring declarative transactions and
PROPAGATION_REQUIRED.  Is this still true?  I'm using version 1.4.
Does anyone know exactly what the issue seems to be with Spring?

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [vfs] FTPS

2012-04-23 Thread James Carman
The patch needs to go through jira for us to accept it.  Please open a jira
issue and attach it.  Thanks!
On Apr 23, 2012 11:34 AM, Jose Juan Montiel josejuan.mont...@gmail.com
wrote:

 The patch...

 2012/4/23 Jose Juan Montiel josejuan.mont...@gmail.com

 Hi,

 Did you figure this out?


 i attach a patch... but maybe could be a option passed (setExecPROT)

 FileSystemManager mgr = VFS.getManager();
 FileSystemOptions opts = new FileSystemOptions();
 FtpsFileSystemConfigBuilder ffscb =
 FtpsFileSystemConfigBuilder.getInstance();
 ffscb.setExecPROT(opts, P);
 ffscb.setFtpsType(opts,explicit);

 like others like setFtpsType.

 What do you think?

 Thanks.

 --
 This is your badness level.
 It's unusually high for someone your size.
 We have to fix that.




 --
 This is your badness level.
 It's unusually high for someone your size.
 We have to fix that.


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



Re: [io] org.apache.commons.io.ThreadMonitor.class ?

2012-03-28 Thread James Carman
Since it's Apache licensed, feel free to copy it for your needs, though. :)
On Mar 28, 2012 6:45 PM, Jörg Schaible joerg.schai...@gmx.de wrote:

 Hi Steve,

 Steve Cohen wrote:

  Someone has suggested that our team look at the Apache Thread Monitor
  as a way of timing out some classes that don't natively support timeouts.
 
  In investigating this using the Google, I find references such as this:
 
 

 http://commons.apache.org/io/cobertura/org.apache.commons.io.ThreadMonitor.html
 
  and this:
 
 
 http://commons.apache.org/io/xref/org/apache/commons/io/ThreadMonitor.html
 
  Yet when I look at the official Commons IO Javadoc
  (http://commons.apache.org/io/api-release/index.html), this class does
  not appear to exist.  Nor can I find it in any of the older official
  javadocs?
 
  Can someone explain this discrepancy and where I might find this class?
 
  Is this old code that was abandoned for some (probably good) reason?  Is
  something else recommended instead?

 It's internal, uses package scope, can therefore not be used from outside
 of
 the package and does in consequence not appear in the official API.

 - Jörg


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




Re: [Collections] Circular Buffer

2012-03-07 Thread James Carman
Does the header include a record size?
On Mar 7, 2012 5:32 AM, manoj mokashi manojmoka...@gmail.com wrote:

 Sorry for always replying to the main thread,
 i have not subscribed to the list, so my in-reply-to headers are not
 correct.

 its more like a circular array i guess.
 i needed to parse a binary file and look for 512 byte headers.
 so i keep storing each byte in a 512 byte circular array and here i
 have the last 512 bytes read,
 which i check under certain conditions against the header pattern.
 to match against the header pattern i would need to see if header[1] != 0
 etc.
 hence the requirement for an efficient getLast( offset) method.

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




Re: [Collections] Circular Buffer

2012-03-06 Thread James Carman
what exactly are you trying to do?   Perhaps a circular buffer isn't what
you're looking for.
On Mar 6, 2012 1:48 AM, manoj mokashi manojmoka...@gmail.com wrote:

 The existing CircularFifoBuffer would suffice if it had an efficient
 get(index) method, which
 gets an element with the specified index from the end.

 btw, the code i posted originally refers mistakenly to another Int
 Buffer class and is not correct.
 Also the IllegalArgumentCheck and the fill constructor needs changing.
 Sorry about that.

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




Re: [Collections] Circular Buffer

2012-03-05 Thread James Carman
Does CircularFifoBuffer not suffice?
On Mar 5, 2012 10:47 AM, manoj mokashi manojmoka...@gmail.com wrote:

 Hi,

 Recently i needed a circular buffer for parsing some binary data
 and thought maybe somebody else too finds it useful. It overwrites the
 previous stored data.
 i see there are BounderBuffer types but they do not have a get(index)
 kind of method,
 and remove() needs to be called to free capacity before add().

 regards,
 manoj

 ---
 import java.util.Arrays;


 // This circular Buffer is of fixed length and overwrites the
 // previous contents with the most recent ones.
 // Hence it has only an end position and we can extract data relative
 // to the end
 public abstract class CircularBufferT {
protected T[] barr;
protected int end = 0;
protected int size = 0;

public CircularBuffer( int size){
this.size = size;
}

public CircularBuffer( int size, int fillWith){
this( size);
Arrays.fill( barr, fillWith);
}

// Get the data with the specified offset from the end(=0)
public T getLast( int offset ) {
if( offset = 0 || offset  size){
throw new IllegalArgumentException(Offset must be
 positive and
 less than size);
}
int calc = end - 1 - offset;
if( calc  0) { calc += size; }
return barr[ calc];
}

// add a piece of data to the end
public void add( T another){
barr[end] = another;
end = (end + 1) % size;
}

// Size is decided at creation
public int getSize(){
return this.size;
}

 }

 public class CircularByteBuffer extends CircularBufferByte {

public CircularByteBuffer( int size){
super( size);
barr = new Byte[size];
}

public CircularByteBuffer( int size, int fillWith){
super( size, fillWith);
}

public static void main(String[] args) throws Exception {
CircularIntBuffer cib = new CircularIntBuffer(
 512,-1);
for( int i=0; i 1000; i++){
cib.add( i );
}
System.out.println( cib.getLast(100));
}
 }

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




Re: Class metadata repository

2012-02-19 Thread James Carman
Chas, the scannotation library works quite well if you don't want to
wait for us to finish up work on meiyo/classscan.  Glad to hear from
you again!

On Sun, Feb 19, 2012 at 1:36 AM, Chas Honton c...@honton.org wrote:
 I need to find classes in a jar file marked with an @Entity annotation 
 without instantiating the classes.

 I have written similar functionality for a jdo implemention and for an IOC 
 container by using asm to read the class files.  Now I'm helping out with a 
 jpa implementation.

 Do I need to rewrite this once again or is there a commons component that 
 exposes this capability?  If not, what is a good component to donate such a 
 capability to?

 Thanks,
 Chas

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [lang] Advise needed for broken reflectionEquals in WebLogic 10.3.5

2011-07-28 Thread James Carman
If you're going to be enumerating the fields anyway, why not use an
EqualsBuilder?

On Thu, Jul 28, 2011 at 4:45 AM, Cancrinus, Bas cancrinu...@schiphol.nl wrote:
 Thanks for sharing your thoughts!

 I reflected on this issue again and I think that the excludeFields array is 
 the root of my problem. Now you can only tell reflectionEquals which fields 
 to exclude, but you never know which non-transient, non-static, non-$ fields 
 are included at runtime. That makes the result of reflectionEquals 
 unpredictable. The only way to guarantee a consistent result would be to use 
 an includeFields array instead.

 I have to release tomorrow, so for now I decided to replace all occurrences 
 of reflectionEquals with the good old copy-paste logic.
 I like the simplicity and elegance of reflectionEquals, so I hope that we can 
 work this out.

 Cheers, Bas

 -Oorspronkelijk bericht-
 Van: paulus.benedic...@gmail.com [mailto:paulus.benedic...@gmail.com] Namens 
 Paul Benedict
 Verzonden: woensdag 27 juli 2011 20:52
 Aan: Commons Users List
 Onderwerp: Re: [lang] Advise needed for broken reflectionEquals in WebLogic 
 10.3.5

 +1 to that idea.

 On Wed, Jul 27, 2011 at 12:25 PM, Gary Gregory ggreg...@seagullsoftware.com 
 wrote:
 We might as well use an RE instead of a prefix. Next week someone will want 
 to do something will fields that /end/ in _ or whatnot.

 Gary

 -Original Message-
 From: paulus.benedic...@gmail.com [mailto:paulus.benedic...@gmail.com]
 On Behalf Of Paul Benedict
 Sent: Wednesday, July 27, 2011 13:15 PM
 To: Commons Users List
 Subject: Re: [lang] Advise needed for broken reflectionEquals in
 WebLogic 10.3.5

 ReflectionEquals uses actual fields, not methods, to build the string 
 output. The underscore is actually a known convention by some Java 
 programmers (I don't subscribe to it but projects like Apache Tapestry use 
 underscore for ALL their fields). So I don't think underscore is suitable to 
 be excluded. However, perhaps as an enhancement the builder could be 
 configured with a list of prefixes to ignore. If that's what you want, 
 please open up a JIRA issue for consideration.

 On Wed, Jul 27, 2011 at 11:49 AM, Cancrinus, Bas cancrinu...@schiphol.nl 
 wrote:
 I'm currently migrating an EAR from WebLogic 10.3.3 to 10.3.5. While 
 testing I noticed that the following invocation returned false while I 
 expected true (lang 2.5):

 EqualsBuilder.reflectionEquals(Object lhs, Object rhs, String[]
 excludeFields)

 I noticed in my debugger that my domain classes were extended by the 
 WebLogic JPA provider with the following field:

 protected org.eclipse.persistence.queries.FetchGroup
 _persistence_fetchGroup

 EqualsBuilder.reflectionAppend() (lang 2.5-3.0) only ignores:

 -          $ in field names

 -          static modifiers

 -          transients (conditional)

 -          and of course the excludeFields array

 The JPA extension field mentioned above doesn't fall into any of those 
 categories, so it is appended to the equals result.

 The easy way out for me would be to add this field to all reflectionEquals 
 excludeFields arrays, but I'm looking for a more sustainable way to do this.

 -          What do you think about patching 
 EqualsBuilder.reflectionAppend() so that it ignores this field ( 
 f.startsWith(_) )?

 -          Are there any other better ways to fix this issue?

 I appreciate any help very much!

 Have a nice day,
 Bas


 P: Please consider the environment before printing this e-mail

 

 This e-mail may contain confidential and privileged material. You are 
 requested not to disclose, copy or distribute any information thereof. If 
 you are not the intended recipient (or have received this e-mail in error) 
 please notify the sender immediately and delete this e-mail. We accept no 
 liability for damage related to data and/or documents which are 
 communicated by electronic mail.

 


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 P: Please consider the environment before printing this e-mail

 

 This e-mail may contain confidential and privileged material. You are 
 requested not to disclose, copy or distribute any information thereof. If you 
 are not the intended recipient (or have received this e-mail in error) please 
 notify the sender immediately and delete this e-mail. We accept no liability 
 for 

Re: Help with change directory

2011-07-25 Thread James Carman
Try vfs
On Jul 25, 2011 4:42 PM, Diane Baumgartner poindex...@yahoo.com wrote:
 I'm new to Apache Commons  (3.0.1), and am writing a Java program to FTP a
file on my local server to an FTP server on the same network.

 First, I'd like to make sure that changeWorkingDirectory() changes the
directory on the remote machine.  It's not clear from the documentation.

 The first thing hat happens is that the Change Directory didn't work
prints out.  but I don't know what went wrong.  So, I'm trying to use
getReply() for more information, but my program hangs on that line.  I know
this becuase the line before it prints, but not the line after it.

 Here's a code snippet:

 FTPClient ftp = new FTPClient();
 ftp.connect (server);

 // status checking here - print statements indicate that connect was
successful

 boolean OK = ftp.changeWorkingDirectory (/tmp/dir_name);
 if {OK} {
   System.out.println (Change directory worked);
 } else {
   System.out.println (Change directory didn't work);
   system.out.println (The FTP Reply Code is);

  reply = ftp.getReply();  // reply was defined as int before doing the
connect previous to this
   System.out.println (Reply);
 }

 Thanks for any help you can offer.


Re: [VFS] vfs2 provider guide

2011-07-21 Thread James Carman
Use the source!  :-)

Sent from tablet device.  Please excuse typos and brevity.
On Jul 21, 2011 7:49 PM, Alex Xin xinxi...@gmail.com wrote:
 Hi,

 I'd like to develop a VFS plugin to support Bluetooth OBEX FTP file
 management, I need to implement a VFS provider. Where I can find a getting
 started guide to help me start my work? There's only API docs on the
 website.

 thanks,

 Alex


Re: [email] Email attachment is inline for some reason

2011-07-06 Thread James Carman
Are you sure you have a clean classpath?

Sent from my Android device.  Please excuse typos and brevity.
On Jul 6, 2011 8:12 AM, David Hoffer dhoff...@gmail.com wrote:
 I've had another email failure this time it's usage with no attachment.
 I'll paste the code below. It's dropping the subject...same as the other
 case. Note that (No Subject) is being added by GMail on the receiving side
 as all emails with no subject show that.

 try {
 Email email = new SimpleEmail();
 email.setHostName(smtp.gmail.com);
 email.setSmtpPort(587);
 final String gMailUsername = appProperties.getGMailUsername();
 email.setAuthenticator(new DefaultAuthenticator(gMailUsername,
 appProperties.getGMailPassword()));
 email.setTLS(true);
 email.setFrom(gMailUsername);
 email.setSubject(App System Error);
 email.setMsg(msg);
 String[] toEmails = appProperties.getSystemErrorSendToEmails();
 for (String toEmail : toEmails) {
 email.addTo(toEmail);
 }
 email.send();
 } catch (EmailException e) {
 log.error(Failed to send system email, e);
 }

 Thanks,
 -Dave


 On Wed, Jul 6, 2011 at 3:08 AM, Siegfried Goeschl 
 siegfried.goes...@it20one.at wrote:

 Hi David,

 that sound a little bit strange - can you have a look at the JUnit tests?
 There is an EmailLiveTest which allows sending real emails with a bit
of
 tinkering - I suggest to have a look at the test, configure them to send
 test emails to your email account and then double-check your production
 code.

 Cheers,

 Siegfried Goeschl


 On 06.07.11 05:46, David Hoffer wrote:

 I have a strange problem. I've used commons-email for a while now
 with good success but now all of the sudden it isn't working right and
 I don't know why. The emails have 3 problems:

 1. Although I attach a file to the email as an attachment it is
 received inline as base64 encoded text. I.e. my code does this:
 attachment.setDisposition(**EmailAttachment.ATTACHMENT);

 2. The subject is replaced with this: (no subject)

 3. The from and reply to email addresses are dropped and replaced with
 the email address used in as the authenticator.

 This is only a problem when I run the code on the production server
 which is Linux (hosted virtual server). It works as expected on
 Windows during test. This code on the Linux server used to work but
 it was a prior build, not sure what changed but nothing in the email
 code changed...just a different file being sent with different
 description.

 Any ideas why these three things might be occurring?

 -Dave


--**--**-
 To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org
user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 --**--**-
 To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org
user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




Re: [pool] Smart (aka auto-configure) pools

2010-11-05 Thread James Carman
On Fri, Nov 5, 2010 at 10:47 AM, Phil Steitz phil.ste...@gmail.com wrote:

 We should probably take this discussion to the dev list at this point.


+1

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [Primitives] Does anyone use this?

2010-11-02 Thread James Carman
Premature optimization with JDK5.  I'd say stick to the JDK classes if
you can and only try to beef up space/performance if you need to.

On Tue, Nov 2, 2010 at 11:11 AM, Haswell, Joe josiah.d.hasw...@hp.com wrote:
 Consider using Gnu Trove (http://trove4j.sourceforge.net/).

 Joe H. | HP Software

 -Original Message-
 From: David Cogen [mailto:co...@ll.mit.edu]
 Sent: Tuesday, November 02, 2010 5:34 AM
 To: Commons Users List
 Subject: [Primitives] Does anyone use this?

 I am considering using Commons Primitives but I note that it is at
 release 1.0 and hasn't changed for 7 years. Should I be using it? Is it
 considered reliable? I am interested in the primitive array types like
 ArrayIntList.


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [Primitives] Does anyone use this?

2010-11-02 Thread James Carman
Yet another dependency to add to the mix.

On Tue, Nov 2, 2010 at 1:17 PM, Cogen, David - 1008 - MITLL
co...@ll.mit.edu wrote:

 
 From: jcar...@carmanconsulting.com [jcar...@carmanconsulting.com] On Behalf 
 Of James Carman [ja...@carmanconsulting.com]
 Sent: Tuesday, November 02, 2010 12:30 PM
 To: Commons Users List
 Subject: Re: [Primitives] Does anyone use this?

 Premature optimization with JDK5.  I'd say stick to the JDK classes if
 you can and only try to beef up space/performance if you need to.


 Normally I agree about evils of premature optimization. But ArrayListInt is 
 practically a drop-in replacement for ArrayListInteger and I see no reason 
 not to use it if it is supported and reliable.

 My test of 2 billion accesses (reads and writes) ran in 35% of the time when 
 I used ArrayListInt vs. ArrayListInteger.
 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: RE: [Primitives] Does anyone use this?

2010-11-02 Thread James Carman
My point was that the Jdk classes can do this with type safety already and
box/inbox it for you automatically.  If that works for you, then I wouldn't
suggest adding another dependency to the mix.  If you absolutely need the
space/speed improvement , then by all means use it.  Adding dependencies
opens you up to jar hell situations, though so I usually try to avoid it.
On Nov 2, 2010 2:43 PM, Haswell, Joe josiah.d.hasw...@hp.com wrote:


Re: [io] is 2.0 on Maven?

2010-10-29 Thread James Carman
The confusion is probably because most folks assume we would be using
the new group id which commons io (for some strange reason) did not.

On Fri, Oct 29, 2010 at 7:51 AM, Niall Pemberton
niall.pember...@gmail.com wrote:
 Its been there since the day after it was released - see:

 http://repo1.maven.org/maven2/commons-io/commons-io/2.0/

 Niall

 On Thu, Oct 28, 2010 at 9:46 PM, Benson Margulies 
 bimargul...@gmail.comwrote:

 I can't find common-io 2.0 on Maven. Has it been released?

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [io] is 2.0 on Maven?

2010-10-29 Thread James Carman
On Fri, Oct 29, 2010 at 9:07 AM, Niall Pemberton
niall.pember...@gmail.com wrote:

 I believe it does, but for example if a put a redirection pom in for
 commons-io:commons-io:1.4 to org.apache.commons:commons-io:1.4 the
 problem is that people will already have the old 1.4 pom in their
 local repo and unless they remove the old artifact, the new
 redirection pom will not be downloaded.


DOH!  Well, that stinks.  I guess we do need to have a discussion on
how we plan to play nice with respect to all of this
version/artifact/group management.  I think the plan of keeping the
artifactId and the package names in sync is a good idea.  But, we need
to be careful about this whole new groupId thing.  Should we fire up
a discussion thread on d...@?

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [io] is 2.0 on Maven?

2010-10-29 Thread James Carman
On Fri, Oct 29, 2010 at 9:31 AM, Niall Pemberton
niall.pember...@gmail.com wrote:

 We could, but I would suggest a slightly different approach. This has
 been discussed in the past and from memory there is more than one
 approach that could be taken. The problem with starting a discussion
 is that the different points people make about how and the pros and
 cons get fragmented among a large thread. I think the best thing would
 be to start a Wiki page - that way we could collect all the options
 and pros/cons in one place. Once we've done that then its likely to
 make any discussion much easier and less contentious. I'm very busy
 for the next week, so I'm happy to take part in that - but not just at
 the moment.

 WDYT?


Sounds like a sensible approach to me.  I was thinking the same thing
when we had all of the artifactId discussions just recently.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [io] is 2.0 on Maven?

2010-10-28 Thread James Carman
I wonder if it doesn't auto-sync since we changed the groupId/artifactId?

On Thu, Oct 28, 2010 at 8:38 PM, Paul Benedict pbened...@apache.org wrote:
 It's been released. Curiously too, i can't find it in the central Maven repo.

 On Thu, Oct 28, 2010 at 3:46 PM, Benson Margulies bimargul...@gmail.com 
 wrote:
 I can't find common-io 2.0 on Maven. Has it been released?

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [VFS] Connecting to a FTP server hungs up (sample included)

2010-10-18 Thread James Carman
It works for me.  Are you behind a firewall/proxy?

On Mon, Oct 18, 2010 at 2:21 PM, J-Pro jpro@gmail.com wrote:
  Good afternoon.

 Please help me solve my problem.
 I'm trying to download a file CBCP.TXT from
 ftp://ftp.microsoft.com:21/MISC;, but VFS hangs up after this log:

   10-18 20:22:42.787 EEST [main] INFO
 org.apache.commons.vfs.impl.DefaultFileReplicator  - Using
   C:\Temp\vfs_cache as temporary files store.
   10-18 20:22:42.857 EEST [main] DEBUG
   org.apache.commons.vfs.impl.StandardFileSystemManager  - Skipping
   provider org.apache.commons.vfs.provider.http.HttpFileProvider
   because required class org.apache.commons.httpclient.HttpClient is
   not available.
   10-18 20:22:42.858 EEST [main] DEBUG
   org.apache.commons.vfs.impl.StandardFileSystemManager  - Skipping
   provider org.apache.commons.vfs.provider.https.HttpsFileProvider
   because required class org.apache.commons.httpclient.HttpClient is
   not available.
   10-18 20:22:44.403 EEST [main] DEBUG
   org.apache.commons.vfs.cache.SoftRefFilesCache  - putFile:
   ftp://ftp.microsoft.com/MISC
   10-18 20:22:44.404 EEST [main] DEBUG
   org.apache.commons.vfs.cache.SoftRefFilesCache  - putFile:
   ftp://ftp.microsoft.com/

 I'm using this code inside my main method(for sure surrounded by try/catch
 block):

   String fileName = CBCP.TXT;
   FileSystemManager fsManager;
   fsManager = VFS.getManager();
   UserAuthenticator auth = new StaticUserAuthenticator(null,
   anonymous, );
   FileSystemOptions srcOpts = new FileSystemOptions();
   String sourceDirAsString = ftp://ftp.microsoft.com:21/MISC;;
 DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(srcOpts,
   auth);
   FileObject sourceDir = fsManager.resolveFile(sourceDirAsString,
   srcOpts); // HERE IS A HANG UP
   FileObject neededFile = sourceDir.resolveFile(fileName);

 In the marked the line where hang up happens, i.e. application freezes and
 waits.
 I've run it in debug mode and made a screenshot of suspended main stack:
 http://img690.imageshack.us/img690/1412/mainm.png

 I've successfully opened this FTP using both firefox and internet explorer.
 Why I can't open it using VFS?

 Thanks in advance!


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [VFS][SOLVED] Connecting to a FTP server hungs up (sample included)

2010-10-18 Thread James Carman
No problem!  Glad you figured it out and more glad that I didn't mess
things up with that FTPS patch! :)


On Mon, Oct 18, 2010 at 5:32 PM, J-Pro jpro@gmail.com wrote:
  I'm sorry, the problem is solved. It's not VFS problem, it's our office
 problem.
 The thing is that our IPs are not seen from outside, but active FTP mode
 needs that to be.

 Sorry for disturbing you guys, the problem is solved.

 On 18.10.2010 22:02, James Carman wrote:

 It works for me.  Are you behind a firewall/proxy?

 On Mon, Oct 18, 2010 at 2:21 PM, J-Projpro@gmail.com  wrote:

  Good afternoon.

 Please help me solve my problem.
 I'm trying to download a file CBCP.TXT from
 ftp://ftp.microsoft.com:21/MISC;, but VFS hangs up after this log:

   10-18 20:22:42.787 EEST [main] INFO
 org.apache.commons.vfs.impl.DefaultFileReplicator  - Using
   C:\Temp\vfs_cache as temporary files store.
   10-18 20:22:42.857 EEST [main] DEBUG
   org.apache.commons.vfs.impl.StandardFileSystemManager  - Skipping
   provider org.apache.commons.vfs.provider.http.HttpFileProvider
   because required class org.apache.commons.httpclient.HttpClient is
   not available.
   10-18 20:22:42.858 EEST [main] DEBUG
   org.apache.commons.vfs.impl.StandardFileSystemManager  - Skipping
   provider org.apache.commons.vfs.provider.https.HttpsFileProvider
   because required class org.apache.commons.httpclient.HttpClient is
   not available.
   10-18 20:22:44.403 EEST [main] DEBUG
   org.apache.commons.vfs.cache.SoftRefFilesCache  - putFile:
   ftp://ftp.microsoft.com/MISC
   10-18 20:22:44.404 EEST [main] DEBUG
   org.apache.commons.vfs.cache.SoftRefFilesCache  - putFile:
   ftp://ftp.microsoft.com/

 I'm using this code inside my main method(for sure surrounded by
 try/catch
 block):

   String fileName = CBCP.TXT;
   FileSystemManager fsManager;
   fsManager = VFS.getManager();
   UserAuthenticator auth = new StaticUserAuthenticator(null,
   anonymous, );
   FileSystemOptions srcOpts = new FileSystemOptions();
   String sourceDirAsString = ftp://ftp.microsoft.com:21/MISC;;

 DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(srcOpts,
   auth);
   FileObject sourceDir = fsManager.resolveFile(sourceDirAsString,
   srcOpts); // HERE IS A HANG UP
   FileObject neededFile = sourceDir.resolveFile(fileName);

 In the marked the line where hang up happens, i.e. application freezes
 and
 waits.
 I've run it in debug mode and made a screenshot of suspended main stack:
 http://img690.imageshack.us/img690/1412/mainm.png

 I've successfully opened this FTP using both firefox and internet
 explorer.
 Why I can't open it using VFS?

 Thanks in advance!


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: How can I get Commons-net-2.1 Source and Binaries

2010-10-14 Thread James Carman
Why does the site list it in the release notes?   Do we need to move all of
the jira issues to 2.2?
On Oct 14, 2010 3:36 AM, Jörg Schaible joerg.schai...@gmx.de wrote:
 陳雪傑 wrote:


 Hi all

 How can I get Commons-net-2.1 Source and Binaries?

 I want get publiced Commons-net-2.1 Source and Binaries from apache,
 but the page (http://commons.apache.org/net/download_net.cgi) do not
 provide it.

 You cannot, since it was never officially released. So, yes, there is a
tag
 in Subversion, but nobody knows, who spread it into public, what it
actually
 contains and you're on your own using this code. Therefore you cannot
 download any binaries or tar balls, it has no direct support here.
Actually
 you should use version 2.0 until we release the next version which will be

 2.2.

 - Jörg


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



Re: [VFS][SFTP] Unable to navigate to directory

2010-09-15 Thread James Carman
I committed a patch a while ago in the FTP provider to have it support
symbolic links better:

https://issues.apache.org/jira/browse/VFS-196

Perhaps we need to do that with SFTP too?

On Wed, Sep 15, 2010 at 11:52 AM, Ralph Goers
ralph.go...@dslextreme.com wrote:
 So the data directory is a link to another mount.  I'm not familiar with 
 the SFTP code but my guess is there is something preventing it from following 
 links.

 Ralph

 On Sep 15, 2010, at 7:45 AM, Nicolas Delsaux wrote:

 On Wed, Sep 15, 2010 at 4:11 PM, Ralph Goers ralph.go...@dslextreme.com 
 wrote:

 What does ls show when in myappli?


 server:/appli/myappli # ls -la
 total 25041454
 drwxr-xr-x 12 root root            576 Sep 15 16:17 .
 drwxr-xr-x 28 root perigee        1632 Aug  3 11:03 ..
 lrwxrwxrwx  1 root root             18 Jan 23  2010 data - 
 /mnt/md0/data_63d/

 Damn, maybe this prevents navigation, no ?

 --
 Nicolas Delsaux

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: persistent connection with https (Apache commons-httpClient 3.0)

2010-09-07 Thread James Carman
This is no longer the mailing list for HttpClient.  Check out:

http://hc.apache.org/httpclient-3.x/mail-lists.html


On Tue, Sep 7, 2010 at 12:30 PM, vinod jadhav vinodjjad...@gmail.com wrote:
 Hi ,

 I am using the Apache commons-httpclient 3.0 library.

 I have set the MultiThreadedHttpConnectionManager for httpSSLclient.

 I expect here the httpsClient SSLSocket to remain alive , So that for
 subsequent http request the same SSLSocket should be used.

 But now when my https request gets completed , the HttpConnection.close()
 method is invoked and the SSLSocket gets closed.

 Hence always a new SSLSocket gets opened !

 Can someone give me pointer if its limitation in HttpClient library  or how
 to tackle it.

 Thanks in Advance,
 Vinod Jadhav


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [vfs] Does VFS already has support for FTPS (FTP over SSL)?

2010-09-07 Thread James Carman
Those people are probably monitoring this list.  This is the best way
to reach them.  We prefer that the discussions happen on-list so that
it's an open discussion that everyone can follow.

On Tue, Sep 7, 2010 at 4:38 PM, J-Pro jpro@gmail.com wrote:
 How can I contact these people about this problem, don't you know?
 About the patch... I've tried to apply it using TortoiseSVN, partially I
 succeeded, but there are some code pieces which are not 100% clear for me if
 I should merge it or not. In other words I can't fully apply it to then
 successfully build the code. Maybe you'll get it better, Ralph. If you have
 few free minutes, please try it... Waiting for your answer.

 Thank you very much, Ralph.

 Ralph Goers wrote:

 I'm sorry. There are actually only a couple of people actively committing
 to the VFS code base currently.  The only answer I can give you is the same
 one as below. I can look at the patch and see what it would take to get it
 to apply, but I don't have an environment to test it.  I assume by your
 question that you've attempted to apply it but can't determine how the patch
 needs to be modified so it will successfully apply?

 Ralph


 On Sep 7, 2010, at 9:48 AM, J-Pro wrote:



 I'm sorry, is my message not delivered or something? I doubt that VFS
 developers doesn't know anything about patch in new version and release
 date...

 Please answer, it's very important for me. Thank you very much in
 advance.


 J-Pro wrote:


 Good afternoon again.
 Sorry for bothering you guys, but I really need this ability in VFS. Did
 anyone ever apply this patch? Or maybe there will be an update of VFS soon?
 Can some VFS developers answer me?

 Thank you very much in advance!


 J-Pro wrote:


 Thanks for the link with patch.
 I've tried to apply it with tortoise, but somewhy can't build the
 project. Maybe tortoise messed up.

 Anyway two questions:

  1. Did anyone ever applied this patch?
  2. When the new(FTPS patched) version of VFS will be released
    approximative? Because this patch in JIRA bug is there for more
    than a year(!) and it's not yet in the last version... Is it
    forgotten or what?

 Thanks in advance.


 Ralph Goers wrote:


 I would be happy to incorporate the patch but I don't have an
 environment to test this.   The patch doesn't include a test either.  If
 someone can apply the patch in their environment. create an
 FtpsProviderTestCase and verify that it works then I'll go ahead and 
 apply
 this along with the test case.

 Ralph

 On Aug 9, 2010, at 5:31 PM, James Carman wrote:




 Actually, the issue is still listed as Open, so I doubt the patch
 has been applied.

 On Mon, Aug 9, 2010 at 6:58 PM, Steve smsi...@gmail.com wrote:


 Wools!

 Looks like was included in the 2.0 build back in 2009.

 https://issues.apache.org/jira/browse/VFS-264



 S

 On Aug 9, 2010, at 3:59 PM, J-Pro jpro@gmail.com wrote:



 It's ok, thanks for the answer.

 I meant FTPS, not SFTP. It's also known as FTP Secure and FTP-SSL.
 See
 http://wikipedia.org/wiki/FTPS

 I use SFTP successfully also, but now I need to connect to some
 users
 using FTPS and it would be very disappointing if I need to use
 different
 code for that... it won't quite fit into architecture already build
 for
 using Apache VFS...

 Thanks.


 - 
 To
 unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [vfs] Does VFS already has support for FTPS (FTP over SSL)?

2010-09-07 Thread James Carman
Either way, you're having the discussion in the right place.
Remember, this stuff is all done by volunteers.  We try to be
responsive, but sometimes life gets in the way.  The patch applied
okay for me, by the way.

On Tue, Sep 7, 2010 at 4:51 PM, J-Pro jpro@gmail.com wrote:
 I've started this discussion a month ago and seems that these people either
 don't have an answer(which I doubt) or just didn't see my question. That's
 why I asked about how can I reach them.
 Well, anyway, it seems that currently Ralph is the only person who is able
 to help me, so I'm waiting for his answer...

 Thanks for the answer.

 James Carman wrote:

 Those people are probably monitoring this list.  This is the best way
 to reach them.  We prefer that the discussions happen on-list so that
 it's an open discussion that everyone can follow.

 On Tue, Sep 7, 2010 at 4:38 PM, J-Pro jpro@gmail.com wrote:


 How can I contact these people about this problem, don't you know?
 About the patch... I've tried to apply it using TortoiseSVN, partially I
 succeeded, but there are some code pieces which are not 100% clear for me
 if
 I should merge it or not. In other words I can't fully apply it to then
 successfully build the code. Maybe you'll get it better, Ralph. If you
 have
 few free minutes, please try it... Waiting for your answer.

 Thank you very much, Ralph.

 Ralph Goers wrote:


 I'm sorry. There are actually only a couple of people actively
 committing
 to the VFS code base currently.  The only answer I can give you is the
 same
 one as below. I can look at the patch and see what it would take to get
 it
 to apply, but I don't have an environment to test it.  I assume by your
 question that you've attempted to apply it but can't determine how the
 patch
 needs to be modified so it will successfully apply?

 Ralph


 On Sep 7, 2010, at 9:48 AM, J-Pro wrote:




 I'm sorry, is my message not delivered or something? I doubt that VFS
 developers doesn't know anything about patch in new version and release
 date...

 Please answer, it's very important for me. Thank you very much in
 advance.


 J-Pro wrote:



 Good afternoon again.
 Sorry for bothering you guys, but I really need this ability in VFS.
 Did
 anyone ever apply this patch? Or maybe there will be an update of VFS
 soon?
 Can some VFS developers answer me?

 Thank you very much in advance!


 J-Pro wrote:



 Thanks for the link with patch.
 I've tried to apply it with tortoise, but somewhy can't build the
 project. Maybe tortoise messed up.

 Anyway two questions:

  1. Did anyone ever applied this patch?
  2. When the new(FTPS patched) version of VFS will be released
   approximative? Because this patch in JIRA bug is there for more
   than a year(!) and it's not yet in the last version... Is it
   forgotten or what?

 Thanks in advance.


 Ralph Goers wrote:



 I would be happy to incorporate the patch but I don't have an
 environment to test this.   The patch doesn't include a test either.
  If
 someone can apply the patch in their environment. create an
 FtpsProviderTestCase and verify that it works then I'll go ahead and
 apply
 this along with the test case.

 Ralph

 On Aug 9, 2010, at 5:31 PM, James Carman wrote:





 Actually, the issue is still listed as Open, so I doubt the patch
 has been applied.

 On Mon, Aug 9, 2010 at 6:58 PM, Steve smsi...@gmail.com wrote:



 Wools!

 Looks like was included in the 2.0 build back in 2009.

 https://issues.apache.org/jira/browse/VFS-264



 S

 On Aug 9, 2010, at 3:59 PM, J-Pro jpro@gmail.com wrote:




 It's ok, thanks for the answer.

 I meant FTPS, not SFTP. It's also known as FTP Secure and
 FTP-SSL.
 See
 http://wikipedia.org/wiki/FTPS

 I use SFTP successfully also, but now I need to connect to some
 users
 using FTPS and it would be very disappointing if I need to use
 different
 code for that... it won't quite fit into architecture already
 build
 for
 using Apache VFS...

 Thanks.






 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [vfs] Does VFS already has support for FTPS (FTP over SSL)?

2010-09-07 Thread James Carman
Patch applied.  Check out trunk to get the changes.

On Tue, Sep 7, 2010 at 5:03 PM, James Carman ja...@carmanconsulting.com wrote:
 Either way, you're having the discussion in the right place.
 Remember, this stuff is all done by volunteers.  We try to be
 responsive, but sometimes life gets in the way.  The patch applied
 okay for me, by the way.

 On Tue, Sep 7, 2010 at 4:51 PM, J-Pro jpro@gmail.com wrote:
 I've started this discussion a month ago and seems that these people either
 don't have an answer(which I doubt) or just didn't see my question. That's
 why I asked about how can I reach them.
 Well, anyway, it seems that currently Ralph is the only person who is able
 to help me, so I'm waiting for his answer...

 Thanks for the answer.

 James Carman wrote:

 Those people are probably monitoring this list.  This is the best way
 to reach them.  We prefer that the discussions happen on-list so that
 it's an open discussion that everyone can follow.

 On Tue, Sep 7, 2010 at 4:38 PM, J-Pro jpro@gmail.com wrote:


 How can I contact these people about this problem, don't you know?
 About the patch... I've tried to apply it using TortoiseSVN, partially I
 succeeded, but there are some code pieces which are not 100% clear for me
 if
 I should merge it or not. In other words I can't fully apply it to then
 successfully build the code. Maybe you'll get it better, Ralph. If you
 have
 few free minutes, please try it... Waiting for your answer.

 Thank you very much, Ralph.

 Ralph Goers wrote:


 I'm sorry. There are actually only a couple of people actively
 committing
 to the VFS code base currently.  The only answer I can give you is the
 same
 one as below. I can look at the patch and see what it would take to get
 it
 to apply, but I don't have an environment to test it.  I assume by your
 question that you've attempted to apply it but can't determine how the
 patch
 needs to be modified so it will successfully apply?

 Ralph


 On Sep 7, 2010, at 9:48 AM, J-Pro wrote:




 I'm sorry, is my message not delivered or something? I doubt that VFS
 developers doesn't know anything about patch in new version and release
 date...

 Please answer, it's very important for me. Thank you very much in
 advance.


 J-Pro wrote:



 Good afternoon again.
 Sorry for bothering you guys, but I really need this ability in VFS.
 Did
 anyone ever apply this patch? Or maybe there will be an update of VFS
 soon?
 Can some VFS developers answer me?

 Thank you very much in advance!


 J-Pro wrote:



 Thanks for the link with patch.
 I've tried to apply it with tortoise, but somewhy can't build the
 project. Maybe tortoise messed up.

 Anyway two questions:

  1. Did anyone ever applied this patch?
  2. When the new(FTPS patched) version of VFS will be released
   approximative? Because this patch in JIRA bug is there for more
   than a year(!) and it's not yet in the last version... Is it
   forgotten or what?

 Thanks in advance.


 Ralph Goers wrote:



 I would be happy to incorporate the patch but I don't have an
 environment to test this.   The patch doesn't include a test either.
  If
 someone can apply the patch in their environment. create an
 FtpsProviderTestCase and verify that it works then I'll go ahead and
 apply
 this along with the test case.

 Ralph

 On Aug 9, 2010, at 5:31 PM, James Carman wrote:





 Actually, the issue is still listed as Open, so I doubt the patch
 has been applied.

 On Mon, Aug 9, 2010 at 6:58 PM, Steve smsi...@gmail.com wrote:



 Wools!

 Looks like was included in the 2.0 build back in 2009.

 https://issues.apache.org/jira/browse/VFS-264



 S

 On Aug 9, 2010, at 3:59 PM, J-Pro jpro@gmail.com wrote:




 It's ok, thanks for the answer.

 I meant FTPS, not SFTP. It's also known as FTP Secure and
 FTP-SSL.
 See
 http://wikipedia.org/wiki/FTPS

 I use SFTP successfully also, but now I need to connect to some
 users
 using FTPS and it would be very disappointing if I need to use
 different
 code for that... it won't quite fit into architecture already
 build
 for
 using Apache VFS...

 Thanks.






 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [Logging] : Can commons.logging be used without log4j

2010-08-09 Thread James Carman
Sounds like a classloader configuration issue.  OC4J probably has a
version of log4j on their classpath and it's bleeding over into the
classpath of your webapps.  Is there a webapp-classpath-first setting
somewhere?

On Mon, Aug 9, 2010 at 10:06 AM, Jasmin Mehta jasmin_me...@nexweb.org wrote:
 What you are suggesting may be true for JBoss. But I have it practically
 not working on OC4J.

 http://download-uk.oracle.com/docs/cd/B31017_01/web.1013/b28952/opensrc.htm#i637153

 According to this article, log4j.xml or log4j.properties plays the same
 role. I do have separate log4j.properties configured for each web
 application, pointing to different log directory and file name. But still
 it picks up the one which deploys first. Looks like limitation of OC4J.

 So that is why I am looking for option without using log4j at all.



 From:   Brent Worden brent.wor...@gmail.com
 To:     user@commons.apache.org
 Date:   08/09/2010 09:56 AM
 Subject:        Re: [Logging] : Can commons.logging be used without log4j


 On 8/9/2010 7:53 AM, Jasmin Mehta wrote:
 The log4j has limitation that if its used as a shared library then it
 can
 initiate only one configuration. So my all we applications which shares
 the same instance are populating the logs into only one log file (the
 web
 app which deployed first in order), rather than individual / separate
 log
 files configured in the path of each of the application's
 log4j.properties.


 This isn't true.  Log4j allows for defining and using multiple log
 configurations in a single JVM.  This is accomplished by using a
 RepositorySelector to manage the multiple log hierarchies.  See
 http://community.jboss.org/wiki/Log4jrepositoryselector for a web
 container example.

 Thanks,

 Brent Worden


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 **
 This email and any files transmitted with it are intended solely for
 the use of the individual or agency to whom they are addressed.
 If you have received this email in error please notify the Navy
 Exchange Service Command e-mail administrator. This footnote
 also confirms that this email message has been scanned for the
 presence of computer viruses.

 Thank You!
 **



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [vfs] Does VFS already has support for FTPS (FTP over SSL)?

2010-08-09 Thread James Carman
Actually, the issue is still listed as Open, so I doubt the patch
has been applied.

On Mon, Aug 9, 2010 at 6:58 PM, Steve smsi...@gmail.com wrote:
 Wools!

 Looks like was included in the 2.0 build back in 2009.

 https://issues.apache.org/jira/browse/VFS-264



 S

 On Aug 9, 2010, at 3:59 PM, J-Pro jpro@gmail.com wrote:

 It's ok, thanks for the answer.

 I meant FTPS, not SFTP. It's also known as FTP Secure and FTP-SSL. See
 http://wikipedia.org/wiki/FTPS

 I use SFTP successfully also, but now I need to connect to some users
 using FTPS and it would be very disappointing if I need to use different
 code for that... it won't quite fit into architecture already build for
 using Apache VFS...

 Thanks.

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-07 Thread James Carman
Or, you could possibly use MethodUtils to find the best matching setter method.

On Mon, Jun 7, 2010 at 2:53 AM, henrib hen...@apache.org wrote:

 I gather you need to invoke get/set methods through signature introspection
 rather than JavaBean spec.
 I dont know if this is possible for you to use it but JEXL2 just does that
 (JexlEngine.{s,g}etProperterty).
 Hope this can help,
 Henri
 --
 View this message in context: 
 http://apache-commons.680414.n4.nabble.com/beanutils-beanutils-library-cannot-invoke-the-correct-accessor-tp2244705p2245549.html
 Sent from the Commons - User mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-07 Thread James Carman
No, you wouldn't have the fields, just the methods that do the
conversion to store/retrieve the values from the one, main, field.

Also, I wouldn't consider this a lack of basic functionality on the
part of BeanUtils (*many* folks use BeanUtils in their projects and
haven't complained that this is a missing feature).  The BeanUtils
library is based on the JavaBeans specification.  In your case, how
would BeanUtils know how to process your API?  Would it be a
read/write property of type ClassTypeA?  Would it be a read-only
property of type ClassTypeB?

What you could do here is instead of using your own methods to convert
the values, you can register a converter for ClassTypeA that allows
you to convert from different types.

public class ClassTypeAConverter implements Converter
{
  public Object convert(Class type, Object value)
  {
if(type instanceof ClassTypeB)
{
  ...
}
  }
}

final ConvertUtilsBean convertUtils = new ConvertUtilsBean();
convertUtils.register(new ClassTypeAConverter(),ClassTypeA.class);
final BeanUtilsBean beanUtils = new BeanUtilsBean(convertUtils);
...
beanUtils.setProperty(myBean, myProperty, myClassTypeBObject);


On Mon, Jun 7, 2010 at 12:18 PM, Dimitris Tsitses 4.biz@gmail.com wrote:
 Hi James, thanks for keeping up with my questions.

 So, you mean end up with something like this: ?

 public class MyBean {
       private ClassTypeA myProperty;
       private ClassTypeB myPropertyAsB;
       private ClassTypeC myPropertyAsC;
       private ClassTypeD myPropertyAsD;
        .
        .

       public void setMyProperty(ClassTypeA anObj) {
               this.myProperty = anObj;
       }
       public void setMyPropertyAsB(ClassTypeB anObj) {
               this.myProperty = Converter.convertBtoA(anObj);
       }
        .
        .
        .
 }

 Isn't this hacky as hell, just to compensate for beanutils' lack of basic 
 functionality (i.e., method overloading)? That looks really messy in my 
 opinion, imagine doing that for a number of properties in a few beans. I 
 honestly don't understand why this functionality is missing from beanutils. 
 Anyhow, even if I wanted to do that, I could not in my use case. It's a very 
 dynamic environment where property names are computed automatically based on 
 mappings or field names in a DB. So I couldn't have multiple 'technical' 
 property names for the same 'logical' property without butchering an 
 otherwise very elegant design. I'd rather enhance the beanutils library 
 instead. So the question still stands, how would I go about it?

 Henri, thanks a lot for the tip about JEXL2, I will look into it and see if 
 it's less work to replace beanutils with that library, instead of enhancing 
 the beanutils library.



 On 2010-06-07, at 5:49 AM, James Carman wrote:

 Why not have another calculated property (myPropertyAsB) that can
 do the translation from ClassTypeB to/from ClassTypeA and store it
 into myProperty?  That way, you don't have to modify the library at
 all?

 On Mon, Jun 7, 2010 at 12:04 AM, Dimitris Tsitses 4.biz@gmail.com 
 wrote:
 Ok. I need some help to hack the library, where do I start. I want to make 
 it so that it checks the available setters against the objectType of the 
 given argument, instead of assuming an argument of a specific type. Example:

 BeanUtils.setProperty(myBeanInst, myProperty, instanceOfClassTypeX);

 Algo: is there a setMyProperty in myBeanInst, accepting an argument of type 
 ClassTypeX?
 YES: call it
 NO: throw exception

 Would appreciate it if someone could point me to the right direction for 
 achieving the above.

 Thanks
 Dimitris


 On 2010-06-06, at 8:24 PM, James Carman wrote:

 The property consists of the getter/setter, not some field.  So, the
 pair of matching setter/getter are what makes up the property.  The
 overloaded method isn't a setter for the property.

 On Sun, Jun 6, 2010 at 12:55 PM, Dimitris Tsitses 4.biz@gmail.com 
 wrote:
 myProperty is of one type only. The overloaded setters are there only for 
 convenience, i.e., to convert to the type of myProperty before setting 
 it. I don't think the JavaBeans spec disallows that, if it did, that 
 would mean that the JavaBeans spec undermines Java's spec! (i.e., do you 
 like method overloading? Well, you can't use it here!). That would of 
 course severally restrict JavaBeans usefulness.


 On 2010-06-06, at 5:50 AM, James Carman wrote:

 That violates the JavaBeans specification.  myProperty is supposed
 to be of one type only.

 On Sat, Jun 5, 2010 at 10:02 PM, Dimitris Tsitses 4.biz@gmail.com 
 wrote:
 Hi all, I'm trying to do something really simple but I can't seem to 
 figure it out, I hope someone can help.

 I have a simple bean:


 public class MyBean {
        private ClassTypeA myProperty;

        public void setMyProperty(ClassTypeA anObj) {
                this.myProperty = anObj;
        }
        public void setMyProperty(ClassTypeB anObj) {
                this.myProperty

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-07 Thread James Carman
On Mon, Jun 7, 2010 at 1:05 PM, Dimitris Tsitses 4.biz@gmail.com wrote:
 Hi James,

 actually replacing:
 BeanUtils.setProperty(myBeanInst, myProperty, instanceOfClassTypeX);

 with:
 MethodUtils.invokeMethod(myBeanInst, myPropertySetter, instanceOfClassTypeX);

 works like a dream, thanks for pointing out MethodUtils. I'm currently 
 converting 'myProperty' to 'myPropertySetter' manually (i.e., propertyName 
 - setPropertyName). Is there a convenience method that I could use for the 
 conversion?


Any modern IDE should have a rename refactoring feature.  I'd use that
to rename properties/methods.  That also will change the places where
it is used.  Very helpful.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-07 Thread James Carman
Create a helper method of your own somewhere?

On Mon, Jun 7, 2010 at 5:28 PM, Dimitris Tsitses 4.biz@gmail.com wrote:
 Sorry, it appears that I didn't explain myself properly. What I mean is that 
 BeanUtils.setProperty() expects to receive the property name (i.e., 
 customer), whereas MethodUtils.invokeMethod() expects to receive the method 
 name (i.e., setCustomer). So I'm wondering what is the best way to resolve 
 a property name into a setter method name. At the moment I use the following:

 PropertyDescriptor aPropDescriptor  = 
 PropertyUtils.getPropertyDescriptor(myBeanInstance, propName);
 String setterMethodName = PropertyUtils.getWriteMethod( 
 aPropDescriptor).getName();

 So that gives me the setter method name which I can pass to 
 MethodUtils.invokeMethod(). However, PropertyUtils.getPropertyDescriptor() 
 returns null for the bean example below. That's because a setter that accepts 
 an argument of type ClassTypeA is not defined in that bean. I suppose that's 
 not a big deal, I was just wondering though if there is an alternative way to 
 resolve a property name to the setter method name of that property, merely on 
 a string processing basis instead of reflection. Of course doing the string 
 processing manually is 2 lines of code, but was curious as to whether there 
 is a standard utility method in beanutils library.

 Thanks
 Dimitris


 public class MyBean {
       private ClassTypeA myProperty;

       public void setMyProperty(ClassTypeB anObj) {
               this.myProperty = Converter.convertBtoA(anObj);
       }

 }

 On 2010-06-07, at 2:05 PM, James Carman wrote:

 On Mon, Jun 7, 2010 at 1:05 PM, Dimitris Tsitses 4.biz@gmail.com wrote:
 Hi James,

 actually replacing:
 BeanUtils.setProperty(myBeanInst, myProperty, instanceOfClassTypeX);

 with:
 MethodUtils.invokeMethod(myBeanInst, myPropertySetter, 
 instanceOfClassTypeX);

 works like a dream, thanks for pointing out MethodUtils. I'm currently 
 converting 'myProperty' to 'myPropertySetter' manually (i.e., 
 propertyName - setPropertyName). Is there a convenience method that I 
 could use for the conversion?


 Any modern IDE should have a rename refactoring feature.  I'd use that
 to rename properties/methods.  That also will change the places where
 it is used.  Very helpful.

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-06 Thread James Carman
That violates the JavaBeans specification.  myProperty is supposed
to be of one type only.

On Sat, Jun 5, 2010 at 10:02 PM, Dimitris Tsitses 4.biz@gmail.com wrote:
 Hi all, I'm trying to do something really simple but I can't seem to figure 
 it out, I hope someone can help.

 I have a simple bean:


 public class MyBean {
        private ClassTypeA myProperty;

        public void setMyProperty(ClassTypeA anObj) {
                this.myProperty = anObj;
        }
        public void setMyProperty(ClassTypeB anObj) {
                this.myProperty = Converter.convertBtoA(anObj);
        }

 }

 If I invoke the setter by passing an instance of ClassTypeA, it works without 
 a problem:
 BeanUtils.setProperty(myBeanInst, myProperty, instanceOfClassTypeA);


 However if I invoke the setter by passing an instance of ClassTypeB, I get an 
 exception and the setter is never actually called:
 BeanUtils.setProperty(myBeanInst, myProperty, instanceOfClassTypeB);
 java.lang.IllegalArgumentException: Cannot invoke.. la la la - argument type 
 mismatch -

 I can't believe it is not possible to do that, I'm sure I'm just missing 
 something. Any help will be greatly appreciated.

 Many thanks
 Dimitris

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Problems with old and new group id

2010-04-15 Thread James Carman
I would suggest you bring this up to the Velocity community:

http://velocity.apache.org/contact.html

What we would hopefully do here in Apache Commons is that we would
change the package name so that there are no naming collisions even if
both jars are on the classpath.

On Thu, Apr 15, 2010 at 10:14 AM, Ludwig Magnusson
lud...@itcatapult.com wrote:
 Hi!

 I have a dependency in my project that in turn depends on velocity 1.5. More
 precisely velocity.velocity (maven 1 layout).

 However, my project also _directly_ depends on velocity 1.6.3 or,
 org.apache.velocity.velocity (maven 2 laoyt).

 Maven doesn't understand that these are different versions of the same
 artifact. Is there a way to solve this, because now two velocity packages
 are added to my classpath. It seems like this would be a very common problem
 with some kind of solution but I can't find information about it.

 /Ludwig



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Problems with old and new group id

2010-04-15 Thread James Carman
Well, I'd play around with doing excludes in your maven setup.

On Thu, Apr 15, 2010 at 10:31 AM, Ludwig Magnusson
lud...@itcatapult.com wrote:
 Well the problem is still that the project I depend on (turbine) will still
 have its velocity.velocity dependency. It does not matter if there is a
 correct one available, right?
 And this was just an example. There are lot of other dependencies that
 create the same problem.
 /Ludwig


 -Original Message-
 From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On
 Behalf Of James Carman
 Sent: den 15 april 2010 16:21
 To: Commons Users List
 Subject: Re: Problems with old and new group id

 I would suggest you bring this up to the Velocity community:

 http://velocity.apache.org/contact.html

 What we would hopefully do here in Apache Commons is that we would
 change the package name so that there are no naming collisions even if
 both jars are on the classpath.

 On Thu, Apr 15, 2010 at 10:14 AM, Ludwig Magnusson
 lud...@itcatapult.com wrote:
 Hi!

 I have a dependency in my project that in turn depends on velocity 1.5.
 More
 precisely velocity.velocity (maven 1 layout).

 However, my project also _directly_ depends on velocity 1.6.3 or,
 org.apache.velocity.velocity (maven 2 laoyt).

 Maven doesn't understand that these are different versions of the same
 artifact. Is there a way to solve this, because now two velocity packages
 are added to my classpath. It seems like this would be a very common
 problem
 with some kind of solution but I can't find information about it.

 /Ludwig



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Problems with old and new group id

2010-04-15 Thread James Carman
I would still ping the velocity list, too.  They might have had
someone else encounter this already.

On Thu, Apr 15, 2010 at 10:47 AM, Ludwig Magnusson
lud...@itcatapult.com wrote:
 Ok, I'll do that and hope it won't be too much to manage =)
 Thanks
 /Ludwig

 -Original Message-
 From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On
 Behalf Of James Carman
 Sent: den 15 april 2010 16:34
 To: Commons Users List
 Subject: Re: Problems with old and new group id

 Well, I'd play around with doing excludes in your maven setup.

 On Thu, Apr 15, 2010 at 10:31 AM, Ludwig Magnusson
 lud...@itcatapult.com wrote:
 Well the problem is still that the project I depend on (turbine) will
 still
 have its velocity.velocity dependency. It does not matter if there is a
 correct one available, right?
 And this was just an example. There are lot of other dependencies that
 create the same problem.
 /Ludwig


 -Original Message-
 From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com]
 On
 Behalf Of James Carman
 Sent: den 15 april 2010 16:21
 To: Commons Users List
 Subject: Re: Problems with old and new group id

 I would suggest you bring this up to the Velocity community:

 http://velocity.apache.org/contact.html

 What we would hopefully do here in Apache Commons is that we would
 change the package name so that there are no naming collisions even if
 both jars are on the classpath.

 On Thu, Apr 15, 2010 at 10:14 AM, Ludwig Magnusson
 lud...@itcatapult.com wrote:
 Hi!

 I have a dependency in my project that in turn depends on velocity 1.5.
 More
 precisely velocity.velocity (maven 1 layout).

 However, my project also _directly_ depends on velocity 1.6.3 or,
 org.apache.velocity.velocity (maven 2 laoyt).

 Maven doesn't understand that these are different versions of the same
 artifact. Is there a way to solve this, because now two velocity packages
 are added to my classpath. It seems like this would be a very common
 problem
 with some kind of solution but I can't find information about it.

 /Ludwig



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [LANG] incompatibility of jar with svn

2010-04-15 Thread James Carman
The Commons Lang library isn't intended to be mixed and matched
between releases like that.  The package is released as a whole.  You
can't expect to pick stuff out of different releases and then just
combine them and somehow expect them to work.

The reason the package name is changing is so that the next-generation
work on Commons Lang can move forward.  This way, even if you still
have an old version of Commons Lang in your classpath (because of a
third-party dependency) and you want to use Lang3, you can still do
it.  The code that depends on the old stuff will work just fine and
the code that depends on the new stuff will work just fine.

On Thu, Apr 15, 2010 at 11:04 AM, Tom Brito brito@gmail.com wrote:
 Hi all!

 I would like to know why this incompatibility between the jar file and the
 svn repository:
 In the jar file there is the package org.apache.commons.lang;
 This same package in svn is called org.apache.commons.lang3

 As consequence, I can't use code directly from svn, becouse it will not run
 with the jar.
 Anyone know why this incompatibility?

 Thanks!


 -- Wellington B. de Carvalho


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [LANG] incompatibility of jar with svn

2010-04-15 Thread James Carman
Yes, you can have code that uses both versions in your code.  What I
meant was that we support the codebase as a whole, publishable unit.
We don't expect folks to pick pieces out of different releases and try
to combine them.

The group id has been renamed to org.apache.commons already
(http://svn.apache.org/repos/asf/commons/proper/lang/trunk/pom.xml),
so you really can have two different versions in your maven project.
One might argue that the artifactId should be commons-lang3 for
consistency with later releases, but since we don't have any lang
releases in the org.apache.commons group yet, it's not that big of a
deal I guess (I'd prefer lang3 in the artifactId too).

On Thu, Apr 15, 2010 at 12:20 PM, Paul Benedict pbened...@apache.org wrote:
 James,

 Actually, I believe Lang 3 is supposed to be mixed and matched. That
 is why the package was renamed. What I think we have here are symptoms
 of an incomplete transition. If we really want mixing/matching, the
 groupId should be renamed too; otherwise, we should revert the package
 name.

 Paul

 On Thu, Apr 15, 2010 at 11:16 AM, Tom Brito brito@gmail.com wrote:
 But the new svn trunk don't have the lang package, just the lang3.
 So the code that depends on the old stuff don't work.

 -- Wellington B. de Carvalho


 On Thu, Apr 15, 2010 at 12:27 PM, James Carman
 ja...@carmanconsulting.comwrote:

 The Commons Lang library isn't intended to be mixed and matched
 between releases like that.  The package is released as a whole.  You
 can't expect to pick stuff out of different releases and then just
 combine them and somehow expect them to work.

 The reason the package name is changing is so that the next-generation
 work on Commons Lang can move forward.  This way, even if you still
 have an old version of Commons Lang in your classpath (because of a
 third-party dependency) and you want to use Lang3, you can still do
 it.  The code that depends on the old stuff will work just fine and
 the code that depends on the new stuff will work just fine.

 On Thu, Apr 15, 2010 at 11:04 AM, Tom Brito brito@gmail.com wrote:
  Hi all!
 
  I would like to know why this incompatibility between the jar file and
 the
  svn repository:
  In the jar file there is the package org.apache.commons.lang;
  This same package in svn is called org.apache.commons.lang3
 
  As consequence, I can't use code directly from svn, becouse it will not
 run
  with the jar.
  Anyone know why this incompatibility?
 
  Thanks!
 
 
  -- Wellington B. de Carvalho
 

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [LANG] incompatibility of jar with svn

2010-04-15 Thread James Carman
No, they're not supposed to be the same.  That's why we changed the
package name so that we have more leeway to change things.  We don't
guarantee backward (or binary) compatibility between major revisions.

On Thu, Apr 15, 2010 at 12:44 PM, Tom Brito brito@gmail.com wrote:
 The trunk and the jar have are different from each other. They aren't
 suppose to be the same code? And the Branches be the variants (not the
 Trunk)?

 -- Wellington B. de Carvalho


 On Thu, Apr 15, 2010 at 1:42 PM, Jörg Schaible joerg.schai...@gmx.dewrote:

 Hi Tom,

 Tom Brito wrote:

  But the new svn trunk don't have the lang package, just the lang3.
  So the code that depends on the old stuff don't work.

 The new stuff in 3.x is not binary compatible either. You have to adjust
 your code in any case, if you want to use it.

 - Jörg


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [LANG] incompatibility of jar with svn

2010-04-15 Thread James Carman
On Thu, Apr 15, 2010 at 12:37 PM, Paul Benedict pbened...@apache.org wrote:
 Great,

 Thanks James and sebb. Then all a user needs to do is declare both
 jars in a POM and things should be fine.

Well, yes, once there's a lang3 release in maven (or you build it on
your own into your local repo).

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [LANG] incompatibility of jar with svn

2010-04-15 Thread James Carman
You would have the old stuff and the new stuff on the classpath at
the same time.

On Thu, Apr 15, 2010 at 12:16 PM, Tom Brito brito@gmail.com wrote:
 But the new svn trunk don't have the lang package, just the lang3.
 So the code that depends on the old stuff don't work.

 -- Wellington B. de Carvalho


 On Thu, Apr 15, 2010 at 12:27 PM, James Carman
 ja...@carmanconsulting.comwrote:

 The Commons Lang library isn't intended to be mixed and matched
 between releases like that.  The package is released as a whole.  You
 can't expect to pick stuff out of different releases and then just
 combine them and somehow expect them to work.

 The reason the package name is changing is so that the next-generation
 work on Commons Lang can move forward.  This way, even if you still
 have an old version of Commons Lang in your classpath (because of a
 third-party dependency) and you want to use Lang3, you can still do
 it.  The code that depends on the old stuff will work just fine and
 the code that depends on the new stuff will work just fine.

 On Thu, Apr 15, 2010 at 11:04 AM, Tom Brito brito@gmail.com wrote:
  Hi all!
 
  I would like to know why this incompatibility between the jar file and
 the
  svn repository:
  In the jar file there is the package org.apache.commons.lang;
  This same package in svn is called org.apache.commons.lang3
 
  As consequence, I can't use code directly from svn, becouse it will not
 run
  with the jar.
  Anyone know why this incompatibility?
 
  Thanks!
 
 
  -- Wellington B. de Carvalho
 

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Connection reset exceptions

2010-04-05 Thread James Carman
you've tried supplying a validation query?

On Mon, Apr 5, 2010 at 4:13 PM, Bruno Melloni
bruno.mell...@chickasaw.net wrote:
 I started getting these on a long-running command-line application, with 
 Spring, SQL Server and DBCP for the DataSource.   What I found by googling 
 seems to point towards:


 a)      The database times out on idle connections and resets them.  Then 
 DBCP does not know how to handle it and fails.

 b)      A network failure causes a failure that triggers the error.

 The only solutions I found suggest that there is a bug in DBCP and that I 
 should switch to the c3p0 DataSource/connection pool.  But I suspect that 
 there must be a way (perhaps through config settings) to make DBCP not have 
 these issues.  I would welcome any help that I can get.

 Thank you.



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Connection reset exceptions

2010-04-05 Thread James Carman
Are you leaving the connection open while you wait for user input?

On Mon, Apr 5, 2010 at 4:19 PM, Bruno Melloni
bruno.mell...@chickasaw.net wrote:
 Yup!  Select 1

 And the exception only happens every once in a while, not constantly.

 -Original Message-
 From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On 
 Behalf Of James Carman
 Sent: Monday, April 05, 2010 3:17 PM
 To: Commons Users List
 Cc: Bruno Melloni
 Subject: Re: Connection reset exceptions

 you've tried supplying a validation query?

 On Mon, Apr 5, 2010 at 4:13 PM, Bruno Melloni
 bruno.mell...@chickasaw.net wrote:
 I started getting these on a long-running command-line application, with 
 Spring, SQL Server and DBCP for the DataSource.   What I found by googling 
 seems to point towards:


 a)      The database times out on idle connections and resets them.  Then 
 DBCP does not know how to handle it and fails.

 b)      A network failure causes a failure that triggers the error.

 The only solutions I found suggest that there is a bug in DBCP and that I 
 should switch to the c3p0 DataSource/connection pool.  But I suspect that 
 there must be a way (perhaps through config settings) to make DBCP not have 
 these issues.  I would welcome any help that I can get.

 Thank you.




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: International characters [FTPClient / VFS]

2010-03-25 Thread James Carman
File a JIRA.

On Thu, Mar 25, 2010 at 6:21 AM, Tom t...@tbee.org wrote:




 But there should be a better way.

 I notice that FileZilla automatically switches to UTF8, so I assume the FTP
 server informs the client what it is using? And that common-net FTP should
 be modified?

 Tom



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP findFiles vs FILE bug

2010-03-17 Thread James Carman
You might want to file a but with the Alfresco folks on this one.
Their FTP server implementation should support paths and not just
directory names for the CWD command.  Everyone else does.

On Wed, Mar 17, 2010 at 5:42 AM, Tom t...@tbee.org wrote:
 The same issues for storeFileStream and appendFileStream with the same fix.
 I assume that the FTP server of Alfresco is the culprit.

 Tom



 On 2010-03-16 19:26, James Carman wrote:

 I would say open up a JIRA and someone will take a look at it.  Make
 sure you attach your patch and check the box that says you allow the
 ASF to use your code (or whatever it says).

 On Tue, Mar 16, 2010 at 2:23 PM, Tomt...@tbee.org  wrote:


 What are the chances of this patch (I can give you the code) being
 submitted
 to SVN? I'd rather not use a special VFS.

 Tom



 On 2010-03-16 7:28, Tom wrote:


 All I can say: I checked out the code from subversion, put a break point
 in the FTP code, saw Alfresco/Documents come in as a parameter, that
 was
 handed over to the FTPClient and the method returned false to indicate
 an
 error. In a stand alone test of FTPClient I already noticed that handing
 over a compound path did not work, so I add a split and a loop et voila;
 the
 code worked.

 It may be Alfresco's FTP server, it may be FTPClient, I don't know. But
 this works and it seems like a more compatible implementation.

 Tom


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org





 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP findFiles vs FILE bug

2010-03-16 Thread James Carman
I would say open up a JIRA and someone will take a look at it.  Make
sure you attach your patch and check the box that says you allow the
ASF to use your code (or whatever it says).

On Tue, Mar 16, 2010 at 2:23 PM, Tom t...@tbee.org wrote:
 What are the chances of this patch (I can give you the code) being submitted
 to SVN? I'd rather not use a special VFS.

 Tom



 On 2010-03-16 7:28, Tom wrote:

 All I can say: I checked out the code from subversion, put a break point
 in the FTP code, saw Alfresco/Documents come in as a parameter, that was
 handed over to the FTPClient and the method returned false to indicate an
 error. In a stand alone test of FTPClient I already noticed that handing
 over a compound path did not work, so I add a split and a loop et voila; the
 code worked.

 It may be Alfresco's FTP server, it may be FTPClient, I don't know. But
 this works and it seems like a more compatible implementation.

 Tom


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP findFiles vs FILE

2010-03-15 Thread James Carman
Can you not just use getChildren()?

On Mon, Mar 15, 2010 at 10:54 AM, Tom t...@tbee.org wrote:
 Slowly making progress on using VFS for FTP access after all kinds of
 exception that did not make sense.

 Anyhow, I have a tree that shows a directory structure. If I specify
 file:///...   the contents of the filesystem is shown; specifically
 findFiles loops into all childeren. If I only replace this withftp://...;
 findFiles does no longer loop into its childeren; it only finds itself. So
 that means that if I unfold a directory I see the same directory again,
 unfold, same dir, unfold, same dir, ...

 Why is the behavior for file: different from ftp:?
 How do I find childeren of an FTP FileObject?


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP findFiles vs FILE

2010-03-15 Thread James Carman
I've used the filtering options with an FTP site before.  Do you have
code that goes against any public FTP sites that you can share with us
that exhibits the behavior?

On Mon, Mar 15, 2010 at 12:00 PM, Tom t...@tbee.org wrote:
 I can, however I would then need to apply my own filter and VFS supports
 FileSelection...

 Tom


 On 2010-03-15 16:03, James Carman wrote:

 Can you not just use getChildren()?

 On Mon, Mar 15, 2010 at 10:54 AM, Tomt...@tbee.org  wrote:


 Slowly making progress on using VFS for FTP access after all kinds of
 exception that did not make sense.

 Anyhow, I have a tree that shows a directory structure. If I specify
 file:///...   the contents of the filesystem is shown; specifically
 findFiles loops into all childeren. If I only replace this
 withftp://...;
 findFiles does no longer loop into its childeren; it only finds itself.
 So
 that means that if I unfold a directory I see the same directory again,
 unfold, same dir, unfold, same dir, ...

 Why is the behavior for file: different from ftp:?
 How do I find childeren of an FTP FileObject?


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org





 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP findFiles vs FILE

2010-03-15 Thread James Carman
I don't know if it's a bug or not.  I can access this URL just fine:

ftp://ftp.ncbi.nih.gov/gene/DATA/

And, it has gene/DATA off the main server.  So, the CWD stuff
shouldn't be the problem.  Here's my code:

FileObject baseDir =
VFS.getManager().resolveFile(ftp://ftp.ncbi.nih.gov/gene/DATA/;);
FileObject[] files = baseDir.getChildren();// baseDir.findFiles(new
AllFileSelector());
System.out.println(Found  + files.length +  files!);

It works with either findFiles() or getChildren().

On Mon, Mar 15, 2010 at 5:48 PM, Tom t...@tbee.org wrote:
 Naturally the better solution is to patch the changeWorkingDirectory method
 in the FTPClientWrapper

 Tom



 On 2010-03-15 22:44, Tom wrote:

 I found the problem: FTPClient cannot do a changeWorkingDirectory with
 multiple directories (Alfresco/Documents), you need to take it there
 step-by-step: first changeWorkingDirectory to Alfresco, then
 changeWorkingDirectory to Documents.

 A simple relPath.split(/) with a for loop solves it.

 Tom





 On 2010-03-15 22:04, Tom wrote:

 And last but not least; accessing the FTP server using Apache Commons Net
 FTPClient works fine as well. It really is something VFS does wrong.

    ftp://admin:ad...@localhost/Alfresco/Documents




 On 2010-03-15 21:23, Tom wrote:

 Interestingly enough getChilderen() on the FTP returns an empty array,
 FILE returns the correct childeren, so rewriting it does not help much.
 Naturally I'm able to connect to the URL using Filezilla and it shows
 the childeren correctly.



 On 2010-03-15 17:41, Tom wrote:

 On 2010-03-15 16:03, James Carman wrote:

 Can you not just use getChildren()?

 On Mon, Mar 15, 2010 at 10:54 AM, Tomt...@tbee.org    wrote:

 Slowly making progress on using VFS for FTP access after all kinds
 of
 exception that did not make sense.

 Anyhow, I have a tree that shows a directory structure. If I
 specify
 file:///...   the contents of the filesystem is shown;
 specifically
 findFiles loops into all childeren. If I only replace this
 withftp://...;
 findFiles does no longer loop into its childeren; it only finds
 itself.
 So
 that means that if I unfold a directory I see the same directory
 again,
 unfold, same dir, unfold, same dir, ...

 Why is the behavior for file: different from ftp:?
 How do I find childeren of an FTP FileObject?



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [dbcp] Re: Oracle session excess over maxActive

2010-03-10 Thread James Carman
Have you considered using Spring's JDBC support, or something like it?
 What you need to do is write/use one piece of code that makes sure
you manage your connections, etc. correctly and use that wherever you
want to do JDBC stuff.

On Wed, Mar 10, 2010 at 12:10 AM, sic sic_1...@naver.com wrote:

 Yeah, I'll check whether I close PreparedStatements, Statements and ResultSet
 objects properly on my code.
 Then I think I've already use testOnBorrow without stating clearly property
 name=testOnBorrow value=true/ since it's default value is true.
 If it occurs again, I'll monitor the number of opened connections by the
 netstat command, thanks.

 And I'm addressing the appropriate configuration in my case.
 I can understand that 5 connections(maxActive(=15) - maxIdle(same as
 minIdle=10)) are destroyed and created continuously.
 So I'm going to set maxIdle property to a negative value(or more than
 maxActive value) in order not to destroy connections.

 However dropping both of these(e.g. maxIdle = 5, minIdle = 2) as you
 remarked above, it's likely to force the pool to destroy excess connections
 and create them more extremely.
 I wonder what means dropping both of these and want to point out my
 misunderstanding.

 BTW, I'll observe the DB session states after upgrading to the latest
 version and eliminating the aggressive abandoned connection cleanup,
 checking my closing code.

 regards,
 sic
 --
 View this message in context: 
 http://n4.nabble.com/Oracle-session-excess-over-maxActive-tp1584311p1586964.html
 Sent from the Commons - User mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: expected behavior of the DBCP (when a db session is killed)

2010-02-24 Thread James Carman
Do you have the validation query set?

On Wed, Feb 24, 2010 at 7:12 AM,  co...@sapo.pt wrote:
 Good morning,

 What is the expected behavior of the DBCP when I try to get a connection
 from the pool and the connection is invalid (eg a session kill was made in
 the database)?

 Is it identified that the conn is invalid, the conn is refreshed and
 returned a valid connection or is returned an exception?


 Context initContext = new InitialContext();
 Context envContext  = (Context)initContext.lookup(java:/comp/env);
 DataSource ds = (DataSource)envContext.lookup(jdbc/myoracle);


 # A session KILL is made in the database ###

 Connection conn = ds.getConnection();

 # what's happen here? ##

 Thanks,
 Best Regards

 Thanks
 Best Regards





 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: expected behavior of the DBCP (when a db session is killed)

2010-02-24 Thread James Carman
It will attempt to establish a new connection.

On Wed, Feb 24, 2010 at 11:56 AM,  co...@sapo.pt wrote:

 what happens if validateQuery() determines that the connection is invalid?
 Will return another valid connection (in runtime) or will return an
 exception which must be handled?

 Thanks!

 Citando cyrille@free.fr:

 Hi,

 you will get a connection object that is no more linked to your db, so
 your thread might get stuck when trying to get data.

 To prevent this you can:
 - set testOnBorrow = true
 - set the validation query

 This will validate the connection before taking it out of the pool, so you
 make sure the connection is valid once taken out of the pool.
 This will cause dbcp to make an extra sql call to your db for every
 business sql, so be sure your db can cope with this extra load.

 Note that you are not guaranted that the connection is alive when you want
 to use it then, i.e network could break after you picked the connection.
 To handle this case, you can use the Statement.setTimeout(), but I did not
 test that yet.

 Hope this helps,
 Cyrille

 - Mail Original -
 De: James Carman ja...@carmanconsulting.com
 À: Commons Users List user@commons.apache.org
 Envoyé: Mercredi 24 Février 2010 14h14:59 GMT +01:00 Amsterdam / Berlin /
 Berne / Rome / Stockholm / Vienne
 Objet: Re: expected behavior of the DBCP (when a db session is killed)

 Do you have the validation query set?

 On Wed, Feb 24, 2010 at 7:12 AM,  co...@sapo.pt wrote:

 Good morning,

 What is the expected behavior of the DBCP when I try to get a connection
 from the pool and the connection is invalid (eg a session kill was made
 in
 the database)?

 Is it identified that the conn is invalid, the conn is refreshed and
 returned a valid connection or is returned an exception?


 Context initContext = new InitialContext();
 Context envContext  = (Context)initContext.lookup(java:/comp/env);
 DataSource ds = (DataSource)envContext.lookup(jdbc/myoracle);


 # A session KILL is made in the database ###

 Connection conn = ds.getConnection();

 # what's happen here? ##

 Thanks,
 Best Regards

 Thanks
 Best Regards





 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: How to use DBCP in J2SE environment

2009-12-15 Thread James Carman
Even with JPA, I'd suggest using Spring so that your transactions are
easier to manage and your EntityManagers are cleaned up at the
appropriate times.

On Tue, Dec 15, 2009 at 9:58 PM, NBW email...@gmail.com wrote:
 Or you could use JPA with Hibernate in your J2SE environment and get
 connection pooling with JPA goodness.

 On Mon, Dec 14, 2009 at 11:41 AM, James Carman
 ja...@carmanconsulting.comwrote:

 I would recommend using something like Spring's jdbc support, so that
 this stuff happens for you automatically if you want to do straight
 JDBC.  You can use DBCP with it, too!

 On Mon, Dec 14, 2009 at 12:45 AM, Pawan Singh pa...@pinger.org wrote:
  Hi
 
  Can someone with Apache DBCP expertise clarify this question? This code
 snippet assumes that Database connection pools have been established using
 Apache DBCP package.
 
  public ResultSet getResults(String sql)
  {
 
            Connection conn = pooledDataSource.getConnection();   -- gets
 connection from pool
            PreparedStatement stmt = conn.prepareStatement(sql,...);
            ResultSet rs = stmt.executeQuery();
            conn.close(); --- return to pool
            return rs;
  }
 
  public uicode_in_someotherproject() {
         ResultSet rs  = getResults(SELECT * from foo);
         bindDataToTableControl(rs);
  }
 
  My problem is simply controlling the lifetime of the ResultSet. Since it
 is a J2SE app, and we return ResultSet back to the user interface to bind
 data to user controls, I cannot close the connection. This is because
 PoolableConnection actually passivates the connection on returning to pool
 which closes the statement and result set.
 
  My only other choice is to make the top layer control the lifetime of
 connection and statement - but that is ugly. I though that DBCP's connection
 pool will simply return the connection without passivating it and
 therefore everything will work properly.
 
  I just want advice from experts on how to control the lifetime of
 ResultSet. Do I have to keep a reference to connection object till I am
 ready to discard ResultSet?
 
  Another question is related to garbage collection. Why does DBCP not
 use finalize to return these connections and statements back to pool? It
 would seem to me that it will solve some of the problems related to having
 to call close on all these objects properly - otherwise one can cause a
 leak.
 
  -Pawan
  -
  To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
  For additional commands, e-mail: user-h...@commons.apache.org
 
 

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: How to use DBCP in J2SE environment

2009-12-14 Thread James Carman
I would recommend using something like Spring's jdbc support, so that
this stuff happens for you automatically if you want to do straight
JDBC.  You can use DBCP with it, too!

On Mon, Dec 14, 2009 at 12:45 AM, Pawan Singh pa...@pinger.org wrote:
 Hi

 Can someone with Apache DBCP expertise clarify this question? This code 
 snippet assumes that Database connection pools have been established using 
 Apache DBCP package.

 public ResultSet getResults(String sql)
 {

           Connection conn = pooledDataSource.getConnection();   -- gets 
 connection from pool
           PreparedStatement stmt = conn.prepareStatement(sql,...);
           ResultSet rs = stmt.executeQuery();
           conn.close(); --- return to pool
           return rs;
 }

 public uicode_in_someotherproject() {
        ResultSet rs  = getResults(SELECT * from foo);
        bindDataToTableControl(rs);
 }

 My problem is simply controlling the lifetime of the ResultSet. Since it is a 
 J2SE app, and we return ResultSet back to the user interface to bind data to 
 user controls, I cannot close the connection. This is because 
 PoolableConnection actually passivates the connection on returning to pool 
 which closes the statement and result set.

 My only other choice is to make the top layer control the lifetime of 
 connection and statement - but that is ugly. I though that DBCP's connection 
 pool will simply return the connection without passivating it and therefore 
 everything will work properly.

 I just want advice from experts on how to control the lifetime of ResultSet. 
 Do I have to keep a reference to connection object till I am ready to discard 
 ResultSet?

 Another question is related to garbage collection. Why does DBCP not use 
 finalize to return these connections and statements back to pool? It would 
 seem to me that it will solve some of the problems related to having to call 
 close on all these objects properly - otherwise one can cause a leak.

 -Pawan
 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Determine if an object is in a list

2009-12-01 Thread James Carman
I was looking for that.  It used to be in collections I believe.

On Tue, Dec 1, 2009 at 10:43 AM, Brent Worden brent.wor...@gmail.com wrote:
 On Mon, Nov 30, 2009 at 10:38 PM, Guy Rouillier guyr-...@burntmail.com 
 wrote:
 James Carman wrote:

 It's not that hard to create your own predicate that does what you
 want.  We did that for our project.  Here are the two classes we use
 (the first one is a useful superclass for property value-based
 predicates):

 James, thank you.  This is indeed what I was looking for.  Mind if I include
 your classes with a feature request? (with attribution, of course.)  I think
 this is basic functionality that should be included with Commons
 Collections.


 I think commons-beanutils has the predicate you need.

 http://commons.apache.org/beanutils/v1.8.2/apidocs/org/apache/commons/beanutils/BeanPropertyValueEqualsPredicate.html

 Brent

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Determine if an object is in a list

2009-11-30 Thread James Carman
It's not that hard to create your own predicate that does what you
want.  We did that for our project.  Here are the two classes we use
(the first one is a useful superclass for property value-based
predicates):

public abstract class AbstractPropertyValuePredicate implements Predicate {

private final String propertyName;

public AbstractPropertyValuePredicate (final String propertyName)  {
this.propertyName = propertyName;
}

public final boolean evaluate( Object o )
{
try
{
final Object propertyValue = PropertyUtils.getProperty( o,
propertyName );
return evaluatePropertyValue(propertyValue);
}
catch( IllegalAccessException e )
{
throw new RuntimeException(e);
}
catch( InvocationTargetException e )
{
throw new RuntimeException(e);
}
catch( NoSuchMethodException e )
{
throw new RuntimeException(e);
}
}

protected abstract boolean evaluatePropertyValue(Object value);
}

public class PropertyValuePredicate extends AbstractPropertyValuePredicate {
private final Object targetValue;

public PropertyValuePredicate (String propertyName, Object targetValue) {
super( propertyName );
this.targetValue = targetValue;
}

protected boolean evaluatePropertyValue( Object value )
{
return targetValue == value || (targetValue != null 
targetValue.equals( value ));
}
}
On Mon, Nov 30, 2009 at 10:37 PM, Guy Rouillier guyr-...@burntmail.com wrote:
 I have a list of objects of class X.  X has a unique identifier property  P.
  Given a value p, I want to see if the list contains an object where x.P =
 p.  Very simple, I ended up using a for loop to iterate over the objects in
 listX, breaking when I found the first occurrence.

 Before doing that, however, I tried to find something in Commons that would
 do this for me.  The closest I could find was
 org.apache.commons.collections.CollectionUtils.find(java.util.Collection
 collection, Predicate predicate).  However, I couldn't find a simple
 PropertyPredicate that allowed me to say look for objects whose property P
 is p.  That seems like one of the most obvious uses of find, so I believe
 I'm just not looking in the right place.

 I'd appreciate a pointer to where I can find this.  Thanks.

 --
 Guy Rouillier

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Determine if an object is in a list

2009-11-30 Thread James Carman
I don't know if it would get through (I'd probably vote against it and
I'm the author).  We don't want to get to beanutilsy in collections.
 Collections only provides the framework.

On Mon, Nov 30, 2009 at 11:38 PM, Guy Rouillier guyr-...@burntmail.com wrote:
 James Carman wrote:

 It's not that hard to create your own predicate that does what you
 want.  We did that for our project.  Here are the two classes we use
 (the first one is a useful superclass for property value-based
 predicates):

 James, thank you.  This is indeed what I was looking for.  Mind if I include
 your classes with a feature request? (with attribution, of course.)  I think
 this is basic functionality that should be included with Commons
 Collections.


 public abstract class AbstractPropertyValuePredicate implements Predicate
 {

    private final String propertyName;

    public AbstractPropertyValuePredicate (final String propertyName)  {
        this.propertyName = propertyName;
    }

    public final boolean evaluate( Object o )
    {
        try
        {
            final Object propertyValue = PropertyUtils.getProperty( o,
 propertyName );
            return evaluatePropertyValue(propertyValue);
        }
        catch( IllegalAccessException e )
        {
            throw new RuntimeException(e);
        }
        catch( InvocationTargetException e )
        {
            throw new RuntimeException(e);
        }
        catch( NoSuchMethodException e )
        {
            throw new RuntimeException(e);
        }
    }

    protected abstract boolean evaluatePropertyValue(Object value);
 }

 public class PropertyValuePredicate extends AbstractPropertyValuePredicate
 {
    private final Object targetValue;

    public PropertyValuePredicate (String propertyName, Object targetValue)
 {
        super( propertyName );
        this.targetValue = targetValue;
    }

    protected boolean evaluatePropertyValue( Object value )
    {
        return targetValue == value || (targetValue != null 
 targetValue.equals( value ));
    }
 }
 On Mon, Nov 30, 2009 at 10:37 PM, Guy Rouillier guyr-...@burntmail.com
 wrote:

 I have a list of objects of class X.  X has a unique identifier property
  P.
  Given a value p, I want to see if the list contains an object where x.P
 =
 p.  Very simple, I ended up using a for loop to iterate over the objects
 in
 listX, breaking when I found the first occurrence.

 Before doing that, however, I tried to find something in Commons that
 would
 do this for me.  The closest I could find was
 org.apache.commons.collections.CollectionUtils.find(java.util.Collection
 collection, Predicate predicate).  However, I couldn't find a simple
 PropertyPredicate that allowed me to say look for objects whose property
 P
 is p.  That seems like one of the most obvious uses of find, so I
 believe
 I'm just not looking in the right place.

 I'd appreciate a pointer to where I can find this.  Thanks.

 --
 Guy Rouillier

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




 --
 Guy Rouillier

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Hex.encodeHexString([B)Ljava/lang/String;

2009-11-17 Thread James Carman
It's probably the space in Program Files ?  Either way, it's showing
that it's getting the file from the 1.4 jar, so that's a good sign
that you're using the one you think you're using.  I haven't use WS in
a long time, so I don't know what's going on with their classpath.
I'd make sure you turn on the setting that tells it to use the
application (not the container) classpath first.

On Mon, Nov 16, 2009 at 3:06 PM, Java Struts struts...@gmail.com wrote:
 Hey thanks a lot for the response...

 I have added the below code to the my code and i am getting the below
 exception. It is able to find the jar file location but i am getting the
 exception for the below line.
 JarFile jarFile = new JarFile(new File(loc.toURI()));

 The exception is here..

 Illegal character in path at index 16: file:/C:/Program
 Files/IBM/SDP70/runtimes/base_v61/profiles/AppSrv01/installedApps/VIPFOLSL0039Node01Cell/TeleworkServiceEAR.ear/lib/commons-codec-1.4.jar
 : java.net.URISyntaxException: Illegal character in path at index 16:

 don't know wht's going on.. Here is the manifest file for the same.

 Manifest-Version: 1.0
 Class-Path: TeleworkServiceJAVA.jar
  lib/commons-codec-1.4.jar
  lib/classes12.jar
  lib/commons-logging.jar
  lib/j2ee.jar
  lib/log4j-1.2.15.jar
  lib/commons-lang-2.4.jar

 One more thing is.. i have added the same code to a simple standalone java
 class file and which is working fine. But why it's giving the problem at the
 webspehere level i don't know...


 Could you please help me on this.

 Thanks,
 Srini.


 On Tue, Nov 10, 2009 at 4:25 PM, James Carman 
 ja...@carmanconsulting.comwrote:

 It's obviously a classpath issue.  Throw this code somewhere where it
 can be executed in your environment where you're having troubles:

 final URL loc =
 Hex.class.getProtectionDomain().getCodeSource().getLocation();
 System.out.println(Found jar file at  + loc);
 final JarFile jarFile = new JarFile(new File(loc.toURI()));
 System.out.println(The version is  +

 jarFile.getManifest().getMainAttributes().getValue(Specification-Version));

 On Tue, Nov 10, 2009 at 2:59 PM, Java Struts struts...@gmail.com wrote:
  Hi Julis,
 
  Thanks a lot for the response. Here is the info. I am thinking it might
 be
  the classpath issue. But i am not 100% sure.
 
  Thanks,
 
 
  On Tue, Nov 10, 2009 at 2:12 PM, Julius Davies juliusdav...@gmail.com
 wrote:
 
  Hi,
 
  Can you supply some version information?
 
  Local machine
  -
  OS Type and Version? *Windows Xp Pro*
  Java Version? *1.5*
  Websphere version? *6.0*
  Commons-Codec version? *1.4*
 
 
  Dev machine
  -
  OS Type and Version?   Linux. *HP-UX,  B.11.11 *
  Java Version? :1.5
  Websphere version? 6.0
  Commons-Codec version? 1.4
 
 
  Also, can you find out if any different versions of commons-codec are
  also present on the dev machine?  Perhaps several versions of the jar
  file are sitting around, and Websphere is picking up an old one?
 
 
 
  yours,
 
  Julius
 
 
 
 
 
  On Tue, Nov 10, 2009 at 10:13 AM, Java Struts struts...@gmail.com
 wrote:
   Hi Folks,
  
   I am using Apache Commons Codec, to convert the encrypted bytes into a
   HexString to pass through the URL. So when i am using it in local
 machine
   which is working fine. when the same into Dev(Linux websphere) it's
 not
   working and it's throwing the following exception.
  
   *java.lang.NoSuchMethodError:
  
 
 org.apache.commons.codec.binary.Hex.encodeHexString([B)Ljava/lang/String;*
  
   Here is the code i am using for it.
  
   *public static String encryptString(SecretKey key, String input)
 throws
   NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException
 {
          logger.error( Input String to Encrypt:  + input );
          Cipher cipher = Cipher.getInstance(DESede);
          cipher.init(Cipher.ENCRYPT_MODE, key);
          //byte[] inputBytes = input.getBytes();
          String encryptedString =;
          byte[] inputBytes;
  
          try {
              logger.error( Inside Try block of Encrypted String
 Method);
              inputBytes = input.getBytes(UTF-8);
              byte[] encryptedBytes= cipher.doFinal(inputBytes);
              logger.error( got encrypted bytes);
  
              encryptedString= Hex.encodeHexString(encryptedBytes);
              logger.error( Encrypted String :  +encryptedString);
              }
          catch (UnsupportedEncodingException e) {
      // TODO Auto-generated catch block
              logger.error(Inside Unsupported Catch Block  +
  e.getMessage()
   +  : +  e );
              e.printStackTrace();
  
  
          }
          catch (Throwable e) {
              // TODO Auto-generated catch block
              logger.error(Inside Exception Catch Block  +
 e.getMessage()
  +
:  +e );
              e.printStackTrace();
                  }
          return encryptedString;*
  
  
   Could you please help me guys, I am just wondering why this is
 throwing

Re: DBCP deadlock

2009-11-12 Thread James Carman
That's the version of commons-dbcp (which is current).  What version
of commons-pool are you using?

On Thu, Nov 12, 2009 at 4:11 AM, Marc Logemann m...@logemann.org wrote:
 Uhh forgot mention this. Seems i am using 1.2.2 ... quite old isnt it? I am
 using Maven Central for JAR management and 1.2.2 is the latest over there.
 Is there a better repository for Commons-DBCP somewhere?


 ---
 regards
 Marc Logemann
 http://www.logemann.org
 http://www.logentis.de




 Am 12.11.2009 um 10:04 schrieb Cyrille Roy:

 Hi,
 which version of common_pool are you using ?
 there is a synchronization issue on 1.3 version, which has been fixed on
 1.4
 See
 http://www.docjar.com/html/api/org/apache/commons/pool/impl/GenericObjectPool.java.html or
 get the source

 1.4 source

 911      public Object borrowObject() throws Exception {
 912          long starttime = System.currentTimeMillis();
 913          for(;;) {
 914              ObjectTime


 1.3 source

 http://www.jdocs.com/pool/1.3/org/apache/commons/pool/impl/GenericObjectPool.Config.html

 |0780*publicsynchronized*ObjectborrowObject()*throws*Exception{
 0781assertOpen();
 0782*long*starttime=System.currentTimeMillis();
 0783*for*(;;){
 0784ObjectTime


 |Regards,
 Cyrille

 Marc Logemann wrote:

 Hi,

 we are facing some deadlocks in production situation with DBCP. We
 analyzed it a bit and even though there are way much lower connections than
 the pool should be able to handle (real DB sessions on db server = 3,
 maxActive in DBCP defined as 30) DBCP is not giving back any more
 connections because of a MONITOR on borrowObject. You will see some threads
 hanging at:

 at
 org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:810)

 I dont know why there is a lock. Perhaps DBCP thinks it has a lot of DB
 connections where in fact it has only very few. Hope someone can help
 because i reall dont have a clue whats going on. The problem is, when this
 situation arrive, we need to stop the AppServer which is a little bit tough
 in production ;-)


 See the stack for the real facts:

 Full thread dump Java HotSpot(TM) Client VM (14.1-b02 mixed mode):

 http-8081-11 daemon prio=6 tid=0x3dd7e800 nid=0x3d58 in Object.wait()
 [0x4111f000]
 java.lang.Thread.State: WAITING (on object monitor)
 at java.lang.Object.wait(Native Method)
 at java.lang.Object.wait(Object.java:485)
 at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:423)
 - locked 0x3b278270 (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
 at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:449)
 at java.lang.Thread.run(Unknown Source)

 http-8081-10 daemon prio=6 tid=0x3dcd8000 nid=0x3054 in Object.wait()
 [0x3f8cf000]
 java.lang.Thread.State: WAITING (on object monitor)
 at java.lang.Object.wait(Native Method)
 at java.lang.Object.wait(Object.java:485)
 at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:423)
 - locked 0x3b277ee8 (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
 at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:449)
 at java.lang.Thread.run(Unknown Source)

 AS400 Read Daemon-36 daemon prio=6 tid=0x3e8f4c00 nid=0x3fb4 runnable
 [0x3e41f000]
 java.lang.Thread.State: RUNNABLE
 at java.net.SocketInputStream.socketRead0(Native Method)
 at java.net.SocketInputStream.read(Unknown Source)
 at com.ibm.as400.access.DataStream.readFromStream(DataStream.java:50)
 at
 com.ibm.as400.access.ClientAccessDataStream.construct(ClientAccessDataStream.java:48)
 at
 com.ibm.as400.access.AS400ThreadedServer.run(AS400ThreadedServer.java:340)
 at java.lang.Thread.run(Unknown Source)

 AS400 Read Daemon-21 daemon prio=6 tid=0x3da98800 nid=0x3acc runnable
 [0x4176f000]
 java.lang.Thread.State: RUNNABLE
 at java.net.SocketInputStream.socketRead0(Native Method)
 at java.net.SocketInputStream.read(Unknown Source)
 at com.ibm.as400.access.DataStream.readFromStream(DataStream.java:50)
 at
 com.ibm.as400.access.ClientAccessDataStream.construct(ClientAccessDataStream.java:48)
 at
 com.ibm.as400.access.AS400ThreadedServer.run(AS400ThreadedServer.java:340)
 at java.lang.Thread.run(Unknown Source)

 Managed directory poller daemon prio=6 tid=0x3e9d9400 nid=0x3b4 waiting
 on condition [0x40ccf000]
 java.lang.Thread.State: TIMED_WAITING (sleeping)
 at java.lang.Thread.sleep(Native Method)
 at org.sadun.util.polling.DirectoryPoller.run(DirectoryPoller.java:856)
 - locked 0x0f535bf8 (a org.sadun.util.polling.ManagedDirectoryPoller)
 at java.lang.Thread.run(Unknown Source)

 Thread-25 daemon prio=6 tid=0x3e960800 nid=0x3090 in Object.wait()
 [0x3e19f000]
 java.lang.Thread.State: WAITING (on object monitor)
 at java.lang.Object.wait(Native Method)
 at java.lang.Object.wait(Object.java:485)
 at com.deltax.util.listener.SignalQueue.run(Unknown Source)
 - locked 0x0f536048 (a com.deltax.util.FIFOQueue)

 AS400 Read Daemon-16 daemon prio=6 tid=0x3d3a4000 nid=0x33b4 runnable
 [0x3f87f000]
 java.lang.Thread.State: RUNNABLE
 at 

Re: java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Hex.encodeHexString([B)Ljava/lang/String;

2009-11-10 Thread James Carman
It's obviously a classpath issue.  Throw this code somewhere where it
can be executed in your environment where you're having troubles:

final URL loc = Hex.class.getProtectionDomain().getCodeSource().getLocation();
System.out.println(Found jar file at  + loc);
final JarFile jarFile = new JarFile(new File(loc.toURI()));
System.out.println(The version is  +
jarFile.getManifest().getMainAttributes().getValue(Specification-Version));

On Tue, Nov 10, 2009 at 2:59 PM, Java Struts struts...@gmail.com wrote:
 Hi Julis,

 Thanks a lot for the response. Here is the info. I am thinking it might be
 the classpath issue. But i am not 100% sure.

 Thanks,


 On Tue, Nov 10, 2009 at 2:12 PM, Julius Davies juliusdav...@gmail.comwrote:

 Hi,

 Can you supply some version information?

 Local machine
 -
 OS Type and Version? *Windows Xp Pro*
 Java Version? *1.5*
 Websphere version? *6.0*
 Commons-Codec version? *1.4*


 Dev machine
 -
 OS Type and Version?   Linux. *HP-UX,  B.11.11 *
 Java Version? :1.5
 Websphere version? 6.0
 Commons-Codec version? 1.4


 Also, can you find out if any different versions of commons-codec are
 also present on the dev machine?  Perhaps several versions of the jar
 file are sitting around, and Websphere is picking up an old one?



 yours,

 Julius





 On Tue, Nov 10, 2009 at 10:13 AM, Java Struts struts...@gmail.com wrote:
  Hi Folks,
 
  I am using Apache Commons Codec, to convert the encrypted bytes into a
  HexString to pass through the URL. So when i am using it in local machine
  which is working fine. when the same into Dev(Linux websphere) it's not
  working and it's throwing the following exception.
 
  *java.lang.NoSuchMethodError:
 
 org.apache.commons.codec.binary.Hex.encodeHexString([B)Ljava/lang/String;*
 
  Here is the code i am using for it.
 
  *public static String encryptString(SecretKey key, String input) throws
  NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {
         logger.error( Input String to Encrypt:  + input );
         Cipher cipher = Cipher.getInstance(DESede);
         cipher.init(Cipher.ENCRYPT_MODE, key);
         //byte[] inputBytes = input.getBytes();
         String encryptedString =;
         byte[] inputBytes;
 
         try {
             logger.error( Inside Try block of Encrypted String Method);
             inputBytes = input.getBytes(UTF-8);
             byte[] encryptedBytes= cipher.doFinal(inputBytes);
             logger.error( got encrypted bytes);
 
             encryptedString= Hex.encodeHexString(encryptedBytes);
             logger.error( Encrypted String :  +encryptedString);
             }
         catch (UnsupportedEncodingException e) {
     // TODO Auto-generated catch block
             logger.error(Inside Unsupported Catch Block  +
 e.getMessage()
  +  : +  e );
             e.printStackTrace();
 
 
         }
         catch (Throwable e) {
             // TODO Auto-generated catch block
             logger.error(Inside Exception Catch Block  + e.getMessage()
 +
   :  +e );
             e.printStackTrace();
                 }
         return encryptedString;*
 
 
  Could you please help me guys, I am just wondering why this is throwing
 in
  Dev. It's throwing the exceptions at the below line.
 
   *encryptedString= Hex.encodeHexString(encryptedBytes);
  *
  and catching at here
 
  *catch (Throwable e) {
             // TODO Auto-generated catch block
             logger.error(Inside Exception Catch Block  + e.getMessage()
 +
   :  +e );
             e.printStackTrace();
                 }
 
  *any idea what's going on here?* *I would appreciate for your help.*
 
  *Thanks,*
 
 
  *
 



 --
 yours,

 Julius Davies
 250-592-2284 (Home)
 250-893-4579 (Mobile)
 http://juliusdavies.ca/logging.html

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: File Upload

2009-10-14 Thread James Carman
The parameters from your form aren't sent as usual when you use
multipart form data.  They are sent as parts.  So, as you iterate
through the FileItem objects from your upload, some of them will be
form fields.  You can check by calling isFormField().  You can call
getFieldName() to get the field name and getString() to get the
field's value.  Check out this document for more information:

http://commons.apache.org/fileupload/using.html


On Wed, Oct 14, 2009 at 12:02 AM, Anand Shankar anand.al@gmail.com wrote:
 Hello

 I am facing more problem about File Upload and anybody is helping me. I have
 listed my problem on all the open source forum, so please give me your some
 important moment to suggest that how can I solve this problem.


 I am using a form with enctype=multipart/form-data in order to upload
 files from the form.
 I have read this page: http://commons.apache.org/fileupload/using.html and
 everything works well for my form.

 The only problem is that I can't get all the values from a multiple select
 html object. I get only one value.

 Using servlets I have used this method:

 *public* java.lang.String[] getParameterValues(java.lang.String name)



 But now I have enctype=multipart/form-data in my form and I can't use this
 way...
 Is there a way to get all the values of a multi-valued parameter?


 Thanks a lot!

 --
 Anand Shankar


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Inherent problem with Java classes.

2009-10-07 Thread James Carman
This should get you started:

http://commons.apache.org/vfs/api.html

You'll want to make sure you've got everything you need on the
classpath so that all of the file system types you need are enabled.

On Wed, Oct 7, 2009 at 1:53 PM, Alan Grimes agri...@speakeasy.net wrote:
 There's an inherent problem with all classes and class packages of all
 languages. Basically when you package up a bundle of classes there are
 few clues for a novice to determine which classes are for internal use
 only and which are the primary front end of the API. Similarly, when
 there are dozens of non-depreciated methods in a class, it becomes
 difficult for a novice to determine which are the critical calls that
 every application will inevitably use and which are there just to handle
 corner cases or special applications. This is why I had trouble finding
 the call for dowloading a file in the FTP system.

 Javadoc is wonderful. It certainly does help when one needs a
 refference. The VFS package seems to be closer to what I actually need,
 but at the same time it's much more complex. This is why HowTos and
 other tutorials are vitally important for all non-trivial packages,
 especially packages for use as libraries. =(

 Do you know where I can find useful getting started guides for VFS?


 --
 New president: Here we go again...
 Chemistry.com: A total rip-off.
 Powers are not rights.


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Inherent problem with Java classes.

2009-10-07 Thread James Carman
Basically, if you just want to use FTP for now, you need to have
Commons Net (yes the one you tried to use :) on the classpath:

http://commons.apache.org/vfs/download.html

You'll also need Commons Logging and some logging provider (log4j, jdk
logging, etc.).

On Wed, Oct 7, 2009 at 2:20 PM, Alan Grimes agri...@speakeasy.net wrote:
 James Carman wrote:
 This should get you started:

 http://commons.apache.org/vfs/api.html

 You'll want to make sure you've got everything you need on the
 classpath so that all of the file system types you need are enabled.

 Thanks much, I guess i have trouble finding things in lengthy lists of
 stuff. (also, I've been wasting too much time on my C++ project,
 ktechlab, hacking on that thing is crack. =P )

 --
 New president: Here we go again...
 Chemistry.com: A total rip-off.
 Powers are not rights.


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP library.

2009-10-06 Thread James Carman
Have you tried Commons VFS?  It might be easier.

On Tue, Oct 6, 2009 at 11:52 AM, Alan Grimes agri...@speakeasy.net wrote:
 I've been trying to grok the NET/FTP library for several hours now and
 I've only met with frustration so far. It's really quite remarkable how
 well the documentation explains how to do practically anything under the
 sun to a FTP archive *EXCEPT DOWNLOAD A FILE*. That's right, I can't
 figure out how one is supposed to download a file. I can't find any
 methods such as getObjectBits or downloadFileText, or any examples
 that involve downloading a file. There are no objects such as
 FTPDataStream. FTPFile seems to be useless for anything other than
 accessing file attributes. This is certainly a major documentation if
 not design problem!!! =(


 --
 New president: Here we go again...
 Chemistry.com: A total rip-off.
 Powers are not rights.


 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP library.

2009-10-06 Thread James Carman
On Tue, Oct 6, 2009 at 12:12 PM, Alan Grimes agri...@speakeasy.net wrote:
 James Carman wrote:
 Have you tried Commons VFS?  It might be easier.

 No, I'm basically groping in the dark. I put ftp into google, and
 net/ftp appears to be the most high-profile project from the apache
 foundation which appears to have the most mature set of Java libraries
 available.

 I feel like I'm the victim of a practical joke where you name one
 package with exactly the terms I would type into google, and then make a
 different package that is actually useful. =P

Heh, too funny.  Commons Net will do what you want, but it's meant to
be a lower-level API, more closely tied to the protocols themselves.
Commons VFS builds a file system abstraction on top of all kinds of
protocols (local files, ftp, http, etc.).  To me, it's easier to get
that up and running and if I ever want to change it in the future to a
different technology, I can without changing my client code, since
it's using the abstraction.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [VFS] Minimum Java version

2009-08-19 Thread James Carman
Are they going to change the package name?

On Wed, Aug 19, 2009 at 10:18 AM, Ralph Goersralph.go...@dslextreme.com wrote:
 Currently the minimum Java version for VFS 2.0 is 1.4.  VFS 2.0 has not been
 released and the developers are considering making the minimum version JDK
 5. We are interested in getting feedback from the community however before
 this change is made.  So please respond with your thoughts on this.

 Ralph

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [VFS] Minimum Java version

2009-08-19 Thread James Carman
What about the maven2 group/artifact id?


On Wed, Aug 19, 2009 at 10:34 AM, Ralph Goersralph.go...@dslextreme.com wrote:
 The packages haven't been changed so far. But this would definitely have to
 be considered whether we would want to take on the package renaming right
 now.

 The minimum JDK for 1.0 was 1.3, although it isn't clear that that was
 correct. The minimum JDK for 2.0 has already been changed to 1.4 since some
 of the code actually required that version to run.

 Ralph

 On Aug 19, 2009, at 7:24 AM, James Carman wrote:

 Are they going to change the package name?

 On Wed, Aug 19, 2009 at 10:18 AM, Ralph Goersralph.go...@dslextreme.com
 wrote:

 Currently the minimum Java version for VFS 2.0 is 1.4.  VFS 2.0 has not
 been
 released and the developers are considering making the minimum version
 JDK
 5. We are interested in getting feedback from the community however
 before
 this change is made.  So please respond with your thoughts on this.

 Ralph

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [VFS] Minimum Java version

2009-08-19 Thread James Carman
Yeah, we probably need to change the package name to o.a.c.vfs2 and
the artifactId to commons-vfs2.  Or, go back the other way, as you
suggest (provided it's backward compatible).

On Wed, Aug 19, 2009 at 10:45 AM, Ralph Goersralph.go...@dslextreme.com wrote:
 The maven group id for 2.0 is currently org.apache.commons. It was
 commons-vfs for VFS 1.0, so it would already be possible to have both jars
 simultaneously. So if the package names are not changed then the pom needs
 to be changed to use commons-vfs as the groupId before 2.0 is formally
 released.

 Ralph

 On Aug 19, 2009, at 7:38 AM, James Carman wrote:

 What about the maven2 group/artifact id?


 On Wed, Aug 19, 2009 at 10:34 AM, Ralph Goersralph.go...@dslextreme.com
 wrote:

 The packages haven't been changed so far. But this would definitely have
 to
 be considered whether we would want to take on the package renaming right
 now.

 The minimum JDK for 1.0 was 1.3, although it isn't clear that that was
 correct. The minimum JDK for 2.0 has already been changed to 1.4 since
 some
 of the code actually required that version to run.

 Ralph

 On Aug 19, 2009, at 7:24 AM, James Carman wrote:

 Are they going to change the package name?

 On Wed, Aug 19, 2009 at 10:18 AM, Ralph
 Goersralph.go...@dslextreme.com
 wrote:

 Currently the minimum Java version for VFS 2.0 is 1.4.  VFS 2.0 has not
 been
 released and the developers are considering making the minimum version
 JDK
 5. We are interested in getting feedback from the community however
 before
 this change is made.  So please respond with your thoughts on this.

 Ralph

 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Commons Email : Newbie question attachment recieved in plantext?

2009-08-19 Thread James Carman
Have you tried using HtmlEmail?

http://commons.apache.org/email/api-release/org/apache/commons/mail/HtmlEmail.html

On Wed, Aug 19, 2009 at 10:59 PM, Ashika Umanga
Umagiliyaauma...@biggjapan.com wrote:
 Greetings all,

 I use following code to send emails with attachment.But I recieve the email
 in plain text as posted below.I tested with Thuderbird,Gmail but everytime
 it gives the same result!
 what could be the problem ?
 thanks in advance,

       EmailAttachment attachment = new EmailAttachment();
       attachment.setPath(/home/umanga/Desktop/ttt.jpg);
       attachment.setDisposition(EmailAttachment.ATTACHMENT);
       attachment.setDescription(SVR Results);

       attachment.setName(Results);

       MultiPartEmail email = new MultiPartEmail();

       String authuser = x...@gmail.com;
       String authpwd = ;           email.setSmtpPort(465);
       email.setAuthenticator(new DefaultAuthenticator(authuser, authpwd));
       email.setDebug(true); // true if you want to debug
       email.setHostName(smtp.gmail.com);

       email.getMailSession().getProperties().put(mail.smtp.auth, true);
       email.getMailSession().getProperties().put(mail.debug, true);
       email.getMailSession().getProperties().put(mail.smtp.port, 465);
       email.getMailSession().getProperties().put(
               mail.smtp.socketFactory.port, 465);
       email.getMailSession().getProperties().put(
               mail.smtp.socketFactory.class,
               javax.net.ssl.SSLSocketFactory);
       email.getMailSession().getProperties().put(
               mail.smtp.socketFactory.fallback, false);
           email.setFrom(x...@gmail.com, SenderName);
       email.setFrom(x...@gmail.com);
       email.setSubject(TestMail);
       email.setMsg(This is a test mail?);
       email.addTo(yy...@gmail.com);
       email.attach(attachment);
       email.send();




 Email is like this,in Thunderbird , Gmail or any mail client :

 --=_Part_0_933349511.1250735447458
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit

 This is a test mail?
 --=_Part_0_933349511.1250735447458
 Content-Type: application/octet-stream; name=Results
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment; filename=Results
 Content-Description: SVR Results

 0M8R4KGxGuEAPgADAP7/CQAGAAABGQAA
 EAAA/v///wD+ABgAAAD/
 
 
 
 
 
 
 //8J
 CBYFAPIVzAcABgAAAOEAAgCwBMEAAgAAAOIAAABcAHAASmF2YSBFeGNlbCBBUEkgdjIu
 NiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
 ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEIAAgDkBGEBAgAAAD0BAgABAJwA
 AgAOABkAAgAAABIAAgAAABMAAgAAAK8BAgAAALwBAgAAAD0AEgBoAQ4BXDq+IzgAAAEAWAJA
 AAIAAACNAAIiAAIOAAIAAQC3AQIAAADaAAIxABoAyP9/kAEFAUEA
 cgBpAGEAbAAxABoAyP9/kAEFAUEAcgBpAGEAbAAxABoAyP9/kAEF
 AUEAcgBpAGEAbAAxABoAyP9/kAEFAUEAcgBpAGEAbADgABQAAPX/IAAA
 wCDgABQAAQAAAPX/IAAAwCDgABQAAQAAAPX/IAAAwCDg
 ABQAAQAAAPX/IAAAwCDgABQAAgAAAPX/IAAAwCDgABQAAwAAAPX/
 IAAAwCDgABQAAPX/IAAAwCDgABQAAPX/IAAA
 wCDgABQAAPX/IAAAwCDgABQAAPX/IAAAwCDgABQA
 APX/IAAAwCDgABQAAPX/IAAAwCDgABQAAPX/IAAA
 wCDgABQAAPX/IAAAwCDgABQAAPX/IAAA
 wCDgABQAAAEAIAAAwCDgABQAAQArAPX/IAAAwCDgABQAAQAp
 APX/IAAAwCDgABQAAQAsAPX/IAAAwCDgABQAAQAqAPX/IAAA
 wCDgABQAAQAJAPX/IAAAwCCTAgQAEIAD/5MCBAARgAb/kwIEABKABP+T
 AgQAE4AH/5MCBAAAgAD/kwIEABSABf9gAQIAAQCFABYAsAQABwFSAGUAcwB1AGwAdABzAIwA
 BAABACwA/ACSABwICwABUAByAG8AYgBhAGIAaQBsAGkAdAB5AAYAAVIARAAgAFYAYQBs
 AAQAATAALgAxADMABQABMAAuADQAOAA3AAQAATAALgAyADYABQABMAAuADkANwA0AAQAATAALgAz
 ADkAEgABMQAuADQANgAwADkAOQA5ADkAOQA5ADkAOQA5ADkAOQA5ADkA/wBCAAEA3AMAAAwAAAD1
 AwAAJQQEAAA0DwQAAD8cBAAATCcEAABXNAQAAGQ/BAAAbwoA
 AAAJCBYQAPIVzAcABgsCFAQAAABsBQAAXAcAAA0AAgABAAwAAgBk
 AA8AAgABABEAAgAAABAACAD8qfHSTWJQP18AAgABACoAAgAAACsAAgAAAIIAAgABAIAACAAA
 ACUCBP8AgQACAMEEFBUAAACDAAIAAACEAAIAAAChACIACQIALAEs
 AQAAAOA/4D8BAFUAAgAIAAACDgAABAAABwgCEAAABwD/
 

Re: DBCP and informix issues!

2009-08-18 Thread James Carman
You need to allow access to the underlying connection:

http://commons.apache.org/dbcp/configuration.html

Search for underlying, there's a code example.

On Tue, Aug 18, 2009 at 2:57 PM, Gerardo Velezjgerardo.ve...@gmail.com wrote:
 Hi!

 I've been working around a web application using java + informix + tomcat

 So my problem is at time I trieds to insert a row in some specific table and
 after that retrieve the serial number (autoincrement id) from informix.

 This is the snipped of code I have and the error generated:


 [CODE]
 java.sql.Connection = conn = dataSource.getConnection();
 java.sql.Statement stmt = conn.createStatement();

 stmt.executeUpdate(insertSQL);

 int serial = ((IfmxStatement)stmt).getSerial();

 [Error]
 java.lang.ClassCastException:
 org.apache.tomcat.dbcp.dbcp.DelegatingStatement cannot be cast to
 com.informix.jdbc.IfmxStatement


 My Connection pool, looks as follow:

 Resource name=jdbc/SIPDB auth=Container type=javax.sql.DataSource
               maxActive=100 maxIdle=30 maxWait=1
               username=mgrnsip password=prx217n
 driverClassName=com.informix.jdbc.IfxDriver

 url=jdbc:informix-sqli://myhostname:myport/mydatabase:INFORMIXSERVER=dev/


 Thanks in advance!

 -- Gerardo Velez


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Does commons-configuration v1.6 work with JREv1.5? [Commons]

2009-08-12 Thread James Carman
It's not compiled with target=1.6.  If you look at the manifest, it
uses the same target as commons-parent-11, 1.3:

X-Compile-Source-JDK: 1.3
X-Compile-Target-JDK: 1.3

It was compiled with a 1.4 Sun JDK:

Created-By: 1.4.2_18 (Sun Microsystems Inc.)
Build-Jdk: 1.4.2_18

So, it should be 1.5 compatible.  What is the exact error you're
getting?  It sounds like you've got a classpath issue.  Are you using
Maven?

On Wed, Aug 12, 2009 at 8:48 PM, Andrew Hughesahhug...@gmail.com wrote:
 Hi, simple question I know... but, I'm lost!!!
 My JavaFX project won't recognize *org.apache.commons.configuration.**.
 JavaFX v1.2's SDK seems to have inherent problems with Java6, because the
 SDK is released with rt15.jar (Java 1.5 runtime)!
 If the answer is yes because configuration 1.6 has a compiled target=1.6 (or
 uses 1.6 classes) then what are my alternatives?

 Thanks for reading (and hopefully replying).


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Re : Re : Convert List to Map

2009-06-13 Thread James Carman
I don't think so, but you're free to copy it if you wish.  There's
really not much code there.

On Fri, Jun 12, 2009 at 5:56 PM, Adrian Gonzalezadr_gonza...@yahoo.fr wrote:
 That's exactly what I was talking about !

 Has it done its way to commons collection ? (I don't see it in 3.2.1 or in 
 JIRA)

 Code extract from 
 http://mail-archives.apache.org/mod_mbox/commons-dev/200709.mbox/f2e8eedf0709032030s1665dd5g36797577927d2...@mail.gmail.com
  :

 MapK,V CollectionUtils.toMap(CollectionC input,
 TransformerC,K keyTransformer, TransformerC,V
 valueTransformer, MapK,V map)
 or
 MapK,V CollectionUtils.toMap(CollectionC input,
 TransformerC,K keyTransformer, TransformerC,V
 valueTransformer)







 
 De : James Carman ja...@carmanconsulting.com
 À : Commons Users List user@commons.apache.org
 Envoyé le : Vendredi, 12 Juin 2009, 17h27mn 03s
 Objet : Re: Re : Convert List to Map

 We had a discussion of something like what you're asking for in the past:

 http://mail-archives.apache.org/mod_mbox/commons-dev/200709.mbox/f2e8eedf0709032030s1665dd5g36797577927d2...@mail.gmail.com


 On Fri, Jun 12, 2009 at 10:55 AM, Adrian Gonzalezadr_gonza...@yahoo.fr 
 wrote:
 Thanks

 Your sample works fine for my use case (that's exactly what I'm doing in my 
 code), but I was wondering about such utility thing just after looking at :
 http://commons.apache.org/collections/api-release/org/apache/commons/collections/map/TransformedMap.html#decorate(java.util.Map,%20org.apache.commons.collections.Transformer,%20org.apache.commons.collections.Transformer)
 which is a map-to-map conversions.

 Since commons-collection provides map-to-map conversion, why does'nt it 
 provide list-to-map conversion with the same logic ?





 
 De : Ted Dunning ted.dunn...@gmail.com
 À : Commons Users List user@commons.apache.org
 Envoyé le : Jeudi, 11 Juin 2009, 23h12mn 10s
 Objet : Re: Convert List to Map

 How is this easier than this:

 Map m = new HashMap();
 for (SpecificObject x : list) {
    m.put(s.getId(), s.getDescription());
 }

 ?

 Why make this soo much harder than it needs to be?

 On Wed, Jun 10, 2009 at 12:19 PM, Adrian Gonzalez 
 adr_gonza...@yahoo.frwrote:

 Hello,

 I have the same question as
 http://mail-archives.apache.org/mod_mbox/commons-user/200509.mbox/%3c878e7290050905002752ed5...@mail.gmail.com%3e:

 I need to do a lot of list-to-map conversions, and I'm looking for a way to
 use commons collections for this.
 I would like to do something like this:

 Map map = ListUtils.toMap(list, new SomeTransformerInterface() {
    void insertIntoMap(Object object, Map map) {
    SpecificObject s = (SpecificObject) object;
    map.put(s.getId(), s.getDescription());
    }
 });

 Is there a way to do that with commons collection ?

 Thank you very much







 --
 Ted Dunning, CTO
 DeepDyve

 111 West Evelyn Ave. Ste. 202
 Sunnyvale, CA 94086
 http://www.deepdyve.com
 858-414-0013 (m)
 408-773-0220 (fax)





 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: TelnetClient in common.net v2.0

2009-05-27 Thread James Carman
On Wed, May 27, 2009 at 2:48 AM, Dale Harris
itsupp...@martinjonkersmotors.com.au wrote:
 Hi,

 I have solved my issue.  I had to set the SocketFactory and create a socket
 with the proxy turned off.  It would be nice to add hints like that to the
 documentation.  Maybe it should default to no proxy too?  Where does the
 Socket class obtain the proxy settings anyway?

There are system properties you can set to turn on proxies for the
Java networking classes.  That's the default way that Socket would
become proxy-aware.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



  1   2   >