[logging] pb using eclipse

2005-03-09 Thread A Leg
Hi
I just installed some commons projects and from now when I want to have 
help in eclipse I get error about common logging.

Any idea welcome.
Andre Legendre
!SUBENTRY 1 org.eclipse.tomcat 4 0 Mar 09, 2005 10:28:52.406
!MESSAGE Exception occurred starting application server.
!STACK 0
org.apache.commons.logging.LogConfigurationException: 
org.apache.commons.logging.LogConfigurationException: 
org.apache.commons.logging.LogConfigurationException: Class 
org.apache.commons.logging.impl.Jdk14Logger does not implement Log
   at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532)
   at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
   at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
   at org.apache.commons.digester.Digester.init(Digester.java:346)
   at 
org.apache.catalina.realm.MemoryRealm.getDigester(MemoryRealm.java:278)
   at org.apache.catalina.realm.MemoryRealm.start(MemoryRealm.java:348)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1173)
   at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363)
   at org.apache.catalina.startup.Embedded.addEngine(Embedded.java:464)
   at 
org.eclipse.tomcat.internal.TomcatAppServer.start(TomcatAppServer.java:97)
   at 
org.eclipse.help.internal.appserver.AppserverPlugin.startWebappServer(AppserverPlugin.java:145)
   at 
org.eclipse.help.internal.appserver.AppserverPlugin.getAppServer(AppserverPlugin.java:42)
   at 
org.eclipse.help.internal.appserver.WebappManager.start(WebappManager.java:57)
   at 
org.eclipse.help.internal.base.BaseHelpSystem.ensureWebappRunning(BaseHelpSystem.java:182)
   at 
org.eclipse.help.internal.base.HelpDisplay.displayHelpURL(HelpDisplay.java:156)
   at 
org.eclipse.help.internal.base.HelpDisplay.displayHelpResource(HelpDisplay.java:80)
   at 
org.eclipse.help.ui.internal.DefaultHelpUI.displayHelpResource(DefaultHelpUI.java:58)
   at 
org.eclipse.ui.help.WorkbenchHelp.displayHelpResource(WorkbenchHelp.java:267)
   at 
org.eclipse.ui.internal.intro.impl.model.IntroURL.showHelpTopic(IntroURL.java:258)
   at 
org.eclipse.ui.internal.intro.impl.model.IntroURL.doExecute(IntroURL.java:127)
   at 
org.eclipse.ui.internal.intro.impl.model.IntroURL.access$0(IntroURL.java:106)
   at 
org.eclipse.ui.internal.intro.impl.model.IntroURL$1.run(IntroURL.java:100)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
   at 
org.eclipse.ui.internal.intro.impl.model.IntroURL.execute(IntroURL.java:97)
   at 
org.eclipse.ui.internal.intro.impl.swt.PageWidgetFactory$1.linkActivated(PageWidgetFactory.java:35)
   at 
org.eclipse.ui.forms.widgets.AbstractHyperlink.handleActivate(AbstractHyperlink.java:183)
   at 
org.eclipse.ui.forms.widgets.AbstractHyperlink.handleMouseUp(AbstractHyperlink.java:265)
   at 
org.eclipse.ui.forms.widgets.AbstractHyperlink.access$1(AbstractHyperlink.java:249)
   at 
org.eclipse.ui.forms.widgets.AbstractHyperlink$4.handleEvent(AbstractHyperlink.java:95)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:954)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2595)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2298)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
   at 
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
   at 
org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
   at 
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
   at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
   at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:324)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
   at org.eclipse.core.launcher.Main.run(Main.java:704)
   at org.eclipse.core.launcher.Main.main(Main.java:688)
Caused by: org.apache.commons.logging.LogConfigurationException: 
org.apache.commons.logging.LogConfigurationException: Class 
org.apache.commons.logging.impl.Jdk14Logger does not implement Log
   at 
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:416)
   at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
   ... 47 more
Caused by: org.apache.commons.logging.LogConfigurationException: Class 
org.apache.commons.logging.impl.Jdk14Logger does not implement Log
   at 

Re: [logging] distribution packaging

2005-03-09 Thread Torsten Curdt
snip/
it's a little ironic that both richard and i have held that opinion for
a long while now. however, ceki's and brian's investigations are now
starting to persuade me that there is actually some hope for much
improved discovery from the 1.0.x series of releases.  

there are a number of subtle issues (well, they seem subtle to me) about
salvaging the interfaces. it's more difficult that it should be. not
being able to fix them easily is what i have always regarded as the JCL
fatal flaw.
i think that there are ways to maintain backwards compatibility which
should also allow the interfaces to be salvaged for reuse by different
implementations. i was working on code along these lines but i only have
so much energy and most of it (over the last few weeks) has been taken
up replying to ceki's posts and analysing ceki's examples (or so it
seems to me).   
No matter what - it more and more seems like
the discovery mechanism builds up a front
of people that more and more dislike JCL.
TBH I am pretty much sick of those discussion
whether to use JCL or not that come up in other
projects. IMHO it would be great to fix (as
good as possible) what people are complaining
about.
My perception is that JCL is a great idea and
does the job ...but as soon as you have a
slightly more complicated classloader setup.
Man - you better know what you are doing!
I personally don't care much of backwards
compatibility of a problematic discovery
mechanism but for sure that's what new major
versions are for. This could be fixed in a
2.x version.
Just my 2 cents
--
Torsten
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [logging] pb using eclipse

2005-03-09 Thread Jörg Schaible
A Leg wrote on Wednesday, March 09, 2005 9:52 AM:

 Hi
 
 I just installed some commons projects and from now when I
 want to have
 help in eclipse I get error about common logging.

What do you mean with I just installed some commons projects ?
What is the classpath used in Eclipse (see also Help/about/configuration 
details)?

- Jörg

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



[GUMP@brutus]: Project commons-jelly-tags-xml (in module commons-jelly) failed

2005-03-09 Thread commons-jelly-tags-xml development
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at [EMAIL PROTECTED]

Project commons-jelly-tags-xml has an issue affecting its community integration.
This issue affects 12 projects,
 and has been outstanding for 18 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- commons-jelly-tags-define :  Commons Jelly
- commons-jelly-tags-html :  Commons Jelly
- commons-jelly-tags-http :  Commons Jelly
- commons-jelly-tags-jaxme :  Commons Jelly
- commons-jelly-tags-jetty :  Commons Jelly
- commons-jelly-tags-jface :  Commons Jelly
- commons-jelly-tags-jsl :  Commons Jelly
- commons-jelly-tags-swing :  Commons Jelly
- commons-jelly-tags-xml :  Commons Jelly
- commons-jelly-tags-xmlunit :  Commons Jelly
- maven :  Project Management Tools
- maven-bootstrap :  Project Management Tools


Full details are available at:

http://brutus.apache.org/gump/public/commons-jelly/commons-jelly-tags-xml/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Sole output [commons-jelly-tags-xml-09032005.jar] identifier set to 
project name
 -DEBUG- Dependency on xml-xerces exists, no need to add for property 
maven.jar.xerces.
 -DEBUG- (Gump generated) Maven Properties in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/xml/build.properties
 -INFO- Failed with reason build failed
 -DEBUG- Maven POM in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/xml/project.xml
 -DEBUG- Maven project properties in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/xml/project.properties
 -INFO- Project Reports in: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/xml/target/test-reports
 -INFO- Failed to extract fallback artifacts from Gump Repository



The following work was performed:
http://brutus.apache.org/gump/public/commons-jelly/commons-jelly-tags-xml/gump_work/build_commons-jelly_commons-jelly-tags-xml.html
Work Name: build_commons-jelly_commons-jelly-tags-xml (Type: Build)
Work ended in a state of : Failed
Elapsed: 13 secs
Command Line: maven --offline jar 
[Working Directory: 
/usr/local/gump/public/workspace/commons-jelly/jelly-tags/xml]
CLASSPATH: 
/opt/jdk1.4/lib/tools.jar:/usr/local/gump/public/workspace/jakarta-commons/beanutils/dist/commons-beanutils-core.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-swing.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-trax.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-junit.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/usr/local/gump/public/workspace/ant/dist/lib/ant.jar:/usr/local/gump/public/workspace/dist/junit/junit.jar:/usr/local/gump/public/workspace/xml-commons/java/build/resolver.jar:/usr/local/gump/public/workspace/ant/bootstrap/lib/ant-launcher.jar:/usr/local/gump/public/workspace/ant/bootstrap/lib/ant.jar:/usr/local/gump/public/workspace/jakarta-commons/collections/build/commons-collections-09032005.jar:/usr/local/gump/public/workspace/commons-jelly/target/commons-jelly-09032005.jar:/usr/local/gump/public/workspace/commons-jelly/jelly-tags/junit/target/commons-jelly-tags-junit-09032005.jar:/usr/local/gump/public/workspace/jakarta-commons/jexl/dist/commons-jexl-09032005.jar:/usr/local/gump/public/workspace/jakarta-commons/logging/dist/commons-logging.jar:/usr/local/gump/public/workspace/jakarta-commons/logging/dist/commons-logging-api.jar:/usr/local/gump/public/workspace/dom4j/build/dom4j.jar:/usr/local/gump/public/workspace/jaxen/target/jaxen-09032005.jar
-
[mkdir] Created dir: 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/xml/target/classes

java:compile:
[echo] Compiling to 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/xml/target/classes
[echo] 
==

  NOTE: Targetting JVM 1.4, classes
  will not run on earlier JVMs

==
  
[javac] Compiling 16 source files to 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/xml/target/classes

java:jar-resources:

test:prepare-filesystem:
[mkdir] Created dir: 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/xml/target/test-classes
[mkdir] Created dir: 
/home/gump/workspaces2/public/workspace/commons-jelly/jelly-tags/xml/target/test-reports

test:test-resources:
Copying 36 files to 

Re: [logging] pb using eclipse

2005-03-09 Thread A Leg
Hi Jorg
Thank's for your help.
I have no more access to help, so no way to read head about conf.
In fact I have installed httpclient to make an application and as I had 
some difficulties with, I tried many things.
Now httpclient is working good for me and my appli is working,
but as side effect I have no more access to help in eclipse, with this 
error message about common-logging.
Worse I have 2 devt machines and it is the same on both...

I don't arrive to locate which change create this.
I will follow the classpath as you propose.
Any idea welcome.
Andre
Jörg Schaible wrote:
A Leg wrote on Wednesday, March 09, 2005 9:52 AM:
 

Hi
I just installed some commons projects and from now when I
want to have
help in eclipse I get error about common logging.
   

What do you mean with I just installed some commons projects ?
What is the classpath used in Eclipse (see also Help/about/configuration 
details)?
- Jörg
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: [logging] pb using eclipse

2005-03-09 Thread Jörg Schaible
A Leg wrote on Wednesday, March 09, 2005 11:24 AM:

 Hi Jorg
 
 Thank's for your help.
 I have no more access to help, so no way to read head about
 conf. 

???
Help/About/Configuration does not call anything of the Eclipse help, its just 
the path in the Eclipse menu structure.

 In fact I have installed httpclient to make an application and
 as I had some difficulties with, I tried many things.

Again, what means install? Did you just add the jar to your project or are 
httpclient jars part of your classpath starting Eclipse (if yes, remove them) ?

[snip]

- Jörg

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



DO NOT REPLY [Bug 33925] New: - [configuration] SubsetConfiguration.clear() throws a ConcurrentModificationException

2005-03-09 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=33925.
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=33925

   Summary: [configuration] SubsetConfiguration.clear() throws a
ConcurrentModificationException
   Product: Commons
   Version: Nightly Builds
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Configuration
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


The default implementation of the clear() method in AbstractConfiguration
doesn't work for a SubsetConfiguration applied to a BaseConfiguration. The
TransformIterator created by the getKeys() in SubsetConfiguration doesn't like
the concurrent modification of the underlying collection in the clear() method.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



Re: [vfs] parsing uri

2005-03-09 Thread Rami Ojares
The File-URI codec on unix encodes
\foo\bar -- %5Cfoo%5Cbar
This is to be interpreted as file or dir named \foo\bar
If you send this uri to jvm on windows you get
new File(new URI(uriStr))
which is interpreted as file or dir bar under dir foo which is under root.
So it seems that %5C is not interpreted as having special meaning
but on windows it is. The other alternative on windows would be to throw
exception because a file with the given path can't be created.
So it is thought that it makes life easier if the %5C is interpreted as 
path separator on
windows.

