How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
Hi,

Configuration (XmlConfiguration) getString returns (^|\\s)#([1-9][0-9]{3 
for config.getString([EMAIL PROTECTED]). How can I get the entire
String?

scc task_expression=(^|\\s)#([1-9][0-9]{3,}) /

I use 1.1RC2.

Zsolt


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get the entire string with Configuration.getString

2005-03-30 Thread Oliver Heger
You have hit a known limitation: The configuration interprets the , as 
a property delimiter and inserts two values for this key. For more 
details see here:

http://issues.apache.org/bugzilla/show_bug.cgi?id=29716
So config.getString([EMAIL PROTECTED](0)) will return the first 
part of the expression and config.getString([EMAIL PROTECTED](1)) 
the part behind the ,.

Oliver
Zsolt Koppany wrote:
Hi,
Configuration (XmlConfiguration) getString returns (^|\\s)#([1-9][0-9]{3 
for config.getString([EMAIL PROTECTED]). How can I get the entire
String?

scc task_expression=(^|\\s)#([1-9][0-9]{3,}) /
I use 1.1RC2.
Zsolt
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


File is corrupted after the upload

2005-03-30 Thread Vicky Kontogianni
Hello,

 

We are using the Jakarta Commons File upload mechanism within an
application that must upload PDF files to our servers.

 

It happened twice lately to receive PDF files which after the EOF
character had many more characters which eventually made the PDF file
corrupted (like rubbish) ; by removing these characters we can see that
the file is fine and can be recognized as a PDF document.

 

Do you have any hint, whether this may happen during the upload using
the Commons File Upload?

 

Thank you in advance for your assistance,

 

Vicky Kontogianni

 

 



--
This e-mail was checked by the e-Sweeper Service.
For more information visit our website, Clearswift Corporation e-Sweeper :
http:// www.mimesweeper.com/products/esweeper/
--



[commons-collections]: how to do reverse iteration in TreeBidiMap

2005-03-30 Thread rinke hoekstra
Hi list, 

maybe a stupid question, or maybe I am missing something, but I cannot sort out 
how to 
do a reverse iteration over the values of a TreeBidiMap, and couldn't find much 
about it 
on the web.
I want to retrieve the 10 greatest values from a HashMap, and thought it best 
to use a 
TreeBidiMap for it.

I have this:

TreeBidiMap bidiMap = new TreeBidiMap(myHashMap);
OrderedBidiMap invMap = bidiMap.inverseOrderedBidiMap(); //creates inversed map
OrderedMapIterator oit = invMap.orderedMapIterator();
while (oit.hasPrevious()) {
  Float value = (Float)oit.previous();
  .
}


The iterator however seems to be initialized at the first element, so 
hasPrevious() is 
usually false, and the loop isn't run. 

How to initialize the iterator at the last element, so you can start iterating 
using 
hasPrevious()? 

thanks, 
Rinke

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get the entire string with Configuration.getString

2005-03-30 Thread Oliver Heger
Oh, I forgot an important point: you can escape the delimiter using a 
backslash. So if your configuration file contains:

scc task_expression=(^|\\s)#([1-9][0-9]{3\,}) /
the entire string should be returned.
Oliver
Oliver Heger wrote:
You have hit a known limitation: The configuration interprets the , as 
a property delimiter and inserts two values for this key. For more 
details see here:

http://issues.apache.org/bugzilla/show_bug.cgi?id=29716
So config.getString([EMAIL PROTECTED](0)) will return the first 
part of the expression and config.getString([EMAIL PROTECTED](1)) 
the part behind the ,.

Oliver
Zsolt Koppany wrote:
Hi,
Configuration (XmlConfiguration) getString returns 
(^|\\s)#([1-9][0-9]{3 for config.getString([EMAIL PROTECTED]). 
How can I get the entire
String?

scc task_expression=(^|\\s)#([1-9][0-9]{3,}) /
I use 1.1RC2.
Zsolt
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Chain : [Digester] Empty stack (returning null) : found a bug

2005-03-30 Thread Vinicius Caldeira Carvalho
Martin Cooper wrote:
On Tue, 29 Mar 2005 18:33:49 -0300, Vinicius Caldeira Carvalho
[EMAIL PROTECTED] wrote:
 

Hello there! I'm trying to use commons chains on my project. Here's a
piece of my web.xml:
context-param
 param-nameorg.apache.commons.chain.CONFIG_CLASS_RESOURCE/param-name
 param-valuecatalog.xml/param-value
/context-param
listener
listener-classorg.apache.commons.chain.web.ChainListener/listener-class
/listener
My catalog.xml is located inside web-inf/classes
here's how it looks like:
chains
   

This is the problem. There is no chains element; you want catalog 
instead.
(It seems there is a bug in the cookbook where it uses chains. I
will fix that.)
--
Martin Cooper
 

   chain name=validarRegraCompraPlanoCobertura
   command
className=com.araujo.convenios.view.administrarregracompra.action.commands.InitSalvarRegraCompraCommand/
   command
className=com.araujo.convenios.view.administrarregracompra.action.commands.RemoveItensCommand/
   command
className=com.araujo.convenios.view.administrarregracompra.action.commands.AssembleUpdateRegraCompraCommand/
   /chain
/chains
Ok. So I start my app on jboss 4.0.1. It outputs:
18:26:18,470 INFO  [ChainListener] Initializing chain listener
18:26:18,720 WARN  [Digester] Empty stack (returning null)
Well, so I guess It wasn't able to load the catalog right? When trying
to load the catalog from webcontext it returns null. Any ideas please?
Best regards
Vinicius
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 

Well, sorry there were a chains element, it wasnt cut and pasted sorry
I figure out the problem after looking at the source code. There's a 
bug with the chains.
On the cookbook it says you don't need to declare the name which your 
catalog will be stored on the servlet context. But, if you don't it 
won't store it (I saw the code) So I added :
context-param
   param-nameorg.apache.commons.chain.CONFIG_ATTR/param-name
   param-valuecatalog/param-value
/context-param
to my web.xml and it started working.
I though one would be interested in knowing this ;)

