[jira] Commented: (JELLY-105) Nested element's setName() called with name of tag

2004-08-27 Thread commons-dev
The following comment has been added to this issue:

 Author: dion gillard
Created: Fri, 27 Aug 2004 1:40 AM
   Body:
Anything I can use to create a testcase?
-
View this comment:
  http://issues.apache.org/jira/browse/JELLY-105?page=comments#action_37851

-
View the issue:
  http://issues.apache.org/jira/browse/JELLY-105

Here is an overview of the issue:
-
Key: JELLY-105
Summary: Nested element's setName() called with name of tag
   Type: Bug

 Status: Unassigned
   Priority: Major

Project: jelly
 Components: 
 taglib.ant

   Assignee: 
   Reporter: Vincent Partington

Created: Fri, 30 Jan 2004 2:01 AM
Updated: Fri, 27 Aug 2004 1:40 AM

Description:
I have written an Ant task that can configure a JMeter task for a specific 
environment. It is invoked like this from an ant build.xml file:

  configurejmeter
basedir=${basedir}/tests
destdir=${current.build.dir}
includes=*.jmx
  
property file=${environment.properties} /
property name=nr_threads value=${test.nr.threads} /
property name=nr_iterations value=${test.nr.iterations} /
  /configurejmeter

The property file=.../ element specifies a file containing properties to be 
inserted into the JMeter task, while the property name=.. value=.../ tags 
specify specific properties.

However, when I put this fragment in a maven.xml file, it doesn't work. It seems the 
setName() of all the objects created for the nested property elements is invoked 
with the value property. The first property element won't work because of that 
because it doesn't expect setName() to be invoked when setFile() is invoked too.

I've isolated the problem to line 261 in org.apache.commons.jelly.tags.ant.AntTag:
http://jakarta.apache.org/commons/jelly/libs/ant/xref/org/apache/commons/jelly/tags/ant/AntTag.html#260

Why is that line of code there? It seems strange to me, also because the exception is 
masked. When I commented out those lines, the problem disappeared.

BTW, I am using Maven 1.0rc1, which includes 
commons-jelly-tags-ant-20030625.032346.jar.



-
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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



Re: [configuration] ConfigurationDynaBean and non-existent property names

2004-08-27 Thread Ricardo Gladwell
Hi Bill,
You are quite correct. The logic stems from my original 
ConfigurationDynaBean which used lazy logic to determine if a property 
existed in a dynabean (I will be releasing a lazy version of the configu 
dynabean soon). If you could create an issue in bugzilla I will generate 
a patch for this.

Kind regards
-- rg
Bill Vollers wrote:
I have a question about the behavior of ConfigurationDynaBean.
I'm not sure what the intended behavior should be, but looking at the
code in the CVS repository makes me think the intent is different from
the current behavior. However, it appears this is fairly new code, so
I don't know if the problem is in the code behavior or if I am just
misinterpreting the intent from the code.
In looking at the code, it appears the intent was for the get method
to throw an IllegalArgumentException in the case where the desired
property does not exist in the backing Configuration instance. This
would cause the method to meet the specification of get in the
DynaBean interface. However, get only throws the exception if the
specified name is null. If the name is non-null but does not exist,
then an empty ConfigurationDynaBean is returned.
The reason for this is in the call to configuration.subset in the get
method. The relevant code is shown below (this is version 1.2 from the
CVS repository):
// get configuration property
Object result = configuration.getProperty(name);
if(result == null  name != null) {
// otherwise attempt to create bean from configuration subset
Configuration subset = configuration.subset(name);
if(subset != null)
result = new ConfigurationDynaBean(configuration.subset(name));
}
If the extracted subset is not null, then a new ConfigurationDynaBean
is constructed from that subset. However, I don't think
Configuration.subset ever returns null. If no properties from the
configuration begin with the specified prefix, then the return value
from subset is an empty Configuration, not null (this is true even if
the prefix argument is null). Therefore, the if(subset != null) test
always succeeds in the above code, and result is always set to a new
ConfigurationDynaBean.
The only way result will remain null is if it is set to null in the
initial configuration.getProperty() call, and then if it bypasses the
if-clause by having (name == null). Therefore, that is the only case
where the exception is thrown.
I didn't notice any JUnit test cases for checking the behavior when
accessing a non-existing property name (although there is a case for a
null name).
So, my question is: should the get method throw an exception when
called with a non-existent property name? If so, then the get method
needs to be changed. If not, I might recommend documenting this
difference from the DynaBean interface in some way, and perhaps
changing the above code to remove the superfluous if-test. I'd be
happy to assist if needed.
--
Bill Vollers
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


DO NOT REPLY [Bug 30545] - [configuration] ConfigurationDynaBean

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30545.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30545

[configuration] ConfigurationDynaBean





--- Additional Comments From [EMAIL PROTECTED]  2004-08-27 09:37 ---
I have a question about the behavior of ConfigurationDynaBean.
I'm not sure what the intended behavior should be, but looking at the
code in the CVS repository makes me think the intent is different from
the current behavior. However, it appears this is fairly new code, so
I don't know if the problem is in the code behavior or if I am just
misinterpreting the intent from the code.

In looking at the code, it appears the intent was for the get method
to throw an IllegalArgumentException in the case where the desired
property does not exist in the backing Configuration instance. This
would cause the method to meet the specification of get in the
DynaBean interface. However, get only throws the exception if the
specified name is null. If the name is non-null but does not exist,
then an empty ConfigurationDynaBean is returned.

The reason for this is in the call to configuration.subset in the get
method. The relevant code is shown below (this is version 1.2 from the
CVS repository):

// get configuration property
Object result = configuration.getProperty(name);
if(result == null  name != null) {
// otherwise attempt to create bean from configuration subset
Configuration subset = configuration.subset(name);
if(subset != null)
result = new ConfigurationDynaBean(configuration.subset(name));
}

If the extracted subset is not null, then a new ConfigurationDynaBean
is constructed from that subset. However, I don't think
Configuration.subset ever returns null. If no properties from the
configuration begin with the specified prefix, then the return value
from subset is an empty Configuration, not null (this is true even if
the prefix argument is null). Therefore, the if(subset != null) test
always succeeds in the above code, and result is always set to a new
ConfigurationDynaBean.

The only way result will remain null is if it is set to null in the
initial configuration.getProperty() call, and then if it bypasses the
if-clause by having (name == null). Therefore, that is the only case
where the exception is thrown.

I didn't notice any JUnit test cases for checking the behavior when
accessing a non-existing property name (although there is a case for a
null name).

So, my question is: should the get method throw an exception when
called with a non-existent property name? If so, then the get method
needs to be changed. If not, I might recommend documenting this
difference from the DynaBean interface in some way, and perhaps
changing the above code to remove the superfluous if-test. I'd be
happy to assist if needed.

--
Bill Vollers

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



DO NOT REPLY [Bug 30545] - [configuration] ConfigurationDynaBean

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30545.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30545

[configuration] ConfigurationDynaBean





--- Additional Comments From [EMAIL PROTECTED]  2004-08-27 09:39 ---
Created an attachment (id=12545)
Fix for bug voller indicated.

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



[jira] Commented: (JELLY-112) Create Script from SAX events

2004-08-27 Thread commons-dev
The following comment has been added to this issue:

 Author: Michael Lipp
Created: Fri, 27 Aug 2004 2:42 AM
   Body:
Oh, I don't mind to subclass (though it is a bit silly to subclass only to change the 
visibility of a single method). I am more concerned whether my solution is 
future-proof.

I could not derive my solution from the API description. I had to use the source (no 
problem, that's what open source is for) and I have to use a protected method (those 
tend to be less stable when version numbers increase) and I am using a sequence of 
instructions that cannot be drived from the documentation.

  JellyContext context = new JellyContext (jellyContext ());
  // ExtXMLParser is XMLParser with changed visibility of configure
  ExtXMLParser jellyParser = new ExtXMLParser ();
  jellyParser.setContext(context);
  jellyParser.configure ();
  ... send SAX events to jellyParser
  Script script = jellyParser.getScript ();
  script.compile ();
  script.run (context, new XMLOutput(...));

Nothing in the documentation tells me that this sequence of invocations is correct. I 
know from the source that I have to invoke configure after setContext. Actually I know 
only from the source that I have to invoke configure at all!

Again, I don't mind subclassing. But if there is no directly documented support for 
sending SAX events to a Jelly parser, I think a proper API documentation should state 
what to do when subclassing. The constructor's documentation should include: If you 
subclass this class, be sure to invoke configure() after setting the context, but 
before anything else. (This does not only tell me that I have to invoke configure, 
much more important is that this implies that I do not have to do anything else!)

The API does not state, that you have to call script.compile() before you can use 
script.run(). I thought compilation was optional. OK, this was relatively easy to 
find out. But I had to find out, while users of other types of XML source get direct 
support. And lacking any documentation, how can I be sure that this is the way the API 
is intended to be used and will support my solution in future versions as well?

I don't remember exactly which method it was (getScript?), but I remember that I had 
to upgrade to a newer version of Jelly to be able to write the code above at all, 
because one of the methods I needed was private in the Jelly version I started with. 
Lucky me, that the Jelly version was changed in time for my project in this way. But 
it shows that previously either nobody had thought about how to send SAX events to a 
Jelly parser, or that I have chosen the wrong solution after all.

I think that Jelly should support receiving the XML as SAX events out of the box in 
order to be efficiently used in a streaming environment as a filter. And I think it 
should be documented how to do this. If you prefer adding something to the 
documentation and having the user write a subclass, this is OK with me. I just think 
it would be an advantage (and less effort than writing the documentation ;-)) if Jelly 
provided a direct API-supported way of passing SAX events.

 - Michael

-
View this comment:
  http://issues.apache.org/jira/browse/JELLY-112?page=comments#action_37852

-
View the issue:
  http://issues.apache.org/jira/browse/JELLY-112

Here is an overview of the issue:
-
Key: JELLY-112
Summary: Create Script from SAX events
   Type: Improvement

 Status: Unassigned
   Priority: Major

Project: jelly
 Components: 
 core / taglib.core

   Assignee: 
   Reporter: Michael Lipp

Created: Fri, 25 Jun 2004 7:37 AM
Updated: Fri, 27 Aug 2004 2:42 AM
Environment: All

Description:
Currently, there is no possibility to feed a SAX event stream through Jelly. There is 
no ContentHandler for the Jelly script.