The same question applies to . (dot = current dir)
double dot ( = parent dir) and any other characters
that we might want to assign some special meaning to ( eg. ~ tilde)
When do we interpret a special charater to have it's special meaning
and how do we escape away that special meaning?
Well the answer is so simple and according to what you think is right.
%xx notation ESCAPES the character and NEGATES the possible special
meaning it might have.
So therefore I think it would be more correct if %5Cfoo%5Cbar on windows
would throw an exception.
And your intuition is correct.
But note: If I have a path ../xtc then the corresponding uri should be
../xtc. Because in this case we want the dots to have their special meaning.
But what if % character would have a special meaning (let's imagine it 
points
to the parent of the parent if one exists or else to root)
Then path %/xtc should be uri %/xtc BUT this is not possible because % 
has a special
meaning in URI as escape character.

All the other excluded characters MUST be encoded because of URI spec.
The reasons being eg. that uri could be printed on paper and new line 
characters
would be hard to read if they were not escaped.

So let's recap the excluded character list
ctrl-chars | space |  |  | # | % | 
None of these have any special meaning in any filesystems
Thus we are saved.
Rest of the encodings are because of the schema specific rules
and serve the purpose of escaping the schema specific meaning
of the character.
Therefore the uri corresponding the path @foo/%bar/+xtc should be 
@foo/%25bar/+xtc

Do these thoughts clarify ? :-)
- rami
Hello!
 

Sounds like a long night today :-)
   

Hard work - it might take some time until I can commit the new naming stuff.
The whole procedure of parsing a uri needs to be refactored, currently I 
fight agains the Layered stuff e.g. 
tar:tar:file:/dir/first.tar!/second.tar!/entry

And I already implemented some incompatibilites between the old and 
the new VFS naming:

Current:
   file = getManager().resolveFile(%2e);
resolves to the current Directory
New:
resolves to a file or directory NAMED .
Current:
   file = getManager().resolveFile(dir%2fchild);
resolves to a file child in directory dir
New:
resolves to a file or directory named dir/child
Current:
   file = getManager().resolveFile(dir%5cchild);
resolves to a file child in directory dir
New:
resolves to a file or directory named dir\child
I leave it up to the filesystem if such a file or directory could be 
created.

The above examples are those from the unit-test, so the old behaviour 
was wanted. But I think the new one is the right one.
I think it is very unlikely that those constructs can be found in the 
wild life, but if one used VFS that way it IS broken.

Any comments?
---
Mario
-
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: [vfs] parsing uri

2005-03-09 Thread B. K. Oxley (binkley)
Mario Ivankovits wrote:
Current:
   file = getManager().resolveFile(%2e);
resolves to the current Directory
New:
resolves to a file or directory NAMED .
I don't think there is a filesystem where this is possible.  I'd need to 
read the relevant W3C specs to be sure.

resolves to a file or directory named dir/child
resolves to a file or directory named dir\child

I leave it up to the filesystem if such a file or directory could be 
created.
Now these are more interesting.  What a load of corner cases to test for!
Cheers,
--binkley
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [vfs] parsing uri

2005-03-09 Thread B. K. Oxley (binkley)
I'm unsure that the URI specs intend to distinguish a string from it's 
encoded form for the purposes of naming.  I believe they are to be 
interpreted equivalently, and that the encoding exists only to permit 
uncorrupted transmission of forbidden characters.

You have found something interesting to encoded URIs if a difference 
exists, but yours is a lot of work and I'd double-check the assumption 
before proceeding further.  Laziness is one of the three virtues.  :-)

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


Re: [logging] pb using eclipse

2005-03-09 Thread A Leg
Hi Jorg
Thank's, with your help I finally find out what was going on.
I had added commons-logging.jar in J2RE/lib/ext.
As soon as I take it off the problem desappear.
I don't really understand why but..
Any ideas welcome
Have a nice time.
Andre
Jörg Schaible wrote:
A Leg wrote on Wednesday, March 09, 2005 11:24 AM:
 

Hi Jorg
Thank's for your help.
I have no more access to help, so no way to read head about
conf. 
   

???
Help/About/Configuration does not call anything of the Eclipse help, its just 
the path in the Eclipse menu structure.
 

In fact I have installed httpclient to make an application and
as I had some difficulties with, I tried many things.
   

Again, what means install? Did you just add the jar to your project or 
are httpclient jars part of your classpath starting Eclipse (if yes, remove them) ?
[snip]
- Jörg
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: [collections] PATCH: Add CollectionContainsPredicate...

2005-03-09 Thread James Carman
Is nobody monitoring the collections project?  

-Original Message-
From: James Carman [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 07, 2005 3:17 PM
To: commons-dev@jakarta.apache.org
Subject: [collections] PATCH: Add CollectionContainsPredicate...


All,

This patch adds a class called CollectionContainsPredicate to the functors
package and adds a method to PredicateUtils for constructing one.  A
CollectionContains predicate takes a Collection in its constructor and
returns true if the input object is in the collection.  I thought this might
be a nice addition.  I couldn't find anything like this in the API, so I had
to write it today for something I was doing at work. 

James



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



Re: [logging] pb using eclipse

2005-03-09 Thread A Leg
Hi Jorg
My problem is when I take common-logging of from the J2RE/lib/ext in my 
appli I get NoClassDefFoundError even with commons-logging.jar passed in 
the command line...

Andre
{orion:rcs} java -classpath 
/Master/extern/java/eclipse/plugins/org.eclipse.tomcat_4.1.30/commons-logging.jar:$J2RE_LIBRARY/ext/commons-httpclient.jar:$J2RE_LIBRARY/jsse.jar:$J2RE_LIBRARY/jce.jar 
-jar Test.jar
Debut
Exception in thread main java.lang.NoClassDefFoundError: 
org/apache/commons/logging/LogFactory
   at 
org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory.clinit(EasySSLProtocolSocketFactory.java:97)
   at Test.main(Test.java:44)

Jörg Schaible wrote:
A Leg wrote on Wednesday, March 09, 2005 11:24 AM:
 

Hi Jorg
Thank's for your help.
I have no more access to help, so no way to read head about
conf. 
   

???
Help/About/Configuration does not call anything of the Eclipse help, its just 
the path in the Eclipse menu structure.
 

In fact I have installed httpclient to make an application and
as I had some difficulties with, I tried many things.
   

Again, what means install? Did you just add the jar to your project or 
are httpclient jars part of your classpath starting Eclipse (if yes, remove them) ?
[snip]
- Jörg
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




DO NOT REPLY [Bug 33926] New: - [configuration] The Iterator returned by getKeys() should support remove()

2005-03-09 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=33926.
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=33926

   Summary: [configuration] The Iterator returned by getKeys()
should support remove()
   Product: Commons
   Version: Nightly Builds
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Configuration
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


Calling the remove() method on an iterator returned by getKeys() or
getKeys(String) should remove the property from the configuration. This is not
supported by CompositeConfiguration, JNDIConfiguration, DatabaseConfiguration
and maybe HierarchicalConfiguration.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



svn commit: r156638 - in jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net: ntp/ ntp/TimeStampTest.java time/ time/TimeTCPClientTest.java time/TimeTestSimpleServer.java

2005-03-09 Thread rwinston
Author: rwinston
Date: Wed Mar  9 04:31:01 2005
New Revision: 156638

URL: http://svn.apache.org/viewcvs?view=revrev=156638
Log:
Added missing NTP unit tests

Added:
jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ntp/

jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ntp/TimeStampTest.java
jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/time/

jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/time/TimeTCPClientTest.java

jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/time/TimeTestSimpleServer.java

Added: 
jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ntp/TimeStampTest.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ntp/TimeStampTest.java?view=autorev=156638
==
--- 
jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ntp/TimeStampTest.java
 (added)
+++ 
jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ntp/TimeStampTest.java
 Wed Mar  9 04:31:01 2005
@@ -0,0 +1,130 @@
+package org.apache.commons.net.ntp;
+
+/* 
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2003 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ *any, must include the following acknowlegement:
+ *   This product includes software developed by the
+ *Apache Software Foundation (http://www.apache.org/).
+ *Alternately, this acknowlegement may appear in the software itself,
+ *if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names The Jakarta Project, Tomcat, and Apache Software
+ *Foundation must not be used to endorse or promote products derived
+ *from this software without prior written permission. For written
+ *permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this software may not be called Apache
+ *nor may Apache appear in their names without prior written
+ *permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * http://www.apache.org/.
+ */
+
+import java.util.Date;
+import java.util.Calendar;
+import junit.framework.TestCase;
+import org.apache.commons.net.ntp.TimeStamp;
+
+/**
+ * Test class that validates assertions for the basic TimeStamp operations and 
comparisons.
+ *
+ * @author Jason Mathews, MITRE Corp
+ */
+public class TimeStampTest extends TestCase {
+
+private static final String TIME1 = c1a9ae1c.cf6ac48d;  // Tue, Dec 17 
2002 14:07:24.810 UTC
+private static final String TIME2 = c1a9ae1c.cf6ac48f;  // Tue, Dec 17 
2002 14:07:24.810 UTC
+private static final String TIME3 = c1a9ae1d.cf6ac48e;  // Tue, Dec 17 
2002 14:07:25.810 UTC
+
+/***
+ * main for running the test.
+ ***/
+public static void main(String args[])
+{
+junit.textui.TestRunner.run(TimeStampTest.class);
+}
+
+public void testCompare() {
+
+TimeStamp ts1 = new TimeStamp(TIME1);  // Tue, Dec 17 2002 
14:07:24.810 UTC
+TimeStamp ts2 = new TimeStamp(TIME1);
+TimeStamp ts3 = new TimeStamp(TIME2);  // Tue, Dec 17 2002 
14:07:24.810 UTC
+TimeStamp ts4 = new TimeStamp(TIME3);  // 

Re: [net] NTP + Time test code not in CVS branch

2005-03-09 Thread Rory Winston
I'va added the missing unit tests into the repository.
Cheers,
Rory
Jason Mathews wrote:
In the latest build of Net commons it appears that the contributed Ntp 
+ Time junit tests got dropped.

http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]msgId=1078351 
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]msgId=1078351 

Test classes in question:
Directory of C:\net\src\test\org\apache\commons\net\ntp
10/08/2003  09:56 AM 5,876 TimeStampTest.java
Directory of C:\net\src\test\org\apache\commons\net\time
10/08/2003  09:57 AM 6,021 TimeTCPClientTest.java
09/26/2003  08:35 AM 6,332 TimeTestSimpleServer.java
--
Jason Mathews [EMAIL PROTECTED]
The MITRE Corporation http://www.mitre.org/
Bedford, MA 01730-1407

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


svn commit: r156639 - in jakarta/commons/proper/configuration/trunk: src/java/org/apache/commons/configuration/AbstractConfiguration.java src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java src/test/org/apache/commons/configuration/TestSubsetConfiguration.java xdocs/changes.xml

2005-03-09 Thread ebourg
Author: ebourg
Date: Wed Mar  9 04:50:07 2005
New Revision: 156639

URL: http://svn.apache.org/viewcvs?view=revrev=156639
Log:
Fixed a ConcurrentModificationException thrown when calling clear() on a 
SubsetConfiguration applied to a BaseConfiguration.

Modified:

jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java

jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java

jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestSubsetConfiguration.java
jakarta/commons/proper/configuration/trunk/xdocs/changes.xml

Modified: 
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java?view=diffr1=156638r2=156639
==
--- 
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
 (original)
+++ 
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
 Wed Mar  9 04:50:07 2005
@@ -261,7 +261,14 @@
 Iterator it = getKeys();
 while (it.hasNext())
 {
-clearProperty((String) it.next());
+String key = (String) it.next();
+it.remove();
+
+if (containsKey(key))
+{
+// workaround for Iterators that do not remove the property on 
calling remove()
+clearProperty(key);
+}
 }
 }
 

Modified: 
jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java?view=diffr1=156638r2=156639
==
--- 
jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java
 (original)
+++ 
jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDatabaseConfiguration.java
 Wed Mar  9 04:50:07 2005