Regards
Vinicius
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
Thank you Oliver,

unfortunately I cannot do that because we have to assure compatibility (with
the version where we didn't use commons-configuration), thus here is my
code:

List exprs = config.getList([EMAIL PROTECTED]);
if (!exprs.isEmpty())
{
   sccTaskIdExpression = StringUtils.join(exprs.iterator(), ,).trim();
}

Is not nice but works.

Zsolt

 -Ursprüngliche Nachricht-
 Von: Oliver Heger [mailto:[EMAIL PROTECTED]
 Gesendet: Mittwoch, 30. März 2005 12:21
 An: Jakarta Commons Users List
 Betreff: Re: How to get the entire string with Configuration.getString
 
 Oh, I forgot an important point: you can escape the delimiter using a
 backslash. So if your configuration file contains:
 
 scc task_expression=(^|\\s)#([1-9][0-9]{3\,}) /
 
 the entire string should be returned.
 
 Oliver
 
 Oliver Heger wrote:
  You have hit a known limitation: The configuration interprets the , as
  a property delimiter and inserts two values for this key. For more
  details see here:
 
  http://issues.apache.org/bugzilla/show_bug.cgi?id=29716
 
  So config.getString([EMAIL PROTECTED](0)) will return the first
  part of the expression and config.getString([EMAIL PROTECTED](1))
  the part behind the ,.
 
  Oliver
 
  Zsolt Koppany wrote:
 
  Hi,
 
  Configuration (XmlConfiguration) getString returns
  (^|\\s)#([1-9][0-9]{3 for config.getString([EMAIL PROTECTED]).
  How can I get the entire
  String?
 
  scc task_expression=(^|\\s)#([1-9][0-9]{3,}) /
 
  I use 1.1RC2.
 
  Zsolt
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [commons-collections]: how to do reverse iteration in TreeBidiMap

2005-03-30 Thread José Antonio Pérez Testa
Maybe I am confused, but the inverseMap is not ordered in inverse order??
In that case greatest value is first ant lowest is last.
rinke hoekstra wrote:
Hi list, 

maybe a stupid question, or maybe I am missing something, but I cannot sort out how to 
do a reverse iteration over the values of a TreeBidiMap, and couldn't find much about it 
on the web.
I want to retrieve the 10 greatest values from a HashMap, and thought it best to use a 
TreeBidiMap for it.

I have this:
TreeBidiMap bidiMap = new TreeBidiMap(myHashMap);
OrderedBidiMap invMap = bidiMap.inverseOrderedBidiMap(); //creates inversed map
OrderedMapIterator oit = invMap.orderedMapIterator();
while (oit.hasPrevious()) {
 Float value = (Float)oit.previous();
 .
}
The iterator however seems to be initialized at the first element, so hasPrevious() is 
usually false, and the loop isn't run. 

How to initialize the iterator at the last element, so you can start iterating using 
hasPrevious()? 

thanks, 
Rinke

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

--
José Antonio Pérez Testa
Ingeniería de Servicios e Innovación técnologica.
Telémaco 3
28027 - Madrid (ESPAÑA)
Tel: +34-91-480.81.12
[EMAIL PROTECTED]
www.indra.es
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Emmanuel Bourg
You can also disable the string splitting by changing the delimiter to a 
char unlikely to be found in your configuration:

XMLConfiguration conf = new XMLConfiguration();
conf.setDelimiter('\u');
conf.setFilename(conf.xml);
conf.load();
We will have a cleaner solution when Bug 29716 is fixed 
(http://issues.apache.org/bugzilla/show_bug.cgi?id=29716)

Emmanuel Bourg
Zsolt Koppany wrote:
Thank you Oliver,
unfortunately I cannot do that because we have to assure compatibility (with
the version where we didn't use commons-configuration), thus here is my
code:
List exprs = config.getList([EMAIL PROTECTED]);
if (!exprs.isEmpty())
{
   sccTaskIdExpression = StringUtils.join(exprs.iterator(), ,).trim();
}
Is not nice but works.
Zsolt
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [commons-collections]: how to do reverse iteration in TreeBidiMap

2005-03-30 Thread rinke hoekstra
On 30 Mar 2005 at 14:25, José Antonio Pérez Testa wrote:

 Maybe I am confused, but the inverseMap is not ordered in inverse order??
 In that case greatest value is first ant lowest is last.


No, that is not the case (sorry for not explaining clear enough).

The inverse map is switching keys and values.

So when the original map has (1, one), the inversed map has (one, 1).

I'm getting the reversed map because I want to order on values. But I also want 
the
greatest value first, in stead of last.

Rinke




 rinke hoekstra wrote:

 Hi list,
 
 maybe a stupid question, or maybe I am missing something, but I cannot sort 
 out how to
 do a reverse iteration over the values of a TreeBidiMap, and couldn't find 
 much about it
 on the web.
 I want to retrieve the 10 greatest values from a HashMap, and thought it 
 best to use a
 TreeBidiMap for it.
 
 I have this:
 
 TreeBidiMap bidiMap = new TreeBidiMap(myHashMap);
 OrderedBidiMap invMap = bidiMap.inverseOrderedBidiMap(); //creates inversed 
 map
 OrderedMapIterator oit = invMap.orderedMapIterator();
 while (oit.hasPrevious()) {
   Float value = (Float)oit.previous();
   .
 }
 
 
 The iterator however seems to be initialized at the first element, so 
 hasPrevious() is
 usually false, and the loop isn't run.
 
 How to initialize the iterator at the last element, so you can start 
 iterating using
 hasPrevious()?
 
 thanks,
 Rinke
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --

 José Antonio Pérez Testa
 Ingeniería de Servicios e Innovación técnologica.

 Telémaco 3
 28027 - Madrid (ESPAÑA)
 Tel: +34-91-480.81.12

 [EMAIL PROTECTED]
 www.indra.es


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Runtime.exec() Utilities?

2005-03-30 Thread Lukas Bradley
Is there ANYTHING out there that can help manage executing system 
commands to batch input, capture output, and generally not make a mess 
of things on different platforms?

I'm pulling my hair out.
If no one knows of anything, I might write an API description and 
propose it be included in Commons.  I'm hoping there is already a solution.

Thanks for any input.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


AW: AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
Sorry, but this doesn't work with 1.1RC2.

XMLConfiguration config = new XMLConfiguration();
AbstractConfiguration.setDelimiter('\u');
char del = AbstractConfiguration.getDelimiter();
log.debug(Delimiter  + del + );
config.setFile(file);
config.load();

CompositeConfiguration cc = new CompositeConfiguration(config);
configuration = cc;

Zsolt

 -Ursprüngliche Nachricht-
 Von: Emmanuel Bourg [mailto:[EMAIL PROTECTED]
 Gesendet: Mittwoch, 30. März 2005 14:30
 An: Jakarta Commons Users List
 Betreff: Re: AW: How to get the entire string with Configuration.getString
 
 You can also disable the string splitting by changing the delimiter to a
 char unlikely to be found in your configuration:
 
 XMLConfiguration conf = new XMLConfiguration();
 conf.setDelimiter('\u');
 conf.setFilename(conf.xml);
 conf.load();
 
 We will have a cleaner solution when Bug 29716 is fixed
 (http://issues.apache.org/bugzilla/show_bug.cgi?id=29716)
 
 Emmanuel Bourg
 
 
 Zsolt Koppany wrote:
  Thank you Oliver,
 
  unfortunately I cannot do that because we have to assure compatibility
 (with
  the version where we didn't use commons-configuration), thus here is my
  code:
 
  List exprs = config.getList([EMAIL PROTECTED]);
  if (!exprs.isEmpty())
  {
 sccTaskIdExpression = StringUtils.join(exprs.iterator(), ,).trim();
  }
 
  Is not nice but works.
 
  Zsolt
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [commons-collections]: how to do reverse iteration in TreeBidiMap

2005-03-30 Thread matthew.hawthorne
rinke hoekstra wrote:
 maybe a stupid question, or maybe I am missing something, but I cannot sort 
 out how to 
 do a reverse iteration over the values of a TreeBidiMap, and couldn't find 
 much about it 
 on the web.
 I want to retrieve the 10 greatest values from a HashMap, and thought it best 
 to use a 
 TreeBidiMap for it.
 
 I have this:
 
 TreeBidiMap bidiMap = new TreeBidiMap(myHashMap);
 OrderedBidiMap invMap = bidiMap.inverseOrderedBidiMap(); //creates inversed 
 map
 OrderedMapIterator oit = invMap.orderedMapIterator();
 while (oit.hasPrevious()) {
   Float value = (Float)oit.previous();
   .
 }
 
 
 The iterator however seems to be initialized at the first element, so 
 hasPrevious() is 
 usually false, and the loop isn't run. 
 
 How to initialize the iterator at the last element, so you can start 
 iterating using 
 hasPrevious()? 

How about something like this?

TreeBidiMap bidiMap = new TreeBidiMap(myHashMap);
Collection values = bidiMap.values()
values.sort()
values.reverse()
for(Iterator i=values.iterator(); i.hasNext();) {
Float value = (Float)i.next()
}

I wouldn't worry about looping using hasPrevious(), I'd just reverse the
collection so that it is in descending order.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get the entire string with Configuration.getString

2005-03-30 Thread Emmanuel Bourg
Sorry I forgot the method was static. Try this instead:
XMLConfiguration config = new XMLConfiguration();
XMLConfiguration.setDelimiter('\u');
Emmanuel Bourg
Zsolt Koppany wrote:
Sorry, but this doesn't work with 1.1RC2.
XMLConfiguration config = new XMLConfiguration();
AbstractConfiguration.setDelimiter('\u');
char del = AbstractConfiguration.getDelimiter();
log.debug(Delimiter  + del + );
config.setFile(file);
config.load();
CompositeConfiguration cc = new CompositeConfiguration(config);
configuration = cc;
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [commons-collections]: how to do reverse iteration in TreeBidiMap

2005-03-30 Thread rinke hoekstra
Yes, I thought of that sollution 

It seems a good sollution. But still I am very curious to know how one would 
use 
hasPrevious() 

I think I will just stop bothering about it and use your sollution. 

Rinke

 How about something like this?
 
 TreeBidiMap bidiMap = new TreeBidiMap(myHashMap);
 Collection values = bidiMap.values()
 values.sort()
 values.reverse()
 for(Iterator i=values.iterator(); i.hasNext();) {
   Float value = (Float)i.next()
 }
 
 I wouldn't worry about looping using hasPrevious(), I'd just reverse the
 collection so that it is in descending order.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [commons-collections]: how to do reverse iteration in TreeBidiMap

2005-03-30 Thread Ha ryon
I think previous() is not about to get the collection in the reverse
order, it's about to be able to backtrack an iteration. Means, you did
10 next() and you realise you have went one step too far, then you do
previous(). As you said, previous() doesn't start at the end.

I think you have to use something along what matthew proposed.
I would check whether the inversed bidimap keeps the original map
order or whether it orders on the values. If it orders on the values
you would simply do :
OrderedBidiMap inv = bidiMap.inverseOrderedBidiMap();
Iterator it = inv.values().iterator();
while (it.hasNext()) {
 // take the 10 firsts.
}
if it is not ordered on the values, then 
TreeSet sorted = new TreeSet(yourcomparator); // design a comparator
that would make the greatest the smallest :), or use a collection and
use sort/reverse as Matthew proposed
sorted.addAll( bidiMap.values() );
sorted.iterator(); // then take the 10 firsts.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
setDelimiter is in AbstractConfiguration and XMLConfiguration doesn't
overwrite it.

Again: I'm using 1.1RC2, I don't have the source code of 1.1-RC2 thus I
cannot check it.

Zsolt


 -Ursprüngliche Nachricht-
 Von: Emmanuel Bourg [mailto:[EMAIL PROTECTED]
 Gesendet: Mittwoch, 30. März 2005 16:33
 An: Jakarta Commons Users List
 Betreff: Re: How to get the entire string with Configuration.getString
 
 Sorry I forgot the method was static. Try this instead:
 
 XMLConfiguration config = new XMLConfiguration();
 XMLConfiguration.setDelimiter('\u');
 
 Emmanuel Bourg
 
 
 Zsolt Koppany wrote:
  Sorry, but this doesn't work with 1.1RC2.
 
  XMLConfiguration config = new XMLConfiguration();
  AbstractConfiguration.setDelimiter('\u');
  char del = AbstractConfiguration.getDelimiter();
  log.debug(Delimiter  + del + );
  config.setFile(file);
  config.load();
 
  CompositeConfiguration cc = new CompositeConfiguration(config);
  configuration = cc;
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get the entire string with Configuration.getString

2005-03-30 Thread Ha ryon
maybe try : 
AbstractConfiguration.setDelimiter('\u'); 
XMLConfiguration config = new XMLConfiguration();

I would assume that, it's better to change a static parameter before
an instance that need the change is created.

On Wed, 30 Mar 2005 17:24:12 +0200, Zsolt Koppany
[EMAIL PROTECTED] wrote:
 setDelimiter is in AbstractConfiguration and XMLConfiguration doesn't
 overwrite it.
 
 Again: I'm using 1.1RC2, I don't have the source code of 1.1-RC2 thus I
 cannot check it.
 
 Zsolt
 
  -Ursprüngliche Nachricht-
  Von: Emmanuel Bourg [mailto:[EMAIL PROTECTED]
  Gesendet: Mittwoch, 30. März 2005 16:33
  An: Jakarta Commons Users List
  Betreff: Re: How to get the entire string with Configuration.getString
 
  Sorry I forgot the method was static. Try this instead:
 
  XMLConfiguration config = new XMLConfiguration();
  XMLConfiguration.setDelimiter('\u');
 
  Emmanuel Bourg
 
 
  Zsolt Koppany wrote:
   Sorry, but this doesn't work with 1.1RC2.
  
   XMLConfiguration config = new XMLConfiguration();
   AbstractConfiguration.setDelimiter('\u');
   char del = AbstractConfiguration.getDelimiter();
   log.debug(Delimiter  + del + );
   config.setFile(file);
   config.load();
  
   CompositeConfiguration cc = new CompositeConfiguration(config);
   configuration = cc;
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Runtime.exec() Utilities?

2005-03-30 Thread Christian Aust
Hi,
Lukas Bradley schrieb:
Is there ANYTHING out there that can help manage executing system 
commands to batch input, capture output, and generally not make a mess 
of things on different platforms?

I'm pulling my hair out.
If no one knows of anything, I might write an API description and 
propose it be included in Commons.  I'm hoping there is already a solution.

Thanks for any input.
I used to be quite successful adding ANT tasks to my code for system 
management. I.e. this code will copy files and subdirectories from one 
directory into another using ANTs copy-task. It will handle recursion as 
well as a list of patterns to exclude from copying.

import java.io.File;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Copy;
import org.apache.tools.ant.types.FileSet;
/**
 * Copies ressources from the directory [EMAIL PROTECTED] #getResourceFile()}
 * into outputFile.
 *
 * @param outputFile target directory, must exist and be writeable
 * @throws ExportException
 */
private void copyRessourcesTo(File outputFile) throws ExportException {
   class CopyTask extends Copy {
  /**
   * Simple framework class to hold the task itself
   */
  public CopyTask() {
 Project p = new Project();
 p.init();
 setProject(p);
 setTaskName(copyResources);
 setTaskType(copyResources);
  }
   }
   CopyTask ct = new CopyTask();
   ct.setTodir(outputFile);
   FileSet fs = new FileSet();
   fs.setDir(getResourceFile());
   fs.setExcludes(*.vm);
   ct.addFileset(fs);
   ct.execute();
}
ANT gives you a selection of well-tested tasks of all kinds, combinable 
and system-independent. Give it a try. HTH,

-  Christian
--
Christian Aust
mailto:[EMAIL PROTECTED]
icq: 84500990 - Yahoo!: datenimperator - MSN: datenimperator
PGP: A94E 0181 664D 27E3 F05A  A751 6A7E 90D1 A0A3 DEC7
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to get the entire string with Configuration.getString

2005-03-30 Thread Emmanuel Bourg
The code I suggested does work, there is a test case with a similar 
syntax, see testChangingDelimiter() in TestPropertiesConfiguration:

http://svn.apache.org/repos/asf/jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java
This will work with 1.1-rc2
Emmanuel Bourg
Ha ryon wrote:
maybe try : 
AbstractConfiguration.setDelimiter('\u'); 
XMLConfiguration config = new XMLConfiguration();

I would assume that, it's better to change a static parameter before
an instance that need the change is created.
On Wed, 30 Mar 2005 17:24:12 +0200, Zsolt Koppany
[EMAIL PROTECTED] wrote:
setDelimiter is in AbstractConfiguration and XMLConfiguration doesn't
overwrite it.
Again: I'm using 1.1RC2, I don't have the source code of 1.1-RC2 thus I
cannot check it.
Zsolt
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [commons-collections]: how to do reverse iteration in TreeBidiMap

2005-03-30 Thread Stephen Colebourne
There is no direct way to iterate over the 10 largest
values. However you can do the following:

TreeBidiMap map;
Object last = map.lastKey();
Object oneBefore = map.previousKey(last);
Object oneBeforeThat = map.previousKey(oneBefore);

Note that these are methods directly on TreeBidiMap.


The alternative is to use a reverse comparator.
BidiMap map;
Collection coll = map.values();
Set reversed = new HashSet(coll,
Collections.reverseOrder());

Stephen

--- rinke hoekstra [EMAIL PROTECTED] wrote:
 Hi list, 
 
 maybe a stupid question, or maybe I am missing
 something, but I cannot sort out how to 
 do a reverse iteration over the values of a
 TreeBidiMap, and couldn't find much about it 
 on the web.
 I want to retrieve the 10 greatest values from a
 HashMap, and thought it best to use a 
 TreeBidiMap for it.
 
 I have this:
 
 TreeBidiMap bidiMap = new TreeBidiMap(myHashMap);
 OrderedBidiMap invMap =
 bidiMap.inverseOrderedBidiMap(); //creates inversed
 map
 OrderedMapIterator oit =
 invMap.orderedMapIterator();
 while (oit.hasPrevious()) {
   Float value = (Float)oit.previous();
   .
 }
 
 
 The iterator however seems to be initialized at the
 first element, so hasPrevious() is 
 usually false, and the loop isn't run. 
 
 How to initialize the iterator at the last element,
 so you can start iterating using 
 hasPrevious()? 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Runtime.exec() Utilities?

2005-03-30 Thread Lukas Bradley
ANT gives you a selection of well-tested tasks of all kinds, combinable 
and system-independent. Give it a try. HTH,
This looks like it might be perfect:
org.apache.tools.ant.taskdefs.Execute
Execute(ExecuteStreamHandler streamHandler, ExecuteWatchdog watchdog)
However, I don't see a stream handler that can batch input and output. 
In other words, I have a list of commands I want to send, and I just 
want all the output retrieved.   I was hoping one might be available, so 
I don't have to write my own in/out/err stream handlers.

Do you know of any?
I'm going to post a similar question to the ANT list.  I will repost the 
answer back here if a solution is received.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Chain: too damn buggy to be out of sandbox

2005-03-30 Thread Vinicius Caldeira Carvalho
Well, I don't know why in the heck did jakarta put chain as a main 
commons project. The thing is too damn buggy. I think it's like 
esperanto a good idea not very well implemented. The first bug I found 
was the name of the catalog.
Now, read this, cuz this is cool.
Only commands that return false are executed. If I return true on a 
command inside a chain. I get a null pointer exception from a filter 
inside my conteiner. I guess someone forgot to do a doChain() in a 
servlet filter somewhere.

I'm most disapointed with commons chains, since I really cried out here 
to be used as a solution for our problems, now I have an even bigger 
problem on my hands.

Did not find the solution for this yet. As soon as I find one I'll post it.
Regards
Vinicius
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Re: Runtime.exec() Utilities?

2005-03-30 Thread Scovetta, Michael V
It'd probably be pretty easy to wrap the ant tools with a simpler
interface. It'd be nice to say:

Batch b = new Batch();
b.add(dir  bar);
b.add(cat bar | grep myfile);
b.run();
String output = b.getOuput();


Michael Scovetta
Computer Associates
Senior Application Developer


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Lukas Bradley
Sent: Wednesday, March 30, 2005 11:54 AM
To: commons-user@jakarta.apache.org
Subject: Re: Runtime.exec() Utilities?

 ANT gives you a selection of well-tested tasks of all kinds,
combinable 
 and system-independent. Give it a try. HTH,

This looks like it might be perfect:

org.apache.tools.ant.taskdefs.Execute
Execute(ExecuteStreamHandler streamHandler, ExecuteWatchdog watchdog)

However, I don't see a stream handler that can batch input and output. 
In other words, I have a list of commands I want to send, and I just 
want all the output retrieved.   I was hoping one might be available, so

I don't have to write my own in/out/err stream handlers.

Do you know of any?

I'm going to post a similar question to the ANT list.  I will repost the

answer back here if a solution is received.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Chain: too damn buggy to be out of sandbox

2005-03-30 Thread Vinicius Caldeira Carvalho
Vinicius Caldeira Carvalho wrote:
Well, I don't know why in the heck did jakarta put chain as a main 
commons project. The thing is too damn buggy. I think it's like 
esperanto a good idea not very well implemented. The first bug I found 
was the name of the catalog.
Now, read this, cuz this is cool.
Only commands that return false are executed. If I return true on a 
command inside a chain. I get a null pointer exception from a filter 
inside my conteiner. I guess someone forgot to do a doChain() in a 
servlet filter somewhere.

I'm most disapointed with commons chains, since I really cried out 
here to be used as a solution for our problems, now I have an even 
bigger problem on my hands.

Did not find the solution for this yet. As soon as I find one I'll 
post it.

Regards
Vinicius
Einstein used to say :  Two things are infinite: the universe and human 
stupidity; and I'm not sure about the the universe. Well I guess I fit 
right in to it. Sorry, no bugs, just dumb user and stressed manager 
complaining about the deadline.

Im trully sorry
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Runtime.exec() Utilities?

2005-03-30 Thread Gary Gregory
How about Commons-Launcher [1]?

Gary

[1] http://jakarta.apache.org/commons/launcher/

-Original Message-
From: Christian Aust [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 30, 2005 7:51 AM
To: Jakarta Commons Users List
Subject: Re: Runtime.exec() Utilities?

Hi,

Lukas Bradley schrieb:
 Is there ANYTHING out there that can help manage executing system 
 commands to batch input, capture output, and generally not make a mess

 of things on different platforms?
 
 I'm pulling my hair out.
 
 If no one knows of anything, I might write an API description and 
 propose it be included in Commons.  I'm hoping there is already a
solution.
 
 Thanks for any input.

I used to be quite successful adding ANT tasks to my code for system 
management. I.e. this code will copy files and subdirectories from one 
directory into another using ANTs copy-task. It will handle recursion as

well as a list of patterns to exclude from copying.

import java.io.File;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Copy;
import org.apache.tools.ant.types.FileSet;

/**
  * Copies ressources from the directory [EMAIL PROTECTED] #getResourceFile()}
  * into outputFile.
  *
  * @param outputFile target directory, must exist and be writeable
  * @throws ExportException
  */
private void copyRessourcesTo(File outputFile) throws ExportException {
class CopyTask extends Copy {
   /**
* Simple framework class to hold the task itself
*/
   public CopyTask() {
  Project p = new Project();
  p.init();
  setProject(p);
  setTaskName(copyResources);
  setTaskType(copyResources);
   }
}

CopyTask ct = new CopyTask();
ct.setTodir(outputFile);
FileSet fs = new FileSet();
fs.setDir(getResourceFile());
fs.setExcludes(*.vm);
ct.addFileset(fs);
ct.execute();
}

ANT gives you a selection of well-tested tasks of all kinds, combinable 
and system-independent. Give it a try. HTH,

-  Christian

-- 

Christian Aust
mailto:[EMAIL PROTECTED]
icq: 84500990 - Yahoo!: datenimperator - MSN: datenimperator
PGP: A94E 0181 664D 27E3 F05A  A751 6A7E 90D1 A0A3 DEC7

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: commons logging class level logging

2005-03-30 Thread Trenton D. Adams
Ok, is there a way of my wrapper class starting up, and automatically 
detecting all the classes available in every package I specify, and then 
setting up loggers for each one?  I mean an easy way.  I could just 
search through all the files, and convert them to class names without 
the '/' or '\'.

If I could do that, then each class could call log (message, classname).
Either that, or I could just have the wrapper class setup a static 
hashtable of loggers.  When a new log request comes in, I can check the 
classname that's passed into the log method, and use it as lookup into 
the hashtable of loggers.  If it's not there, make it and add it.

What do you guys think?
Also, again I ask, how does commons logging handle this, considering it 
is a wrapper around logging implementations?

Thorbjørn Ravn Andersen wrote:
Scovetta, Michael V wrote:
   (new Throwable()).printStackTrace(pw);
 

Depending on your JVM this might be extremely slow.  Additionally the 
log4j people (who uses this method too) have found that some JIT's give 
incorrect stack traces.

Java 1.5 is rumoured to have much better facilities for this.

--
Trenton D. Adams
Web Programmer Analyst
Navy Penguins at your service!
Athabasca University
(780) 675-6195
:wq!
__ 
   This communication is intended for the use of the recipient to whom it
   is addressed, and may contain confidential, personal, and or privileged
   information. Please contact us immediately if you are not the intended
   recipient of this communication, and do not copy, distribute, or take
   action relying on it. Any communications received in error, or
   subsequent reply, should be deleted or destroyed.
---

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Chain : [Digester] Empty stack (returning null) : found a bug

2005-03-30 Thread Martin Cooper
On Wed, 30 Mar 2005 09:02:52 -0300, Vinicius Caldeira Carvalho
[EMAIL PROTECTED] wrote:
 Martin Cooper wrote:
 
 On Tue, 29 Mar 2005 18:33:49 -0300, Vinicius Caldeira Carvalho
 [EMAIL PROTECTED] wrote:
 
 
 Hello there! I'm trying to use commons chains on my project. Here's a
 piece of my web.xml:
 
 context-param
   param-nameorg.apache.commons.chain.CONFIG_CLASS_RESOURCE/param-name
   param-valuecatalog.xml/param-value
 /context-param
 
 listener
 
 listener-classorg.apache.commons.chain.web.ChainListener/listener-class
 /listener
 
 My catalog.xml is located inside web-inf/classes
 
 here's how it looks like:
 
 chains
 
 
 
 This is the problem. There is no chains element; you want catalog 
 instead.
 
 (It seems there is a bug in the cookbook where it uses chains. I
 will fix that.)
 
 --
 Martin Cooper
 
 
 
 
 chain name=validarRegraCompraPlanoCobertura
 command
 className=com.araujo.convenios.view.administrarregracompra.action.commands.InitSalvarRegraCompraCommand/
 command
 className=com.araujo.convenios.view.administrarregracompra.action.commands.RemoveItensCommand/
 
 command
 className=com.araujo.convenios.view.administrarregracompra.action.commands.AssembleUpdateRegraCompraCommand/
 /chain
 /chains
 
 Ok. So I start my app on jboss 4.0.1. It outputs:
 
 18:26:18,470 INFO  [ChainListener] Initializing chain listener
 18:26:18,720 WARN  [Digester] Empty stack (returning null)
 
 Well, so I guess It wasn't able to load the catalog right? When trying
 to load the catalog from webcontext it returns null. Any ideas please?
 
 Best regards
 
 Vinicius
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 Well, sorry there were a chains element, it wasnt cut and pasted sorry
 I figure out the problem after looking at the source code. There's a
 bug with the chains.
 On the cookbook it says you don't need to declare the name which your
 catalog will be stored on the servlet context. But, if you don't it
 won't store it (I saw the code) So I added :
 context-param
 param-nameorg.apache.commons.chain.CONFIG_ATTR/param-name
 param-valuecatalog/param-value
 /context-param
 to my web.xml and it started working.
 I though one would be interested in knowing this ;)

Thanks. I've checked in a fix to the cookbook that will show up the
next time the site is refreshed.

--
Martin Cooper


 Regards
 
 Vinicius
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: commons logging class level logging

2005-03-30 Thread Thorbjørn Ravn Andersen
Trenton D. Adams wrote:
Ok, is there a way of my wrapper class starting up, and automatically 
detecting all the classes available in every package I specify, and 
then setting up loggers for each one?  I mean an easy way.  I could 
just search through all the files, and convert them to class names 
without the '/' or '\'.

If I could do that, then each class could call log (message, 
classname).

Either that, or I could just have the wrapper class setup a static 
hashtable of loggers.  When a new log request comes in, I can check 
the classname that's passed into the log method, and use it as lookup 
into the hashtable of loggers.  If it's not there, make it and add it.
There is nothing wrong with you creating a utility class that does 
exactly that (except you probably want to pass a class instead of a 
classname - so you can pass this - which you then get the name for).

You may also want to investigate how JUnit discovers its testmethods.
--
 Thorbjørn
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: commons logging class level logging

2005-03-30 Thread Trenton D. Adams
Thanks for the suggestions.  Keep reading...
Thorbjørn Ravn Andersen wrote:
Trenton D. Adams wrote:
Ok, is there a way of my wrapper class starting up, and automatically 
detecting all the classes available in every package I specify, and 
then setting up loggers for each one?  I mean an easy way.  I could 
just search through all the files, and convert them to class names 
without the '/' or '\'.

If I could do that, then each class could call log (message, 
classname).

Either that, or I could just have the wrapper class setup a static 
hashtable of loggers.  When a new log request comes in, I can check 
the classname that's passed into the log method, and use it as lookup 
into the hashtable of loggers.  If it's not there, make it and add it.

There is nothing wrong with you creating a utility class that does 
exactly that (except you probably want to pass a class instead of a 
classname - so you can pass this - which you then get the name for).
Yes, that's cleaner, and less code. :)
You may also want to investigate how JUnit discovers its testmethods.
Sure, I may try that, thanks.
--
Trenton D. Adams
Web Programmer Analyst
Navy Penguins at your service!
Athabasca University
(780) 675-6195
:wq!
__ 
   This communication is intended for the use of the recipient to whom it
   is addressed, and may contain confidential, personal, and or privileged
   information. Please contact us immediately if you are not the intended
   recipient of this communication, and do not copy, distribute, or take
   action relying on it. Any communications received in error, or
   subsequent reply, should be deleted or destroyed.
---

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
I also tried that, didn't work either.

Zsolt

 -Ursprüngliche Nachricht-
 Von: Ha ryon [mailto:[EMAIL PROTECTED]
 Gesendet: Mittwoch, 30. März 2005 17:32
 An: Jakarta Commons Users List
 Betreff: Re: How to get the entire string with Configuration.getString
 
 maybe try :
 AbstractConfiguration.setDelimiter('\u');
 XMLConfiguration config = new XMLConfiguration();
 
 I would assume that, it's better to change a static parameter before
 an instance that need the change is created.
 
 On Wed, 30 Mar 2005 17:24:12 +0200, Zsolt Koppany
 [EMAIL PROTECTED] wrote:
  setDelimiter is in AbstractConfiguration and XMLConfiguration doesn't
  overwrite it.
 
  Again: I'm using 1.1RC2, I don't have the source code of 1.1-RC2 thus I
  cannot check it.
 
  Zsolt
 
   -Ursprüngliche Nachricht-
   Von: Emmanuel Bourg [mailto:[EMAIL PROTECTED]
   Gesendet: Mittwoch, 30. März 2005 16:33
   An: Jakarta Commons Users List
   Betreff: Re: How to get the entire string with Configuration.getString
  
   Sorry I forgot the method was static. Try this instead:
  
   XMLConfiguration config = new XMLConfiguration();
   XMLConfiguration.setDelimiter('\u');
  
   Emmanuel Bourg
  
  
   Zsolt Koppany wrote:
Sorry, but this doesn't work with 1.1RC2.
   
XMLConfiguration config = new XMLConfiguration();
AbstractConfiguration.setDelimiter('\u');
char del = AbstractConfiguration.getDelimiter();
log.debug(Delimiter  + del + );
config.setFile(file);
config.load();
   
CompositeConfiguration cc = new CompositeConfiguration(config);
configuration = cc;
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
Can it be an xmlconfiguration problem?

 -Ursprüngliche Nachricht-
 Von: Emmanuel Bourg [mailto:[EMAIL PROTECTED]
 Gesendet: Mittwoch, 30. März 2005 17:59
 An: Jakarta Commons Users List
 Betreff: Re: How to get the entire string with Configuration.getString
 
 The code I suggested does work, there is a test case with a similar
 syntax, see testChangingDelimiter() in TestPropertiesConfiguration:
 
 http://svn.apache.org/repos/asf/jakarta/commons/proper/configuration/trunk
 /src/test/org/apache/commons/configuration/TestPropertiesConfiguration.jav
 a
 
 This will work with 1.1-rc2
 
 Emmanuel Bourg
 
 
 Ha ryon wrote:
  maybe try :
  AbstractConfiguration.setDelimiter('\u');
  XMLConfiguration config = new XMLConfiguration();
 
  I would assume that, it's better to change a static parameter before
  an instance that need the change is created.
 
  On Wed, 30 Mar 2005 17:24:12 +0200, Zsolt Koppany
  [EMAIL PROTECTED] wrote:
 
 setDelimiter is in AbstractConfiguration and XMLConfiguration doesn't
 overwrite it.
 
 Again: I'm using 1.1RC2, I don't have the source code of 1.1-RC2 thus I
 cannot check it.
 
 Zsolt
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Runtime.exec() Utilities?

2005-03-30 Thread Lukas Bradley
How about Commons-Launcher [1]?
Commons Launcher seems very geared toward launching Java processes.  I 
am attempting to launch a non-Java related binary, with versions on 
Windows and LINUX systems.

So far, Ant's Execute task is working nicely.  However, I'm using an 
interium batch/shell script to redirect stdin/stdout.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Chain: too damn buggy to be out of sandbox

2005-03-30 Thread Craig McClanahan
On Wed, 30 Mar 2005 14:24:03 -0300, Vinicius Caldeira Carvalho
[EMAIL PROTECTED] wrote:
 
 Einstein used to say :  Two things are infinite: the universe and human
 stupidity; and I'm not sure about the the universe. Well I guess I fit
 right in to it. Sorry, no bugs, just dumb user and stressed manager
 complaining about the deadline.
 
 Im trully sorry
 

We've all been there at least once :-).  Good luck!

Craig

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [jxpath] regular expressions in XSLT string operations

2005-03-30 Thread Stephen Colebourne
Apologies in advance for MY brevity:
- Read the mailing list guidelines.
- Add [jxpath] to the subject.
- Remember that we don't get paid for this.
- Generally, if you want it, you may have to help do it.
Stephen
depub2 wrote:
Apologies in advance for my brevity: I did not ask for a workaround - I know
workarounds exist.
I ASKED: Is there a PLAN for commons/jx-path to support at least some of
the XPATH 2.0 features such as regex (fn:matches, fn:replaces, fn:tokenize)
and other really helpful string operations?
IS THERE A PLAN?
IS THERE A ROUGH DATE OF COMPLETION?
This planning information will help me determine if I should put a
work-around in place.
Thank You,
David


Hi David,
  I'm just a JXPath user.  Maybe you could implement fn:replaces,
fn:matches and fn:tokenize as custom functions in JXPath.
Check out
http://jakarta.apache.org/commons/jxpath/users-guide.html#Custom%20Extension
%20Functions
  Cheers,
Adrian P.J.
depub2 wrote:

fn:replaces provides for regular expression based string match/substitution
within xslt. Is there a plan for commons/jx-path to support at least some
of
the XPATH 2.0 features such as regex (fn:matches, fn:replaces, fn:tokenize)
and other really helpful string operations? I am using cocoon and could
*really* use these string functions!
David


Best Regards,
David E. Epperly
Engineering Services
Inflection Technologies Corp.
Tel#: (310) 523-2817
Cel#: (310) 780-2817
Fax#: (310) 329-0781
IWeb: http://www.inflectech.com
Mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[Digester] Problem with XML rule definiton.

2005-03-30 Thread Silas Snider
Dear List:
I am having problems with Digester. I am using it to parse the XML
returned by Amazon's Web Services. My problem occurs when I create a .jar
out of my java program. I am passing the XML rules to DigesterLoader as a
stream from the getClass().getResourceAsStream(resource file name) method,
and digester likes the rules file. When it actually tries to parse the XML,
it chokes on a object creation rule saying that it can't find the class
named in the rule. However, when I am running it outside of .jar, it works
fine, and the class is included in the .jar (I checked with 7-zip). I have
solved the problem by defining rule programmatically, but, for obvious
reasons, would like to have them defined in a seperate file. Does anyone
have suggestions as to what I might be doing wrong?
 
Sincerely,
Silas Snider


[Commons-DBCP] Connections not being closed.

2005-03-30 Thread Nathan Smith
Hi all,
 
We have had a major problem over the last few weeks with respect to
connections not being closed. The problem started to occur after installing
our software for a new client. I suppose we hadn't tested the software as
well we should have, but we also trust and use a lot of software from ASF. 
 
The DBCP software was correctly keeping track of the numbers such as
minIdle, maxIdle, pool size etc. The problem was the connection, if deemed
to be unusable and therefore not placed back in the pool, was not being
closed. The number of users/connections available on the Database side
slowly became used up and the application unusable. I managed, after some
lengthy logging and debugging and profiling sessions to track down where
this was happening. I have since edited the source code for Commons-DBCP,
rebuilt the distribution and supplied it as part of a patch to our client. 

 
I was just wondering about some things that I hoped somebody might be able
to clear up.
 
1. Why is Commons-DBCP trying to reproduce the behaviour that a JDBC driver
should carry out? i.e. Having DelegatedStatement and DelegatedResultSet
objects hanging off a DelegatedConnection, which are then closed when the
Connection is closed. The code as it stands at the moment assumes the user
is not going close ResultSet's and Statement's in their own code.
NullPointerException's can be thrown also SQLException's. The implementation
of the JDBC driver we use throws an SQLException if a Statement or ResultSet
have already been closed. Thats OK the exceptions can be ignored, the
Connection can still be used.
 
 
Here are the changes I have made to the code:
NOTE: Theses changes fall to pieces when using a StatementPoolFactory.
 
DelegatedConnection.java
 
public void close() throws SQLException
{
try {
passivate();
} catch(SQLException sqle) {
throw sqle;
}
finally {
if(_conn != null) {
_conn.close();
}
}
}

protected void passivate() throws SQLException {
log.debug([DelegatingConnection.passivate] Connection ( + _conn +
')');
try {

...

if(set[i] != null) {
set[i].close();
}

...

}
finally {
_closed = true;
}
}
 
 

Nathan Smith
Software Developer
LabPro 2000 Limited
Phone: +64 4 586 6840
Facsimile: +64 4 586 6841
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.labpro2000.com/ www.labpro2000.com

Level 6, Riverside Tower on Daly, 15 Daly Street
Lower Hutt, New Zealand 
 


Re: Chain: too damn buggy to be out of sandbox

2005-03-30 Thread Dakota Jack
I know that people have said Einstein said this.  Does anyone have a
real citation to prove it?  This does not sound like Einstein.  This
sounds like a list-geek.

Jack


On Wed, 30 Mar 2005 13:27:32 -0800, Craig McClanahan [EMAIL PROTECTED] wrote:
 On Wed, 30 Mar 2005 14:24:03 -0300, Vinicius Caldeira Carvalho
 [EMAIL PROTECTED] wrote:
  
  Einstein used to say :  Two things are infinite: the universe and human
  stupidity; and I'm not sure about the the universe. Well I guess I fit
  right in to it. Sorry, no bugs, just dumb user and stressed manager
  complaining about the deadline.
 
  Im trully sorry
 
 
 We've all been there at least once :-).  Good luck!
 
 Craig
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[commons-logging] Problem renaming logfiles

2005-03-30 Thread Jeroen Verhagen
Hi all,

I using commons-logging with log4j in my webapp. I'm using a
DailyRollingFileAppender and every morning when I start developping I
get the following message in my Tomcat console:

log4j:ERROR Failed to rename [logfile.txt] to ...

I did some investigation using the handle utility from
www.sys-internals.com and found that after a redeploy of my webapp,
Tomcat is keeping open multiple handles to the same logfile probably
causing the rename problem. If I restart Tomcat it has only one handle
to logfile as expected until I redeploy again etc.

Can someone please tell me what's causing this?

I'm using Tomcat 5.0.19 with commons-logging 1.0.3 in its common/lib
dir to also use commons-logging for Tomcat. In every class I declare a
Log like this:

private static Log logger = LogFactory.getLog(MyClass.class);

I tried calling LogFactory.releaseAll() from the webapps
ContextListener.contextDestroyed() and giving the webapp its own
commons-logging.jar but that didn't help.

Thanks for any help and regards,

Jeroen

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Digester] Problem with XML rule definiton.

2005-03-30 Thread Reid Pinchback

It sounds like one of two things:
1) in the jar'd configuration something is missing from the classpath
2) in the jar'd configuration you aren't using the same type of
   classloaders as you are in the non-jar'd configuration
   (e.g. not just jar vs non-jar, but jar-in-webapp vs
   unjarred-standalone-app).

--- Silas Snider [EMAIL PROTECTED] wrote:
 Dear List:
 I am having problems with Digester. I am using it to parse the XML
 returned by Amazon's Web Services.




__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]