Currently we use a work-around: we define a class derived from XMLParser, for the sole 
purpose of being able to invoke configure() :-(
Then we use this parser as ContentHandler and send all SAX events to it.

From the parser we get the script (getScript()) and invoke compile() and run(...). 
While all this works, it is not really nice.

The funny thing is that XMLParser uses SAX events internally. I'd propose to make 
getXMLParser() public and to automatically invoke compile() when the end document 
event is received (removing the invocations from JellyContext).

 - Michael



-
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   

Re: [CONFIGURATION] Semantics change in 1.0-rc1

2004-08-27 Thread Emmanuel Bourg
Henning P. Schmiedehausen wrote:
Please no, no method signature change.
Sorry I wasn't clear enough, that's not what I suggested. The idea is to 
add a setThrowExceptionOnMissingProperties(boolean) method to change the 
behavior, it would be false by default.


But we should definitely let the getxxx methods return null.
Not every getter return null if the property doesn't exist, getList() 
returns an empty list and getStringArray() returns en empty array. It's 
more useful than a null value imho.

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


[Jakarta Commons Wiki] Updated: ValidatorStandalone

2004-08-27 Thread commons-dev
   Date: 2004-08-27T04:07:00
   Editor: ReinhardSpisser [EMAIL PROTECTED]
   Wiki: Jakarta Commons Wiki
   Page: ValidatorStandalone
   URL: http://wiki.apache.org/jakarta-commons/ValidatorStandalone

   no comment

Change Log:

--
@@ -10,7 +10,12 @@
 
 -Jeff Kyser
 
+The new Validator version 1.1.3 allows you to validate contains an example on how to 
use Validator
+outside of Struts.  
http://cvs.apache.org/viewcvs.cgi/jakarta-commons/validator/src/example/org/apache/commons/validator/example/
 
+-Reinhard Spisser
+
+Se also 
 
 Up to ValidatorFaq
 

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



[Jakarta Commons Wiki] Updated: ValidatorStandalone

2004-08-27 Thread commons-dev
   Date: 2004-08-27T04:09:51
   Editor: ReinhardSpisser [EMAIL PROTECTED]
   Wiki: Jakarta Commons Wiki
   Page: ValidatorStandalone
   URL: http://wiki.apache.org/jakarta-commons/ValidatorStandalone

   no comment

Change Log:

--
@@ -10,7 +10,7 @@
 
 -Jeff Kyser
 
-The new Validator version 1.1.3 allows you to validate contains an example on how to 
use Validator
+The new Validator version 1.1.3 contains an example on how to use Validator
 outside of Struts.  
http://cvs.apache.org/viewcvs.cgi/jakarta-commons/validator/src/example/org/apache/commons/validator/example/
 
 -Reinhard Spisser

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



Re: kama for commons/sandbox Email

2004-08-27 Thread James Mitchell
1. Make sure you are using 'extssh' as the connection method in Eclipse (as
Craig suggested)
2. Make sure the Repository path is set to /home/cvs and not
/home/cvspublic (as Martin suggested)

If all else fails, delete the project and start from scratch.
Use the CVS view and 'check out as' on the right click menu.



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message -
From: Matthias Wessendorf [EMAIL PROTECTED]
To: 'Jakarta Commons Developers List' [EMAIL PROTECTED]
Sent: Friday, August 27, 2004 1:18 AM
Subject: RE: kama for commons/sandbox Email


Hen,

thanks.
I just tryed to commit via cvs (SSH)
with my account [EMAIL PROTECTED],
but got CVS-Error (The Server reported an error while performing the
cvs commit command).

anything to do with jakarata-unix-group ?

Regards,
Matthias

 -Original Message-
 From: Henri Yandell [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 26, 2004 7:37 AM
 To: Jakarta Commons Developers List
 Subject: Re: kama for commons/sandbox Email



 Now added to the jakarta group.

 Hen

 On Wed, 25 Aug 2004, Henri Yandell wrote:

 
  Karma added. I've asked the infrastructure group to add you to the
  jakarta unix group, so you won't be able to use your karma
 until then.
 
  Hen
 
  On Wed, 25 Aug 2004, Matthias Wessendorf wrote:
 
   I'd take care of patches if no one who's been more
   active on commons-email. I think it is a great project.
   The patch I would like submit allows the users to use
   the pop3-before-smtp-functionality for mailservers.
   Some mailserver may need this... perhaps one reason
   is spam?
   So if someone wants to give me sandbox karma, I'll take
 care of that
   bug/enhancement.
  
   http://issues.apache.org/bugzilla/show_bug.cgi?id=29435
  
   Matthias
   --
   Matthias Weßendorf
   Aechterhoek 18
   DE-48282 Emsdetten
   Germany
   Email: matthias AT wessendorf DOT net
   URL: http://www.wessendorf.net
  
  
  
 
   -
   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]





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



RE: kama for commons/sandbox Email

2004-08-27 Thread Jörg Schaible
James Mitchell wrote on Friday, August 27, 2004 1:26 PM:

 1. Make sure you are using 'extssh' as the connection method
 in Eclipse (as Craig suggested) 2. Make sure the Repository
 path is set to /home/cvs and not /home/cvspublic (as Martin
 suggested) 

3. Open the view Error Log in Eclipse to see the internal error report of Eclipse. 
That might give you another idea, what's really going wrong.

- Jörg

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



RE: kama for commons/sandbox Email

2004-08-27 Thread Matthias Wessendorf
thanks guys!

it was the /home/cvs-thing,
thank James!

Regards,
Matthias

 -Original Message-
 From: Jörg Schaible [mailto:[EMAIL PROTECTED] 
 Sent: Friday, August 27, 2004 1:58 PM
 To: Jakarta Commons Developers List
 Subject: RE: kama for commons/sandbox Email
 
 
 James Mitchell wrote on Friday, August 27, 2004 1:26 PM:
 
  1. Make sure you are using 'extssh' as the connection method in 
  Eclipse (as Craig suggested) 2. Make sure the Repository 
 path is set 
  to /home/cvs and not /home/cvspublic (as Martin
  suggested)
 
 3. Open the view Error Log in Eclipse to see the internal 
 error report of Eclipse. That might give you another idea, 
 what's really going wrong.
 
 - Jörg
 
 -
 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: kama for commons/sandbox Email

2004-08-27 Thread James Mitchell
No problem.  That's why we are hereit's all about the community.



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message -
From: Matthias Wessendorf [EMAIL PROTECTED]
To: 'Jakarta Commons Developers List' [EMAIL PROTECTED]
Sent: Friday, August 27, 2004 7:58 AM
Subject: RE: kama for commons/sandbox Email


thanks guys!

it was the /home/cvs-thing,
thank James!

Regards,
Matthias

 -Original Message-
 From: Jörg Schaible [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 27, 2004 1:58 PM
 To: Jakarta Commons Developers List
 Subject: RE: kama for commons/sandbox Email


 James Mitchell wrote on Friday, August 27, 2004 1:26 PM:

  1. Make sure you are using 'extssh' as the connection method in
  Eclipse (as Craig suggested) 2. Make sure the Repository
 path is set
  to /home/cvs and not /home/cvspublic (as Martin
  suggested)

 3. Open the view Error Log in Eclipse to see the internal
 error report of Eclipse. That might give you another idea,
 what's really going wrong.

 - Jörg

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



DO NOT REPLY [Bug 30858] - [configuration] PropertyConfiguration.save() does not take basePath into account

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30858.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30858

[configuration] PropertyConfiguration.save() does not take basePath into account





--- Additional Comments From [EMAIL PROTECTED]  2004-08-27 12:22 ---
The basePath can indeed contain a full URL, and not necessarily a file URL. Only
removing the file: prefix will probably not work in all constellations (just
consider that in windows environments the backslash is used as path separator).

I would suggest to implement the save() method the same way as the load()
method, i.e. obtaining the URL for storing from ConfigurationUtils (which takes
the base path into account and can deal with both absolute and relative URLs)
and then opening an OutputStream on this URL.

Oliver

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



DO NOT REPLY [Bug 29435] - pop3 before smtp

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=29435.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29435

pop3 before smtp

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED



--- Additional Comments From [EMAIL PROTECTED]  2004-08-27 12:24 ---
patch submitted

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



DO NOT REPLY [Bug 30893] New: - Javadoc for Configuration.subset(String prefix) is misleading

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30893.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30893

Javadoc for Configuration.subset(String prefix) is misleading

   Summary: Javadoc for Configuration.subset(String prefix) is
misleading
   Product: Commons
   Version: 1.0 Alpha
  Platform: All
OS/Version: All
Status: NEW
  Severity: Enhancement
  Priority: Other
 Component: Configuration
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


Hi there,

the Javadoc for the method public Configuration subset(String prefix)
in the Interface Configuration is somewhat misleading.
It reads: Return a decorator Configuration containing every key from the
current Configuration that starts with the specified prefix.

Now, if the current Configuration does not contain any keys that start with the
specified prefix, Configuration.subset does not return an empty Configuration
object (which could then be tested with .isEmpty whether it contains keys at
all), but null (which leads to a nice NullPointerException if you try to run
.isEmpty on it.. ;-)

Can you please include half a line in the Javadoc describing this behaviour?

Thanks,

Joerg

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



DO NOT REPLY [Bug 30893] - [configuration] Misleading javadoc for Configuration.subset(String prefix)

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30893.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30893

[configuration] Misleading javadoc for Configuration.subset(String prefix)

[EMAIL PROTECTED] changed:

   What|Removed |Added

Summary|Javadoc for |[configuration] Misleading
   |Configuration.subset(String |javadoc for
   |prefix) is misleading   |Configuration.subset(String
   ||prefix)

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



DO NOT REPLY [Bug 30893] - [configuration] Misleading javadoc for Configuration.subset(String prefix)

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30893.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30893

[configuration] Misleading javadoc for Configuration.subset(String prefix)





--- Additional Comments From [EMAIL PROTECTED]  2004-08-27 12:52 ---
Well, as currently implemented subset(String) never returns null, it
instanciates a SubsetConfiguration and returns it immediately:

public Configuration subset(String prefix)
{
return new SubsetConfiguration(this, prefix, .);
}

Could you provide a test case for this issue ?

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



cvs commit: jakarta-commons-sandbox/email/src/java/org/apache/commons/mail Email.java

2004-08-27 Thread matzew
matzew  2004/08/27 04:43:14

  Modified:email/src/java/org/apache/commons/mail Email.java
  Log:
  subbmitted patch for bug-entrie #29435
  for supporting popBeforeSMTP
  
  Revision  ChangesPath
  1.16  +35 -5 
jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/Email.java
  
  Index: Email.java
  ===
  RCS file: 
/home/cvs/jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/Email.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Email.java19 Feb 2004 22:38:09 -  1.15
  +++ Email.java27 Aug 2004 11:43:14 -  1.16
  @@ -26,6 +26,7 @@
   import javax.mail.Message;
   import javax.mail.MessagingException;
   import javax.mail.Session;
  +import javax.mail.Store;
   import javax.mail.Transport;
   import javax.mail.internet.InternetAddress;
   import javax.mail.internet.MimeMessage;
  @@ -131,7 +132,15 @@
* Disposition-Notification-To: [EMAIL PROTECTED]
*/
   private Hashtable headers = null;
  -
  +
  +/**
  + * Used to determine wether to use pop3 before smtp, and if so the settings.
  + */
  +private boolean popBeforeSmtp = false;
  +private String popHost = null;
  +private String popUsername = null;
  +private String popPassword = null;
  +
   /**
* Setting to true will enable the display of debug information.
*
  @@ -280,7 +289,7 @@
   public Email setFrom(String email)
   throws MessagingException
   {
  -return setFrom(email, null);
  +   return setFrom(email, null);
   }
   
   /**
  @@ -629,7 +638,8 @@
   public void send()
   throws MessagingException
   {
  -Session session = getMailSession();
  + 
  + Session session = getMailSession();
   MimeMessage message = new MimeMessage(session);
   
   if (subject != null)
  @@ -715,6 +725,11 @@
   {
   message.setSentDate(getSentDate());
   }
  +
  +if (popBeforeSmtp){
  +Store store = session.getStore(pop3);
  +store.connect(popHost, popUsername, popPassword);
  +}
   
   Transport.send(message);
   }
  @@ -754,4 +769,19 @@
   
   return ia;
   }
  -}
  +
  +/**
  + * Set details regarding pop3 before smtp authentication
  + * @param popBeforeSmtp Wether or not to log into pop3 server before sending 
mail
  + * @param popHost The pop3 host to use.
  + * @param popUsername The pop3 username.
  + * @param popPassword The pop3 password.
  + */
  +public void setPopBeforeSmtp(boolean popBeforeSmtp, String popHost, String 
popUsername, String popPassword){
  +this.popBeforeSmtp=popBeforeSmtp;
  +this.popHost=popHost;
  +this.popUsername=popUsername;
  +this.popPassword=popPassword;
  +}
  +
  +}
  \ No newline at end of file
  
  
  

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



Re: [MATH] Matrix indices

2004-08-27 Thread Mark R. Diggory
I agree entirely with your argument. I would feel more comfortable with 
0 to n-1.

-Mark
Kim van der Linde wrote:
Hi All,
I ran into a problem with the RealMatrixImpl class. The class is 
designed such that it uses the default 1 to n counting for the rows and 
columns. However, JAVA has as a default the 0 tot n-1 system. i now run 
into the problem that some standard methods return an array of n (0 tot 
n-1) while the methods require n+1 cells. I could of course write a 
method to create a n+1 array, but I do not see much problems with using 
the 0 to n-1 system of Java for the matrices. However, I could be 
completly wrong. BTW, I saw that the JAMA packages uses the underlying 
JAVA indexes, not the 1 to n system.

I have no problem changing all the methods if you all agree that we 
should change it

Cheers,
Kim
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [MATH] Matrix indices

2004-08-27 Thread Kim van der Linde

Mark R. Diggory wrote:
I agree entirely with your argument. I would feel more comfortable with 
0 to n-1.
Ok, how do I update the inproved class, as I did that already yesterday 
evening. I would also like to add several new methods:

RealMatrix getSubMatrix (int startRow, int endRow, int startColumn, int 
endColumn)  throws MatrixIndexException;

RealMatrix getSubMatrix (int[] rows, int[] columns)  throws 
MatrixIndexException;

RealMatrix getSubMatrix (int startRow, int endRow, int[] columns) 
throws MatrixIndexException;

RealMatrix getSubMatrix (int[] rows, int startColumn, int endColumn) 
throws MatrixIndexException;

RealMatrix getRowMatrix(int row) throws MatrixIndexException;
RealMatrix getColumnMatrix(int col) throws MatrixIndexException;
double[] columnMeans();
double[] rowMeans();
getRowMatrix and getColumnMatrix could be excluded as they are special 
cases of the getSubMatrix methods.

Objections against these?
Cheers,
Kim
--
http://www.kimvdlinde.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [lang] Release 2.1 (1)

2004-08-27 Thread Henri Yandell

And I'll do a JDiff on Saturday.

On Fri, 27 Aug 2004, Henri Yandell wrote:


 I just committed an implementation for DurationFormatUtils.

 My target is to keep it at a stupid level. We should have a comment
 directing people to JODA for more complicated or detailed needs.

 There are two decisions I've made which are probably bad. A year is 365
 days (and ignores the leap stuff) and a month is a year / 12. I've no idea
 what the ISO concept is for durations for these periods. Probably it means
 dealing with real dates and not milliseconds, so beyond the scope of Lang.

 Next step for me is to add unit tests for the new underlying format
 method. I reimplemented the existing methods in terms of it, so used their
 tests to drive me.

 Most of the new parts aren't public, so I haven't javadoc'd those parts
 yet. I have switched DurationFormatUtils to being a public class however.

 Hen

 (mental note for self..move the token-values into the Token class. Too
 late to do it right now)

 On Thu, 26 Aug 2004, Stephen Colebourne wrote:

  From: Henri Yandell [EMAIL PROTECTED]
   Saturday for me is to work on DurationFormat and try and steal enough from
   JODA and figure out exactly what is needed to finish it off. I'm mainly
   viewing that it needs a pattern language; hh:mm:ss etc.
 
  I'm still working on getting the joda version working fully, and its very
  big and complex. So, DurationFormatUtils may be quite a big task.
 
 
  Do we have a jdiff of all the methods added/removed in this release?
 
  Stephen
 
 
  -
  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: [MATH] Matrix indices

2004-08-27 Thread Mark R. Diggory
I would recommend submitting a patch to the java files into bugzilla 
with the changes in it.

Review the contributing documentation on the developers page:
http://jakarta.apache.org/commons/math/developers.html
Post any questions you may have about contributing a patch.
Cheers,
-Mark
Kim van der Linde wrote:

Mark R. Diggory wrote:
I agree entirely with your argument. I would feel more comfortable 
with 0 to n-1.

Ok, how do I update the inproved class, as I did that already 
yesterday evening. I would also like to add several new methods:

RealMatrix getSubMatrix (int startRow, int endRow, int startColumn, 
int endColumn)  throws MatrixIndexException;

RealMatrix getSubMatrix (int[] rows, int[] columns)  throws 
MatrixIndexException;

RealMatrix getSubMatrix (int startRow, int endRow, int[] columns) 
throws MatrixIndexException;

RealMatrix getSubMatrix (int[] rows, int startColumn, int endColumn) 
throws MatrixIndexException;

RealMatrix getRowMatrix(int row) throws MatrixIndexException;
RealMatrix getColumnMatrix(int col) throws MatrixIndexException;
double[] columnMeans();
double[] rowMeans();
getRowMatrix and getColumnMatrix could be excluded as they are special 
cases of the getSubMatrix methods.

Objections against these?
Cheers,
Kim

--
Mark R. Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[Sandbox/Email] - Maven

2004-08-27 Thread Matthias Wessendorf
hi,

when I try to run Maven,
I got that:

WARNING: Failed to download activation-1.0.2.jar.
The build cannot continue because of the following unsatisfied
dependencies:

javamail-1.2.jar (try downloading from
http://java.sun.com/products/javamail/)
activation-1.0.2.jar (try downloading from
http://java.sun.com/products/javabeans/glasgow/jaf.html)

Total time: 5 seconds



Any workarounds ?

--
Matthias Weßendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
Email: matthias AT wessendorf DOT net
URL: http://www.wessendorf.net


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



DO NOT REPLY [Bug 30896] New: - Adding new methods to RealMatrix

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30896.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30896

Adding new methods to RealMatrix

   Summary: Adding new methods to RealMatrix
   Product: Commons
   Version: 1.0 Final
  Platform: All
OS/Version: All
Status: NEW
  Severity: Enhancement
  Priority: Other
 Component: Math
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


/*
 * Copyright 2003-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.commons.math.linear;

/**
 * Interface defining a real-valued matrix with basic algebraic operations
 * @version $Revision: 1.20 $ $Date: 2004/08/22 01:42:58 $
 */
public interface RealMatrix {

   /** 
* Get a submatrix. Rows and columns are indicated counting from 1 to n, NOT
from 0 to n-1.
* @param startRow  Initial row index
* @param endRowFinal row index
* @param startColumn   Initial column index
* @param endColumn Final column index
* @return  The subMatrix containing the data of the specified 
rows and
columns
* @exception  MatrixIndexException matrix dimension mismatch
*/

   RealMatrix getSubMatrix (int startRow, int endRow, int startColumn, int
endColumn)  
throws MatrixIndexException;

   /** 
* Get a submatrix. Rows and columns are indicated counting from 1 to n, NOT
from 0 to n-1.
* @param rows   Array of row indices.
* @param columnsArray of column indices.
* @return   The subMatrix containing the data of the specified 
rows and
columns
* @exceptionMatrixIndexException matrix dimension mismatch
*/
   RealMatrix getSubMatrix (int[] rows, int[] columns)  
throws MatrixIndexException;

   /** 
* Get a submatrix. Rows and columns are indicated counting from 1 to n, NOT
from 0 to n-1.
* @param startRow   Initial row index
* @param endRow Final row index
* @param columnsArray of column indices.
* @return  The subMatrix containing the data of the specified 
rows and
columns
* @exceptionMatrixIndexException matrix dimension 
mismatch
*/
   RealMatrix getSubMatrix (int startRow, int endRow, int[] columns)  
throws MatrixIndexException;
   
   /** 
* Get a submatrix. Rows and columns are indicated counting from 1 to n, NOT
from 0 to n-1.
* @param rows   Array of row indices.
* @param startColumnInitial column index
* @param endColumn Final column index
* @return  The subMatrix containing the data of the specified 
rows and
columns
* @exceptionMatrixIndexException matrix dimension mismatch
*/
   RealMatrix getSubMatrix (int[] rows, int startColumn, int endColumn) 
throws MatrixIndexException;

/**
 * Returns a (deep) copy of this.
 *
 * @return matrix copy
 */
RealMatrix copy();

/**
 * Compute the sum of this and m.
 *
 * @param mmatrix to be added
 * @return this + m
 * @throws  IllegalArgumentException if m is not the same size as this
 */
RealMatrix add(RealMatrix m) throws IllegalArgumentException;

/**
 * Compute this minus m.
 *
 * @param mmatrix to be subtracted
 * @return this + m
 * @throws  IllegalArgumentException if m is not the same size as this
 */
RealMatrix subtract(RealMatrix m) throws IllegalArgumentException;

 /**
 * Returns the result of adding d to each entry of this.
 *
 * @param dvalue to be added to each entry
 * @return d + this
 */
RealMatrix scalarAdd(double d);

/**
 * Returns the result multiplying each entry of this by d.
 *
 * @param dvalue to multiply all entries by
 * @return d * this
 */
RealMatrix scalarMultiply(double d);

/**
 * Returns the result of postmultiplying this by m.
 *
 * @param mmatrix to postmultiply by
 * @return this * m
 

DO NOT REPLY [Bug 30897] New: - New methods in RealMatrixImpl and changing indexing

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30897.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30897

New methods in RealMatrixImpl and changing indexing

   Summary: New methods in RealMatrixImpl and changing indexing
   Product: Commons
   Version: 1.0 Alpha
  Platform: All
OS/Version: All
Status: NEW
  Severity: Enhancement
  Priority: Other
 Component: Math
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


Numbering of the rows and columns is as default for an JAVA array, starting with
0 with the higest value for either row-1 or column-1. This facilitates
programming of modules which give back an array to construct subMatrices from
the original matrix. 

This change affects the folowing old methods:
getRow(int row)
getColumn(int column)
isValidCoordinate(int row, int col)
setEntry(...)
getEntry(...)


/*
 * Copyright 2003-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.commons.math.linear;
import java.io.Serializable;

/**
 * Implementation for RealMatrix using a double[][] array to store entries
 * and a href=http://www.math.gatech.edu/~bourbaki/math2601/Web-notes/2num.pdf;
 * LU decompostion/a to support linear system
 * solution and inverse.
 * p
 * The LU decompostion is performed as needed, to support the following
operations: ul
 * lisolve/li
 * liisSingular/li
 * ligetDeterminant/li
 * liinverse/li /ul
 * p
 * strongUsage note/strong:br
 * The LU decomposition is stored and reused on subsequent calls.  If matrix
 * data are modified using any of the public setXxx methods, the saved
 * decomposition is discarded.  If data are modified via references to the
 * underlying array obtained using codegetDataRef()/code, then the stored
 * LU decomposition will not be discarded.  In this case, you need to
 * explicitly invoke codeLUDecompose()/code to recompute the decomposition
 * before using any of the methods above.
 * 
 * p Numbering of the rows and columns is as default for an JAVA array,
starting with 0
 * with the higest value for either row-1 or column-1. This facilitates
programming of 
 * modules which give back an array to construct subMatrices from the original
matrix. 
 *
 * @version $Revision: 1.26 $ $Date: 2004/08/22 01:42:58 $
 */
public class RealMatrixImpl implements RealMatrix, Serializable {

/** Serializable version identifier */
static final long serialVersionUID = 4237564493130426188L;

/** Entries of the matrix */
private double data[][] = null;

/** Entries of cached LU decomposition.
 *  All updates to data (other than luDecompose()) *must* set this to null
 */
private double lu[][] = null;

/** Permutation associated with LU decompostion */
private int[] permutation = null;

/** Parity of the permutation associated with the LU decomposition */
private int parity = 1;

/** Bound to determine effective singularity in LU decomposition */
protected static double TOO_SMALL = 10E-12;

/**
 * Creates a matrix with no data
 */
public RealMatrixImpl() {
}

/**
 * Create a new RealMatrix with the supplied row and column dimensions.
 *
 * @param rowDimension  the number of rows in the new matrix
 * @param columnDimension   the number of columns in the new matrix
 */
public RealMatrixImpl(int rowDimension, int columnDimension) {
data = new double[rowDimension][columnDimension];
lu = null;
}

/**
 * Create a new RealMatrix using the codedata/code as the underlying
 * data array.
 * p
 * The input array is copied, not referenced.
 *
 * @param d data for new matrix
 */
public RealMatrixImpl(double[][] d) {
this.copyIn(d);
lu = null;
}

/**
 * Create a new (column) RealMatrix using codev/code as the
 * data for the unique column of the codev.length x 1/code matrix
 * created.
 * p
 * The input array is copied, not referenced.
 *
 * @param v column vector holding data for new matrix
 */
public RealMatrixImpl(double[] v) {
int nRows = v.length;
data = new double[nRows][1];
for (int 

DO NOT REPLY [Bug 30897] - New methods in RealMatrixImpl and changing indexing

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30897.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30897

New methods in RealMatrixImpl and changing indexing





--- Additional Comments From [EMAIL PROTECTED]  2004-08-27 14:56 ---
Java doc comments for all four subMatrix methods should read : Rows and columns
are indicated counting from 0 to n-1. and not Rows and columns are indicated
counting from 1 to n, NOT from 0 to n-1.

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



DO NOT REPLY [Bug 30896] - Adding new methods to RealMatrix

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30896.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30896

Adding new methods to RealMatrix





--- Additional Comments From [EMAIL PROTECTED]  2004-08-27 14:56 ---
Java doc comments for all four subMatrix methods should read : Rows and columns
are indicated counting from 0 to n-1. and not Rows and columns are indicated
counting from 1 to n, NOT from 0 to n-1.

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



Re: [Sandbox/Email] - Maven

2004-08-27 Thread Dion Gillard
Download the jars manually and place them in your repo.

On Fri, 27 Aug 2004 16:36:39 +0200, Matthias Wessendorf
[EMAIL PROTECTED] wrote:
 hi,
 
 when I try to run Maven,
 I got that:
 
 WARNING: Failed to download activation-1.0.2.jar.
 The build cannot continue because of the following unsatisfied
 dependencies:
 
 javamail-1.2.jar (try downloading from
 http://java.sun.com/products/javamail/)
 activation-1.0.2.jar (try downloading from
 http://java.sun.com/products/javabeans/glasgow/jaf.html)
 
 Total time: 5 seconds
 
 Any workarounds ?
 
 --
 Matthias Weßendorf
 Aechterhoek 18
 DE-48282 Emsdetten
 Germany
 Email: matthias AT wessendorf DOT net
 URL: http://www.wessendorf.net
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
http://www.multitask.com.au/people/dion/

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



Re: [Sandbox/Email] - Maven

2004-08-27 Thread Dirk Verbeeck
You have to download those 2 jars yourself, give them the correct name 
and put them in your local maven repository.

-- Dirk
Matthias Wessendorf wrote:
hi,
when I try to run Maven,
I got that:
WARNING: Failed to download activation-1.0.2.jar.
The build cannot continue because of the following unsatisfied
dependencies:
javamail-1.2.jar (try downloading from
http://java.sun.com/products/javamail/)
activation-1.0.2.jar (try downloading from
http://java.sun.com/products/javabeans/glasgow/jaf.html)
Total time: 5 seconds

Any workarounds ?
--
Matthias Weßendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
Email: matthias AT wessendorf DOT net
URL: http://www.wessendorf.net
-
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]


DO NOT REPLY [Bug 30864] - [codec] Document how to print a QPDecoderStream with QCodec?

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30864.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30864

[codec] Document how to print a QPDecoderStream with QCodec?

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |ASSIGNED



--- Additional Comments From [EMAIL PROTECTED]  2004-08-27 17:15 ---
Added Javadocs in the whole package noting that arguments are expected to be
String (and byte[] sometimes). Codec does not do Stream (yet). For
QCodec.decode(Object): Currently, this method only works with String arguments.
A DecoderException is thrown if the argument is not a String.

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



RE: [general] logging

2004-08-27 Thread Alex Karasulu
Yep I think these are some of the concerns that will be addressed if we
just test it out.  

If it's bad when using a simple do nothing adapter than we can just junk
the branch.  I can't imagine a call that returns immediately causing too
much of a slow down.  Then again you can guard against the call if the
monitor is null and that would just cost a conditional.  

The good thing is we can run these approaches side by side and let the
benchmarks show us if there really are significant problems.

Alex

On Fri, 2004-08-27 at 13:04, Shapira, Yoav wrote:
 Hi,
 If you do convert anything, I for one would be interested in performance
 benchmarks of this monitor approach compared to C-L and to direct
 logging e.g. log4j.  Logging has to be a low-to-negligible performance
 cost component.
 
 Yoav Shapira
 Millennium Research Informatics
 
 
 -Original Message-
 From: Alex Karasulu [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 27, 2004 1:04 PM
 To: Jakarta Commons Developers List
 Subject: Re: [general] logging
 
 Hiya,
 
 BTW before I begin I wanted to say that C-L is simple and costs
 relatively little.  It does not tie a library to a logging
 implementation and IMHO it gets far too much criticism for the
 convenience it affords us.  Its really an **adapter** for other logging
 implementations and that's it (as Craig pointed out below).  Perhaps
 its
 the fact that this is a dependency on another jar that causes this
 issue
 to come up repeatedly as opposed to logging itself.  In the end I don't
 know exactly why it is such a hot topic of debate.
 
 However I think this issue is one we can resolve if we generalize the
 problem using monitors and event notification.  Logging is just a
 specific application for a monitor. Paul Hammant described this in the
 NoLogging wiki here:
 
 http://wiki.apache.org/avalon/AvalonNoLogging
 
 I think I brought this up before and forgive me for doing it again.  If
 this is annoying anyone I will not discuss it again.  Perhaps I need
 the
 cons against it once more.  However I still do believe that this is the
 best solution for now.
 
 All a library needs to do is expose a monitor interface to publish the
 notible events that may occur while the library is doing its thang.
 How
 the monitor responds to events by logging them or otherwise is a matter
 of implementation.  A default do-nothing monitor adapter may be
 packaged
 with the library instead of the dependency on C-L.  Other monitor
 interface implementations, not packaged with the core, can have a C-L
 based logging monitor implementation (hence C-L dependency) that can be
 used out of the box if desired.  Dependencies are minimized, ugly
 logging code is isolated away and all the parties concerned are happy.
 Is this too idealistic a viewpoint?  Perhaps.  I guess I'm offering up
 this approach yet again for others to correct me.
 
 On Thu, 2004-08-26 at 17:17, Craig McClanahan wrote:
  You are asking two separate but related quesitons here, so they
 should
  be addressed separately.
 
  (1) Should libraries depend on *any* logging library?
 
 I believe there should be no dependency at all although I'm comfortable
 with a dep on C-L.  People just get too passionate about dependencies
 now adays.  So why not get rid of the argument by solving all these
 concerns.  The use of a callback monitor interface exposed by these
 libraries would solve the need for any C-L or other dependencies.  Plus
 by generalizing the problem we open the door for many more use cases.
 
  (2) If so, what logging library should be used?
 
 I don't think (1) has to be the case but if it were C-L IMO would be
 the
 absolute best choice for the reasons you've stated below:
 
 
  * Log4J -- but this would force all downstream users of the
library to use Log4J, even if the applications themseves
use something else.
 
  * JDK 1.4 -- but this would force all downstream users of
the library to run on JDK 1.4, and also doesn't obey the
single logging configuration desire if they are using
something like Log4J
 
  * The same basic issue will apply to any other individual
logging implementation you might like -- the selection
of a particular logging API by a commonly reused library
*forces* applications using that library to support that
logging API, even if the app is using something different.
 
  Indeed, this issue was the motivation for creating Commons Logging in
  the first place -- instead of being a logging *implementation* it was
  deliberately designed as an *adapter* to whatever underlying
  implementation you want to use.
 
 Yes this has been said over and over again and I don't understand why
 the debate re-emerges.  Again I can only suspect that its the required
 jar dependecy that is causing most of the concern out there.
 
  So, what is it that you are suggesting?
 
 I would like to add to this.  Is the root of our concerns really the
 fact that we have a dependency on another library or is the 

cvs commit: jakarta-commons/codec/src/java/org/apache/commons/codec/net URLCodec.java QCodec.java BCodec.java QuotedPrintableCodec.java

2004-08-27 Thread ggregory
ggregory2004/08/27 10:18:17

  Modified:codec/src/java/org/apache/commons/codec/net URLCodec.java
QCodec.java BCodec.java QuotedPrintableCodec.java
  Log:
  Bugzilla Bug 30864
  [codec] Document how to print a QPDecoderStream with QCodec?
  Added Javadoc noting that arguments are expected to be String (and byte[] sometimes).
  Codec does not do Stream (yet).
  
  Revision  ChangesPath
  1.22  +3 -7  
jakarta-commons/codec/src/java/org/apache/commons/codec/net/URLCodec.java
  
  Index: URLCodec.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/codec/src/java/org/apache/commons/codec/net/URLCodec.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- URLCodec.java 27 Aug 2004 17:10:48 -  1.21
  +++ URLCodec.java 27 Aug 2004 17:18:17 -  1.22
  @@ -321,16 +321,12 @@
* Decodes a URL safe object into its original form. Escaped characters are 
converted back to their original
* representation.
* 
  - * p
  - * emCurrently, this method only works with codeString/code and 
codebyte[]/code arguments. 
  - * A codeDecoderException/code is thrown if the argument is not a 
codeString/code or codebyte[]./code/em.
  - * /p
  - * 
* @param pObject
*  URL safe object to convert into its original form
* @return original object
* @throws DecoderException
  - *  Thrown if URL decoding is not applicable to objects of this 
type if decoding is unsuccessful
  + *  Thrown if the argument is not a codeString/code or 
codebyte[]/code. Thrown if a failure condition is
  + *  encountered during the decode process.
*/
   public Object decode(Object pObject) throws DecoderException {
   if (pObject == null) {
  
  
  
  1.9   +3 -8  
jakarta-commons/codec/src/java/org/apache/commons/codec/net/QCodec.java
  
  Index: QCodec.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/codec/src/java/org/apache/commons/codec/net/QCodec.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- QCodec.java   27 Aug 2004 17:10:48 -  1.8
  +++ QCodec.java   27 Aug 2004 17:18:17 -  1.9
  @@ -259,19 +259,14 @@
* Decodes a quoted-printable object into its original form. Escaped characters 
are converted back to their original
* representation.
* 
  - * p
  - * emCurrently, this method only works with codeString/code arguments. 
  - * A codeDecoderException/code is thrown if the argument is not a 
codeString/code./em
  - * /p
  - * 
  - * 
* @param pObject
*  quoted-printable object to convert into its original form
* 
* @return original object
* 
* @throws DecoderException
  - *  A decoder exception is thrown if a failure condition is 
encountered during the decode process.
  + *  Thrown if the argument is not a codeString/code. Thrown 
if a failure condition is
  + *  encountered during the decode process.
*/
   public Object decode(Object pObject) throws DecoderException {
   if (pObject == null) {
  
  
  
  1.9   +3 -7  
jakarta-commons/codec/src/java/org/apache/commons/codec/net/BCodec.java
  
  Index: BCodec.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/codec/src/java/org/apache/commons/codec/net/BCodec.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BCodec.java   27 Aug 2004 17:10:48 -  1.8
  +++ BCodec.java   27 Aug 2004 17:18:17 -  1.9
  @@ -177,18 +177,14 @@
* Decodes a Base64 object into its original form. Escaped characters are 
converted back to their original
* representation.
* 
  - * p
  - * emCurrently, this method only works with codeString/code arguments. 
  - * A codeDecoderException/code is thrown if the argument is not a 
codeString/code./em
  - * /p
  - * 
* @param value
*  Base64 object to convert into its original form
* 
* @return original object
* 
* @throws DecoderException
  - *  A decoder exception is thrown if a failure condition is 
encountered during the decode process.
  + *  Thrown if the argument is not a codeString/code. Thrown 
if a failure condition is
  + *  encountered during the decode process.
*/
   public Object decode(Object value) throws DecoderException {
   if (value == null) {
  
  
  
  1.11  +3 -8  

cvs commit: jakarta-commons-sandbox/feedparser/tests/locate - New directory

2004-08-27 Thread burton
burton  2004/08/27 10:32:17

  jakarta-commons-sandbox/feedparser/tests/locate - New directory

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



Re: cvs commit: jakarta-struts project.xml

2004-08-27 Thread James Mitchell
Oops, this was meant for commons/validator



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message -
From: James Mitchell [EMAIL PROTECTED]
To: Struts Developers List [EMAIL PROTECTED]
Sent: Friday, August 27, 2004 1:18 PM
Subject: Re: cvs commit: jakarta-struts project.xml


 I went ahead and updated the downloads page to 1.1.3, what should I put
for
 latest development versions?  Other commons subprojex look very different
 from validator and even each other???



 --
 James Mitchell
 Software Engineer / Open Source Evangelist
 EdgeTech, Inc.
 678.910.8017
 AIM: jmitchtx

 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, August 27, 2004 1:01 PM
 Subject: cvs commit: jakarta-struts project.xml


  germuska2004/08/27 10:01:36
 
Modified:.project.xml
Log:
remove comment on commons-validator dependency since the current
version
 is now served from iBiblio (yay!)
 
Revision  ChangesPath
1.33  +0 -9  jakarta-struts/project.xml
 
Index: project.xml
===
RCS file: /home/cvs/jakarta-struts/project.xml,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- project.xml 25 Aug 2004 11:49:06 - 1.32
+++ project.xml 27 Aug 2004 17:01:35 - 1.33
@@ -227,16 +227,7 @@
   groupIdcommons-validator/groupId
   artifactIdcommons-validator/artifactId
   version1.1.3/version
-  urlhttp://apache.org/~husted/validator/v1.1.3//url
-  !--
-  Until the validator dependency is served from one of Struts'
 repositories,
-  change the URL to point to the latest development release,
which
 includes a
-  page that explains how to build using Maven and offers a copy
of
 the requisite
-  JAR.  This is the URL Maven shows when a dependency can't be
 resolved, so the
-  above, with explanation, will probably help people more than
just
 pointing
-  to the Validator project (below).
   urlhttp://jakarta.apache.org/commons/validator//url
-  --
   properties
 war.bundletrue/war.bundle
 cactus.bundletrue/cactus.bundle
 
 
 
 
  -
  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]



cvs commit: jakarta-commons-sandbox/feedparser/tests/filter - New directory

2004-08-27 Thread burton
burton  2004/08/27 10:34:45

  jakarta-commons-sandbox/feedparser/tests/filter - New directory

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



cvs commit: jakarta-commons-sandbox/feedparser/tests/locate locate1.html locate2.html locate3.html locate4.html locate5.html locate6.html locate7.html locate8.html locate9.html

2004-08-27 Thread burton
burton  2004/08/27 10:58:04

  Added:   feedparser/tests/locate locate1.html locate2.html
locate3.html locate4.html locate5.html locate6.html
locate7.html locate8.html locate9.html
  Log:
  more tests...
  
  Revision  ChangesPath
  1.1  jakarta-commons-sandbox/feedparser/tests/locate/locate1.html
  
  
http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/feedparser/tests/locate/locate1.html?rev=1.1
  
  
  1.1  jakarta-commons-sandbox/feedparser/tests/locate/locate2.html
  
  
http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/feedparser/tests/locate/locate2.html?rev=1.1
  
  
  1.1  jakarta-commons-sandbox/feedparser/tests/locate/locate3.html
  
  
http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/feedparser/tests/locate/locate3.html?rev=1.1
  
  
  1.1  jakarta-commons-sandbox/feedparser/tests/locate/locate4.html
  
  
http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/feedparser/tests/locate/locate4.html?rev=1.1
  
  
  1.1  jakarta-commons-sandbox/feedparser/tests/locate/locate5.html
  
  
http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/feedparser/tests/locate/locate5.html?rev=1.1
  
  
  1.1  jakarta-commons-sandbox/feedparser/tests/locate/locate6.html
  
  
http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/feedparser/tests/locate/locate6.html?rev=1.1
  
  
  1.1  jakarta-commons-sandbox/feedparser/tests/locate/locate7.html
  
  
http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/feedparser/tests/locate/locate7.html?rev=1.1
  
  
  1.1  jakarta-commons-sandbox/feedparser/tests/locate/locate8.html
  
  
http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/feedparser/tests/locate/locate8.html?rev=1.1
  
  
  1.1  jakarta-commons-sandbox/feedparser/tests/locate/locate9.html
  
  
http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/feedparser/tests/locate/locate9.html?rev=1.1
  
  

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



cvs commit: jakarta-commons-sandbox/feedparser/tests locate1.html locate2.html locate3.html locate4.html locate5.html locate6.html locate7.html

2004-08-27 Thread burton
burton  2004/08/27 10:58:24

  Removed: feedparser/tests locate1.html locate2.html locate3.html
locate4.html locate5.html locate6.html locate7.html
  Log:
  more tests...

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



cvs commit: jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/test TestFeedLocator.java

2004-08-27 Thread burton
burton  2004/08/27 11:07:01

  Modified:feedparser TODO
   feedparser/src/java/org/apache/commons/feedparser
FOAFFeedParser.java FeedParser.java
   feedparser/src/java/org/apache/commons/feedparser/impl
DebugFeedParserListener.java
   feedparser/src/java/org/apache/commons/feedparser/locate
FeedReference.java
   feedparser/src/java/org/apache/commons/feedparser/test
TestFeedLocator.java
  Log:
  documentation for FeedReference
  
  Revision  ChangesPath
  1.10  +12 -1 jakarta-commons-sandbox/feedparser/TODO
  
  Index: TODO
  ===
  RCS file: /home/cvs/jakarta-commons-sandbox/feedparser/TODO,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TODO  4 Jul 2004 05:52:35 -   1.9
  +++ TODO  27 Aug 2004 18:07:01 -  1.10
  @@ -1,5 +1,16 @@
   
  -- Implementation of RSS/Atom autodiscovery...
  +
  +- Support Base64 Atom values and the ability to enable them.
  +
  +- Atom's xml:base is NOT supported right now.  We NEED to support this.
  +
  +- Do we support multiple content items in Atom?
  +
  +
  +
  +- Implement RSS 2.0 enclosure linkage
  +
  +- (DONE) Implementation of RSS/Atom autodiscovery...
   
   - Rework the factory mechanism to support multiple FeedParsers... should be an
 interface.
  
  
  
  1.5   +23 -13
jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/FOAFFeedParser.java
  
  Index: FOAFFeedParser.java
  ===
  RCS file: 
/home/cvs/jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/FOAFFeedParser.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FOAFFeedParser.java   22 Aug 2004 11:28:04 -  1.4
  +++ FOAFFeedParser.java   27 Aug 2004 18:07:01 -  1.5
  @@ -49,23 +49,33 @@
   
   listener.init();
   
  +FOAFFeedParserListener flistener = null;
  +
  +if ( listener instanceof FOAFFeedParserListener )
  +flistener = (FOAFFeedParserListener)listener;
  +
   //this should be the root directory.
   XPath xpath = new XPath( /rdf:RDF/foaf:Person );
   xpath.setNamespaceContext( NS.context );
   
   Element person = (Element)xpath.selectSingleNode( doc );
   
  +String name = RSSFeedParser.getChildElementTextByName( state, name );
  +
  +String homepage = getAttributeValue( state,
  + homepage, NS.FOAF,
  + resource, NS.RDF );
  +
  +if ( flistener != null )
  +flistener.onPerson( state, name );
  +
   xpath = new XPath( foaf:knows );
  +
   xpath.setNamespaceContext( NS.context );
   
   List list = xpath.selectNodes( person );
   Iterator i = list.iterator();
   
  -FOAFFeedParserListener flistener = null;
  -
  -if ( listener instanceof FOAFFeedParserListener )
  -flistener = (FOAFFeedParserListener)listener;
  -
   while ( i.hasNext() ) {
   
   Element knows = (Element)i.next();
  @@ -76,15 +86,13 @@
   
   String title = RSSFeedParser.getChildElementTextByName( state, 
name );
   
  -System.out.println(  FIXME: (debug):  + title );
  -
   String seeAlso = getAttributeValue( state,
   seeAlso, NS.RDFS,
   resource, NS.RDF );
   
  -String homepage = getAttributeValue( state,
  - homepage, NS.FOAF,
  - resource, NS.RDF );
  +homepage = getAttributeValue( state,
  +  homepage, NS.FOAF,
  +  resource, NS.RDF );
   
   System.out.println( seeAlso:  + seeAlso );
   System.out.println( homepage:  + homepage );
  @@ -108,7 +116,6 @@
   flistener.onSeeAlso( state,
seeAlso );
   
  -
   flistener.onSeeAlsoEnd();
   
   } 
  @@ -119,7 +126,10 @@
   flistener.onKnowsEnd();
   
   }
  -
  +
  +if ( flistener != null )
  +flistener.onPersonEnd();
  +
   listener.finished();
   
   } catch ( Throwable t ) { throw new FeedParserException( 

[io] Re: ProcessUtils and support classes offer

2004-08-27 Thread matthew.hawthorne
Cris Perdue wrote:
The purpose of the main ProcessUtils class is to make it simpler to call 
external programs and receive the results back.  It was inspired 
especially by the TCL exec function and also resembles the Perl backtick 
operator.  A simple call to df using the simplest form of call could 
look something like:

String filestats = ProcessUtils.exec(new String[] {df});
The package handles program output to standard error and nonzero exit 
codes.

This may be a good fit for commons-io 
(http://jakarta.apache.org/commons/io/).   A class like ProcessUtils 
seems interesting, but it would definitely need some extensive testing 
on different platforms to make sure it's OK.

Consider submitting your stuff as a Bugzilla enhancement, so that  the 
commons-io developers can take a look when they
get a chance.

I believe the javadocs state that ProcessUtils throws an exception if 
anything is written to stderr.  I would like it if this were 
customizable, since a lot of programs write warnings and such to stderr, 
but still keep on running.  Perhaps it could become
some type of callback mechanism.

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


Re: [general] logging

2004-08-27 Thread Craig McClanahan
On Fri, 27 Aug 2004 13:03:43 -0400, Alex Karasulu [EMAIL PROTECTED] wrote:
 
 However I think this issue is one we can resolve if we generalize the
 problem using monitors and event notification.  Logging is just a
 specific application for a monitor. Paul Hammant described this in the
 NoLogging wiki here:
 
 http://wiki.apache.org/avalon/AvalonNoLogging
 

The problem I have with this general approach is that it trades a
dependency on a logging adapter for a requirement to create code that
responds to the individual event handling interface for every single
library I'm using.  The primary benefit of having all the libraries
conform to a common logging API (whatever it is) is *precisely* the
fact that I, as an application developer, don't have to go through
that kind of pain -- I just configure the logging levels and
destinations, using my favorite logging implementation (using a single
log for everything, separate logs for functional areas, requesting the
appropriate amount of detail on a global or local level, or whatever
else I want), and it just works.

My concern can be dealt with by implementing a commone event monitor
API that all the libraries use, so that I can still implement a
generic event listening framework ... but isn't that, in spirit
(although not in the proposed implementation manner), exactly what
commons-logging already does?

Craig

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



Re: [general] logging

2004-08-27 Thread matthew.hawthorne
Craig McClanahan wrote:
On Fri, 27 Aug 2004 13:03:43 -0400, Alex Karasulu [EMAIL PROTECTED] wrote:
However I think this issue is one we can resolve if we generalize the
problem using monitors and event notification.  Logging is just a
specific application for a monitor. Paul Hammant described this in the
NoLogging wiki here:
http://wiki.apache.org/avalon/AvalonNoLogging
The problem I have with this general approach is that it trades a
dependency on a logging adapter for a requirement to create code that
responds to the individual event handling interface for every single
library I'm using.  
This is only a requirement if you have a need to get details about what
the library is doing.  In most cases, I don't -- but I obviously can't 
speak for
everyone else.

Logging (via commons-logging) has become pretty much a standard part
of development for me.  But for those for which this is not the case,
I don't see implementing a simple monitor interface to handle events
as much harder than putting log4j into the classpath, setting up
the config file to log for the desired class, etc.  Either way requires 
some extra work.


The primary benefit of having all the libraries
conform to a common logging API (whatever it is) is *precisely* the
fact that I, as an application developer, don't have to go through
that kind of pain -- I just configure the logging levels and
destinations, using my favorite logging implementation (using a single
log for everything, separate logs for functional areas, requesting the
appropriate amount of detail on a global or local level, or whatever
else I want), and it just works.
I guess I always saw the primary benefit and purpose of commons-logging 
to be
a bit simpler than this.  I thought it was to allow libraries to log, 
while allowing the user
to choose which logging library is used -- nothing more.

However, what you've said may indeed be true -- the issue is whether 
what works best
for you works best for everyone else.  I'm fine with everything using 
commons-logging,
but that's because I use it in pretty much every project I'm on anyway. 
 For others,
it may cause more of an inconvenience, although I'm not quite sure how. 
 Too many jars, maybe.


My concern can be dealt with by implementing a commone event monitor
API that all the libraries use, so that I can still implement a
generic event listening framework ... but isn't that, in spirit
(although not in the proposed implementation manner), exactly what
commons-logging already does?
Very true -- but I don't think this is what anyone was proposing.
If this was the idea, then, just as you've said, I think commons-logging 
does the job fine.

No need for commons-monitor or anything weird like that...
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JEXL 1.0-RC1

2004-08-27 Thread robert burrell donkin
good work :)
- robert
On 26 Aug 2004, at 07:44, Dion Gillard wrote:
The commons-jexl team is pleased to announce the Commons JEXL 1.0-RC1 
release!

http://jakarta.apache.org/commons/jexl/
Jexl is an implementation of the JSTL Expression Language with 
extensions.

Changes in this version include:
  New Features:
o Handle any size() method that returns an int
  Fixed bugs:
o Fix string concatenation broken for variables Thanks to Geoff 
Waggott.
o Implement short circuit logic for boolean and/or Issue: 29550.
o Can't issue .size() on java.util.Set Issue: 30562.

I've updated JEXL's site, and placed the 1.0-RC1 jar in the the
dist/java-repository directory.
You can find the RC1 distributions in:
http://www.apache.org/dist/java-repository/commons-jexl/distributions/
--
http://www.multitask.com.au/people/dion/
-
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]


[resources] An interesting problem

2004-08-27 Thread James Mitchell
I am refactoring and removing the source files that directly link to code
that falls outside of the ASL.

I am moving these over to sf.net/struts and I am almost done, but for 1
small problem.  If you've looked over any of the test cases, you know that
the tests are actually conducted with calls tracing up the hierarchy to
ResourcesFactoryBaseTestCase.

I want my test classes to reuse this same test code, but I don't know what
the best approach is.  I don't want to copy/paste the existing code because
I don't care to maintain the same code in 2 places.  However, I can't simply
reference the jar.because there is no jar, they are just test classes.


What would you do?



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx




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



Re: [resources] An interesting problem

2004-08-27 Thread matthew.hawthorne
James Mitchell wrote:
I want my test classes to reuse this same test code, but I don't know what
the best approach is.  I don't want to copy/paste the existing code because
I don't care to maintain the same code in 2 places.  However, I can't simply
reference the jar.because there is no jar, they are just test classes. 

What would you do?

Create a jar containing the test classes.  If other projects depend on 
these tests, then
they are a valid artifact produced by the project and no longer just 
test classes.

I run into this situation frequently when I have one component which 
defines a set of
interfaces, and also tests for these interfaces.  Then, I have another 
component which implements
the interfaces, and the tests need to reference the interface tests.

So, I'm in the habit of producing test jars along side the normal ones. 
 [collections] does something
similar to this.

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


Re: [general] logging

2004-08-27 Thread Henri Yandell

+1. I don't see any advantage to the commons-monitor approach as it would
still involve a dependency and would probably be harder to code than
simple logging.

Is there an easy way to produce a jar stripped of its logging parts? Any
of the bytecode-manip/aspect systems that could do it?

Hen

On Fri, 27 Aug 2004, matthew.hawthorne wrote:

 Craig McClanahan wrote:
  On Fri, 27 Aug 2004 13:03:43 -0400, Alex Karasulu [EMAIL PROTECTED] wrote:
 
 However I think this issue is one we can resolve if we generalize the
 problem using monitors and event notification.  Logging is just a
 specific application for a monitor. Paul Hammant described this in the
 NoLogging wiki here:
 
 http://wiki.apache.org/avalon/AvalonNoLogging
 
  The problem I have with this general approach is that it trades a
  dependency on a logging adapter for a requirement to create code that
  responds to the individual event handling interface for every single
  library I'm using.

 This is only a requirement if you have a need to get details about what
 the library is doing.  In most cases, I don't -- but I obviously can't
 speak for
 everyone else.

 Logging (via commons-logging) has become pretty much a standard part
 of development for me.  But for those for which this is not the case,
 I don't see implementing a simple monitor interface to handle events
 as much harder than putting log4j into the classpath, setting up
 the config file to log for the desired class, etc.  Either way requires
 some extra work.


  The primary benefit of having all the libraries
  conform to a common logging API (whatever it is) is *precisely* the
  fact that I, as an application developer, don't have to go through
  that kind of pain -- I just configure the logging levels and
  destinations, using my favorite logging implementation (using a single
  log for everything, separate logs for functional areas, requesting the
  appropriate amount of detail on a global or local level, or whatever
  else I want), and it just works.

 I guess I always saw the primary benefit and purpose of commons-logging
 to be
 a bit simpler than this.  I thought it was to allow libraries to log,
 while allowing the user
 to choose which logging library is used -- nothing more.

 However, what you've said may indeed be true -- the issue is whether
 what works best
 for you works best for everyone else.  I'm fine with everything using
 commons-logging,
 but that's because I use it in pretty much every project I'm on anyway.
   For others,
 it may cause more of an inconvenience, although I'm not quite sure how.
   Too many jars, maybe.


  My concern can be dealt with by implementing a commone event monitor
  API that all the libraries use, so that I can still implement a
  generic event listening framework ... but isn't that, in spirit
  (although not in the proposed implementation manner), exactly what
  commons-logging already does?

 Very true -- but I don't think this is what anyone was proposing.
 If this was the idea, then, just as you've said, I think commons-logging
 does the job fine.

 No need for commons-monitor or anything weird like that...

 -
 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: [resources] An interesting problem

2004-08-27 Thread James Mitchell
Currently the project.xml produces commons-resources-1.0-dev.jar

Can you help me with how I need to tell maven to create a 2nd artifact?

Something like commons-resources-tests-1.0-dev.jar



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message -
From: matthew.hawthorne [EMAIL PROTECTED]
To: Jakarta Commons Developers List [EMAIL PROTECTED]
Sent: Friday, August 27, 2004 4:12 PM
Subject: Re: [resources] An interesting problem


 James Mitchell wrote:
  I want my test classes to reuse this same test code, but I don't know
what
  the best approach is.  I don't want to copy/paste the existing code
because
  I don't care to maintain the same code in 2 places.  However, I can't
simply
  reference the jar.because there is no jar, they are just test
classes.
 
  What would you do?


 Create a jar containing the test classes.  If other projects depend on
 these tests, then
 they are a valid artifact produced by the project and no longer just
 test classes.

 I run into this situation frequently when I have one component which
 defines a set of
 interfaces, and also tests for these interfaces.  Then, I have another
 component which implements
 the interfaces, and the tests need to reference the interface tests.

 So, I'm in the habit of producing test jars along side the normal ones.
   [collections] does something
 similar to this.

 -
 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: [resources] An interesting problem

2004-08-27 Thread matthew.hawthorne
James Mitchell wrote:
Currently the project.xml produces commons-resources-1.0-dev.jar
Can you help me with how I need to tell maven to create a 2nd artifact?
Something like commons-resources-tests-1.0-dev.jar
The cleanest way is to split the project into 2 subprojects.
commons-resources/
  core/
src/
  main/
  tests/
src/
  main/
Make the 2nd project depend on the 1st.  You could do maven 
multiproject:install
in the commons-resources directory to build them both.

However, a lot of people find this undesirable.  You could do some maven.xml
magic to make this happen instead, and keep everything in one source tree.
Here's an example of how I did this, before I switched to the 
multiproject format.

!-- Builds and deploys test jar --
postGoal name=jar:jar
ant:jar destfile=${maven.build.dir}/${testjar.name}
fileset dir=${maven.build.dir}/test-classes/
/ant:jar
/postGoal
define the property 'testjar.name' as whatever you want.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-commons/betwixt/xdocs/guide binding.xml start.xml

2004-08-27 Thread rdonkin
rdonkin 2004/08/27 14:13:36

  Modified:betwixt/xdocs tasks.xml
   betwixt/xdocs/guide binding.xml start.xml
  Log:
  Documentation for multi mapping document support. Contributed by Brian Pugh.
  
  Revision  ChangesPath
  1.34  +5 -1  jakarta-commons/betwixt/xdocs/tasks.xml
  
  Index: tasks.xml
  ===
  RCS file: /home/cvs/jakarta-commons/betwixt/xdocs/tasks.xml,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- tasks.xml 23 Aug 2004 19:33:58 -  1.33
  +++ tasks.xml 27 Aug 2004 21:13:36 -  1.34
  @@ -189,7 +189,11 @@
   listrongImproved introspection for interfaces/strong 
superinterface 
   properties now checked./li
   listrongAttribute suppression/strong - Betwixt now allows the 
  -expression of certain values to be suppressed through a custom 
strategy./li
  +expression of certain values to be suppressed through a custom 
strategy./li  
  +listrongCustom Dot Betwixt Documents/strong - custom dot betwixt
  +documents can be passed in directly./li
  +listrongMulti mapping/strong documents allowing several mappings 
to be
  +specified within a single document./li
   /ul
   /subsection
   subsection name='0.6'
  
  
  
  1.8   +144 -0jakarta-commons/betwixt/xdocs/guide/binding.xml
  
  Index: binding.xml
  ===
  RCS file: /home/cvs/jakarta-commons/betwixt/xdocs/guide/binding.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- binding.xml   13 Jul 2004 21:34:48 -  1.7
  +++ binding.xml   27 Aug 2004 21:13:36 -  1.8
  @@ -513,6 +513,150 @@
   /p
   /subsection
   /section
  +section name='Multi Mapping'
  +subsection name='Custom Dot Betwixt Documents'
  +p
  +There are occasions when it proves useful to be able to override the standard 
  +loading behaviour for code.betwixt/code mapping file. For example, this is 
  +one way in which multiple mapping for the same object can be supported (but see
  +later sections for more sophisticated solutions to this problem). 
  +/p
  +p
  +Betwixt supports this by providing writing and reading methods which allow
  +an codeInputSource/code specifying a code.betwixt/code document to be 
passed in.
  +For example:
  +/p
  +source
  +![CDATA[ 
  +StringReader dotBetwixtDocument = new StringReader(
  +?xml version='1.0' ? +
  +info +
  +element name='address' +
  +...
  +/element +
  +/info);
  +
  +BeanReader reader = new BeanReader();
  +reader.registerBeanClass(new InputSource(dotBetwixtDocument), 
Address.class);
  +Address address = reader.parse(in);
  +]]
  +/source
  +p
  +parses the input document using the mapping specified in the string whilst:
  +/p
  +source
  +![CDATA[ 
  +StringReader reader = new StringReader(
  +?xml version='1.0' ? +
  +info +
  +element name='address' +
  +...
  +/element +
  +/info);
  +
  + 
  +BeanWriter writer;
  +...
  +writer.write(bean, new InputSource(reader));
  +]]
  +/source
  +p
  +writes out a bean according to the mapping given in the string.
  +/p
  +/subsection
  +subsection name='Multi Mapping Document Format'
  +p
  +This xml document format extends the code.betwixt/code vocabulary so that 
several
  +different classes mapping can be registered by a single document.  
  +The mapping file format is an intuitive extension to the standard .betwixt format.
  +The root elements is codelt;betwixt-configgt;/code which contains one or more
  +codelt;classgt;/code elements. Each of these specifies a class and contains
  +a mapping definition for that class (as found in a standard dot betwixt document).
  +/p
  +p
  +For example:
  +/p
  +source
  +![CDATA[ 
  +  ?xml version=1.0?
  +  betwixt-config
  +  !--name of the class to map --
  +   class name=org.some.package.MyClass
  +   !-- standard definations (same as in standard .betwixt file)--
  + element name=repository-registration-result
  +   element name=repository-id property=repositoryId/
  +   element name=id-mapping property=idMapping 
class=org.some.package.SomeOtherClass/
  +   element name=status property=status/
  +   element name=exception property=exception/
  +   element name=primary-luid property=primaryLuid/
  +   addDefaults add-properties='false'/
  + /element
  +   /class
  +  

cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/strategy MixedContentEncodingStrategy.java

2004-08-27 Thread rdonkin
rdonkin 2004/08/27 14:14:04

  Modified:betwixt/src/java/org/apache/commons/betwixt
XMLIntrospector.java
   betwixt/src/java/org/apache/commons/betwixt/io
BeanReader.java
   betwixt/src/java/org/apache/commons/betwixt/strategy
MixedContentEncodingStrategy.java
  Log:
  Multi mapping document support. Contributed by Brian Pugh.
  
  Revision  ChangesPath
  1.34  +55 -0 
jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/XMLIntrospector.java
  
  Index: XMLIntrospector.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/XMLIntrospector.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- XMLIntrospector.java  24 Aug 2004 21:00:50 -  1.33
  +++ XMLIntrospector.java  27 Aug 2004 21:14:04 -  1.34
  @@ -29,10 +29,12 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  +import java.util.Set;
   
   import org.apache.commons.beanutils.DynaBean;
   import org.apache.commons.beanutils.DynaClass;
   import org.apache.commons.beanutils.DynaProperty;
  +import org.apache.commons.betwixt.digester.MultiMappingBeanInfoDigester;
   import org.apache.commons.betwixt.digester.XMLBeanInfoDigester;
   import org.apache.commons.betwixt.digester.XMLIntrospectorHelper;
   import org.apache.commons.betwixt.expression.EmptyExpression;
  @@ -85,6 +87,9 @@
   /** Digester used to parse the XML descriptor files */
   private XMLBeanInfoDigester digester;
   
  +/** Digester used to parse the multi-mapping XML descriptor files */
  +private MultiMappingBeanInfoDigester multiMappingdigester;
  +
   /** Configuration to be used for introspection*/
   private IntrospectionConfiguration configuration;
   
  @@ -525,6 +530,56 @@
   XMLBeanInfo xmlBeanInfo = createXMLBeanInfo( beanInfo );
   populate( xmlBeanInfo, new JavaBeanType( beanInfo ) );
   return xmlBeanInfo;
  +}
  +
  +
  +/**
  + * pRegisters the class mappings specified in the multi-class document
  + * given by the codeInputSource/code.
  + * /p
  + * p
  + * strongNote:/strong that this method will override any existing mapping
  + * for the speficied classes.
  + * /p
  + * @param source codeInputSource/code, not null
  + * @return codeClass/code array containing all mapped classes
  + * @throws IntrospectionException
  + * @throws SAXException
  + * @throws IOException
  + */
  +public synchronized Class[] register(InputSource source) throws 
IntrospectionException, IOException, SAXException {
  +Map xmlBeanInfoByClass = loadMultiMapping(source);   
  +Set keySet = xmlBeanInfoByClass.keySet();
  +Class mappedClasses[] = new Class[keySet.size()];
  +int i=0;
  +for (Iterator it=keySet.iterator(); it.hasNext(); ) {
  +Class clazz = (Class) it.next();
  +mappedClasses[i++] = clazz;
  +XMLBeanInfo xmlBeanInfo = (XMLBeanInfo) xmlBeanInfoByClass.get(clazz);
  +if (xmlBeanInfo != null) {
  +getRegistry().put(clazz, xmlBeanInfo);
  +}   
  +}
  +return mappedClasses;
  +}
  +
  +/**
  + * Loads the multi-mapping from the given codeInputSource/code.
  + * @param mapping codeInputSource/code, not null
  + * @return codeMap/code containing codeXMLBeanInfo/code's
  + * indexes by the codeClass/code they describe
  + * @throws IOException
  + * @throws SAXException
  + */
  +private synchronized Map loadMultiMapping(InputSource mapping) throws 
IOException, SAXException {
  +// synchronized method so this digester is only used by
  +// one thread at once
  +if (multiMappingdigester == null) {
  +multiMappingdigester = new MultiMappingBeanInfoDigester();
  +multiMappingdigester.setXMLIntrospector(this);
  +}
  +Map multiBeanInfoMap = (Map) multiMappingdigester.parse(mapping);
  +return multiBeanInfoMap;
   }
   
   /**
  
  
  
  1.24  +30 -0 
jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/BeanReader.java
  
  Index: BeanReader.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/BeanReader.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- BeanReader.java   24 Aug 2004 21:00:50 -  1.23
  +++ BeanReader.java   27 Aug 2004 21:14:04 -  1.24
  @@ -191,6 +191,36 @@
   }
   }
   
  +/**
  + * pRegisters a class with a multi-mapping.
  + * This mapping is specified by the 

cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/digester ConfigRule.java

2004-08-27 Thread rdonkin
rdonkin 2004/08/27 14:14:35

  Added:   betwixt/src/java/org/apache/commons/betwixt/digester
ConfigRule.java
  Log:
  Multi mapping document support. Contributed by Brian Pugh.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/digester/ConfigRule.java
  
  Index: ConfigRule.java
  ===
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the License);
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an AS IS BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */ 
  package org.apache.commons.betwixt.digester;
  
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.xml.sax.Attributes;
  import org.xml.sax.SAXException;
  
  /**
   * Digester Rule to process config elements.
   * @author Brian Pugh
   */
  public class ConfigRule extends RuleSupport {
  /** Logger. */
  private static final Log log = LogFactory.getLog(ConfigRule.class);
  
  /** Base constructor. */
  public ConfigRule() {
  }
  // Rule interface
  //-
  /**
   * Process the beginning of this element.
   *
   * @param attributes The attribute list of this element
   * @throws org.xml.sax.SAXException if the primitiveTypes attribute contains an 
invalid value
   */
  public void begin(Attributes attributes) throws SAXException {
  String value = attributes.getValue(primitiveTypes);
  if (value != null) {
  if (value.equalsIgnoreCase(element)) {
getXMLInfoDigester().setAttributesForPrimitives(false);
  
  } else if (value.equalsIgnoreCase(attribute)) {
  getXMLInfoDigester().setAttributesForPrimitives(true);
  } else {
  throw new SAXException(
  Invalid value inside element betwixt-config for attribute 
'primitiveTypes'.
  +  Value should be 'element' or 'attribute');
  }
  }
  MultiMappingBeanInfoDigester digester = (MultiMappingBeanInfoDigester) 
getDigester();
  getDigester().push(digester.getBeanInfoMap());
  }
  /**
   * Process the end of this element.
   */
  public void end() {
  Object top = getDigester().pop();
  }
  
  
  }
  
  
  

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



cvs commit: jakarta-commons/betwixt/src/test/org/apache/commons/betwixt mapping.xml

2004-08-27 Thread rdonkin
rdonkin 2004/08/27 14:15:03

  Added:   betwixt/src/test/org/apache/commons/betwixt mapping.xml
  Log:
  Multi mapping document support. Contributed by Brian Pugh.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/mapping.xml
  
  Index: mapping.xml
  ===
  ?xml version=1.0?
  betwixt-config
class name=org.apache.commons.betwixt.PartyBean
  element name=party
element name=the-excuse property=excuse/
element name=location property=venue/  
element name=time property=fromHour/
  /element
/class
class name=org.apache.commons.betwixt.AddressBean
  element name=address
element name=street property=street/
element name=city property=city/
element name=code property=code/
element name=country property=country/
  /element
/class
  /betwixt-config
  
  
  

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



cvs commit: jakarta-commons/betwixt/src/test/org/apache/commons/betwixt TestMultiMapping.java

2004-08-27 Thread rdonkin
rdonkin 2004/08/27 14:15:19

  Added:   betwixt/src/test/org/apache/commons/betwixt
TestMultiMapping.java
  Log:
  Multi mapping document support. Contributed by Brian Pugh.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/TestMultiMapping.java
  
  Index: TestMultiMapping.java
  ===
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the License);
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an AS IS BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */ 
  package org.apache.commons.betwixt;
  
  
  import java.beans.IntrospectionException;
  import java.io.FileReader;
  import java.io.IOException;
  import java.io.StringReader;
  import java.io.StringWriter;
  import java.util.Date;
  
  import org.apache.commons.betwixt.io.BeanReader;
  import org.apache.commons.betwixt.io.BeanWriter;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  
  /**
   * @author Brian Pugh
   */
  public class TestMultiMapping extends AbstractTestCase {
  
  public TestMultiMapping(String testName) {
  super(testName);
  
  }
  
public void testRoundTripWithSingleMappingFile() throws IOException, 
SAXException, IntrospectionException {
AddressBean addressBean = new AddressBean();
addressBean.setCity(New York);
addressBean.setCode(92342);
addressBean.setCountry(USA);
addressBean.setStreet(12312 Here);
PartyBean partyBean = new PartyBean();
partyBean.setDateOfParty(new Date());
partyBean.setExcuse(too late);
partyBean.setFromHour(22);
partyBean.setVenue(addressBean);

InputSource source 
= new InputSource(
new 
FileReader(getTestFile(src/test/org/apache/commons/betwixt/mapping.xml)));

StringWriter outputWriter = new StringWriter();
outputWriter.write(?xml version='1.0' ?\n);
BeanWriter beanWriter = new BeanWriter(outputWriter);
beanWriter.enablePrettyPrint();
beanWriter.setWriteEmptyElements(true);
beanWriter.getXMLIntrospector().register(source);
beanWriter.write(partyBean);
String expectedOut = ?xml version='1.0' ?\n +
   party id=\1\\n +
 the-excusetoo late/the-excuse\n +
 location id=\2\\n +
   street12312 Here/street\n +
   cityNew York/city\n +
   code92342/code\n +
   countryUSA/country\n +
 /location\n +
 time22/time\n +
   /party\n;
assertEquals(expectedOut, outputWriter.toString());

BeanReader beanReader = new BeanReader();
beanReader.registerMultiMapping(
new InputSource(
new 
FileReader(getTestFile(src/test/org/apache/commons/betwixt/mapping.xml;
StringReader xmlReader = new StringReader(outputWriter.toString());
//Parse the xml
PartyBean result = (PartyBean)beanReader.parse(xmlReader);
assertEquals(partyBean.getExcuse(), result.getExcuse());
assertEquals(partyBean.getFromHour(), result.getFromHour());
AddressBean addressResult = result.getVenue();
assertEquals(addressBean.getCity(), addressResult.getCity());
assertEquals(addressBean.getCode(), addressResult.getCode());
assertEquals(addressBean.getCountry(), addressResult.getCountry());
assertEquals(addressBean.getStreet(), addressResult.getStreet());

  }
  
  }
  
  
  
  

-
To unsubscribe, e-mail: [EMAIL 

cvs commit: jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/dotbetwixt TestMultiMap.java

2004-08-27 Thread rdonkin
rdonkin 2004/08/27 14:15:39

  Added:   betwixt/src/test/org/apache/commons/betwixt/dotbetwixt
TestMultiMap.java
  Log:
  Multi mapping document support. Contributed by Brian Pugh.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/dotbetwixt/TestMultiMap.java
  
  Index: TestMultiMap.java
  ===
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the License);
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an AS IS BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */ 
  package org.apache.commons.betwixt.dotbetwixt;
  
  import java.io.StringReader;
  
  import org.apache.commons.betwixt.AbstractTestCase;
  import org.apache.commons.betwixt.AddressBean;
  import org.apache.commons.betwixt.ElementDescriptor;
  import org.apache.commons.betwixt.XMLBeanInfo;
  import org.apache.commons.betwixt.XMLIntrospector;
  import org.xml.sax.InputSource;
  
  /**
   * @author a href='http://jakarta.apache.org/commons'Jakarta Commons Team/a, a 
href='http://www.apache.org'Apache Software Foundation/a
   */
  public class TestMultiMap extends AbstractTestCase {
  
  public TestMultiMap(String testName) {
  super(testName);
  }
  
  private static final String MAPPING = ?xml version='1.0'? +
 betwixt-config +
class name='org.apache.commons.betwixt.PartyBean' +
   element name='party' +
element name='the-excuse' property='excuse'/ +
element name='location' property='venue'/   +
element name='time' property='fromHour'/ +
  /element +
/class +
class name='org.apache.commons.betwixt.AddressBean' +
  element name='not-address' +
element name='not-street' property='street'/ +
element name='not-city' property='city'/ +
element name='not-code' property='code'/ +
element name='not-country' property='country'/ +
  /element +
/class +
class 
name='org.apache.commons.betwixt.dotbetwixt.SimpleTestBean' +
  element name='jelly' +
  element name='wibble' property='alpha'/ +
  element name='wobble' property='beta'/ +
  /element +
/class +
 /betwixt-config;
  
  public void testRegisterMultiMapping() throws Exception {
  XMLIntrospector xmlIntrospector = new XMLIntrospector();
  Class[] mapped = xmlIntrospector.register(new InputSource(new 
StringReader(MAPPING)));
  
  assertEquals(Mapped classes, 3, mapped.length);
  
  XMLBeanInfo beanInfo = xmlIntrospector.introspect(AddressBean.class);
  assertNotNull(Bean info mapping, beanInfo);
  ElementDescriptor descriptor = beanInfo.getElementDescriptor();
  assertEquals(Root element name, not-address, descriptor.getLocalName());
  ElementDescriptor[] childDescriptors = descriptor.getElementDescriptors();
  assertEquals(4 child elements, 4, childDescriptors.length);
  assertEquals(First element, not-street, 
childDescriptors[0].getLocalName());
  assertEquals(Second element, not-city, 
childDescriptors[1].getLocalName());
  assertEquals(Third element, not-code, 
childDescriptors[2].getLocalName());
  assertEquals(Forth element, not-country, 
childDescriptors[3].getLocalName());

  beanInfo = xmlIntrospector.introspect(SimpleTestBean.class);
  assertNotNull(Bean info mapping, beanInfo);
  descriptor = beanInfo.getElementDescriptor();
  assertEquals(Root element name, jelly, descriptor.getLocalName());
  childDescriptors = descriptor.getElementDescriptors();
  assertEquals(Child elements, 2, childDescriptors.length);
  assertEquals(First element, wibble, childDescriptors[0].getLocalName());
  assertEquals(Second element, wobble, childDescriptors[1].getLocalName());
   
  }
  }
  
  
  


cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/digester ClassRule.java

2004-08-27 Thread rdonkin
rdonkin 2004/08/27 14:14:20

  Added:   betwixt/src/java/org/apache/commons/betwixt/digester
ClassRule.java
  Log:
  Multi mapping document support. Contributed by Brian Pugh.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/digester/ClassRule.java
  
  Index: ClassRule.java
  ===
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the License);
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an AS IS BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */ 
  package org.apache.commons.betwixt.digester;
  
  import java.util.Map;
  
  import org.apache.commons.betwixt.XMLBeanInfo;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.xml.sax.Attributes;
  import org.xml.sax.SAXException;
  
  /**
   * Digester Rule to process class elements.
   * @author Brian Pugh
   */
  public class ClassRule extends RuleSupport {
  /** Logger. */
  private static final Log log = LogFactory.getLog(ClassRule.class);
  
  /** Base constructor. */
  public ClassRule() {
  }
  
  // Rule interface
  //-
  /**
   * Process the beginning of this element.
   *
   * @param attributes The attribute list of this element
   * @throws org.xml.sax.SAXException if the primitiveTypes attribute contains an 
invalid value
   */
  public void begin(Attributes attributes) throws SAXException {
  String className = attributes.getValue(name);
  if (className == null || .equals(className)) {
  throw new SAXException(Invalid 'class' element.  
 + Attribute 'name' is required but was not found but 
was not found.);
  }
  
  try {
  
  Class beanClass = Class.forName(className);
  XMLBeanInfo xmlBeanInfo = new XMLBeanInfo(beanClass);
  XMLBeanInfoDigester xmlBeanInfoDigester = (XMLBeanInfoDigester) 
getDigester();
  xmlBeanInfoDigester.setBeanClass(beanClass);
  xmlBeanInfoDigester.push(xmlBeanInfo);
  
  } catch (ClassNotFoundException e) {
  throw new SAXException(Invalid 'class' element.  Unable to find class: 
 + className, e);
  }
  }
  
  /**
   * Process the end of this element.
   */
  public void end() {
  XMLBeanInfo xmlBeanInfo = (XMLBeanInfo) getDigester().pop();
  MultiMappingBeanInfoDigester digester = (MultiMappingBeanInfoDigester) 
getDigester();
  Map xmlBeanInfoMapping = digester.getBeanInfoMap();
  xmlBeanInfoMapping.put(xmlBeanInfo.getBeanClass(), xmlBeanInfo);
  digester.setBeanClass(null);
  }
}
  
  
  
  

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



cvs commit: jakarta-commons/attributes maven.xml

2004-08-27 Thread leosutic
leosutic2004/08/27 16:12:53

  Modified:attributes maven.xml
  Log:
  Fixed build.
  
  Revision  ChangesPath
  1.8   +1 -1  jakarta-commons/attributes/maven.xml
  
  Index: maven.xml
  ===
  RCS file: /home/cvs/jakarta-commons/attributes/maven.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- maven.xml 27 Aug 2004 21:30:10 -  1.7
  +++ maven.xml 27 Aug 2004 23:12:52 -  1.8
  @@ -34,7 +34,7 @@
   !-- == --
   postGoal name=xdoc:copy-resources  
   copy todir=${basedir}/target/docs/style/ failonerror=false
  -fileset dir=${basedir}/../commons-build/xdocs/style
  +fileset dir=${basedir}/../../commons-build/xdocs/style
   include name='**/*'/
   exclude name='**/CVS/**'/
   /fileset
  
  
  

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



cvs commit: jakarta-commons/attributes windeploysite.cmd

2004-08-27 Thread leosutic
leosutic2004/08/27 16:13:13

  Added:   attributes windeploysite.cmd
  Log:
  Added this one to make it easier to update the site in Windows.
  
  Revision  ChangesPath
  1.1  jakarta-commons/attributes/windeploysite.cmd
  
  Index: windeploysite.cmd
  ===
  @ECHO OFF
  
  if %1 ==  goto :HELP
  
  pscp target/site.zip [EMAIL PROTECTED]:__site.zip
  plink [EMAIL PROTECTED] rm -rf /www/jakarta.apache.org/commons/attributes/*;unzip 
__site.zip -d /www/jakarta.apache.org/commons/attributes/;rm -f __site.zip
  
  goto END
  
  :HELP
  
  echo Usage: windeploysite username
  echo Example: windeploysite leosutic
  
  :END
  
  

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



RE: [lang] Interpolation

2004-08-27 Thread Gary Gregory
Hello,

Since Interpolation is so close in intent to MessageFormat, I seems less
confusing to Java (as opposed to Perl) people to use a
MessageFormat-like name. For example MappedMessageFormat is not bad.

Look at java.text.MessageFormat [1], Interpolation seems to do the same
kind of thing. For example [1], with MessageFormat, you can:

Object[] arguments = {
 new Integer(7),
 new Date(System.currentTimeMillis()),
 a disturbance in the Force
 };

 String result = MessageFormat.format(
 At {1,time} on {1,date}, there was {2} on planet
{0,number,integer}.,
 arguments);

 output: At 12:30 PM on Jul 3, 2053, there was a disturbance
   in the Force on planet 7.

The new Interpolation version would be:

   Map arguments = HashMap();
   valuesMap.put( time, new Date(System.currentTimeMillis()) );
   valuesMap.put( what, a disturbance in the Force );
   //etc
   String result = Interpolation.interpolate(
 At ${time} on ${date}, there was ${what} on planet ${planet}.,
 arguments);

So the added value to MessageFormat is a more flexible way to pass in
arguments (no positional issues). So why call it something oh-so
completely different from MessageFormat which is so close in
functionality? ;-)

The MappedMessageFormat would also have a format method, not an
interpolate.

Thanks,
Gary

[1] http://java.sun.com/j2se/1.3/docs/api/java/text/MessageFormat.html

 -Original Message-
 From: Gary Gregory [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 27, 2004 09:35
 To: Jakarta Commons Developers List
 Subject: RE: [lang] Interpolation
 
 I do not like a *Utils name for this because I'd like the class to be
 instantiable per my example.
 
 Gary
 
  -Original Message-
  From: Stephen Colebourne [mailto:[EMAIL PROTECTED]
  Sent: Thursday, August 26, 2004 17:35
  To: Jakarta Commons Developers List
  Subject: Re: [lang] Interpolation
 
  1) I felt the 'interpolateRepeatedly' scanned badly as a method
name.
 But
  I
  couldn't think of anything better.
 
  2) I wondered if it should be InterpolateUtils, or some such to fit
 with
  our
  Utils classes.
 
  Stephen
 
  - Original Message -
  From: Gary Gregory [EMAIL PROTECTED]
  To: Jakarta Commons Developers List
[EMAIL PROTECTED]
  Sent: Thursday, August 26, 2004 11:52 PM
  Subject: RE: [lang] Interpolation
 
 
(3) Usage.
   
I'd like that class to be more flexible in order to do the
 following
  for
example:
   
Interpolation interpolation = new Interpolation();
interpolation.setStartMarker();
interpolation.setEndMarker();
interpolation.setMap(aMap);
String news = interpolation.interpolate(templateString);
  
   Sounds interesting.  ${..} seems a common default though.
  
   Hen
 
  Agreed, the defaults are fine. The pieces should be pluggable is all
I
  am saying which gives us the biggest bang for the buck with this new
  class.
 
  Gary
 


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



Re: [general] logging

2004-08-27 Thread Alex Karasulu
On Fri, 2004-08-27 at 15:13, Craig McClanahan wrote:
 On Fri, 27 Aug 2004 13:03:43 -0400, Alex Karasulu [EMAIL PROTECTED] wrote:
  
  However I think this issue is one we can resolve if we generalize the
  problem using monitors and event notification.  Logging is just a
  specific application for a monitor. Paul Hammant described this in the
  NoLogging wiki here:
  
  http://wiki.apache.org/avalon/AvalonNoLogging
  
 
 The problem I have with this general approach is that it trades a
 dependency on a logging adapter for a requirement to create code that
 responds to the individual event handling interface for every single
 library I'm using.  The primary benefit of having all the libraries

Actually the logging monitor implementation would still be implemented
by the library developer as an optional peice.  The user would not have
to write a logging implementation for the monitor interface.  Say for
example the library is the dbcp library.  It might expose the following
interface as part of the library:

public interface DBCPMonitor
{
connectionAcquired( ConnectionPool pool, Connection conn );
connectionReleased( ConnectionPool pool, Connection conn );
}

Obviously this is a very simplistic example so please bear with me.  The
library developer would have a setMonitor(DBCPMonitor) or even an
addMonitor(DBCPMonitor) method on the connection pool class for example
to set the monitor used.  The developer might implement a do-nothing
monitor adapter for the default monitor to use.  When these events occur
in the connection pool the methods are called instead of handling
logging.

Outside of the distribution jar the developer might include several
monitor implementations one of which can be a C-L based logging monitor
which is dependent on C-L obviously.  So the user does not have to
implement the logger at all.  

Someone (possibly James Strachan) actually used this pattern in the
ThreadPool package within the Jakarta Commons Sandbox here:

http://jakarta.apache.org/commons/sandbox/threadpool/apidocs/index.html

Take a look at the ThreadPoolMonitor interface and the
NullThreadPoolMonitor.  I don't think the author actually implemented a
logging monitor here but they could have and not included it with the
core classes going into the jar.  

 conform to a common logging API (whatever it is) is *precisely* the
 fact that I, as an application developer, don't have to go through
 that kind of pain -- I just configure the logging levels and
 destinations, using my favorite logging implementation (using a single
 log for everything, separate logs for functional areas, requesting the
 appropriate amount of detail on a global or local level, or whatever
 else I want), and it just works.

Yes it does work but not everyone wants the dependency.  This is the
core problem.  I personally don't mind having the commons-logging
dependency.  Just making a recommendation to solve a recurring topic on
this list. 

 My concern can be dealt with by implementing a commone event monitor
 API that all the libraries use, so that I can still implement a
 generic event listening framework ... but isn't that, in spirit
 (although not in the proposed implementation manner), exactly what
 commons-logging already does?

I disagree but I see where you're comming from.  The fact that you're
logging makes you specific to a particular monitoring implementation so
this is not a generic event listening framework.  Furthermore I'm not
recommending we DO have a generic event listening framework. Each
monitor is specific to the library.  I'm just saying let libraries
publish/expose the notable events that external systems can respond to. 
The monitor interface for any library, component etcetera accomplishes
that.  What the user does with that is their business.  Also while
exposing that monitor interface give the user interested in logging a
head start by offing a logging monitor based on C-L outside of your core
jar.

Regards,
Alex



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



Re: cvs commit: jakarta-commons/validator project.xml

2004-08-27 Thread David Graham
Welcome aboard James!  I noticed you misspelled your email address so I
saved you some time and added [EMAIL PROTECTED] to some lists I thought
you might enjoy :-).

David

--- [EMAIL PROTECTED] wrote:

 jmitchell2004/08/27 09:17:28
 
   Modified:validator project.xml
   Log:
   Volunteer myself - no applause, just send money :P
   
   Revision  ChangesPath
   1.51  +7 -1  jakarta-commons/validator/project.xml
   
   Index: project.xml
   ===
   RCS file: /home/cvs/jakarta-commons/validator/project.xml,v
   retrieving revision 1.50
   retrieving revision 1.51
   diff -u -r1.50 -r1.51
   --- project.xml 11 Jun 2004 20:51:57 -  1.50
   +++ project.xml 27 Aug 2004 16:17:28 -  1.51
   @@ -1,4 +1,4 @@
   -?xml version=1.0 encoding=UTF-8?
   +?xml version=1.0 encoding=UTF-8?
!--
   Copyright 2003-2004 The Apache Software Foundation

   @@ -121,6 +121,12 @@
  idmrdon/id
  email[EMAIL PROTECTED]/email
  organization/organization
   +/developer
   +developer
   +  nameJames Mitchell/name
   +  idjmitchell/id
   +  emailjmitchell NOSPAM apache.org/email
   +  organizationEdgeTech, Inc/organization
/developer
   /developers
  
   
   
   
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: cvs commit: jakarta-commons/validator project.xml

2004-08-27 Thread James Mitchell
Geethanks!!!  :P



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message -
From: David Graham [EMAIL PROTECTED]
To: Jakarta Commons Developers List [EMAIL PROTECTED]
Sent: Friday, August 27, 2004 9:01 PM
Subject: Re: cvs commit: jakarta-commons/validator project.xml


 Welcome aboard James!  I noticed you misspelled your email address so I
 saved you some time and added [EMAIL PROTECTED] to some lists I thought
 you might enjoy :-).

 David

 --- [EMAIL PROTECTED] wrote:

  jmitchell2004/08/27 09:17:28
 
Modified:validator project.xml
Log:
Volunteer myself - no applause, just send money :P
 
Revision  ChangesPath
1.51  +7 -1  jakarta-commons/validator/project.xml
 
Index: project.xml
===
RCS file: /home/cvs/jakarta-commons/validator/project.xml,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- project.xml 11 Jun 2004 20:51:57 - 1.50
+++ project.xml 27 Aug 2004 16:17:28 - 1.51
@@ -1,4 +1,4 @@
-?xml version=1.0 encoding=UTF-8?
+?xml version=1.0 encoding=UTF-8?
 !--
Copyright 2003-2004 The Apache Software Foundation
 
@@ -121,6 +121,12 @@
   idmrdon/id
   email[EMAIL PROTECTED]/email
   organization/organization
+/developer
+developer
+  nameJames Mitchell/name
+  idjmitchell/id
+  emailjmitchell NOSPAM apache.org/email
+  organizationEdgeTech, Inc/organization
 /developer
/developers
 
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com

 -
 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: [general] logging

2004-08-27 Thread Martin Cooper
On Fri, 27 Aug 2004 20:53:41 -0400, Alex Karasulu [EMAIL PROTECTED] wrote:
 On Fri, 2004-08-27 at 15:13, Craig McClanahan wrote:

snip/

  My concern can be dealt with by implementing a commone event monitor
  API that all the libraries use, so that I can still implement a
  generic event listening framework ... but isn't that, in spirit
  (although not in the proposed implementation manner), exactly what
  commons-logging already does?
 
 I disagree but I see where you're comming from.  The fact that you're
 logging makes you specific to a particular monitoring implementation so
 this is not a generic event listening framework.  Furthermore I'm not
 recommending we DO have a generic event listening framework. Each
 monitor is specific to the library.  I'm just saying let libraries
 publish/expose the notable events that external systems can respond to.
 The monitor interface for any library, component etcetera accomplishes
 that.  What the user does with that is their business.  Also while
 exposing that monitor interface give the user interested in logging a
 head start by offing a logging monitor based on C-L outside of your core
 jar.

If there isn't a standard way of doing this, doesn't that mean that
each component (library) will end up doing it slightly differently?
That, in turn, means that each component will have its own (optional)
additional library that needs to be included just to add logging for
that library. This seems like it would result in an explosion of jars
- much worse than everyone just using Commons Logging, which is now so
ubiquitous in any case.

It also means that, if we decide to migrate a class from one component
to another, the logging (sorry, monitoring ;) scheme needs to change
to adhere to the conventions of the new component.

Finally - and perhaps my biggest worry - performance would be
negatively impacted by the additional calls, and by the lack of any
ability to check the logging level before actually logging. (You can't
have methods like isDebugEnabled() in a general purpose monitoring
interface, after all.)

IMHO, logging should be easy and cheap, so that developers put it
wherever it could be useful. I can't tell you how many times I've
wished that 3rd party code had more logging in it so that I could
figure out why things weren't working as I expected.

--
Martin Cooper


 
 Regards,
 Alex
 
 
 
 
 -
 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]



DO NOT REPLY [Bug 30911] - Map that returns a defaul value if key is not present

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30911.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30911

Map that returns a defaul value if key is not present





--- Additional Comments From [EMAIL PROTECTED]  2004-08-28 02:32 ---
I forgot to comment: This new class could be called NotNullMap or better name.

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



DO NOT REPLY [Bug 30910] New: - EL: implementation of parseExpression does not implement spec

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30910.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30910

EL: implementation of parseExpression does not implement spec

   Summary: EL: implementation of parseExpression does not implement
spec
   Product: Commons
   Version: 1.0 Final
  Platform: All
OS/Version: All
Status: NEW
  Severity: Normal
  Priority: Other
 Component: EL
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


The implementation of parseExpression in the EL expression evaluator does not conform 
to the JSP 2.0 specification.  The javadoc for the fMapper argument states that 
The ExpressionEvaluatormustnotholdontotheFunctionMapperreferenceafter returning 
fromparseExpression(). TheExpression object returned must invoke the same functions 
regardless of whether the mappings in the providedFunctionMapper instance change 
between calling ExpressionEvaluator.parseExpression() andExpression.evaluate().

The test case which I will attach clearly shows that this is not the case.

Why hasn't anybody noticed this before, you may ask?  I suspect that the current 
implementation of Tomcat never updates the bindings in its function mapper once one is 
constructed, since the functions are defined at web-app load time and can't be updated 
after that.

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



DO NOT REPLY [Bug 30910] - EL: implementation of parseExpression does not implement spec

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30910.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30910

EL: implementation of parseExpression does not implement spec





--- Additional Comments From [EMAIL PROTECTED]  2004-08-28 02:04 ---
Created an attachment (id=12556)
JUnit test case for function binding in parseExpression

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



DO NOT REPLY [Bug 30910] - EL: implementation of parseExpression does not implement spec

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30910.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30910

EL: implementation of parseExpression does not implement spec





--- Additional Comments From [EMAIL PROTECTED]  2004-08-28 02:05 ---
Created an attachment (id=12557)
Patch which correctly implements the function binding behavior described in the JSP 
2.0 spec for parseExpression.

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



DO NOT REPLY [Bug 30911] New: - Map that returns a defaul value if key is not present

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30911.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30911

Map that returns a defaul value if key is not present

   Summary: Map that returns a defaul value if key is not present
   Product: Commons
   Version: 3.2
  Platform: Other
OS/Version: Other
Status: NEW
  Severity: Normal
  Priority: Other
 Component: Collections
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


By definition if a map does not contain a determined key it returns null. But 
sometimes may be desirable that it returns a not-null value for not present 
keys. My propose is create a Decorated Map that extends 
org.apache.commons.collections.map.AbstractMapDecorator class. In constructor 
it receives the original Map and a default value to be returned is for a 
inexistent key. This class will override get() method like this:

public Object get(Object key) {
Object value = super.get(key);
if(value == null) {
value = this.defaultValue;
}
return value;
}

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



DO NOT REPLY [Bug 30911] - Map that returns a defaul value if key is not present

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30911.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30911

Map that returns a defaul value if key is not present





--- Additional Comments From [EMAIL PROTECTED]  2004-08-28 02:29 ---
Created an attachment (id=12558)
Implementatio of NotNullMap class

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



DO NOT REPLY [Bug 30911] - Map that returns a defaul value if key is not present

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30911.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30911

Map that returns a defaul value if key is not present





--- Additional Comments From [EMAIL PROTECTED]  2004-08-28 02:30 ---
Created an attachment (id=12559)
Test class for NotNullMap

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



Re: problem with reading response of a multipart post

2004-08-27 Thread Tomislav Dedus
Hi Ortwin,

thanks for the help!

The problem was the content-type an the transfer-encoding-header.
Overwriting of StringPart with not setting these headers solved the problem.


Thanks again and best regards

Tomi

 
 Tomislav Dedus wrote:
 
  Hi,
  
  first of all great project.
  
  But I'm having little trouble with a multipart post.All other requests
 are
  working fine.
  After I execute the MultipartPostMethod with a few (120) StringParts
 nothing
  happens.
  The log shows that I get the response header HTTP/1.1 100 continue but
  thats all.
  Then after while (9ms) a SocketTimeoutException  occures. 
  
  Is there a problem in my code or is that a known problem?
 
 
 Toislav,
 
 it seems that IIS expects you to use a 100 continue handshake. Try and 
 enable it in HttpClient.
 
 -- 
   _
   NOSE applied intelligence ag
 
   ortwin glück  [www]  http://www.nose.ch
   software engineer
   hardturmstrasse 171   [pgp id]   0x81CF3416
   8005 zürich   [office]  +41-1-277 57 35
   switzerland   [fax] +41-1-277 57 12
 
 -
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 

-- 
NEU: Bis zu 10 GB Speicher für e-mails  Dateien!
1 GB bereits bei GMX FreeMail http://www.gmx.net/de/go/mail


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



DO NOT REPLY [Bug 30908] New: - Chunked Stream Encoding Problems Fails to throw Exceptions

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30908.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30908

Chunked Stream Encoding Problems Fails to throw Exceptions

   Summary: Chunked Stream Encoding Problems Fails to throw
Exceptions
   Product: Commons
   Version: 2.1 Final
  Platform: All
OS/Version: Other
Status: NEW
  Severity: Major
  Priority: Other
 Component: HttpClient
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


Using the HttpClient 2.0.1 with Sun's JDK 1.4.1_01 and connecting to a site 
that appareantly has problems generating proper chunked output causes the http 
client to catch and log an exception then return null data. Ideally the http 
client should throw the IOException to the calling class so that it can be 
handled by the programmer. It's not a problem that an exception is being 
generated it is a bug that the exception is being trapped in the somewhere in 
the httpclient code.

2004-08-27 21:19:01,013 main HttpMethodBase [ERROR]: I/O failure reading 
response body
java.io.IOException: chunked stream ended unexpectedly
at 
org.apache.commons.httpclient.ChunkedInputStream.getChunkSizeFromInputStream
(ChunkedInputStream.java:234)
at org.apache.commons.httpclient.ChunkedInputStream.nextChunk
(ChunkedInputStream.java:205)
at org.apache.commons.httpclient.ChunkedInputStream.read
(ChunkedInputStream.java:160)
at java.io.FilterInputStream.read(FilterInputStream.java:111)
at org.apache.commons.httpclient.AutoCloseInputStream.read
(AutoCloseInputStream.java:110)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
at org.apache.commons.httpclient.AutoCloseInputStream.read
(AutoCloseInputStream.java:129)
at org.apache.commons.httpclient.HttpMethodBase.getResponseBody
(HttpMethodBase.java:685)
at com.algorim.ei.cets.EmailPreProcessor.processMessage
(EmailPreProcessor.java:565)
at com.algorim.ei.cets.EmailUpdate.run(EmailUpdate.java:332)
at com.algorim.ei.cets.EmailUpdate.main(EmailUpdate.java:89)

Request and response that are causing the error:
GET /aeq.aspx?k=32226[EMAIL PROTECTED] HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 
1.1.4322)
Host: 38.117.227.56

HTTP/1.1 200 OK
Date: Fri, 27 Aug 2004 20:55:27 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Transfer-Encoding: chunked
Cache-Control: private
Content-Type: text/html; charset=utf-8

179
htmlheadMETA HTTP-EQUIV=Refresh CONTENT=1; 
URL=http://www.datingresults.com/default.asp?
p=7090PRM=38664/headbodyscriptwin2=win
dow.open('http://m.qmct.com/images/d.html?
a=1', 'newwin','toolbar=0,width=730,height=500');if (win2 != null) win2.blur
();window.focus();wind
ow.location = 'http://www.datingresults.com/default.asp?
p=7090PRM=38664';/script/body/html

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



DO NOT REPLY [Bug 30908] - Chunked Stream Encoding Problems Fails to throw Exceptions

2004-08-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=30908.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30908

Chunked Stream Encoding Problems Fails to throw Exceptions

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED



--- Additional Comments From [EMAIL PROTECTED]  2004-08-27 21:48 ---
Cullin,
It's a known problem with the 2.0 API. It's already been fixed in 3.0 Alpha1 and
CVS HEAD

Oleg

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



Problems with commons-logging jar and request for advice.

2004-08-27 Thread Eric Bloch
Hey Folks,
I've experienced a few problems with httpclient not instantiating in a 
web application under some containers (websphere 5.1 is the latest, but 
I've seen problems in tomcat and ATG as well).  This turns out to 
*always* be a problem with class-loading and commons-logging.  It's hard 
to precisely describe the problems, but it always seems like it has 
something to do with different class-loaders loading the commons-logging 
 api or implementation jar.

I'm wondering what the current advice is on common-logging.  See 
http://www.qos.ch/logging/thinkAgain.html for details on links to the 
numerous problems and problem reports with commons-logging.  I imagine I 
could be walking into a religious debate here, bu, as far as I can tell, 
commons-logging is basically broken wrt to its class-loader and the 
servlet-container spec for class-loading.  (It always chooses the Java 
spec rather than the servlet container spec).

I really only care about httpclient, but unfortunately, it seems I'm 
stuck with commons-logging because httpclient uses it.  The only plan I 
can think of now is to remove commons-logging from httpclient.

1) Is there anyone else interested in a copy of httpclient modified to 
use either jdk1.4 logging or log4j logging directly?  Any preferences 
(me I prefer log4j mostly because it's what I'm accustomed to).

2) Anyone have any advice on how to maintain a copy of httpclient that 
avoided commons-logging?

3) Anyone know any commons-logging folks I can email/talk to?
FWIW, I'm not a class-loader expert.  I've tried to explain the problems 
to commons-logging folks in a bug I filed (and in other bugs I've read), 
but I don't see this getting resolved in a timely fashion.

-Eric

A few details btw:
To get things working in ATG, I had to:
- unjar DAS/lib/classes.jar
- remove org/apache/common/*
- jar it back up into classes.jar
I also removed the common_logging.jar file (it looks like there are some 
additional org.apache.common.logging classes in there too)


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


Re: Problems with commons-logging jar and request for advice.

2004-08-27 Thread Oleg Kalnichevski
Hi Eric

Personally up to now I have not had too much of a hard time using
commons-logging with Websphere 5.0 and 5.1. Maybe I was just lucky

You may want to fork off the HttpClient 2.0 branch and host it on the
SourceForge, for instance. HttpClient 2.0 is stable and will not be
actively developed in the future. So you should not have too much
trouble keeping the forked version in sync with the official one. The
drawback of this approach is that once HttpClient 3.0 is out you may
have to repeat the whole exercise again. So, probably a better solution
would be to develop a simple converter, which would walk through the
source code and replace all the references to commons-logging with log4j
or jdk14. Such a converter could be used against any other
commons-logging dependent library or application, so it might be a
worthwhile investment. 

We'd happily include this utility into the contrib package

Just a bunch of random thoughts

Oleg




On Sat, 2004-08-28 at 00:39, Eric Bloch wrote:
 Hey Folks,
 
 I've experienced a few problems with httpclient not instantiating in a 
 web application under some containers (websphere 5.1 is the latest, but 
 I've seen problems in tomcat and ATG as well).  This turns out to 
 *always* be a problem with class-loading and commons-logging.  It's hard 
 to precisely describe the problems, but it always seems like it has 
 something to do with different class-loaders loading the commons-logging 
   api or implementation jar.
 
 I'm wondering what the current advice is on common-logging.  See 
 http://www.qos.ch/logging/thinkAgain.html for details on links to the 
 numerous problems and problem reports with commons-logging.  I imagine I 
 could be walking into a religious debate here, bu, as far as I can tell, 
 commons-logging is basically broken wrt to its class-loader and the 
 servlet-container spec for class-loading.  (It always chooses the Java 
 spec rather than the servlet container spec).
 
 I really only care about httpclient, but unfortunately, it seems I'm 
 stuck with commons-logging because httpclient uses it.  The only plan I 
 can think of now is to remove commons-logging from httpclient.
 
 1) Is there anyone else interested in a copy of httpclient modified to 
 use either jdk1.4 logging or log4j logging directly?  Any preferences 
 (me I prefer log4j mostly because it's what I'm accustomed to).
 
 2) Anyone have any advice on how to maintain a copy of httpclient that 
 avoided commons-logging?
 
 3) Anyone know any commons-logging folks I can email/talk to?
 
 FWIW, I'm not a class-loader expert.  I've tried to explain the problems 
 to commons-logging folks in a bug I filed (and in other bugs I've read), 
 but I don't see this getting resolved in a timely fashion.
 
 -Eric
 
 
 
 A few details btw:
 
 To get things working in ATG, I had to:
 
 - unjar DAS/lib/classes.jar
 - remove org/apache/common/*
 - jar it back up into classes.jar
 
 I also removed the common_logging.jar file (it looks like there are some 
 additional org.apache.common.logging classes in there too)
 
 
 
 
 -
 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]