@@ -44,6 +44,8 @@
 {
 public final String DATABASE_DRIVER = org.hsqldb.jdbcDriver;
 public final String DATABASE_URL = 
jdbc:hsqldb:target/test-classes/testdb;
+public final String DATABASE_USERNAME = sa;
+public final String DATABASE_PASSWORD = ;
 
 private static HsqlDB hsqlDB = null;
 
@@ -67,8 +69,8 @@
 BasicDataSource datasource = new BasicDataSource();
 datasource.setDriverClassName(DATABASE_DRIVER);
 datasource.setUrl(DATABASE_URL);
-datasource.setUsername(sa);
-datasource.setPassword();
+datasource.setUsername(DATABASE_USERNAME);
+datasource.setPassword(DATABASE_PASSWORD);
 
 this.datasource = datasource;
 
@@ -118,7 +120,7 @@
 
 public void testGetPropertyDirectSingle()
 {
-DatabaseConfiguration config = new DatabaseConfiguration(datasource, 
configuration, key, value);
+Configuration config = new DatabaseConfiguration(datasource, 
configuration, key, value);
 
 assertEquals(property1, value1, config.getProperty(key1));
 assertEquals(property2, value2, config.getProperty(key2));
@@ -127,7 +129,7 @@
 
 public void testGetPropertyDirectMultiple()
 {
-DatabaseConfiguration config = new DatabaseConfiguration(datasource, 
configurations, name, key, value, test);
+Configuration config = new DatabaseConfiguration(datasource, 
configurations, name, key, value, test);
 
 assertEquals(property1, value1, config.getProperty(key1));
 assertEquals(property2, value2, config.getProperty(key2));
@@ -136,7 +138,7 @@
 
 public void testClearPropertySingle()
 {
-DatabaseConfiguration config = new DatabaseConfiguration(datasource, 
configuration, key, value);
+Configuration config = new DatabaseConfiguration(datasource, 
configuration, key, value);
 config.clearProperty(key);
 
 assertFalse(property not cleared, config.containsKey(key));
@@ -144,7 +146,7 @@
 
 public void testClearPropertyMultiple()
 {
-DatabaseConfiguration config = new DatabaseConfiguration(datasource, 
configurations, name, key, value, test);
+Configuration config = new DatabaseConfiguration(datasource, 
configurations, name, key, value, test);
 config.clearProperty(key);
 
 assertFalse(property not cleared, config.containsKey(key));
@@ -152,7 +154,7 @@
 
 public void testClearSingle()
 {
-DatabaseConfiguration config = new DatabaseConfiguration(datasource, 
configuration, key, value);
+

DO NOT REPLY [Bug 33925] - [configuration] SubsetConfiguration.clear() throws a ConcurrentModificationException

2005-03-09 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=33925.
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=33925


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2005-03-09 13:51 ---
Fixed, clear() in AbstractConfiguration now first tries to use the remove method
of the Iterator to avoid the ConcurrentModificationException.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



Re: [vfs] parsing uri

2005-03-09 Thread Rami Ojares
[EMAIL PROTECTED] wrote:
I'm unsure that the URI specs intend to distinguish a string from it's 
encoded form for the purposes of naming.  I believe they are to be 
interpreted equivalently, and that the encoding exists only to permit 
uncorrupted transmission of forbidden characters.
 

Quote from RFC 2396
Uniform Resource Identifiers (URI): Generic Syntax
2.4.2. When to Escape and Unescape
  A URI is always in an escaped form, since escaping or unescaping a
  completed URI might change its semantics.  /_*Normally, the only time
  escape encodings can safely be made is when the URI is being created
  from its component parts; each component may have its own set of
  characters that are reserved, so only the mechanism responsible for
  generating or interpreting that component can determine whether or
  not escaping a character will change its semantics. Likewise, a URI
  must be separated into its components before the escaped characters
  within those components can be safely decoded.*_/
  In some cases, data that could be represented by an unreserved
  character may appear escaped; for example, some of the unreserved
  mark characters are automatically escaped by some systems.  If the
  given URI scheme defines a canonicalization algorithm, then
  unreserved characters may be unescaped according to that algorithm.
  For example, %7e is sometimes used instead of ~ in an http URL
  path, but the two are equivalent for an http URL.
  Because the percent % character always has the reserved purpose of
  being the escape indicator, it must be escaped as %25 in order to
  be used as data within a URI.  Implementers should be careful not to
  escape or unescape the same string more than once, since unescaping
  an already unescaped string might lead to misinterpreting a percent
  data character as another escaped character, or vice versa in the
  case of escaping an already escaped string.
Important passage:
/each component may have its own set of characters that are reserved,
so only the mechanism responsible for generating or interpreting that
component can determine whether or not escaping a character will
change its semantics
At this point the RFC indirectly says that only % MUST be always encoded.
But later it excludes other characters from ever existing in URI for reasons
of readability when uri is eg. printed.
Think if you see somewhere URI: foo
Is this URI foo or foo  ?
The same applies to URI: foo
That being said I think that the absolute minimum is only %
But what is the practical minimum is left in the air.
- rami
/
You have found something interesting to encoded URIs if a difference 
exists, but yours is a lot of work and I'd double-check the assumption 
before proceeding further.  Laziness is one of the three virtues.  :-)

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




RE: [logging] pb using eclipse

2005-03-09 Thread Jörg Schaible
A Leg wrote on Wednesday, March 09, 2005 12:29 PM:

 Hi Jorg
 
 Thank's, with your help I finally find out what was going on.
 I had added commons-logging.jar in J2RE/lib/ext.
 As soon as I take it off the problem desappear.
 
 I don't really understand why but..

Different classloaders. Search the archive.

- Jörg

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



RE: [logging] pb using eclipse

2005-03-09 Thread Jörg Schaible
A Leg wrote on Wednesday, March 09, 2005 12:58 PM:

 Hi Jorg
 
 My problem is when I take common-logging of from the J2RE/lib/ext in
 my appli I get NoClassDefFoundError even with
 commons-logging.jar passed in
 the command line...
 
 Andre
 
 {orion:rcs} java -classpath
 /Master/extern/java/eclipse/plugins/org.eclipse.tomcat_4.1.30/
 commons-logging.jar:$J2RE_LIBRARY/ext/commons-httpclient.jar:$
 J2RE_LIBRARY/jsse.jar:$J2RE_LIBRARY/jce.jar
 -jar Test.jar
 Debut
 Exception in thread main java.lang.NoClassDefFoundError:
 org/apache/commons/logging/LogFactory
 at
 org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocke
 tFactory.clinit(EasySSLProtocolSocketFactory.java:97)
 at Test.main(Test.java:44)

Again different class loaders. You may not put httpclient into J2RE/lib/ext.

- Jörg

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



Re: [logging] pb using eclipse

2005-03-09 Thread A Leg
Hi Jorg
I try httpclient in another place and I get a problem too.
I don't understand and worse I don't find any solution.
Thank's for your help.
Andre
{orion:rcs} java -classpath 
$JWSDP_HOME/jwsdp-shared/lib/commons-httpclient.jar:$JWSDP_HOME/jwsdp-shared/lib/commons-logging.jar:$J2RE_LIBRARY/jsse.jar:$J2RE_LIBRARY/jce.jar 
-jar Test.jar
Exception in thread main java.lang.NoClassDefFoundError: 
org/apache/commons/httpclient/protocol/SecureProtocolSocketFactory

Jörg Schaible wrote:
A Leg wrote on Wednesday, March 09, 2005 12:58 PM:
 

Hi Jorg
My problem is when I take common-logging of from the J2RE/lib/ext in
my appli I get NoClassDefFoundError even with
commons-logging.jar passed in
the command line...
Andre
{orion:rcs} java -classpath
/Master/extern/java/eclipse/plugins/org.eclipse.tomcat_4.1.30/
commons-logging.jar:$J2RE_LIBRARY/ext/commons-httpclient.jar:$
J2RE_LIBRARY/jsse.jar:$J2RE_LIBRARY/jce.jar
-jar Test.jar
Debut
Exception in thread main java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory
   at
org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocke
tFactory.clinit(EasySSLProtocolSocketFactory.java:97)
   at Test.main(Test.java:44)
   

Again different class loaders. You may not put httpclient into J2RE/lib/ext.
- 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: [logging][httpclient] pb using eclipse

2005-03-09 Thread Jörg Schaible
Hi Andre,

A Leg wrote on Wednesday, March 09, 2005 3:32 PM:

 Hi Jorg
 
 I try httpclient in another place and I get a problem too.
 I don't understand and worse I don't find any solution.

[snip]

 {orion:rcs} java -classpath
 $JWSDP_HOME/jwsdp-shared/lib/commons-httpclient.jar:$JWSDP_HOM
 E/jwsdp-shared/lib/commons-logging.jar:$J2RE_LIBRARY/jsse.jar:
 $J2RE_LIBRARY/jce.jar -jar Test.jar
 Exception in thread main java.lang.NoClassDefFoundError:
 org/apache/commons/httpclient/protocol/SecureProtocolSocketFactory

Hmmm. Never used httpclient nor jsse so I am unsure about the classloader 
requirement for this factory. E.g. an own implementation for 
java.util.log.Formatter is only found everytime, if it is located in the system 
class loader (means also J2SE/lib/ext), but not if your app has special 
classloader hierarchy. Same may apply here for this factory for httpclient. 
Then you have no choice but stuffing anything into J2SE/lib/ext again.

The problem with Eclipse is, that is uses the Log interface loaded by the 
classloader of the help plugin utilizing Tomcat and the Jdk14Logger is found in 
the system classloader. This will not work. Part of the problem is also, that 
the integrated tomcat in eclipse comes with both commons-logging.jar and 
commons-logging-api.jar. Try to remove the -api.jar and adjust the plugin.xml. 
The other jar has all classes anyway.

- Jörg

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



Re: [logging][httpclient] pb using eclipse

2005-03-09 Thread A Leg
Hi Jorg
Thank's for your help.
I will try to find a solution following your advices.
Cheers
Andre
Jörg Schaible wrote:
Hi Andre,
A Leg wrote on Wednesday, March 09, 2005 3:32 PM:
 

Hi Jorg
I try httpclient in another place and I get a problem too.
I don't understand and worse I don't find any solution.
   

[snip]
 

{orion:rcs} java -classpath
$JWSDP_HOME/jwsdp-shared/lib/commons-httpclient.jar:$JWSDP_HOM
E/jwsdp-shared/lib/commons-logging.jar:$J2RE_LIBRARY/jsse.jar:
$J2RE_LIBRARY/jce.jar -jar Test.jar
Exception in thread main java.lang.NoClassDefFoundError:
org/apache/commons/httpclient/protocol/SecureProtocolSocketFactory
   

Hmmm. Never used httpclient nor jsse so I am unsure about the classloader 
requirement for this factory. E.g. an own implementation for 
java.util.log.Formatter is only found everytime, if it is located in the system 
class loader (means also J2SE/lib/ext), but not if your app has special 
classloader hierarchy. Same may apply here for this factory for httpclient. 
Then you have no choice but stuffing anything into J2SE/lib/ext again.
The problem with Eclipse is, that is uses the Log interface loaded by the 
classloader of the help plugin utilizing Tomcat and the Jdk14Logger is found in 
the system classloader. This will not work. Part of the problem is also, that 
the integrated tomcat in eclipse comes with both commons-logging.jar and 
commons-logging-api.jar. Try to remove the -api.jar and adjust the plugin.xml. 
The other jar has all classes anyway.
- Jörg
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




DO NOT REPLY [Bug 33931] New: - WeakHashMap incorrectly used in ContextClassLoaderLocal - may cause memory leak

2005-03-09 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=33931.
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=33931

   Summary: WeakHashMap incorrectly used in ContextClassLoaderLocal
- may cause memory leak
   Product: Commons
   Version: unspecified
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P3
 Component: Bean Utilities
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


Signaled in version 1.7 of beanutils: the class ContextClassLoaderLocal
incorrectly uses a WeakHashMap (valueByClassLoader) - used by BeanUtilsBean.
In order for a WeakHashMap to work correctly, the values must not hold
references to keys, otherwise it behaves like a normal map. 
But in ContextClassLoaderLocal, the key is the context class loader of the
current thread, while the value is any object (for example a BeansUtilsBean,
when used by BeanUtilsBean). If the value class is loaded by the context class
loader, it violates the above mentioned rule, and this may cause severe memory
leaks when used in web applications that are stopped/started multiple times, by
holding strong references to class loaders that would otherwise be garbage
collected.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33931] - [beanutils] WeakHashMap incorrectly used in ContextClassLoaderLocal - may cause memory leak

2005-03-09 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=33931.
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=33931


[EMAIL PROTECTED] changed:

   What|Removed |Added

Summary|WeakHashMap incorrectly used|[beanutils] WeakHashMap
   |in ContextClassLoaderLocal -|incorrectly used in
   |may cause memory leak   |ContextClassLoaderLocal -
   ||may cause memory leak




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33926] - [configuration] The Iterator returned by getKeys() should support remove()

2005-03-09 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=33926.
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=33926





--- Additional Comments From [EMAIL PROTECTED]  2005-03-09 19:55 ---
Not a big blocker I would say.

Well, if this feature is desired, a possible solution would be to let
AbstractConfiguration return a special (non public) ConfigurationIterator, which
wraps an iterator obtained from a concrete sub class. This special iterator
implementation could store a reference to the associated Configuration object
and route the remove() method to this configuration's clearProperty() method.

I think, it is important that the removal is done by the clearProperty() method
itself (so I am not too content that remove is supported by some Configuration
classes directly) because there might be other actions associated with this. One
example would be observable configurations where a removal of a property should
cause an event to be fired.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



[OT] Co-location of app and DB

2005-03-09 Thread Matt Sgarlata
For performance and other reasons, we collocate the presentation tier 
and business object tier on the same server.  Question: why not take 
this even further and put everything on the same server?  If the DB is 
on the same server as the rest of your application, then won't you get a 
performance boost since the DB and app servers don't have to communicate 
over a slow network, but rather can communicate through the server's 
main memory?

I understand that for performance tuning of the database and to ensure 
proper backups, etc. that the DB server often has different needs than 
the application server, so that is why they are kept separate.  However, 
I'm wondering if for small applications it wouldn't just be better to 
keep the DB server and the app server on the same box.  What do you guys 
think?

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


svn commit: r156673 - in jakarta/commons/sandbox/benchmark/trunk/src: java/org/apache/commons/benchmark/Benchmark.java java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java test/org/apache/commons/benchmark/Test1.java

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 11:36:41 2005
New Revision: 156673

URL: http://svn.apache.org/viewcvs?view=revrev=156673
Log:
support for returning results as hashlists... 

Modified:

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java

jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java?view=diffr1=156672r2=156673
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 Wed Mar  9 11:36:41 2005
@@ -304,6 +304,9 @@
 , +
 duration: +
 getTracker1().now.getDuration() +
+, +
+meanDuration: +
+getTracker1().now.getMeanDuration() +
 ) + 
   +
 last=(  +
@@ -312,6 +315,12 @@
 , +
 completed: +
 getTracker1().last.getCompleted() +
+, +
+duration: +
+getTracker1().now.getDuration() +
+, +
+meanDuration: +
+getTracker1().now.getMeanDuration() +
 );
 
 }

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java?view=diffr1=156672r2=156673
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java
 Wed Mar  9 11:36:41 2005
@@ -54,5 +54,47 @@
.getTracker1().getLast().getMeanDuration() );
 }
 
+public Hashtable getBenchmarkAsHashtable( String name ) {
+
+Benchmark benchmark = Benchmark.getBenchmark( name );
+
+if ( benchmark == null )
+return null;
+
+Hashtable map = new Hashtable();
+
+//map.put( 1min.now.duration, new Double( 
benchmark.getTracker1().getNow().duration ) );
+//map.put( 1min.last.duration, new Double( 
benchmark.getTracker1().getNow().duration ) );
+
+addHashtableMetrics( map, benchmark.getTracker1().getLast(), 
1min.last. );
+addHashtableMetrics( map, benchmark.getTracker5().getLast(), 
5min.last. );
+addHashtableMetrics( map, benchmark.getTracker15().getLast(), 
15min.last. );
+
+return map;
+
+}
+
+public void addHashtableMetrics( Hashtable map, BenchmarkMeta meta, String 
prefix ) {
+
+map.put( prefix + duration, new Double( meta.getDuration() ) );
+map.put( prefix + meanDuration, new Double( meta.getMeanDuration() ) 
);
+map.put( prefix + completed, new Double( meta.getCompleted() ) );
+map.put( prefix + started, new Double( meta.getStarted() ) );
+
+}
+
+/*
+  Add support for getting values back as a hashmap
+
+duration1=N
+duration5=N
+duration15=N
+
+completed1=N
+completed5=N
+completed15=N
+
+*/
+
 }
 

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java?view=diffr1=156672r2=156673
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 Wed Mar  9 11:36:41 2005
@@ -33,8 +33,6 @@
 super(testName);
 }
 
-//FIXME: test with using really short intervals but with diff values.
-
 public void testXmlrpc() throws Exception {
 
 WebServer webserver = new WebServer ( 2048 );
@@ -76,9 +74,15 @@
 Object result = xmlrpc.execute ( benchmark.getLastCompleted, params 
);
 
 assertEquals( new Double( 1 ), result );
+
+//now call getBenchmark on the service to get it back as a hashmap
+
+result = xmlrpc.execute ( benchmark.getBenchmarkAsHashtable, params 
);
+
+System.out.println( result:  + result );
 
 }
-
+
 public void 

svn commit: r156674 - in jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd: ./ BenchmarkSource.java ExampleRandomSource.java GraphTask.java GraphTaskRunner.java Main.java Source.java

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 11:37:12 2005
New Revision: 156674

URL: http://svn.apache.org/viewcvs?view=revrev=156674
Log:
new rrd logging and graphing infra

Added:

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/BenchmarkSource.java

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/ExampleRandomSource.java

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/GraphTask.java

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/GraphTaskRunner.java

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/Main.java
   (with props)

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/Source.java

Added: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/BenchmarkSource.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/BenchmarkSource.java?view=autorev=156674
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/BenchmarkSource.java
 (added)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/BenchmarkSource.java
 Wed Mar  9 11:37:12 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 1999,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.benchmark.rrd;
+
+/**
+ * Represents an abstract datasource for an source for logging.
+ *
+ * @author a href=mailto:[EMAIL PROTECTED]Kevin A. Burton/a
+ * @version $Id: $
+ */
+public abstract class BenchmarkSource {
+
+String title = null;
+String description = null;
+
+/**
+ * Get the current value for this counter.
+ *
+ * @author a href=mailto:[EMAIL PROTECTED]Kevin A. Burton/a
+ */
+public abstract long getValue() throws Exception;
+
+}
\ No newline at end of file

Added: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/ExampleRandomSource.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/ExampleRandomSource.java?view=autorev=156674
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/ExampleRandomSource.java
 (added)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/ExampleRandomSource.java
 Wed Mar  9 11:37:12 2005
@@ -0,0 +1,50 @@
+/*
+ * Copyright 1999,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.benchmark.rrd;
+
+import java.util.*;
+
+/**
+ * Source which logs a random number between 0 and 100 for testing purposes.
+ *
+ * @author a href=mailto:[EMAIL PROTECTED]Kevin A. Burton/a
+ * @version $Id: $
+ */
+public class ExampleRandomSource extends Source {
+
+private String foo = null;
+
+/**
+ * Get the current value for this counter.
+ *
+ * @author a href=mailto:[EMAIL PROTECTED]Kevin A. Burton/a
+ */
+public long getValue() throws Exception {
+
+Random r = new Random();
+return (long)(r.nextFloat() * 100F);
+}
+
+public void setFoo( String foo ) {
+this.foo = foo;
+}
+
+public String getFoo() {
+return foo;
+}
+
+}
\ No newline at end of file

Added: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/rrd/GraphTask.java
URL: 

svn commit: r156675 - jakarta/commons/sandbox/benchmark/trunk/benchmark.xml

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 12:05:29 2005
New Revision: 156675

URL: http://svn.apache.org/viewcvs?view=revrev=156675
Log:
benchmark.xml example/test/config

Added:
jakarta/commons/sandbox/benchmark/trunk/benchmark.xml

Added: jakarta/commons/sandbox/benchmark/trunk/benchmark.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/benchmark.xml?view=autorev=156675
==
--- jakarta/commons/sandbox/benchmark/trunk/benchmark.xml (added)
+++ jakarta/commons/sandbox/benchmark/trunk/benchmark.xml Wed Mar  9 12:05:29 
2005
@@ -0,0 +1,42 @@
+?xml version=1.0?
+
+benchmark
+
+tasks copyright=Copyright 2005 Apache Software Foundation.
+
+source 
classname=org.apache.commons.benchmark.rrd.ExampleRandomSource
+name=random
+title=Random RRD Source
+unitDescription=random
+unitName=int
+
+param name=foo
+   value=bar /
+
+!--
+param name= value=/
+
+param name=q
+   
+SELECT AVG(*) FROM FEED WHERE LAST_UPDATED  n;
+
+/param
+ 
+ --
+
+/source
+
+!--
+source classname=org.apache.commons.benchmark.rrd.XmlrpcSource
+
+param name=hostvalue=robot4.rojo.com /
+param name=portvalue=2048 /
+param name=benchmark   value=ksa.robot.FeedTask /
+
+/source
+
+ --
+
+/tasks
+
+/benchmark



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



svn commit: r156689 - jakarta/commons/proper/logging/trunk/optional/src/java/org/apache/commons/logging/impl/WeakHashtable.java

2005-03-09 Thread rdonkin
Author: rdonkin
Date: Wed Mar  9 13:13:21 2005
New Revision: 156689

URL: http://svn.apache.org/viewcvs?view=revrev=156689
Log:
Improved javadocs for WeakHashTable. More readable explaination contributed by 
Simon Kitching.

Modified:

jakarta/commons/proper/logging/trunk/optional/src/java/org/apache/commons/logging/impl/WeakHashtable.java

Modified: 
jakarta/commons/proper/logging/trunk/optional/src/java/org/apache/commons/logging/impl/WeakHashtable.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/logging/trunk/optional/src/java/org/apache/commons/logging/impl/WeakHashtable.java?view=diffr1=156688r2=156689
==
--- 
jakarta/commons/proper/logging/trunk/optional/src/java/org/apache/commons/logging/impl/WeakHashtable.java
 (original)
+++ 
jakarta/commons/proper/logging/trunk/optional/src/java/org/apache/commons/logging/impl/WeakHashtable.java
 Wed Mar  9 13:13:21 2005
@@ -23,10 +23,14 @@
 
 /**
  * pImplementation of codeHashtable/code that uses 
codeWeakReference/code's
- * to hold it's keys thus allowing them to be reclaimed by the garbage 
collector.
- * This class follows the symantics of codeHashtable/code as closely as 
possible.
- * It therefore does not accept null values or keys.
- * p
+ * to hold its keys thus allowing them to be reclaimed by the garbage 
collector.
+ * The associated values are retained using strong references./p
+ *
+ * pThis class follows the symantics of codeHashtable/code as closely as
+ * possible. It therefore does not accept null values or keys./p
+ *
+ * pstrongNote:/strong
+ * This is emnot/em intended to be a general purpose hash table 
replacement.
  * This implementation is also tuned towards a particular purpose: for use as 
a replacement
  * for codeHashtable/code in codeLogFactory/code. This application 
requires
  * good liveliness for codeget/code and codeput/code. Various tradeoffs
@@ -34,36 +38,83 @@
  * /p
  * p
  * strongUsage:/strong typical use case is as a drop-in replacement 
- * for the codeHashtable/code use in codeLogFactory/code for J2EE 
enviroments
+ * for the codeHashtable/code used in codeLogFactory/code for J2EE 
enviroments
  * running 1.3+ JVMs. Use of this class iin most cases/i (see below) will
  * allow classloaders to be collected by the garbage collector without the 
need 
  * to call [EMAIL PROTECTED] 
org.apache.commons.logging.LogFactory#release(ClassLoader) 
LogFactory.release(ClassLoader)}.
  * /p
+ *
+ * pcodeorg.apache.commons.logging.LogFactory/code looks to see whether 
this 
+ * class is present in the classpath, and if so then uses it to store
+ * references to the codeLogFactory/code implementationd it loads 
+ * (rather than using a standard Hashtable instance). 
+ * Having this class used instead of codeHashtable/code solves
+ * certain issues related to dynamic reloading of applications in J2EE-style
+ * environments. However this class requires java 1.3 or later (due to its use
+ * of codejava.lang.ref.WeakReference/code and associates) and therefore 
cannot be
+ * included in the main logging distribution which supports JVMs prior to 1.3.
+ * And by the way, this extends codeHashtable/code rather than 
codeHashMap/code
+ * for backwards compatibility reasons. See the documentation
+ * for method codeLogFactory.createFactoryStore/code for more details./p
+ *
+ * pThe reason all this is necessary is due to a issue which
+ * arises during hot deploy in a J2EE-like containers. 
+ * Each component running in the container owns one or more classloaders; when
+ * the component loads a LogFactory instance via the component classloader
+ * a reference to it gets stored in the static LogFactory.factories member,
+ * keyed by the component's classloader so different components don't
+ * stomp on each other. When the component is later unloaded, the container
+ * sets the component's classloader to null with the intent that all the 
+ * component's classes get garbage-collected. However there's still a
+ * reference to the component's classloader from the global 
codeLogFactory/code's
+ * factories member! If codeLogFactory.release()/code is called whenever 
component
+ * is unloaded (as happens in some famous containers), the classloaders will 
be correctly  
+ * garbage collected.
+ * However, holding the classloader references weakly ensures that the 
classloader
+ * will be garbage collected without programmatic intervention. 
+ * Unfortunately, weak references are
+ * only available in java 1.3+, so this code only uses 
codeWeakHashtable/code if the
+ * class has explicitly been made available on the classpath./p
+ *
  * p
- * In a particular usage scenario, use of codeWeakHashtable/code alone will
- * be insufficent to allow garbage collection of a classloader without a call 
to
- * coderelease/code.  If the abstract class codeLogFactory/code is 
- * loaded by a parent classloader and a concrete subclass implementation of 
- * 

Re: [VOTE] Release commons email 1.0

2005-03-09 Thread robert burrell donkin
On Tue, 2005-03-08 at 22:13, Stephen Colebourne wrote:
 From: Eric Pugh [EMAIL PROTECTED]

snip

  And, in the interests of finally getting a release out, especially since
  we have the required +1 votes, can I just add the file by hand?  Icky, I
  know, but...
 
 As this is a 1.0, personally I'd prefer to see a clean (re)vote and release.

+1

there are a lot of eyes on email at the moment so i'd guess that should
be no problem getting the required number of votes.

- robert


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



DO NOT REPLY [Bug 33931] - [beanutils] WeakHashMap incorrectly used in ContextClassLoaderLocal - may cause memory leak

2005-03-09 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=33931.
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=33931





--- Additional Comments From [EMAIL PROTECTED]  2005-03-09 22:35 ---
Thanks for pointing this out.

I believe this problem is only struck when:
(a) a parent classloader loads the BeanUtilsBean class.
(b) a child classloader loads a custom BeanUtilsBean subclass, then calls
BeanUtilsBean.setInstance(customBeanUtilsBean).

I can't imagine why anyone would want to write a custom BeanUtilsBean...can you
suggest why someone would do this?

Assuming there *is* a reason for custom BeanUtilsBean objects to be registered,
I can think of only one solution: 
 * providing a release method which clears an entry from the 
   valueByClassLoader map, and documenting that anyone who calls
   setInstance with a BeanUtilsBean subclass must call this on
   webapp unload.

This is an ugly solution, but I don't believe there is any alternative.

It did occur to me that a *clean* solution would be for ClassLoader instances to
provide a generic ThreadLocal-like facility. Rather than have this global
hashmap keyed by ClassLoader, code wanting to store per-classloader info could
just attach the data to the ClassLoader instance. This would solve similar
classloader problems in commons-logging too. Anyone think this is worth
suggesting to the JCP? (though that won't solve the current problem in the
forseeable future :-)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



svn commit: r156690 - jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java

2005-03-09 Thread olegk
Author: olegk
Date: Wed Mar  9 13:40:30 2005
New Revision: 156690

URL: http://svn.apache.org/viewcvs?view=revrev=156690
Log:
PR #33856 (Authentication fails when connecting to server with username and 
password in non ascii characters)

Contributed by Oleg Kalnichevski
Reviewed by Michael Becke

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java?view=diffr1=156689r2=156690
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java
 Wed Mar  9 13:40:30 2005
@@ -333,6 +333,7 @@
 + credentials.getClass().getName());
 }
 NTLM ntlm = new NTLM();
+ntlm.setCredentialCharset(method.getParams().getCredentialCharset());
 String response = null;
 if (this.state == INITIATED || this.state == FAILED) {
 response = ntlm.getType1Message(



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



svn commit: r156691 - in jakarta/commons/sandbox/benchmark/trunk/src: java/org/apache/commons/benchmark/Benchmark.java java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java test/org/apache/commons/benchmark/Test1.java

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 13:45:54 2005
New Revision: 156691

URL: http://svn.apache.org/viewcvs?view=revrev=156691
Log:
support for getting ALL benchmarks back over XMLRPC

Modified:

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java

jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java?view=diffr1=156690r2=156691
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 Wed Mar  9 13:45:54 2005
@@ -288,7 +288,7 @@
  * @author a href=mailto:[EMAIL PROTECTED]Kevin A. Burton/a
  */
 public static Map getBenchmarks() {
-return Collections.unmodifiableMap( benchmarks );
+return benchmarks;
 }
 
 //  Object methods 
**

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java?view=diffr1=156690r2=156691
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/xmlrpc/BenchmarkHandler.java
 Wed Mar  9 13:45:54 2005
@@ -74,7 +74,29 @@
 
 }
 
-public void addHashtableMetrics( Hashtable map, BenchmarkMeta meta, String 
prefix ) {
+/**
+ * @see Benchmark.getBenchmarks()
+ * @author a href=mailto:[EMAIL PROTECTED]Kevin A. Burton/a
+ */
+public Map getBenchmarks() {
+Hashtable result = new Hashtable();
+
+Iterator it = Benchmark.getBenchmarks().keySet().iterator();
+
+while ( it.hasNext() ) {
+
+String key = (String)it.next();
+
+Benchmark b = Benchmark.getBenchmark( key );
+
+result.put( b.getName(), b.toString() );
+
+} 
+
+return result;
+}
+
+private void addHashtableMetrics( Hashtable map, BenchmarkMeta meta, 
String prefix ) {
 
 map.put( prefix + duration, new Double( meta.getDuration() ) );
 map.put( prefix + meanDuration, new Double( meta.getMeanDuration() ) 
);
@@ -82,19 +104,6 @@
 map.put( prefix + started, new Double( meta.getStarted() ) );
 
 }
-
-/*
-  Add support for getting values back as a hashmap
 
-duration1=N
-duration5=N
-duration15=N
-
-completed1=N
-completed5=N
-completed15=N
-
-*/
-
 }
 

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java?view=diffr1=156690r2=156691
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 Wed Mar  9 13:45:54 2005
@@ -78,9 +78,12 @@
 //now call getBenchmark on the service to get it back as a hashmap
 
 result = xmlrpc.execute ( benchmark.getBenchmarkAsHashtable, params 
);
-
 System.out.println( result:  + result );
-
+
+result = xmlrpc.execute ( benchmark.getBenchmarks, new Vector() );
+
+System.out.println( benchmarks are now:  + result );
+
 }
 
 public void testDuration() throws Exception {



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



svn commit: r156692 - jakarta/commons/proper/httpclient/trunk/release_notes.txt

2005-03-09 Thread olegk
Author: olegk
Date: Wed Mar  9 13:46:35 2005
New Revision: 156692

URL: http://svn.apache.org/viewcvs?view=revrev=156692
Log:
PR #33856

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffr1=156691r2=156692
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Wed Mar  9 
13:46:35 2005
@@ -1,5 +1,9 @@
 Changes since Release Candidate 1:
 
+ * 33856 - Fixed the problem with the credential-charset parameter not having 
an effect on
+   the encoding of the NTLM credentials
+   Contributed by Oleg Kalnichevski olegk at apache.org
+ 
  * 33541 - Fixed the problem with host level parameters having no effect on 
HTTP CONNECT 
methods
Contributed by Oleg Kalnichevski olegk at apache.org



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



svn commit: r156693 - jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 13:49:05 2005
New Revision: 156693

URL: http://svn.apache.org/viewcvs?view=revrev=156693
Log:
more test dox

Modified:

jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java?view=diffr1=156692r2=156693
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 Wed Mar  9 13:49:05 2005
@@ -33,6 +33,11 @@
 super(testName);
 }
 
+/**
+ * Test out all XMLRPC methods...that we have exported.
+ *
+ * @author a href=mailto:[EMAIL PROTECTED]Kevin A. Burton/a
+ */
 public void testXmlrpc() throws Exception {
 
 WebServer webserver = new WebServer ( 2048 );



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



svn commit: r156695 - in jakarta/commons/sandbox/benchmark/trunk/src: java/org/apache/commons/benchmark/Benchmark.java java/org/apache/commons/benchmark/BenchmarkTracker.java test/org/apache/commons/benchmark/Test1.java

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 14:01:29 2005
New Revision: 156695

URL: http://svn.apache.org/viewcvs?view=revrev=156695
Log:
We were ALWAYS resetting the last metric which was really stupid...

Modified:

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkTracker.java

jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java?view=diffr1=156694r2=156695
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 Wed Mar  9 14:01:29 2005
@@ -157,7 +157,7 @@
  *
  */
 public BenchmarkTracker getTracker1() {
-return tracker1.resetWhenNecessary();
+return tracker1.rolloverWhenNecessary();
 }
 
 /**
@@ -165,7 +165,7 @@
  *
  */
 public BenchmarkTracker getTracker5() {
-return tracker5.resetWhenNecessary();
+return tracker5.rolloverWhenNecessary();
 }
 
 /**
@@ -173,7 +173,7 @@
  *
  */
 public BenchmarkTracker getTracker15() {
-return tracker15.resetWhenNecessary();
+return tracker15.rolloverWhenNecessary();
 }
 
 /**

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkTracker.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkTracker.java?view=diffr1=156694r2=156695
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkTracker.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/BenchmarkTracker.java
 Wed Mar  9 14:01:29 2005
@@ -64,13 +64,18 @@
 this.parent = parent;
 }
 
-BenchmarkTracker reset( long currentTimeMillis ) {
+/**
+ * Do a physical rollover from now to - last .
+ *
+ * @author a href=mailto:[EMAIL PROTECTED]Kevin A. Burton/a
+ */
+BenchmarkTracker rollover( long currentTimeMillis ) {
 
 //need to perform a swap and save the current benchmark.
 last = now;
 
 //if we've slept for too long we have to start fresh
-if ( currentTimeMillis - last.timestamp  interval ) {
+if ( currentTimeMillis - last.timestamp  (interval*2) ) {
 last.reset();
 } 
 
@@ -86,15 +91,15 @@
 }
 
 /**
- * Reset stats if necessary.
+ * Rollover stats if necessary.
  */
-BenchmarkTracker resetWhenNecessary() {
+BenchmarkTracker rolloverWhenNecessary() {
 
 long currentTimeMillis = System.currentTimeMillis();
 
 if ( currentTimeMillis - now.timestamp  interval ) {
-
-reset( currentTimeMillis );
+
+rollover( currentTimeMillis );
 
 }
 
@@ -113,7 +118,7 @@
 //threads this is important.
 synchronized( MUTEX ) {
 
-resetWhenNecessary();
+rolloverWhenNecessary();
 ++now.started;
 
 doLocalStart();
@@ -129,7 +134,7 @@
 
 synchronized( MUTEX ) {
 
-resetWhenNecessary();
+rolloverWhenNecessary();
 ++now.completed;
 
 doLocalCompleted();

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java?view=diffr1=156694r2=156695
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 Wed Mar  9 14:01:29 2005
@@ -40,6 +40,10 @@
  */
 public void testXmlrpc() throws Exception {
 
+Benchmark.INTERVAL_1 =   1000;
+Benchmark.INTERVAL_5 =   5000;
+Benchmark.INTERVAL_15 = 15000;
+
 WebServer webserver = new WebServer ( 2048 );
 
 webserver.addHandler( benchmark,
@@ -63,7 +67,12 @@
 
 assertEquals( 1, b.getTracker1().now.completed );
 
-b.getTracker1().reset( System.currentTimeMillis() );
+//this should sleep long enough to rollover interval1
+
+System.out.println( going to sleep );
+Thread.sleep( 1500 );
+
+//b.getTracker1().reset( 

Re: [logging] distribution packaging

2005-03-09 Thread robert burrell donkin
On Wed, 2005-03-09 at 07:24, Torsten Curdt wrote:
 snip/
 
  it's a little ironic that both richard and i have held that opinion for
  a long while now. however, ceki's and brian's investigations are now
  starting to persuade me that there is actually some hope for much
  improved discovery from the 1.0.x series of releases.  
  
  there are a number of subtle issues (well, they seem subtle to me) about
  salvaging the interfaces. it's more difficult that it should be. not
  being able to fix them easily is what i have always regarded as the JCL
  fatal flaw.
  
  i think that there are ways to maintain backwards compatibility which
  should also allow the interfaces to be salvaged for reuse by different
  implementations. i was working on code along these lines but i only have
  so much energy and most of it (over the last few weeks) has been taken
  up replying to ceki's posts and analysing ceki's examples (or so it
  seems to me).   
 
 No matter what - it more and more seems like
 the discovery mechanism builds up a front
 of people that more and more dislike JCL.

+1

 TBH I am pretty much sick of those discussion
 whether to use JCL or not that come up in other
 projects. IMHO it would be great to fix (as
 good as possible) what people are complaining
 about.

JCL lacks energy and community. it's a tough project to work on and it's
a pretty thankless task. i think that there's hope but only if the
community can rally round. 

 My perception is that JCL is a great idea and
 does the job ...but as soon as you have a
 slightly more complicated classloader setup.
 Man - you better know what you are doing!

that's true :)

one of the problems is distinguishing those cases where discovery is
prohibited by the java language specification from those where discovery
may be theoretically possible but JCL falls short. this is partly an
education problem: there really isn't good enough documentation to
distinguish those cases. i'll try to find time to create a document (a
little like ceki and brian's) that goes through the possible classloader
scenarios in a simple fashion and details those which aren't possible.

 I personally don't care much of backwards
 compatibility of a problematic discovery
 mechanism but for sure that's what new major
 versions are for. This could be fixed in a
 2.x version.

my concern is that discovery is something that sounds easy but is
actually tough. when you look at the names on the list of folks who've
given it a shot and only managed a partial solution, it's not from want
of technical expertise or J2EE experience: it's difficult. (i didn't
code the discovery stuff.) 

my considered opinion is that discovery can be improved in the 1.0.x
series of releases but that there will be cases when it falls short (you
can decide whether these cases are fatal flaws or corners). in these
cases static binding is better. where i disagree with ceki is that i
don't think that static binding is the whole solution. language
restrictions prevent certain combinations working. i suspect that
(compile time) static binding may have as many corner cases as dymanic
binding (but i'd need to analyse the case and come up with some
examples). education about these cases seems to be very important.  

i believe that these difficult cases could be addressed by doping the
implementation using byte code engineering. (the idea is that you
statically bind not JCL but the calls themselves from the code.)  

the discovery stuff is in LogFactory and is exposed in such a way that
it's hard to deal with without losing backwards compatibility. i think
that it can be addressed by lifting off a super class (JCL, say) with a
reduced interface which is bound (either statically or dynamically) to a
(possibly) more complex implementation. this super class would be very
simply and configurable dynamically in only a small number of simple
ways. it could alternatively be bound statically at compile time. 

this way of proceeding would preserve compatibility with the existing
JCL installation base and the 1.0.x series of discovery could continue
as JCL classic which could be bound to the super class when required. 

i think that such a set up would cover the use cases i'm aware of.
however, it's a complex solution. i'm also aware of how much effort is
involved. support would be needed from the community if this is going to
have a chance of succeeding especially in the thankless tasks of
creating documentation and unit tests for all those corner cases ;)

anyone think that this approach is worth pursuing?

- robert


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



DO NOT REPLY [Bug 33942] New: - FTP: NoSuchMethodError thrown when sending command to disconnected FTP server

2005-03-09 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=33942.
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=33942

   Summary: FTP: NoSuchMethodError thrown when sending command to
disconnected FTP server
   Product: Commons
   Version: 1.3 Final
  Platform: PC
OS/Version: Windows 2000
Status: NEW
  Keywords: ErrorMessage
  Severity: critical
  Priority: P1
 Component: Net
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


- This bug only happens when running under JDK1.3.x or lower.
  (when running under JDK1.4.x or higher, this bug does not happen)
- Create and configure an FTP server. Make sure it runs OK.

- Create a program and run it under JDK1.3.x or lower:
=== Test Program ===
...
...
// Connect to the above FTP server and login
// Check that everything went fine.
...
while (true)
{
try {
FTPFile[] files = ftpClient.listFiles(*);
showFiles(files);
}
catch (FTPConnectionClosedException fcce) {
// Oops.. the FTP server has been disconnected.
System.out.println(Disconnected from FTP Server. Ending prog.);
break; // while(true)
}
Thread.sleep(3000);
}
... // close/disconnect and clean-up.
...


- Run the above program. The ftpClient.listFiles(...) works OK.
- At some point, stop the FTP server.

=== Expected result: ===
Program ends normally with message Disconnected from FTP Server. Ending prog.


=== Actual result: =
Pogram throws java.lang.NoSuchMethodError.


=== Stacktrace: 
java.lang.NoSuchMethodError
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:442)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:484)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:533)
at org.apache.commons.net.ftp.FTP.pasv(FTP.java:833)
at org.apache.commons.net.ftp.FTPClient._openDataConnection_
(FTPClient.java:493)
at org.apache.commons.net.ftp.FTPClient.initiateListParsing
(FTPClient.java:2356)
at org.apache.commons.net.ftp.FTPClient.initiateListParsing
(FTPClient.java:2330)
at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2072)
at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2123)


=== Probable cause: 
The FTP.sendCommand(...) method, on line 442 is as follows:

if (!isConnected() || _socket_ == null || !_socket_.isConnected())

The '_socket_' variable is of type 'java.net.Socket'.
Under JKD1.3, the 'java.net.Socket' class does NOT implement 'isConnected()'.


Why this bug is P1  critical: If the FTP Server closed the connection (e.g. 
due to a time-out), our code catches the FTPConnectionClosedException exception 
and tries to reconnect to the server. If this exception is not thrown, but the 
NoSuchMethodError is thrown instead, our code fails.

PS: It is hard to find information about which JDK-versions support the 
Commons/Net component. This page (http://jakarta.apache.org/commons/net/changes-
report.html#1_3_0), indicates that the component should run correctly at least 
under JDK1.3.x.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33942] - FTP: NoSuchMethodError thrown when sending command to disconnected FTP server

2005-03-09 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=33942.
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=33942


[EMAIL PROTECTED] changed:

   What|Removed |Added

   Priority|P1  |P2




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33942] - FTP: NoSuchMethodError thrown when sending command to disconnected FTP server

2005-03-09 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=33942.
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=33942





--- Additional Comments From [EMAIL PROTECTED]  2005-03-10 00:18 ---
I'm not sure, but it looks like that this bug is related to the fix/patch for 
bug 31793 (the patch from 2004-12-30 08:57 never made it into version 
1.3.Final...?).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



Re: [collections] PATCH: Add CollectionContainsPredicate...

2005-03-09 Thread matthew.hawthorne
James Carman wrote:
Is nobody monitoring the collections project?  
I'd consider adding your patch to Bugzilla as an enhancement.
Nobody has responded to your message for 2 days -- but that definitely 
doesn't mean that nobody is monitoring [collections].  It just means 
that nobody has had the time to respond.

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


RE: [collections] PATCH: Add CollectionContainsPredicate...

2005-03-09 Thread James Carman
Matthew,

Ok, I was just getting worried there.  Usually the developers are somewhat
quick to respond.  I at least expected something like good idea or that's
stupid. :-)

James

-Original Message-
From: matthew.hawthorne [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 09, 2005 6:51 PM
To: Jakarta Commons Developers List
Subject: Re: [collections] PATCH: Add CollectionContainsPredicate...


James Carman wrote:
 Is nobody monitoring the collections project?

I'd consider adding your patch to Bugzilla as an enhancement.

Nobody has responded to your message for 2 days -- but that definitely 
doesn't mean that nobody is monitoring [collections].  It just means 
that nobody has had the time to respond.

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



[Jakarta Commons Wiki] Updated: DBCP

2005-03-09 Thread commons-dev
   Date: 2005-03-09T16:47:27
   Editor: DavidTonhofer
   Wiki: Jakarta Commons Wiki
   Page: DBCP
   URL: http://wiki.apache.org/jakarta-commons/DBCP

   no comment

Change Log:

--
@@ -12,10 +12,9 @@
 
 Diagrams hosted by http://rei1.m-plify.net
 
-= Tomcat Configuration examples =
-
-Some Tomcat JNDI Datasource examples (in addition to the 
[http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
 Tomcat howto]).
+= Tomcat 5.0 Configuration examples =
 
+Some Tomcat JNDI Datasource examples (in addition to the 
[http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
 Tomcat 5.0 JNDI datasource howto]).
 
 '''!BasicDataSource'''
 {{{
@@ -53,6 +52,103 @@

parameternamedataSourceName/namevaluejava:comp/env/jdbc/TestDBCPDS/value/parameter
 /ResourceParams
 }}}
+
+= Tomcat 5.5 Configuration examples =
+
+Less DBCP, more Tomcat (and Tomcat 5.5.7 in particular):
+
+A more specialized example, in which we want to set up a Tomcat Authentication 
Realm based
+on a database. The database shall be accessed through connections from a DBCP 
+pool. We edit server.xml directly. This configuration can be tricky to get 
right, so here is a
+complete example:
+
+First, define the 'javax.sql.!DataSource' available to web applications in the 
JNDI default context
+under 'jdbc/m3p_5_0' by:
+
+'''1''': Saying what class or interface a JNDI context lookup will return: 
'javax.sql.!DataSource'.
+
+'''2''': Saying what class will actually create instances of the above, i.e. 
give the factory. We use
+the 'org.apache.commons.dbcp.!BasicDataSourceFactory'. It creates
+'org.apache.commons.dbcp.!BasicDataSource' instances. These use a resource 
pool of type
+'org.apache.commons.pool.impl.!GenericObjectPool'. Finally, for this type of 
pool we can demand that objects
+be verified at borrowing time - which is what we want as it will prevent 
Tomcat getting its
+paws on stale database connections.
+
+'''3''': Configuring the attributes of the '!BasicDataSourceFactory'. The 
allowed attributes can be found
+by looking for !JavaBean-compliant set() methods and members in the source or 
the
+[http://jakarta.apache.org/commons/dbcp/apidocs/index.html DBCP API doc].
+In particular: what driver shall be used by the factory to actually get 
database connections: 'com.mysql.jdbc.Driver'.
+
+Additionally (and one level down, if you will) the 'Driver' named in 
'!driverClassName' is itself
+configured through the URL used when a new connection is created
+
+Following the [http://issues.apache.org/bugzilla/show_bug.cgi?id=24723 bug 
24723] I have put
+the 'Resource' definition into the '!GlobalNamingResource' instead of the 
'Context'
+definition. Where it should be according to the documentation.
+
+ * [http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/server.html Tomcat 
5.5 'server' element configuration].
+ * 
[http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html
 Tomcat 5.5 JNDI-DataSource examples]
+ * 
[http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html#Resource%20Definitions
 The definition of 'resource']
+ * [http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html 
Tomcat 4.1 JDNI resources howto]
+ * [http://forums.devshed.com/archive/t-120081 (Outside link) Another trouble 
report]
+
+{{{
+Server ...
+
+GlobalNamingResources
+
+Resource name=jdbc/mydatabase
+  auth=Container
+  type=javax.sql.DataSource
+  factory=org.apache.commons.dbcp.BasicDataSourceFactory
+  driverClassName=com.mysql.jdbc.Driver
+  validationQuery=SELECT 1
+  loginTimeout=10
+  maxWait=5000
+  username=i_am_tomcat
+  password=my_password_is_foo
+  testOnBorrow=true
+  
url=jdbc:mysql://127.0.0.1/mydatabase?connectTimeout=5000amp;socketTimeout=8000amp;useUsageAdvisor=true
+/
+
+/GlobalNamingResources
+
+...something something...
+
+/Server
+}}}
+
+Now define the Tomcat Authentication Realm. I have done that inside the Host 
tag,
+because I could not make it work inside the Context tag for some reason. 
Tomcat gave
+an exception in that case.
+
+The Realm implementation is 'org.apache.catalina.realm.!DataSourceRealm'; it 
will use
+a 'javax.sql.!DataSource' interface found in the JNDI initial context. The 
location of
+that interface inside the JNDI namespace is given by 'dataSourceName': 
'java:com/env/jdbc/mydatabase'.
+
+ * [http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/realm.html Tomcat 
5.5 Realm configuration]
+ * 
[http://jakarta.apache.org/tomcat/tomcat-5.5-doc/realm-howto.html#DataSourceRealm
 Tomcat 5.5 DataSourceRealm]
+
+{{{
+Host 
+
+  Context ... ... /Context
+ 
+  Context ... ... /Context
+
+  Realm 

DO NOT REPLY [Bug 33942] - [net] FTP: NoSuchMethodError thrown when sending command to disconnected FTP server

2005-03-09 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=33942.
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=33942


[EMAIL PROTECTED] changed:

   What|Removed |Added

Summary|FTP: NoSuchMethodError  |[net] FTP: NoSuchMethodError
   |thrown when sending command |thrown when sending command
   |to disconnected FTP server  |to disconnected FTP server




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



Re: [logging] distribution packaging

2005-03-09 Thread Simon Kitching
On Wed, 2005-03-09 at 22:18 +, robert burrell donkin wrote:
 On Wed, 2005-03-09 at 07:24, Torsten Curdt wrote:
  TBH I am pretty much sick of those discussion
  whether to use JCL or not that come up in other
  projects. IMHO it would be great to fix (as
  good as possible) what people are complaining
  about.
 
 JCL lacks energy and community. it's a tough project to work on and it's
 a pretty thankless task. i think that there's hope but only if the
 community can rally round. 

Well, by my count the following people are actually willing to work on
fixing JCL:
 * Robert Donkin
 * Richard Sitze
 * Torsten Curdt?
 * Brian Stansberry
 * Simon Kitching (me).

 + Ceki offering his views
 + Tomas Znamenacek ?

I think that is sufficient to get some momentum on this - particularly
if tomcat/geronimo/other teams are willing to do some testing of
releases to make sure we don't break anything badly.

As you say, it's a tough and tricky project. But I expect we all work
with container-style projects on a regular basis so it's in our own
interests to get this right :-).

And intellectually I find it an interesting project to get to grips with
- I expect we'll all be experts on classloaders + related issues by the
time this is sorted!


What I'm trying to do at the moment is actually put together a
requirements document for logging, after which I intend to see how
UGLI fits the requirements so I can understand how static resolution
fares versus the current dynamic stuff. If anyone's already created a
list of logging requirements (including required behaviour when
classloaders are involved), then please point me at the info so I can
save my time!


Cheers,

Simon


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



[logging] parent-first classloaders

2005-03-09 Thread Simon Kitching
Hi Ceki,

You mentioned in your page on JCL
(http://www.qos.ch/logging/classloader.jsp):

quote
Jake also keeps reminding us on the log4j-dev mailing list that the
child-parent delegation model is not the only model out there and that
parent-first delegation model is alive and well.
/quote

Are you able to provide the names of some frameworks that use
parent-first classloading? I'm curious to find out whether these are
large + well-used frameworks or whether these are experimental and/or
obsolete systems.

I find it odd that a container would make it impossible for a contained
application to override libraries that the parent provides. This seems
rather fragile and inflexible to me; maybe reading the documentation for
some projects which Jake has referred to will help me understand the
reasons for using parent-first delegation.

Regards,

Simon


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



svn commit: r156736 - in jakarta/commons/sandbox/benchmark/trunk/src: java/org/apache/commons/benchmark/Benchmark.java test/org/apache/commons/benchmark/Test1.java

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 19:49:44 2005
New Revision: 156736

URL: http://svn.apache.org/viewcvs?view=revrev=156736
Log:
unit test to assert that memory usage is within acceptable limits...

Modified:

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java

jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java?view=diffr1=156735r2=156736
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 Wed Mar  9 19:49:44 2005
@@ -103,7 +103,7 @@
 /**
  * Maintain a metadata map between the name and BMeta classes.
  */
-public static HashMap benchmarks = new HashMap();
+static HashMap benchmarks = new HashMap();
 
 /**
  * The current name of this benchmark.

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java?view=diffr1=156735r2=156736
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 Wed Mar  9 19:49:44 2005
@@ -33,6 +33,34 @@
 super(testName);
 }
 
+//FIXME: setup a test to verify that X benchmarks don't use more than Y
+//bytes of memory.
+
+public void testMemory() throws Exception {
+
+long before = Runtime.getRuntime().totalMemory() - 
Runtime.getRuntime().freeMemory();
+
+int count = 1000;
+
+for ( int i  = 0; i  count; ++i  ) {
+
+Benchmark b = Benchmark.getBenchmark( foo: + i );
+b.start();
+b.complete();
+
+}
+
+long after = Runtime.getRuntime().totalMemory() - 
Runtime.getRuntime().freeMemory();
+
+//150k bytes is only 150 bytes per benchmark.  
+assertTrue( after  150 * count );
+
+System.out.println( total bytes used:  + (after-before) );
+
+Benchmark.benchmarks = new HashMap();
+
+}
+
 /**
  * Test out all XMLRPC methods...that we have exported.
  *



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



svn commit: r156737 - jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 19:59:36 2005
New Revision: 156737

URL: http://svn.apache.org/viewcvs?view=revrev=156737
Log:
looks like I need 500 bytes of memory to to object overhead... need to thin 
that down...

Modified:

jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java?view=diffr1=156736r2=156737
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 Wed Mar  9 19:59:36 2005
@@ -38,6 +38,8 @@
 
 public void testMemory() throws Exception {
 
+System.gc();
+
 long before = Runtime.getRuntime().totalMemory() - 
Runtime.getRuntime().freeMemory();
 
 int count = 1000;
@@ -45,20 +47,25 @@
 for ( int i  = 0; i  count; ++i  ) {
 
 Benchmark b = Benchmark.getBenchmark( foo: + i );
+
 b.start();
 b.complete();
 
 }
 
+System.gc();
+
 long after = Runtime.getRuntime().totalMemory() - 
Runtime.getRuntime().freeMemory();
 
-//150k bytes is only 150 bytes per benchmark.  
-assertTrue( after  150 * count );
+long usedMemory = after - before;
 
-System.out.println( total bytes used:  + (after-before) );
+//500k bytes is only 500 bytes per benchmark.  
+System.out.println( Total bytes used by benchmark:  + usedMemory );
+
+assertTrue( usedMemory  500 * count );
 
 Benchmark.benchmarks = new HashMap();
-
+//Benchmark.benchmarks.clear();
 }
 
 /**



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



svn commit: r156739 - jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 20:05:53 2005
New Revision: 156739

URL: http://svn.apache.org/viewcvs?view=revrev=156739
Log:
looks like I need 500 bytes of memory to to object overhead... need to thin 
that down...

Modified:

jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java?view=diffr1=156738r2=156739
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 Wed Mar  9 20:05:53 2005
@@ -59,7 +59,10 @@
 
 long usedMemory = after - before;
 
-//500k bytes is only 500 bytes per benchmark.  
+//500k bytes is only 500 bytes per benchmark.  We should try to thin
+//this down a bit.  I could do MUCH better I think.  Maybe NOT keep
+//references to strings?
+
 System.out.println( Total bytes used by benchmark:  + usedMemory );
 
 assertTrue( usedMemory  500 * count );



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



Re: [logging] parent-first classloaders

2005-03-09 Thread matthew.hawthorne
Simon Kitching wrote:
 You mentioned in your page on JCL
 (http://www.qos.ch/logging/classloader.jsp):
 
 quote
 Jake also keeps reminding us on the log4j-dev mailing list that the
 child-parent delegation model is not the only model out there and that
 parent-first delegation model is alive and well.
 /quote
 
 Are you able to provide the names of some frameworks that use
 parent-first classloading? I'm curious to find out whether these are
 large + well-used frameworks or whether these are experimental and/or
 obsolete systems.


You probably already know this, but I think most containers give the
option to use parent-first, if so desired.

I don't know much about classloaders, but I was working with the
WebSphere administration console today and I noticed a drop down for
choosing parent-first or child-first classloaders.

So, there may be a situation where a developer is forced to work with a
parent-first configuration, whether it's considered a good thing or not.

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



DO NOT REPLY [Bug 33945] New: - DelegatingConnection.close() throws exception

2005-03-09 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=33945.
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=33945

   Summary: DelegatingConnection.close() throws exception
   Product: Commons
   Version: Nightly Builds
  Platform: Macintosh
OS/Version: Mac OS X 10.3
Status: NEW
  Severity: critical
  Priority: P1
 Component: Dbcp
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


Closing connections that were obtained from PoolingDataSource und wrapped with 
a 
DelegatingConnection throws a 'java.sql.SQLException: Already closed' when 
calling close() on them in 
order to return the connection to the underlying pool.

The reason is code in DelegatingConnection.passivate() the motivation for which 
I don't completely 
understand.

At any rate, here is what happens. DelegatingConnection.close() calls 
passivate() before actually closing 
the delegate: 

/**
 * Closes the underlying connection, and close
 * any Statements that were not explicitly closed.
 */
public void close() throws SQLException
{
passivate();
_conn.close();
}

DelegatingConnection.passivate() in turn cleans up statements and, if the 
delegate is a 
DelegatingConnection too, calls passivate() on the delegate. Finally, the 
instance variable _closed is set 
to true:

protected void passivate() throws SQLException {
try {
// ... some statement clean up work, then: 
if(_conn instanceof DelegatingConnection) {
((DelegatingConnection)_conn).passivate();
}
}
finally {
_closed = true;
}
}

When this finishes and the delegate is indeed itself a delegating connection, 
close() will call 
_conn.close(). If DelegatingConnection were final this would even work, but it 
is not (on purpose). A 
notable derived class is PoolableConnection, which overrides close() and throws 
an exception if it is 
called when isClosed() returns true. isClosed() returns true if the _closed 
instance variable is true. 
BUMMER.

The problem surfaces as soon as one tries to wrap the connection returned by 
PoolingDataSource with 
another DelegatingConnections, which happens to be what I do.

I noticed this when I upgraded from 1.1 to 1.2.1, and it's still there in the 
nightly snapshot.

There are several design decisions that I think deserve a critical look:

- why does passivate() set a variable that effectively decides whether a 
connection is considered 
closed or not? shouldn't only close() be doing that?
 
- why does DelegatingConnection even bother to clean up statements when 
those statements by 
definition must have come from the delegate (or its delegate and so forth) and 
so are the responsibility 
of the delegate (creator) to clean up

- by propagating passivate() in the same method to the delegate if the 
delegate delegates itself 
DelegatingConnection is making assumptions that may be (and in fact are) easily 
violated if someone 
sub-classes DelegatingConnection and the delegate is now a subclass with 
possibly altered behavior. 
Why does it not suffice to expect that calling close() on the delegate will 
give the delegate enough 
chance to clean up itself, regardless of the implementing class of the delegate.

I'd be thrilled if this can be fixed quickly, and fixing any of the problems 
pinpointed above will fix the 
issue. Or so I think.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



Re: [logging] parent-first classloaders

2005-03-09 Thread Simon Kitching
On Thu, 2005-03-10 at 16:25 +1300, Simon Kitching wrote:
 Hi Ceki,
 
 You mentioned in your page on JCL
 (http://www.qos.ch/logging/classloader.jsp):
 
 quote
 Jake also keeps reminding us on the log4j-dev mailing list that the
 child-parent delegation model is not the only model out there and that
 parent-first delegation model is alive and well.
 /quote
 
 Are you able to provide the names of some frameworks that use
 parent-first classloading? I'm curious to find out whether these are
 large + well-used frameworks or whether these are experimental and/or
 obsolete systems.
 
 I find it odd that a container would make it impossible for a contained
 application to override libraries that the parent provides. This seems
 rather fragile and inflexible to me; maybe reading the documentation for
 some projects which Jake has referred to will help me understand the
 reasons for using parent-first delegation.

I received the following email from Paul Smith ([EMAIL PROTECTED]) which
did not get to this list because, apparently, the moderator rejected it.
It's certainly on-topic and useful so I presume this was just a slip of
the mouse on the moderator's part. Anyway, here's Paul's email:

mail
Resin's default class loader behaviour is parent first.  In Resin 2 to 
emulate the true specifaction, one has to:

servlet-classloader-hackfalse/servlet-classloader-hack  [1]

Which shows you what the Caucho folks think of child-first
delegation :)

[1] - http://www.caucho.com/support/resin-interest/0403/0132.html

Paul Smith
/mail

Following the email thread referred to above:

* Joseph Dane recommends using Resin's default parent-first classloading
but ensuring that the Resin classloader actually has no jars in the path
(ie nothing in resin/lib).
simonWell, if there is nothing in the parent classloader, then
parent-first and child-first are effectively equivalent, yes? So this
advice is not bad, but doesn't shed any light on why Resin goes with
parent-first/simon

* Eric Hauser recommends using a Resin-proprietory extension to
classloading, which involves putting
  classpath id='/path-to-hibernate/hibernate2.jar' /
in the web.xml file.
simonI'll try to track down exactly what exactly this does with
respect to class-loaders and CLASSPATHs/simon


NB: in Resin 3.0, the servlet-classloader-hack feature still exists,
but has been moved in the config file to class-loader/servlet-hack.


I've done a fair bit of research in the hope of finding additional info
on resin's classloading policy:

* The Resin docs for the servlet-classloader-hack config element:
http://www.caucho.com/products/resin/ref/http-config.xtp#servlet-classloader-hack
Nope, no clues there

* Hmm..here's a reply to a question from one Torsten Curdt; now where
have I seen that name lately? :-)
http://www.caucho.com/support/resin-interest/0305/0223.html
In the end, though, it doesn't shed a lot of light on why Resin doesn't
wish to follow the java spec...

The resin-reference.pdf file has a fraction more information. It
states that using child-first loading can cause surprising
ClassCaseExceptions. Yep, that's the full description of why they
reject the sun recommendation.

The resin source code doesn't hold any clues either. No comments at all
on why they prefer parent-first.


So I'm still looking for someone to suggest why anyone would not use
child-first


Regards,

Simon


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



svn commit: r156744 - in jakarta/commons/sandbox/benchmark/trunk/src: java/org/apache/commons/benchmark/Benchmark.java test/org/apache/commons/benchmark/Test1.java

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 21:58:34 2005
New Revision: 156744

URL: http://svn.apache.org/viewcvs?view=revrev=156744
Log:
...

Modified:

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java

jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java?view=diffr1=156743r2=156744
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 Wed Mar  9 21:58:34 2005
@@ -260,6 +260,21 @@
 }
 
 /**
+ * Create a benchmark on a the caller when performing a specific operation
+ * on a given target object..  For example if your class is 
'org.apache.Foo'
+ * and the operation is 'bar' then the resulting benchmark name will be
+ * 'org.apache.Foo#bar'.
+ */
+public static Benchmark getBenchmark( Object target,
+  String operation ) {
+
+String name = target.getClass().getName() + # + operation;
+
+return getBenchmark( name );
+
+}
+
+/**
  * Factory method for obtaining a benchmark by name
  *
  */

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java?view=diffr1=156743r2=156744
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 Wed Mar  9 21:58:34 2005
@@ -33,7 +33,15 @@
 super(testName);
 }
 
-//FIXME: setup a test to verify that X benchmarks don't use more than Y
+public void testBenchmarkWithCaller() {
+
+Benchmark b = Benchmark.getBenchmark( this, foo );
+
+assertEquals( org.apache.commons.benchmark.Test1#foo, b.getName() );
+
+}
+
+//setup a test to verify that X benchmarks don't use more than Y
 //bytes of memory.
 
 public void testMemory() throws Exception {



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



svn commit: r156745 - in jakarta/commons/sandbox/benchmark/trunk/src: java/org/apache/commons/benchmark/Benchmark.java test/org/apache/commons/benchmark/Test1.java

2005-03-09 Thread burton
Author: burton
Date: Wed Mar  9 22:19:40 2005
New Revision: 156745

URL: http://svn.apache.org/viewcvs?view=revrev=156745
Log:
reverted to use '.' for methods and '#' for operations

Modified:

jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java

jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java?view=diffr1=156744r2=156745
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/java/org/apache/commons/benchmark/Benchmark.java
 Wed Mar  9 22:19:40 2005
@@ -219,7 +219,7 @@
 /**
  * Return a child benchmark of the current method.  This can be used to
  * return a benchmark for a specific method based on a benchmark for a
- * class.
+ * class.  The resulting name will have parent#name semantics.
  *
  * @author a href=mailto:[EMAIL PROTECTED]Kevin A. Burton/a
  */
@@ -231,6 +231,19 @@
 
 //  static code 
*
 
+/**
+ * Get the name of the calling classname..
+ *
+ */
+static String getCallerClassname() {
+
+Exception e = new Exception();
+String name = e.getStackTrace()[2].getClassName();
+
+return name;
+
+}
+
 public static Object getBenchmarkAsProxy( Object _instance, Class 
_interface ) {
 
 return BenchmarkProxyFactory.newBenchmarkFactory( _instance, 
_interface );
@@ -245,12 +258,11 @@
  */
 public static Benchmark getBenchmark() {
 
-Exception e = new Exception();
-String name = e.getStackTrace()[1].getClassName();
+String name = getCallerClassname();
 return getBenchmark( name );
 
 }
-
+
 /**
  * Factory method for obtaining a benchmark by classname
  *
@@ -263,12 +275,22 @@
  * Create a benchmark on a the caller when performing a specific operation
  * on a given target object..  For example if your class is 
'org.apache.Foo'
  * and the operation is 'bar' then the resulting benchmark name will be
- * 'org.apache.Foo#bar'.
+ * 'org.apache.Foo#bar'.  When the target is null the name of the caller is
+ * used. This means we won't throw an NPE and it also means we have similar
+ * operation to child(),
  */
 public static Benchmark getBenchmark( Object target,
   String operation ) {
 
-String name = target.getClass().getName() + # + operation;
+String prefix = null;
+
+if ( target == null ) {
+prefix = getCallerClassname();
+} else {
+prefix = target.getClass().getName();
+}
+
+String name = prefix + # + operation;
 
 return getBenchmark( name );
 

Modified: 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java?view=diffr1=156744r2=156745
==
--- 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 (original)
+++ 
jakarta/commons/sandbox/benchmark/trunk/src/test/org/apache/commons/benchmark/Test1.java
 Wed Mar  9 22:19:40 2005
@@ -38,7 +38,15 @@
 Benchmark b = Benchmark.getBenchmark( this, foo );
 
 assertEquals( org.apache.commons.benchmark.Test1#foo, b.getName() );
-
+
+b = Benchmark.getBenchmark( null, foo );
+
+assertEquals( org.apache.commons.benchmark.Test1#foo, b.getName() );
+
+b = Benchmark.getBenchmark( string, foo );
+
+assertEquals( java.lang.String#foo, b.getName() );
+
 }
 
 //setup a test to verify that X benchmarks don't use more than Y



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



Re: [OT] Co-location of app and DB

2005-03-09 Thread Henri Yandell
Wonder if any of the native JDBC drivers can take advantage of being
on the same box. Rather than using full networking, they could use the
faster local networking thingymabob (yup, you can tell I only have a
vague grasp on what I'm suggesitng).

For my personal stuff, I've always run the database and applications
on the same machines. Due to the increased security (a local database
isn't open to the Internet) and because for personal stuff I'm on a
pretty constrained budget/setup. Also because apps become atomic; if a
machine dies, I only lose 1/4 of my apps (as they're spread over 4
boxes). If I was using one as a dbms, and it died, all apps would die.

Also could make it easier for me to migrate from one box to another
when there is a problem; though currently I have different styles of
box. An Apache 1.3/PHP/Mysql box and a Java/Apache2/Postgres box.

So there are some pluses.

That said, it's probably not worth it for performance. Stick gigabit
ethernet in. I imagine that most databases will still go out to the
TCP/IP layer for the database connection, so it won't be as quick as
could be hoped. After that, it'll depend on the SQL I guess, and the
application. Anything classed as a small application is probably not a
huge performance worry a la Amazon's site or something.

I recently tried to use hsqldb as a memory-cache for an Oracle
database to save the many round trips that were happening (code reuse
meant that we wanted to run the real-time code in a batch mode, but
didn't want a separate series of daos/sql to talk batch to Oracle). 
As it was a memory only database, I was hoping for big improvements in
speed. Instead I got minor improvements. There are a whole host of
reasons as to why, but the moral is that to show said major
improvements I'm going to have to do more than just switch to memory.

More indexes for the memory-only (max table was 1200 rows, but the
nasty SQL statement was slow, so I added the one index). Compare to an
Oracle db under load and not one sitting idle and able to do stunning
caching. Run over larger datasets to see if memory becomes better over
time.

The only one I'm expecting good results from is the second.

So, same machine might be worth it if it saves you rack rental, or
allows your failover system to be easier, but likely as not isn't
worth it if you're just concerned with performance.

My one-pence (not even worth tuppence),

Hen


On Wed, 09 Mar 2005 13:54:33 -0500, Matt Sgarlata
[EMAIL PROTECTED] wrote:
 For performance and other reasons, we collocate the presentation tier
 and business object tier on the same server.  Question: why not take
 this even further and put everything on the same server?  If the DB is
 on the same server as the rest of your application, then won't you get a
 performance boost since the DB and app servers don't have to communicate
 over a slow network, but rather can communicate through the server's
 main memory?
 
 I understand that for performance tuning of the database and to ensure
 proper backups, etc. that the DB server often has different needs than
 the application server, so that is why they are kept separate.  However,
 I'm wondering if for small applications it wouldn't just be better to
 keep the DB server and the app server on the same box.  What do you guys
 think?
 
 Thanks,
 
 Matt
 
 -
 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: [logging] 1.0.5: WeakHashtable

2005-03-09 Thread Brian Stansberry

--- robert burrell donkin
[EMAIL PROTECTED] wrote:
 On Tue, 2005-03-08 at 06:41, Simon Kitching wrote:
  
  Should the WeakHashtable class be rolled into
 commons-logging.jar?
  It seems easier for users than remembering to
 deploy the extra jar, and
  should be feasable by having something like this
 in 
 Hashtable foo;
 String version =
 System.getProperty(java.vm.specification.version);
  if (versionLessThan(version, 1.3)) {
foo = new Hashtable();
  } else {
// use reflection to create instance
foo = createWeakHashtable();
  }

  Or is the reason for having it separate because
 there is a performance
  hit when using it? If that is so, then file
 guide.xml should document
  that rather than saying always deploy it when
 using java 1.3 or later.
 
 there may be some performance hit but this should
 only really happen the
 first time that a Log is obtained for a new
 classloader. i doubt that
 there will be significant real world performance
 degradation by using
 this jar. be nice to have some figures, though.  
 
 there were two main reasons why it was issued as an
 optional jar:
 
 1. JCL has always tried hard to be compatible with
 early JVMs 
 2. backwards compatibility is very important
  

I was looking at the javadoc for WeakReference and
Hashtable, and they look like they've actually both
had stable APIs since JDK 1.2.  So, I downloaded a 1.2
SDK and confirmed that I was able to compile
WeakHashtable using it.

This doesn't contradict the point about preserving
compatibility with early JVM, as WeakHashtable won't
run under 1.1.  But, the JCL docs and I believe the
user guide talk about needing 1.3 and it looks like
1.2 is sufficient.

 the memory problem is only likely to manifest when
 frequently hot
 deploying in certain containers. 

In regards to my comment above, I'm sure the large
group of container providers who are supporting JDK
1.2 will be thrilled to know they can use
WeakHashtable to fix their memory leaks ;-)

 i'm a little
 reluctant to use system
 property version numbers (since they haven't always
 been very reliable)
 and prefer to give users the explicit choice as to
 whether they risk
 using the new code or not. 
 
 however, maybe it would be a reasonable tradeoff in
 this case and i
 would be willing to be convinced. (i tend to be very
 conservation when
 maintaining components with large installation
 bases).
 
 opinions anyone?

 
The way I've seen JDK detection done is by trying to
load a class that first appeared in the target JDK.

ClassLoader loader = getClass().getClassLoader();
boolean jdk12 = false;
try {
  loader.loadClass(java.util.Collection);
  jdk12 = true;
}
catch (Exception e) {
  // ignore
}

BTW, I believe JDK detection is actually mildly safer
than what LogFactory is doing now, which in the
default configuration amounts to calling
Class.forName(o.a.c.l.i.WeakHashtable) and catching
any Exception.  If, contrary to instructions,
commons-logging-optional.jar were on the classpath in
a JDK 1.1 environment, I believe this call would throw
a NoClassDefFoundError which would not be caught.

Brian




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

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



Re: [logging] parent-first classloaders

2005-03-09 Thread Brian Stansberry
--- Simon Kitching [EMAIL PROTECTED] wrote:
 Hi Ceki,
 
 You mentioned in your page on JCL
 (http://www.qos.ch/logging/classloader.jsp):
 
 quote
 Jake also keeps reminding us on the log4j-dev
 mailing list that the
 child-parent delegation model is not the only model
 out there and that
 parent-first delegation model is alive and well.
 /quote
 
 Are you able to provide the names of some frameworks
 that use
 parent-first classloading? I'm curious to find out
 whether these are
 large + well-used frameworks or whether these are
 experimental and/or
 obsolete systems.
 
 I find it odd that a container would make it
 impossible for a contained
 application to override libraries that the parent
 provides. This seems
 rather fragile and inflexible to me; maybe reading
 the documentation for
 some projects which Jake has referred to will help
 me understand the
 reasons for using parent-first delegation.
 

JBoss also defaults to parent-first delegation (their
Tomcat integration overrides the standard TC
classloading).  To get child-first classloading you
have to add

class-loading java2ClassLoadingCompliance=false/

to your war's jboss-web.xml file.

I believe the EJB spec mandates standard Java2 (i.e.
parent-first) classloading as well.

Best regards,
Brian

 Regards,
 
 Simon
 
 

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



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

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



DO NOT REPLY [Bug 31793] - [net] handling ftp disconnection initiated by firewalls

2005-03-09 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=31793.
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=31793


[EMAIL PROTECTED] changed:

   What|Removed |Added

OtherBugsDependingO||33942
  nThis||




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 33942] - [net] FTP: NoSuchMethodError thrown when sending command to disconnected FTP server

2005-03-09 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=33942.
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=33942


[EMAIL PROTECTED] changed:

   What|Removed |Added

  BugsThisDependsOn||31793




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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