[ANNOUNCEMENT] Commons Daemon 1.4.0 Released

2024-05-24 Thread Mark Thomas

The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.4.0

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.4.0 raises the minimum supported version of Java to Java 8 and 
Windows to Windows 10 / Windows Server 2012. Version 1.4.0 also 
addresses a number of bugs.


A full list of changes can be found at
https://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

https://commons.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

https://commons.apache.org/proper/commons-daemon/

Mark
on behalf of the Apache Commons community

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



[ANNOUNCEMENT] Commons Daemon 1.3.4 Released

2023-05-12 Thread Mark Thomas

The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.3.4.

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.3.4 is a bugfix release.

A full list of changes can be found at
https://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

https://commons.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

https://commons.apache.org/proper/commons-daemon/

Mark
on behalf of the Apache Commons community

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



Re: [SECURITY] CVE-2023-24998 Apache Commons FileUpload - DoS with excessive parts

2023-02-20 Thread Mark Thomas

On 20/02/2023 17:01, Olivier Jaquemet wrote:

On 20/02/2023 17:52, Mark Thomas wrote:

On 20/02/2023 16:40, Olivier Jaquemet wrote:


Does it mean that the 1.5 is not secured by default against
CVE-2023-24998, and require explicit configuration to be secured ?


Correct.

Commons FileUpload does not enable any of the limits (individual file
size, total upload size, number of files) by default. Each must be
configured explicitly.
So It should probably be specified in the online advisory that an 
upgrade to version 1.5 is required but not enough to fix the issue.
Users of Commons FileUpload must also invoke setFileCountMax(long) to 
configure the maximum number of files allowed per request.


Fair point. Updated.

Mark




Note that when Commons FileUpload is integrated into other products,
those products typically provide appropriate defaults for their use of
the library.


Indeed. But developpers of those products must be informed of such 
features ;) You did in the changelog.


Thanks

[1] 
https://commons.apache.org/proper/commons-fileupload/apidocs/org/apache/commons/fileupload/FileUploadBase.html#setFileCountMax-long-

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



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



Re: [SECURITY] CVE-2023-24998 Apache Commons FileUpload - DoS with excessive parts

2023-02-20 Thread Mark Thomas

On 20/02/2023 16:40, Olivier Jaquemet wrote:

Hello Mark

Thank you for this advisory.

The changes report [1] of Commons FileUpload 1.5 indicates :

    "Add a configurable limit (disabled by default) for the number of 
files to upload per request"


Does it mean that the 1.5 is not secured by default against 
CVE-2023-24998, and require explicit configuration to be secured ?


Correct.

Commons FileUpload does not enable any of the limits (individual file 
size, total upload size, number of files) by default. Each must be 
configured explicitly.


Note that when Commons FileUpload is integrated into other products, 
those products typically provide appropriate defaults for their use of 
the library.


Kind regards,

Mark




Thanks for your help,
Olivier

[1] 
https://commons.apache.org/proper/commons-fileupload/changes-report.html#a1.5


On 20/02/2023 16:55, Mark Thomas wrote:

CVE-2023-24998 Apache Commons FileUpload - DoS with excessive parts

Severity: Important

Vendor: The Apache Software Foundation

Versions Affected:
Apache Commons FileUpload 1.0-beta-1 to 1.4

Description:
Apache Commons FileUpload before 1.5 does not limit the number of
request parts to be processed resulting in the possibility of an
attacker triggering a DoS with a malicious upload or series of uploads.

Mitigation:
Users of the affected versions should apply one of the following
mitigations:
- Upgrade to Apache Commons FileUpload 1.5 or later

Credit:
This issue was identified by Jakob Ackermann and reported responsibly to
the Apache Commons Security Team.

History:
2023-02-20 Original advisory

References:
[1]
https://commons.apache.org/proper/commons-fileupload/security-reports.html


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org
EXTERNAL SENDER: Do not click any links or open any attachments unless 
you trust the sender and know the content is safe.
EXPÉDITEUR EXTERNE: Ne cliquez sur aucun lien et n’ouvrez aucune pièce 
jointe à moins qu’ils ne proviennent d’un expéditeur fiable, ou que 
vous ayez l'assurance que le contenu provient d'une source sûre.


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



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



[SECURITY] CVE-2023-24998 Apache Commons FileUpload - DoS with excessive parts

2023-02-20 Thread Mark Thomas

CVE-2023-24998 Apache Commons FileUpload - DoS with excessive parts

Severity: Important

Vendor: The Apache Software Foundation

Versions Affected:
Apache Commons FileUpload 1.0-beta-1 to 1.4

Description:
Apache Commons FileUpload before 1.5 does not limit the number of 
request parts to be processed resulting in the possibility of an 
attacker triggering a DoS with a malicious upload or series of uploads.


Mitigation:
Users of the affected versions should apply one of the following
mitigations:
- Upgrade to Apache Commons FileUpload 1.5 or later

Credit:
This issue was identified by Jakob Ackermann and reported responsibly to 
the Apache Commons Security Team.


History:
2023-02-20 Original advisory

References:
[1] 
https://commons.apache.org/proper/commons-fileupload/security-reports.html



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



[ANNOUNCE] Apache Commons FIleUpload 1.5 Released

2023-02-13 Thread Mark Thomas

The Apache Commons Team is pleased to announce the release of
Apache Commons FileUpload 1.5.


The Commons FileUpload software library makes it easy to add
robust, high-performance, file upload capability to your servlets
and web applications.


Source and binary distributions are available for download from the Apache
Commons FileUpload download site:
https://commons.apache.org/proper/commons-fileupload/download_fileupload.cgi


When downloading, please verify signatures using the KEYS file available 
at the above location when downloading the release.



Alternatively the release can be pulled via maven:
  commons-fileupload
  commons-fileupload
  1.5


The release notes can be reviewed at:
https://www.apache.org/dist/commons/fileupload/RELEASE-NOTES.txt


For complete information on Commons FileUpload, including instructions 
on how to

submit bug reports, patches, or suggestions for improvement, see the Apache
Commons FileUpload website:


https://commons.apache.org/proper/commons-fileupload/


Best regards,
Mark
on behalf of the Apache Commons community

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



[ANNOUNCEMENT] Commons Daemon 1.3.2 Released

2022-10-10 Thread Mark Thomas

The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.3.2.

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.3.2 is a bugfix release.

A full list of changes can be found at
https://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

https://commons.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

https://commons.apache.org/proper/commons-daemon/

Mark
on behalf of the Apache Commons community

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



Re: [daemon] Procrun and -javaagent

2022-08-19 Thread Mark Thomas

Hi,

What version of Commons Daemon?

Are you configuring the service via the UI or the command line?

Mark

On 19/08/2022 13:46, Fernando O. wrote:

Hi all,
     Disclaimer:  I'm pretty new to windows, I worked most of my life on 
linux


     I'm trying to add a java agent to a windows service, that was 
installed with procrun. In the doc it seems like there's no option for 
adding an agent.
I tried adding it to options (the doc says that accepts -D and -X) but 
just in case I tried with -javaagent as in command line but it's 
failing. I can't find a way to get proper logs on what's going on 
either. Does anyone know if this is doable?

Or how to get trace/debug lvl logs from the jvm?

I'ḿ running it in jvm mode.


image.png


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



[ANNOUNCEMENT] Commons Daemon 1.3.1 Released

2022-05-09 Thread Mark Thomas

The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.3.1.

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.3.1 is a mainly bugfix release.

A full list of changes can be found at
https://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

https://commons.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

https://commons.apache.org/proper/commons-daemon/

Mark
on behalf of the Apache Commons community

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



[ANNOUNCEMENT] Commons Daemon 1.3.0 Released

2022-03-15 Thread Mark Thomas

The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.3.0.

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.3.0 is a mainly bugfix release but also increases the minimum 
Java version to Java 7.


A full list of changes can be found at
https://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

https://commons.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

https://commons.apache.org/proper/commons-daemon/

Mark
on behalf of the Apache Commons community

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



Re: [DAEMON] Updating install image on Windows

2021-12-24 Thread Mark Thomas

On 23/12/2021 16:20, Kauppila Jared wrote:

Hello,

When using 'procrun.exe' to install a service on Windows, you can specify 
'-Install C:/path/to/procrun.exe' to set the imagePath that the service will 
utilize.

I've noticed that updating a service while passing '-install' will not update 
that imagePath and digging into the code verifies this at 
https://github.com/apache/commons-daemon/blob/master/src/native/windows/apps/prunsrv/prunsrv.c#L994


That was clearly a deliberate decision. What isn't clear is why the 
decision was made.



In my scenario, I would like to upgrade the version of Commons Daemon I'm using 
and need to update that imagePath value. Is my only option to delete/install 
the service, or manually edit the registry? Or is there some other command to 
facilitate updating that value?


I don't believe there is a command to do that.

Is another option just to replace the executable with the new version?


Would a PR be accepted to allow updating imagePath via the update command?


I don't see why not, providing that it was shown that updating the image 
path didn't cause any complications. I do wonder how a service would 
react if that was changed while the service was running.


Given that you are going to have to stop the service to update 
procrun.exe, why not stop the service, replace procrun.exe and restart 
the service instead?


Mark

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



Re: [daemon] Escaping the colon

2021-08-17 Thread Mark Thomas

Please try again with single quotes rather than double quotes. i.e.

-Dfoo='bar;zar'

Mark


On 17/08/2021 07:43, Gridinas, Mantas wrote:

I did test that prior writing the message. Result was the following:

-Dfoo=bar
zar

-Original Message-
From: Gary Gregory 
Sent: Monday, August 16, 2021 19:17
To: Commons Users List 
Subject: Re: [daemon] Escaping the colon

What happens if you say:

-Dfoo="bar;zar"

Gary

On Mon, Aug 16, 2021, 11:54 Gridinas, Mantas 
wrote:


Hi!

I've come into a bit of a pickle. I'm trying to pass the following
value as my argument for a system property -Dfoo=bar;zar Which results
in the following usage of ++StartParams
++StartParams=-Dfoo=bar;zar

In my JVM I am using `System.getProperty("foo")` to read the the
expected value of "bar;zar", but instead procsrv.exe considers that
zar should be a different argument which in turn causes the java.exe
think that zar is the main class name for application instead. How do
I go about escaping the colon in startparams?

Cheers!
// Mantas



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




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



Re: commons-fileupload dependency and CVE

2021-07-11 Thread Mark Thomas

On 10/07/2021 00:04, Matt Sicker wrote:

Snyk looks like they have something like that in early access. I’ve seen a
similar feature before in Whitesource, though it was fairly clunky. Then
there’s the CodeQL queries on GitHub/LGTM which can find effective usage
fairly well.


It was bugging me I couldn't remember.

It was SourceClear - it looks like it was bought by Veracode.

Mark




On Fri, Jul 9, 2021 at 11:54 Mark Thomas  wrote:


On 09/07/2021 15:49, Daniel Wille wrote:

That is good to know, and I appreciate that info.

I know that making updates to libraries for reasons like this is
frowned upon by developers whose time is better spent fixing actual
problems. It does mean however that many users will be in a situation
where a corporate tool will detect the CVE, requiring the developer to
investigate so they can either explain why the CVE is a non-issue, or
force them to override the dependency in their build (which I did,
because that's the easiest course).


I'd strongly recommend pushing for better tools.

For example, the ASF automatically rejects any vulnerability report that
is just the verbatim output of a security scanner. We will only accept
issues from such reports when backed either by a PoC or manual analysis
that demonstrates a genuine security issue.

There are scanners available that don't just check dependencies but
check the code used so they only flag the dependencies where the
problematic code path is used. You'll still get some false positives but
the valid / invalid ratio will be a lot better.

We did a trial with one such tool at the ASF. I liked it. I don't recall
the name of the tool. I can try and look it up if there is interest
although I think it may have gone through a rebrand since we tested it.

Mark

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







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



Re: commons-fileupload dependency and CVE

2021-07-09 Thread Mark Thomas

On 09/07/2021 15:49, Daniel Wille wrote:

That is good to know, and I appreciate that info.

I know that making updates to libraries for reasons like this is
frowned upon by developers whose time is better spent fixing actual
problems. It does mean however that many users will be in a situation
where a corporate tool will detect the CVE, requiring the developer to
investigate so they can either explain why the CVE is a non-issue, or
force them to override the dependency in their build (which I did,
because that's the easiest course).


I'd strongly recommend pushing for better tools.

For example, the ASF automatically rejects any vulnerability report that 
is just the verbatim output of a security scanner. We will only accept 
issues from such reports when backed either by a PoC or manual analysis 
that demonstrates a genuine security issue.


There are scanners available that don't just check dependencies but 
check the code used so they only flag the dependencies where the 
problematic code path is used. You'll still get some false positives but 
the valid / invalid ratio will be a lot better.


We did a trial with one such tool at the ASF. I liked it. I don't recall 
the name of the tool. I can try and look it up if there is interest 
although I think it may have gone through a rebrand since we tested it.


Mark

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



Re: commons-fileupload dependency and CVE

2021-07-09 Thread Mark Thomas

On 09/07/2021 15:11, Daniel Wille wrote:

Hi all,

I recently noted that commons-fileupload:commons-fileupload:1.4 has a
dependency on commons-io:commons-io:2.2, which has a CVE (CVE-2021-29425).
This could be mitigated by simply updating the dependency version to 2.7 or
later. Would it be possible to publish a newer version of
commons-fileupload with these changes?


Mitigate what?

Commons FileUpload doesn't use the code in Commons IO affected by 
CVE-2021-29425.


Mark

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



Re: Security issue in commons-fileup.load version 1.4 .

2021-05-27 Thread Mark Thomas

On 27/05/2021 16:29, Matt Sicker wrote:

As the user, you have ultimate control over transitive dependency
versions that end up in your application. Using Maven, for example,
you can override the commons-fileupload dependency on commons-io to
the latest release. I don't think anyone here wants to go through an
entire release for a component just to update a dependency.


I'll add that a vulnerability in a dependency does not always translate 
into a vulnerability in the code using the dependency. The last time the 
ASF looked at this across a large number of our Java projects, only 
about 10% of vulnerabilities translated into potential vulnerabilities 
in the code using the dependency.


Mark




On Thu, 27 May 2021 at 10:00, Singh, Randeep  wrote:


HI All,

This is regarding one of security issue that is reported in our component which 
is coming from commons-io (2.2) lib transitive dependency via 
commons-fileupload .
It seems this is fixed in commons-io (2.7) or above, Hence would it be  
possible to bump version of commons-io to 2.8 or 2.9 and release a patch .
I can see that it has been already done with this commit 
https://github.com/apache/commons-fileupload/commit/8370f1e0a15a0469d04579e2abd5500ebf90b8c8/
   may I know by when we can expect a release of 2.0 ? in case patch is not 
possible .


Best Regards
Randeep


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




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



Re: [daemon] Windows service not starting JVM mode with -javaagent (JDK11)

2021-02-22 Thread Mark Thomas
On 22/02/2021 08:40, Sebastian Götz wrote:
> Okay.
> 
> I got it. It appears that the double quotes are no longer allowed. When
> removing them the service starts:

See the 1.2.0 changelog and https://issues.apache.org/jira/browse/DAEMON-399

Mark

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



Re: [daemon] Windows service not starting JVM mode with -javaagent (JDK11)

2021-02-12 Thread Mark Thomas
Please can you be specific about exactly which JVM versions and Procrun
versions you tested and which worked and which did not?

Thanks,

Mark


On 12/02/2021 10:38, Sebastian Götz wrote:
> Hi all,
> 
> I have an issue when I try upgrading my existing application.
> For years I have been using procrun to install and start the application
> as a Windows service.
> No it seems that there is some sort of compatibility problem. My
> application is compiled with JDK 11 and also run with JDK 11.
> It is configured to run in JVM mode. Now comes the main issue: it makes
> use of load time weaving (AspectJ). For this I need to install a Java
> agent in order to register a class transformer. I use Spring's
> instrumentation support package (spring-instrument.jar) for this. When I
> change the JvmOptions in the service configuration to add the javaagent
> like this:
> 
> -javaagent:"lib/spring-instrument.jar"
> 
> It stops working. The service does not start and Windows event viewer
> states that my service has crashed. I see no log message giving my any
> hint where to start searching. Initially I used Version 1.1.0.0 of
> procrun, but even with the recent 1.2.4 the problem persists. I double
> checked the path to the jar file and even tried with the absolute path
> in case the working directory would not match. I used the exact same
> configuration formerly for this application using Oracle JDK 8. Is there
> a known issue with OpenJDK 11 I am not aware of?
> 
> Kind regards
> Sebastian Götz
> 
> 


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



[ANNOUNCEMENT] Commons Daemon 1.2.4 Released

2021-01-22 Thread Mark Thomas
The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.2.3.

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.2.4 is a bugfix release.

A full list of changes can be found at
https://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

https://commons.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

https://commons.apache.org/proper/commons-daemon/

Mark
on behalf of the Apache Commons community

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



Re: [daemon] Daemon Logfile Rotation on Windows

2020-11-02 Thread Mark Thomas
On 02/11/2020 12:20, JP wrote:
> Hello,
> 
> I am searching for any documentation on Daemon / Procrun Logfile
> Rotation. As there is not much in the official documentation, I'd like
> to ask you my questions.
> 
> From observation it seems like the Procrun log itself and also StdOutput
> and StdError are rotated at service startup. Ok, not really rotated but
> on each restart a new logfile with a date suffix -MM-DD is created
> and used. Is this correct?

Correct.

> The more important question, is there any mechanism in place which
> deletes older logfiles after a certain time period? And what time period
> is used there?

No. N/A.

The expectation is that applications use a logging framework rather than
log directly to stdout / stderr. The volume of logging to those
destinations is expected is be sufficiently small that rotation is not
necessary.

Mark

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



[ANNOUNCEMENT] Commons Daemon 1.2.3 Released

2020-09-14 Thread Mark Thomas
The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.2.3.

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.2.3 is a bugfix release.

A full list of changes can be found at
  https://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

https://commons.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

https://commons.apache.org/proper/commons-daemon/

Mark
on behalf of the Apache Commons community

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



Re: prunsrv JPMS support?

2020-09-02 Thread Mark Thomas
On 01/09/2020 17:31, Jan Patrick Lübbert wrote:



> I tried the JVM mode with the service config (arguments as array in a
> PowerShell script):
> 
>   "install",
>   "MyService",
>   "--DisplayName=""My Service""",
>   "--JavaHome=""$RootPath\jre""",
>   "--Jvm=""$RootPath\jre\bin\client\jvm.dll""",
>   "--StartMode=jvm",
>   "--StopMode=jvm",
>   "--JvmOptions9=""--module-path modules""",
>   "++JvmOptions9=""--module de.my.package/de.my.package.Main""",
> "--StartClass=de.my.package.Main",
> "--StopClass=de.my.package.Main",
>   "--StopTimeout=300",
>   "--JvmMs=128",
>   "--JvmMx=1024",
>   "--JvmSs=128",
>   "--LogPath=$RootPath\log",
>   "--LogPrefix=service",
>   "--LogLevel=Debug",
>   "--StdOutput=auto",
>   "--StdError=auto",
>   "--StartPath=$RootPath",
>   "--Startup=auto",
>   "--LogJniMessages=1"
>   
> The log output:   
> 
> ( prunsrv.c:1763) [ 5048] Apache Commons Daemon procrun log initialized.
> ( prunsrv.c:1767) [ 5048] Apache Commons Daemon procrun (1.2.2.0 64-bit)
> started.
> ( prunsrv.c:621 ) [ 5048] Installing service...
> ( prunsrv.c:660 ) [ 5048] Installing service 'MyService' name 'My Service'.
> ( prunsrv.c:694 ) [ 5048] Service 'MyService' installed.
> ( prunsrv.c:1848) [ 5048] Apache Commons Daemon procrun finished.
> ( prunsrv.c:1763) [ 7308] Apache Commons Daemon procrun log initialized.
> ( prunsrv.c:1767) [ 7308] Apache Commons Daemon procrun (1.2.2.0 64-bit)
> started.
> ( prunsrv.c:1677) [ 7308] Running Service 'MyService'...
> ( prunsrv.c:1448) [ 4548] Inside ServiceMain...
> ( prunsrv.c:910 ) [ 4548] reportServiceStatusE: dwCurrentState = 2,
> dwWin32ExitCode = 0, dwWaitHint = 3000, dwServiceSpecificExitCode = 0.
> ( prunsrv.c:1203) [ 4548] Starting service...
> ( javajni.c:216 ) [ 4548] Explicit RuntimeLib specified
> 'D:\MyService\jre\bin\client\jvm.dll'
> ( javajni.c:285 ) [ 4548] loading jvm 'D:\MyService\jre\bin\client\jvm.dll'
> ( javajni.c:795 ) [ 5688] Jvm Option[0] vfprintf
> ( javajni.c:795 ) [ 5688] Jvm Option[1] --module-path modules
> ( javajni.c:795 ) [ 5688] Jvm Option[2] --module
> de.my.package/de.my.package.Main
> ( javajni.c:795 ) [ 5688] Jvm Option[3] exit
> ( javajni.c:795 ) [ 5688] Jvm Option[4] abort
> ( javajni.c:795 ) [ 5688] Jvm Option[5] -Xms128m
> ( javajni.c:795 ) [ 5688] Jvm Option[6] -Xmx1024m
> ( javajni.c:795 ) [ 5688] Jvm Option[7] -Xss128k
> ( javajni.c:536 ) [ 5688] Unrecognized option: --module-path modules
> ( javajni.c:806 ) [ 5688] CreateJavaVM Failed with error [-1]
> ( javajni.c:806 ) [ 5688] Das System kann die angegebene Datei nicht finden.
> ( javajni.c:1057) [ 5688] Java Worker thread finished : with status = 2
> ( prunsrv.c:1258) [ 4548] Failed to start Java
> ( prunsrv.c:1611) [ 4548] ServiceStart returned 4.
> ( prunsrv.c:910 ) [ 4548] reportServiceStatusE: dwCurrentState = 1,
> dwWin32ExitCode = 1066, dwWaitHint = 0, dwServiceSpecificExitCode = 4.
> ( prunsrv.c:1679) [ 7308] Run service finished.
> ( prunsrv.c:1848) [ 7308] Apache Commons Daemon procrun finished.
> 
> If I change Jvm to java.exe and StartMode to Java the stderr log states:
> 
> 2020-09-01 18:18:10 Apache Commons Daemon procrun stderr initialized.
> NOTE: Picked up JDK_JAVA_OPTIONS: --module-path modules --module
> de.my.package/de.my.package.Main
> 
> Error: Option --module is not allowed in environment variable
> JDK_JAVA_OPTIONS
> 
> What am I doing wrong?

At first glance nothing. That is pretty much exactly what I tried first
when I set this up to test locally. And my test environment isn't work
either.

The good news is that with a few changes it should be possible to get
this working. At least, I got my simple test working.

The first change is the module path. As documented in [1] you need to use:

--module-path=modules

(note the addition of the equals)

The second is how you define the main module. As documented in [2] you
need to use:

-Djdk.module.main=module


So my full config was:

prunsrv.exe install
--DisplayName "Test"
--JavaHome "C:\java\adopt-14.0.2+12"
--Jvm "C:\java\adopt-14.0.2+12\bin\server\jvm.dll"
--JvmOptions ""
--JvmOptions9
"--module-path=C:\Users\god\Documents\bin#-Djdk.module.main=test"
--JvmMs 128
--JvmMx 256
--JvmSs 0
--StopPath "C:\Users\god\Documents\bin"
--StopClass "org.apache.markt.Test"
--StopParams ""
--StopTimeout 0
--StartPath "C:\Users\god\Documents\bin"
--StartClass "org.apache.markt.Test"
--StartParams ""
--StartMode "jvm"
--LogPath "C:\Users\god\Documents\bin"
--LogPrefix "commons-daemon"
--LogLevel "Debug"
--StdError "auto"
--StdOutput "auto"
--LogJniMessages 0
--Rotate 0

where the equivalent command line was:
java --module-path . --module test/org.apache.markt.Test

HTH,

Mark

[1] https://bugs.openjdk.java.net/browse/JDK-8227497
[2] https://community.oracle.com/thread/4135394

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org

Re: prunsrv JPMS support?

2020-08-31 Thread Mark Thomas
On 31/08/2020 12:38, JP wrote:
> Hello,
> 
> Can anyone tell me if prunsrv does support JPMS/modularized applications
> on the Windows platform? I read that Jsvc does support it, but I havn't
> found anything about prunsrv in the docs so far.
> 
> I tried to modify my configuration, but hat no luck yet. On the command
> line the syntax to launch the application would be:
> 
> jre\bin\java.exe --module-path modules --module
> de.my.package/de.my.package.Main
> 
> Any help appreciated. Thanks.

What have you tried so far? What happened? How did that differ from what
you expected?

Generally, procrun passes arguments like that direct to the JVM.

There might be something about jvm mode that means it needs special
setup but I'd expect java mode to work out of the box.

Mark

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



Re: [daemon] Procrun UnsatisfiedLinkError with JNI project

2020-05-12 Thread Mark Thomas
On 12/05/2020 15:15, Adam Retter wrote:
> Thanks for your response Mark, further comments inline below -
> 
>> It shouldn't.
>>
>> Maybe a permissions problem? Although running as LocalService is should
>> be fine.
> 
> So I am using the `--ServiceUser=LocalSystem` flag - to run under the
> LocalSystem account. (i.e. NOT `NT Authority\Local Service`).

Sorry. I knew that and still typed it wrong.

LocalSystem is a member of the local administrators group so it should
be able to read the file.

Maybe try running the service as the same user as the one you use when
running from the command line. That should help narrow down what is
going on.

>> I guess check the obvious. Does the dll exist where the app is looking?
> 
> It does exist yes. I have a working theory in fact that it loads the
> DLL, but it is the dependencies of that DLL (which will be various
> Windows system DLL's) that it can't load.

Is there a tool (ProcessMonitor?) that you can use to monitor attempts
to load DLLs?

>> Can LocalSystem read that file etc.
> 
> Do you know - Is there someway that I can directly execute code under
> "LocalSystem" to see if I can reproduce the problem outside of
> Procrun?

I'd go the other way and run procrun under the user you know works on
the command line.

Mark

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



Re: [daemon] Procrun UnsatisfiedLinkError with JNI project

2020-05-12 Thread Mark Thomas
On 12/05/2020 11:40, Adam Retter wrote:
> Hi there,
> 
> I have a Java project which is using JNI to load a native library. I
> would like to install it as a Windows service.
> 
> To install it I am running:
> 
> prunsrv.exe install FusionDB-Server --DisplayName=FusionDB-Server
> --Description="FusionDB Server" --StdError=auto --StdOutput=auto
> --LogPath="C:\Users\aretter\AppData\Roaming\FusionDB Server\logs"
> --LogPrefix=service --PidFile=service.pid --Startup=auto
> --ServiceUser=LocalSystem --Jvm="C:\Program
> Files\BellSoft\LibericaJRE-11-Full\bin\client\jvm.dll"
> --Classpath="C:/Program Files/FusionDB Server/lib/*" --JvmMs=128m
> --StartMode=jvm --StartClass=org.exist.service.ExistDbDaemon
> --StartMethod=start --StopMode=jvm
> --StopClass=org.exist.service.ExistDbDaemon --StopMethod=stop
> --JvmOptions="-Dfile.encoding=UTF-8;-Dlog4j.configurationFile=C:\Program
> Files\FusionDB Server/etc/log4j2.xml;-Djetty.home=C:\Program
> Files\FusionDB Server;-Dexist.jetty.config=C:\Program Files\FusionDB
> Server/etc/jetty/standard.enabled-jetty-configs;-Djetty.git.hash=ab228fde9e55e9164c738d7fa121f8ac5acd51c9;-Dexist.home=C:\Program
> Files\FusionDB Server;-Dexist.configurationFile=C:\Program
> Files\FusionDB Server/etc/conf.xml" --StartParams="C:\Program
> Files\FusionDB Server\etc\conf.xml" --JvmMx=4224m"
> 
> 
> However, when I then try and start the Service for my application, my
> application raises an error when it tries to load the native library
> via Java's System.load(absolutePathToLib) and fails to start up:
> 
> Caused by: java.lang.UnsatisfiedLinkError:
> C:\Windows\Temp\librocksdbjni18005926251924699790.dll: Can't find
> dependent libraries
> at java.lang.ClassLoader$NativeLibrary.load0(Native Method) ~[?:?]
> at java.lang.ClassLoader$NativeLibrary.load(Unknown Source) ~[?:?]
> at java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source) ~[?:?]
> at java.lang.ClassLoader.loadLibrary0(Unknown Source) ~[?:?]
> at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:?]
> at java.lang.Runtime.load0(Unknown Source) ~[?:?]
> at java.lang.System.load(Unknown Source) ~[?:?]
> at 
> org.rocksdb.NativeLibraryLoader.loadLibraryFromJar(NativeLibraryLoader.java:79)
> ~[rocksdbjni-202004011324-patched-debug.jar:?]
> 
> If I run my application directly, i.e. not via the Service, then it is
> able to correctly load the native library and start's up ok.
> 
> I have tested this on both Windows Server 2012 and 2019 with both JRE
> 8 and JRE 11.
> 
> Are there limitations on loading native libraries (or their
> dependencies) from a Java Application started from a Procrun service?
> I am also using StartMode "jvm" perhaps that has some limitation in this area?

It shouldn't.

Maybe a permissions problem? Although running as LocalService is should
be fine.

I guess check the obvious. Does the dll exist where the app is looking?
Can LocalSystem read that file etc.

Mark

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



Re: [daemon] Does prunsrv only run under Administrator account?

2020-05-12 Thread Mark Thomas
On 12/05/2020 11:25, Adam Retter wrote:
> I am seeing different behaviour when running prunsrv either as an
> Administrator or not. I have seen this in the past and it has bothered
> me, but I thought it was about time to get to the bottom of it!
> 
> Starting from a clean install of Windows 2012 Server Base, if I login
> as my user account `aretter` which is a member-of the `Administrators`
> group...
> 
> 1. Launch "Command Prompt" from the Windows Start Menu, then execute
> `prunsrv.exe //?`. I get a dialog asking if I want to allow the
> program to make changes to my computer, clicking "Yes" then briefly
> flashes a second black console screen before returning me to the
> original cmd.exe with absolutely no output, i.e. I see just this on
> the cmd.exe
> 
> c:\tools\bin>prunsrv.exe //?
> 
> c:\tools\bin>
> 
> 
> 2. Right-click on "Command Prompt" in the Windows Start Menu, and
> click "Run as adminstrator", accept the warning, then execute
> `prunsrv.exe //?`. I get no security dialog, and I get the expected
> help message printed on the console:
> 
> C:\Program Files\FusionDB Server\bin>prunsrv.exe //?
> Usage: prunsrv command [ServiceName] [--options]
>   Commands:
>   help   This page
>   install [ServiceName]  Install Service
>   update  [ServiceName]  Update Service parameters
>   delete  [ServiceName]  Delete Service
>   start   [ServiceName]  Start Service
>   stop[ServiceName]  Stop Service
>   run [ServiceName]  Run Service as console application
>   pause   [Num Seconds]  Sleep for n Seconds (defaults to 60)
>   versionDisplay version
>   Options:
> ...
> 
> 
> So I am wondering what the difference is, and why I don't get anything
> in (1)? Do you have to run prunsrv as THE Administrator?

That is the User Account Control feature getting in the way. Even if the
user is in the administrators group, you don't get full admin privs. My
understanding is that this is by design

I don't generally run prunsrv directly but if I did I'd run if from a
command prompt started via "Run as Administrator"

Mark

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



Re: How to pass the --enable-preview tomcat parameter with JSVC?

2020-03-20 Thread Mark Thomas
On 20/03/2020 13:50, ken edward wrote:
> Hello,
> 
> When I deploy my tomcat war it produces the below error message, telling me
> to pass  the "--enable-preview".  I can add the "--enable-preview" to
> my non-jsvc dev tomcat start.sh script to resolve the problem fine.
> BUT, if I launch the production tomcat using the jsvc binary (to
> bind to port 443 instead of 8443), the JSVC binary doesn't seem to
> pass the "--enable-preview" parameter.
> 
> If I try to add --enable-preview to the production JSVC
> script environment:
> "Invalid option --enable-preview
> Cannot parse command line arguments"
> 
> What must I do to allow JSVC to accept and pass the "--enable-preview"
> parameter?

Have you tried looking at the JSVC documentation?

http://commons.apache.org/proper/commons-daemon/jsvc.html

Mark

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



[ANNOUNCEMENT] Commons Daemon 1.2.2 Released

2019-10-11 Thread Mark Thomas
The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.2.2.

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.2.2 is a bugfix release.

A full list of changes can be found at
  https://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

https://commons.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

https://commons.apache.org/proper/commons-daemon/

Mark
on behalf of the Apache Commons community

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



[ANNOUNCEMENT] Commons Daemon 1.2.1 Released

2019-09-12 Thread Mark Thomas
The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.2.1.

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.2.1 is a bugfix release.

A full list of changes can be found at
  https://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

https://commons.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

https://commons.apache.org/proper/commons-daemon/

Mark, on behalf of the Apache Commons community

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



Re: [daemon] prunsrv x64 1.2.0 doesn't start under local service account

2019-09-02 Thread Mark Thomas
On 02/09/2019 09:00, Adam Retter wrote:
> Hi Mark, thanks for your response. I am just wondering when you say:
> 
>> If your application doesn't run under LocalService and you want it to
>> then you'll need to fix your application.
> 
> How can we diagnose why Procrun won't start our application under
> LocalService? We would like to understand what it is about our
> application that stops Procrun from starting it as a LocalService?
> 
> Our application installs into C:\Program Files\, and has
> a data directory in C:\Users\\AppData\Roaming\ data dir>

It is most likely a permissions issue. LocalService has a lot less
access than LocalSystem.

Review the application error logs for permissions related issues and
address them as you find them. The nature of the application may be that
it needs a dedicated (domain or local) user to run under to ensure it
gets only the permissions it needs.

Mark

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



Re: [daemon] prunsrv x64 1.2.0 doesn't start under local service account

2019-09-01 Thread Mark Thomas
On 31/08/2019 14:40, Adam Retter wrote:
> I note in the release notes for 1.2.0 it states:
> 
>  - The default Windows service user has changed from LocalSystem to
>   'NT Authority\LocalService'
> 
> Could this be the problem that I am experiencing? How can I switch
> back to LocalSystem?



>>> Ideally we don't want to run under the `Local System Account` we want
>>> to use the `local service account` instead. This seemed to work well
>>> with version 1.1.0 but is not working for us with version 1.2.0.

The above statements are contradictory.

1.1.0 uses LocalSystem by default
1.2.0 uses LocalService by default

If you want to use a different user then you are free to change via the
Windows Service Manager, prunmgr or any other available method.

If your application doesn't run under LocalService and you want it to
then you'll need to fix your application.

Mark


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



Re: [daemon] after updating prunsrv to 1.2.0 on Windows - The Service doesn't start

2019-08-30 Thread Mark Thomas
Known issue with 32-bit processes.

You can track progress here:
https://issues.apache.org/jira/browse/DAEMON-401

Mark


On 30/08/2019 15:57, David Gutknecht wrote:
> Hello everybody,
> 
> I tried to update the prunsrv.exe (1.0.15) installed on my server
> (Windows 2012) to the latest version (1.2.0)
> I simply replaced the exe with the newest version.
> After replacing it I was no more able to start the service.
> Windows deliver the message "1067: the process has unexpectedly been
> stopped"
> The log-file contains only following messages:
> [2019-08-30 14:43:49] [debug] ( prunsrv.c:1754) [20592] Apache Commons
> Daemon procrun log initialized.
> [2019-08-30 14:43:49] [info]  ( prunsrv.c:1758) [20592] Apache Commons
> Daemon procrun (1.2.0.0 32-bit) started.
> [2019-08-30 14:43:49] [info]  ( prunsrv.c:1668) [20592] Running Service
> 'Med2Unify_Swisscom'...
> [2019-08-30 14:43:49] [debug] ( prunsrv.c:1441) [22040] Inside
> ServiceMain...
> [2019-08-30 14:43:49] [debug] ( prunsrv.c:904 ) [22040]
> reportServiceStatusE: dwCurrentState = 2, dwWin32ExitCode = 0,
> dwWaitHint = 3000, dwServiceSpecificExitCode = 0.
> [2019-08-30 14:43:49] [info]  ( prunsrv.c:1196) [22040] Starting service...
> 
> If I replace back the prunsrv.exe with the oldest version (1.0.15). It
> works fine.
> I use AdoptOpenJDK (Hotspot) JRE 11
> 
> This is the command Line I used to install the service:
> prunsrv.exe^
>  //US//ServiceEngine^
>  --Startup=manual^
>  --DisplayName="ServiceEngine"^
>  --Classpath=ServiceEngine.jar^
>  --Jvm="C:\Program Files (x86)\jdk-11.0.4+11-jre\bin\client\jvm.dll"^
>  --StartMode jvm^
>  --StartClass ch.novcom.ServiceEngine^
>  --StartMethod windowsService^
>  --StartParams start^
>  --StopMode jvm^
>  --StopClass ch.novcom.ServiceEngine^
>  --StopMethod windowsService^
>  --StopParams stop^
>  --LogPath "%CD%\log"^
>  --LogPrefix ServiceEngine_
>  --LogLevel Debug
> 
> 
> And below the Java source code of the object that contains the Daemon part:
> public class ServiceEngine implements Daemon {
>     private final static Logger LOGGER =
> Logger.getLogger(ServiceEngine.class.getName());
> 
>     private static TheEngine myEngine = null;
>     private static ServiceEngine m2uInstance = new ServiceEngine();
> 
>     /**
>      * The Java entry point.
>      *
>      * @param args
>      *    Command line arguments, all ignored.
>      */
>     public static void main(String[] args) {
>         LOGGER.entering("ServiceEngine", "main");
>         // the main routine is only here so I can also run the app from the
>         // command line
> 
>         m2uInstance.initialize();
> 
>         Scanner sc = new Scanner(System.in);
>         //wait until receive stop command from keyboard
>         System.out.printf("Enter 'stop' to halt: ");
>         while(!sc.nextLine().toLowerCase().equals("stop") &&
> myEngine!=null && myEngine.isAlive());
> 
>         if (myEngine!=null && myEngine.isAlive()) {
>             m2uInstance.terminate();
>         }
>         sc.close();
>         LOGGER.exiting("ServiceEngine", "main");
>     }
> 
>     /**
>      * Static methods called by prunsrv to start/stop the Windows
> service. Pass
>      * the argument "start" to start the service, and pass "stop" to
> stop the
>      * service.
>      *
>      * Taken lock, stock and barrel from Christopher Pierce's blog at
>      * http://blog.platinumsolutions.com/node/234
>      *
>      * @param args
>      *    Arguments from prunsrv command line
>      **/
>     public static void windowsService(String args[]) {
>         String cmd = "start";
>         if (args.length > 0) {
>             cmd = args[0];
>         }
> 
>         if ("start".equals(cmd)) {
>             m2uInstance.windowsStart();
>         } else {
>             m2uInstance.windowsStop();
>         }
>     }
> 
>     public void windowsStart() {
>         LOGGER.entering(getClass().getName(), "windowsStart");
> 
>         initialize();
>         if (myEngine != null){
>             while (myEngine.isAlive()) {
>                 // don't return until stopped
>                 synchronized (this) {
>                     try {
>                         this.wait(5000); // wait 5s and check if stopped
>                     } catch (InterruptedException ie) {
>                     }
>                 }
>             }
>         }
> 
>         LOGGER.exiting(getClass().getName(), "windowsStart");
>     }
> 
>     public void windowsStop() {
>         LOGGER.entering(getClass().getName(), "windowsStop");
>         terminate();
>         synchronized (this) {
>             // stop the start loop
>             this.notify();
>         }
>         LOGGER.exiting(getClass().getName(), "windowsStop");
>     }
> 
>     // Implementing the Daemon interface is not required for Windows but
> is for
>     // Linux
>     @Override
>     public void init(DaemonContext arg0) throws Exception {
>         LOGGER.entering(getClass().getName(), "init");
> 
>         

Re: [daemon] Enabling Native Memory Tracking while starting tomcat using jsvc

2019-07-30 Thread Mark Thomas
On 30/07/2019 11:18, కృష్ణ చైతన్య wrote:
> Hi,
> 
> We are trying to enable Native Memory Tracking by setting the flags 
> "-XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=detail 
> -XX:+PrintNMTStatistics" during startup.  We use jsvc to fire up tomcat and 
> it fails to turn on Native Memory Tracking.  In Catalina.out we see the 
> following error during startup.
> 
> Java HotSpot(TM) 64-Bit Server VM warning: Native Memory Tracking did not 
> setup properly, using wrong launcher? 
> Java HotSpot(TM) 64-Bit Server VM warning: PrintNMTStatistics is disabled, 
> because native memory tracking is not enabled
> 
> The below link from the tomcat users mailer list, indicates that we can’t 
> enable Native Memory Tracking while using jsvc.  Is there a way to have this 
> turned on while using jsvc to start tomcat.

That would require code changes to the jsvc code to configure the
environment variable as described in:
https://blogs.oracle.com/poonam/using-nmt-with-custom-jvm-launcher

Mark

> 
> http://mail-archives.apache.org/mod_mbox/tomcat-users/201703.mbox/%3ccap-jj3o-nzo3rgkqzvhbf8zxbngwrcdmem9wawoxnkd5isb...@mail.gmail.com%3e
>  
> 
> 
> Regards,
> Krishna Chaitanya.
> 


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



[ANNOUNCEMENT] Commons Daemon 1.2.0 Released

2019-07-04 Thread Mark Thomas
The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.2.0.

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.2.0 is a feature and bugfix release.

A full list of changes can be found at
  https://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

https://commons.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

https://commons.apache.org/proper/commons-daemon/

Mark, on behalf of the Apache Commons community

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



Re: [pool] Possible deadlock or user error (me) commons-pool 2.5.0

2018-09-09 Thread Mark Thomas
On 08/09/18 19:36, Mark Thomas wrote:



>> For the "- parking to wait for  <0x0006471cd7d8> (a
>> java.util.concurrent.locks.ReentrantLock$NonfairSync)" there are 155.
>> Though I see no other messages with that object in the thread dump.
>>
>> Has anyone run into this? It seems like some sort of deadlock.
> 
> Do you still have the full thread dump? Can you post it somewhere (where
> we can look at it)?

Thanks. Lots of threads waiting for the lock. None holding it. That is
very strange.

Some variation of this?

https://confluence.atlassian.com/jirakb/jira-applications-stall-due-to-stackoverflowerror-exception-941601100.html

Mark

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



Re: [pool] Possible deadlock or user error (me) commons-pool 2.5.0

2018-09-08 Thread Mark Thomas
On 07/09/18 22:56, Bruce Milner wrote:
> Hello,
> 
> I am using commons-pool2-2.5.0 for a MySQL connection pooler. The reason
> for not using out-of-the-box is that the existing code relies on
> changing catalogs at runtime reusing an existing connection. The
> original design was to use multiple databases using the same connection
> and this cannot be changed.
> 
> I recently replaced a lot of hand crafted code with the commons-pool2
> implementation.
> 
> The issue I have is that one server I manage went into a state where
> there are plenty of connections, but none are being returned to the
> pool. They are all stuck on a lock inside of
> GenericKeyedObjectPool.returnObject.
> 
> The config is basically
>     GenericKeyedObjectPoolConfig config = new
> GenericKeyedObjectPoolConfig();
>     config.setBlockWhenExhausted(true);
>     config.setMaxTotal(120);
>     config.setMaxTotalPerKey(60);
>     config.setTestOnBorrow(true);
>     config.setTimeBetweenEvictionRunsMillis(6);
>     config.setMinEvictableIdleTimeMillis(0); // don't starve
> connections because of catalog switches.
>     /**
>  * For database connections, use FIFO so that we get rid of
> older connections first before newer ones.
>  */
>     config.setLifo(false);
>     return new GenericKeyedObjectPool(new
> PooledConnectionFactory(), config);
> 
> There are 150 of these threads waiting on a lock to release connections
>    java.lang.Thread.State: WAITING (parking)
>     at sun.misc.Unsafe.park(Native Method)
>     - parking to wait for  <0x0006471cd7d8> (a
> java.util.concurrent.locks.ReentrantLock$NonfairSync)
>     at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
>     at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
> 
>     at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870)
> 
>     at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199)
> 
>     at
> java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:209)
> 
>     at
> java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:285)
>     at
> org.apache.commons.pool2.impl.LinkedBlockingDeque.hasTakeWaiters(LinkedBlockingDeque.java:1389)
> 
>     at
> org.apache.commons.pool2.impl.GenericKeyedObjectPool.hasBorrowWaiters(GenericKeyedObjectPool.java:849)
> 
>     at
> org.apache.commons.pool2.impl.GenericKeyedObjectPool.returnObject(GenericKeyedObjectPool.java:551)
> 
>     at
> com.ilrn.util.sql.connectionpooler.ConnectionPooler.releaseConnection(ConnectionPooler.java:358)
> 
>     at
> com.ilrn.util.sql.connectionpooler.PooledConnection.close(PooledConnection.java:141)
> 
>     at
> com.ilrn.util.sql.connectionpooler.ConnectionPooler.safeClose(ConnectionPooler.java:480)
> 
> 
> and 158 of these threads waiting to open connections.
>  java.lang.Thread.State: WAITING (parking)
>     at sun.misc.Unsafe.park(Native Method)
>     - parking to wait for  <0x0006471cd7d8> (a
> java.util.concurrent.locks.ReentrantLock$NonfairSync)
>     at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
>     at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
> 
>     at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870)
> 
>     at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199)
> 
>     at
> java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:209)
> 
>     at
> java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:285)
>     at
> org.apache.commons.pool2.impl.LinkedBlockingDeque.pollFirst(LinkedBlockingDeque.java:560)
> 
>     at
> org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:356)
> 
>     at
> org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:281)
> 
>     at
> com.ilrn.util.sql.connectionpooler.ConnectionPooler.getConnection(ConnectionPooler.java:197)
> 
>     at com.ilrn.util.sql.Database.getConnection(Database.java:1273)
> 
> For the "- parking to wait for  <0x0006471cd7d8> (a
> java.util.concurrent.locks.ReentrantLock$NonfairSync)" there are 155.
> Though I see no other messages with that object in the thread dump.
> 
> Has anyone run into this? It seems like some sort of deadlock.

Do you still have the full thread dump? Can you post it somewhere (where
we can look at it)?

Mark



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



Re: commons-daemon on windows, not honoring JvmMx setting?

2018-04-26 Thread Mark Thomas
On 26/04/18 11:32, Alex O'Ree wrote:
> I had it set to 300, task mgr listed it at 800

That looks normal.

"Maximum Java Heap Size" != "Maximum OS Memory footprint"

Mark

> 
> On Mon, Apr 16, 2018, 9:59 AM Mark Thomas <ma...@apache.org> wrote:
> 
>> On 16/04/18 14:37, Alex O'Ree wrote:
>>>  I've been experimenting with prunsrv and have been able to get my java
>>> process to fire up as a windows service when using the "jvm" mode
>> (couldn't
>>> get java or exe to work). I am noticing that the setting "--JvmMx" does
>> not
>>> seem to be honored. According to the docs, it should.
>>>
>>>> Maximum memory pool size in MB. (Not used in *exe* mode.)
>>>
>>> Either my configuration is wrong or I'm just not understanding something.
>>> Any ideas?
>>>
>>
>> Define "not honored".
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
>>
> 


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



Re: commons-daemon on windows, not honoring JvmMx setting?

2018-04-16 Thread Mark Thomas
On 16/04/18 14:37, Alex O'Ree wrote:
>  I've been experimenting with prunsrv and have been able to get my java
> process to fire up as a windows service when using the "jvm" mode (couldn't
> get java or exe to work). I am noticing that the setting "--JvmMx" does not
> seem to be honored. According to the docs, it should.
> 
>> Maximum memory pool size in MB. (Not used in *exe* mode.)
> 
> Either my configuration is wrong or I'm just not understanding something.
> Any ideas?
> 

Define "not honored".

Mark

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



Re: [DBCP] troubleshooting pool activity (tomcat version)

2018-03-21 Thread Mark Thomas
On 21/03/18 04:49, Shawn Heisey wrote:
> On 3/20/2018 9:49 PM, Phil Steitz wrote:
>> First, find out what version of tomcat you are running.  Then look
>> in the tomcat build file sources for the properties that define the
>> dbcp and pool versions being used.  In TC 7, I am pretty sure the
>> repackaged sources were always from release tags.  Ask again if you
>> have trouble locating the dbcp/pool versions once you know the TC
>> version.
> 
> Tomcat on the system I'm looking at is 7.0.42, bundled with Liferay 6.2.

Tomcat 7 uses DBCP 1.x (and always will).

>> In DBCP 1.x (what TC 7 used), abandoned connection tracking was in
>> the AbandonedObjectPool bundled with DBCP.  Tracking can be turned
>> on by configuration of BasicDataSource to remove abandoned
>> connections and to log them.  When connections are considered
>> abandoned and closed, the stack trace of the code that created them
>> is logged.  That requires that they actually go past the abandoned
>> connection timeout, though and get closed by the pool.
> 
> In the pool definitions (which are in tomcat's context.xml),
> removeAbandoned is true, and removeAbandonedTimeout is set to 30.  (this
> is really low!)  But this does not appear to actually be happening.  I
> see connections on the server (which look like they are from the
> configured pool) that have been idle for HOURS.
> 
> Here's a relevant definition, slightly redacted:
> 
>      factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
> driverClassName="com.mysql.jdbc.Driver" type="javax.sql.DataSource"
> maxActive="60" maxIdle="10" maxWait="3" removeAbandoned="true"
> removeAbandonedTimeout="30" username="REDACTED" password="REDACTED"
> testOnBorrow="true" validationQuery="select 1"
> url="jdbc:mysql://encore.REDACTED.com:3306/REDACTED?autoReconnect=truezeroDateTimeBehavior=round"
> />
> 
> The factory is different from the recommended value in the 7.0 docs
> (which specifically say 7.0.85, I've got 7.0.42).  Those docs say it
> should be org.apache.tomcat.jdbc.pool.DataSourceFactory.  I wonder if
> this means that it's ignoring some of the pool configuration.

org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory is the default
factory and the correct factory to use for Tomcat's re-packaged version
of DBCP.

For the record, the code is an exact copy of the DBCP code (at the point
the copy was updated). Tomcat doesn't make any local changes.

Another reason for the repackaging is to prevent conflicts if an
application includes its own copy of Commons DBCP.

org.apache.tomcat.jdbc.pool.DataSourceFactory is the factory to use for
Tomcat's JDBC pool implementation.

> In a surface review of our application DB code, I have encountered a
> common theme:  Connections are obtained, used, and closed, all within a
> try block.  It is my understanding that closes should actually be done
> in a finally block (with null checks), to be absolutely certain that a
> close cannot be skipped, regardless of any exceptions that might occur. 
> I suspect that this is the root of our troubles,

+1

> and that we need to
> change the factory on our pool definitions.

I believe not.

Mark

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



Re: [daemon] - High memory consumption

2018-03-19 Thread Mark Thomas
On 19/03/18 08:32, Kenneth Vindum wrote:
> Dear user list
> 
> I'm having a bit of trouble with memory consumption using procsrv.exe.
> I've set the --JvmMX=4096 but the .exe process is consuming nearly 7GB of 
> memory despite the fact that the JVM only consumed the requested 4GM. The 
> remaining 3GB seems to be consumed by procsrv.exe
> 
> I can see in VisualVM that the JVM has registered the -Xmx4096m argument and 
> are using the expected 4GB. But what can be causing the procsrv.exe to be 
> using additionally 3GB? Any help will be appreciated.

The 4GB is just the Java object heap. The Java process also needs to
allocate memory for:
- Permanent Space
- Code Generation
- Socket Buffers
- Thread stacks
- Direct Memory Space
- JNI Code
- Garbage Collection
- JNI Allocated Memory

How much memory will be required for all of the above is highly
application dependent.

Mark

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



Re: [POOL] EvictionTimer daemon thread

2018-01-31 Thread Mark Thomas
On 31/01/18 08:15, Bruno P. Kinoshita wrote:
> Not sure if it was intentional.
> 
> But here's the reason: 
> https://github.com/apache/commons-pool/commit/4a20cdca923bd342360f821d7020538e985d9ec2#diff-38e254894b87bdf9a1758778c7ffd50fL167
> 
> Instead of a `new Timer("", /* isDaemon */ true)`, now we have an 
> implementation of `ThreadFactory` that when it creates new `Thread`s, it 
> doesn't set the `setDaemon(true)`. So it just creates a thread with default 
> behaviour of daemon set to false.
> 
> As the previous behaviour was to have the threads as daemon, and there 
> doesn't seem to have any arguments for dropping it, we could raise a new 
> issue, with a patch, and ping Mark to see what he thinks?

There is a typo in the commit message. The issue is POOL-315. It looks
like I had finger trouble that day. I've spotted another typo in the
changelog which I have now fixed.

I don't recall any discussion of whether or not the threads should be
daemon threads.

Starting with a clean slate, I'd turn this around. What is the argument
that the threads should be daemon threads?

If the pool is correctly shutdown it should not matter as the evictor
thread will be stopped at shutdown.

The only reason I can see for changing back to using a daemon thread is
that it used to be a daemon thread and that allowed pools to be used
without shutting them down cleanly.

Overall, I guess I am neutral on changing it.

Mark


> 
> Cheers
> Bruno
> 
> (ps: the threads have a typo in their names, but it has been fixed in the 
> master branch already)
> 
> 
> 
> From: "Wegrzyn, Jakub" 
> To: Commons Users List  
> Sent: Wednesday, 31 January 2018 8:54 PM
> Subject: RE: [POOL] EvictionTimer daemon thread
> 
> 
> 
> I couldn’t find it either.
> Pool-351 was a commit message. 
> https://git-wip-us.apache.org/repos/asf?p=commons-pool.git;a=commit;h=4a20cdca923bd342360f821d7020538e985d9ec2
> 
> Jakub 
> 
> 
> -Original Message-
> From: Gary Gregory [mailto:garydgreg...@gmail.com] 
> Sent: Wednesday, January 31, 2018 8:28 AM
> To: Commons Users List 
> Subject: Re: [POOL] EvictionTimer daemon thread
> 
> I cannot find a POOL-351 issue. Can you double check please?
> 
> Gary
> 
> On Jan 31, 2018 00:15, "Wegrzyn, Jakub"  wrote:
> 
>> Hi,
>>
>> We want to upgrade dbcp2 from version 2.1.1 to version 2.2.0. It 
>> requires upgrading commons-pool2 from version 2.4.2 to 2.5.0. However, 
>> during the upgrade we encountered a problem.
>> It seems that commons-pool2 Evictor thread has been changed from 
>> daemon to non-daemon thread (Issue POOL-351, commit: 
>> 4a20cdca923bd342360f821d702053 8e985d9ec2).
>>
>> We cannot find any documentation describing the reason or the change 
>> itself. Can you provide more insight why that was changed and add it 
>> to the changes-report.
>>
>> Best regards,
>> Jakub
>>
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 


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



Re: [dbcp] Exposing JMXbeans

2017-12-08 Thread Mark Thomas
On 08/12/17 14:28, Walter Heestermans (TME) wrote:
> This is what has been coded by the project

I've confirmed that the name used is valid.

You won't see anything in JMX until BasicDataSource.createDataSource()
is called. Typically, you'd trigger that with a call to getConnection().

I used TestBasicDataSource#testClose() to confirm everything was working
as expected. I recommended comparing your code to that test case to see
where it differs.

Mark


> 
>  
> 
> …
> 
>  
> 
>     public static void setUp() throws Exception {
> 
>     // Load JDBC Driver class.
> 
>     Class.forName(DatabaseProperties.DB_DRIVER).newInstance();
> 
>  
> 
> *  connectionPool = new BasicDataSource();*
> 
>  
> 
>     connectionPool.setUsername(DatabaseProperties.DB_USER);
> 
>     connectionPool.setPassword(DatabaseProperties.DB_PASSWORD);
> 
>     connectionPool.setDriverClassName(DatabaseProperties.DB_DRIVER);
> 
>     connectionPool.setUrl(DatabaseProperties.DB_URL);
> 
>     connectionPool.setInitialSize(0);
> 
>    
> connectionPool.setValidationQuery(DatabaseProperties.DB_PREFERRED_TEST_QUERY);
> 
>     connectionPool.setMaxIdle(DatabaseProperties.DB_MAX_IDLE);
> 
>     connectionPool.setMinIdle(DatabaseProperties.DB_MIN_IDLE);
> 
>    
> //connectionPool.setMaxActive(Integer.parseInt(DatabaseProperties.DB_MAX_POOL_SIZE));
> 
>    
> connectionPool.setMinEvictableIdleTimeMillis(DatabaseProperties.DB_MIN_EVICTABLE_IDLE_TME_MILIS);
> 
> *  connectionPool.setJmxName("org.apache.dbcp:DataSource=ECIDB");*
> 
>  
> 
> …
> 
>  
> 
> Nothing in jconsole
> 
>  
> 
>  
> 
> Maybe related to the name they use?
> 
>  
> 
> *connectionPool.setJmxName("org.apache.dbcp:DataSource=ECIDB");*
> 
>  
> 
> Walter
> 
>  
> 
>  
> 
> -Original Message-
> From: Mark Thomas [mailto:ma...@apache.org]
> Sent: 08 December 2017 15:11
> To: Commons Users List <user@commons.apache.org>
> Subject: Re: [dbcp] Exposing JMXbeans
> 
>  
> 
> On 08/12/17 12:59, Walter Heestermans (TME) wrote:
> 
>> We are using:
> 
>>
> 
>> commons-dbcp2-2.1.1.jar
> 
>> commons-pool2-2.4.3.jar
> 
>  
> 
> Set the jmxName property on your BasicDataSourceFcatory and that will
> enable JMX for DBCP and the underlying pools.
> 
>  
> 
> Mark
> 
>  
> 
>>
> 
>> Walter
> 
>>
> 
>>
> 
>> -Original Message-
> 
>> From: Mark Thomas [mailto:ma...@apache.org]
> 
>> Sent: 08 December 2017 13:58
> 
>> To: user@commons.apache.org <mailto:user@commons.apache.org>
> 
>> Subject: Re: [dbcp] Exposing JMXbeans
> 
>>
> 
>> On 08/12/17 12:47, Walter Heestermans (TME) wrote:
> 
>>> Hi,
> 
>>> 
> 
>>> We have Struts application using  the commons DBCP and commons Pool
> implementation. I like to have the pool information exposed as JMX
> beans, so that I can use JConsole to look a t the pool behaviour. The
> application is deployed inside a Jetty container. I can see a lot of
> info already via JConsole but the pool information is missing.
> 
>>> 
> 
>>> What is required to be able to do that?
> 
>>
> 
>> A good place to start would be you telling the list which versions of
> Commons DBCP and Commons Pool are being used.
> 
>>
> 
>> Mark
> 
>>
> 
>> -
> 
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> <mailto:user-unsubscr...@commons.apache.org>
> 
>> For additional commands, e-mail: user-h...@commons.apache.org
> <mailto:user-h...@commons.apache.org>
> 
>>
> 
>> This e-mail may contain confidential information. If you are not an
> addressee or otherwise authorised to receive this message, you should
> not use, copy, disclose or take any action based on this e-mail. If you
> have received this e-mail in error, please inform the sender promptly
> and delete this message and any attachments immediately.
> 
>>
> 
>> -
> 
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> <mailto:user-unsubscr...@commons.apache.org>
> 
>> For additional commands, e-mail: user-h...@commons.apache.org
> <mailto:user-h...@commons.apache.org>
> 
>>
> 
>  
> 
>  
> 
> -
> 
> To unsubscribe, e-mail:

Re: [dbcp] Exposing JMXbeans

2017-12-08 Thread Mark Thomas
On 08/12/17 12:59, Walter Heestermans (TME) wrote:
> We are using:
> 
> commons-dbcp2-2.1.1.jar
> commons-pool2-2.4.3.jar

Set the jmxName property on your BasicDataSourceFcatory and that will
enable JMX for DBCP and the underlying pools.

Mark

> 
> Walter
> 
> 
> -Original Message-
> From: Mark Thomas [mailto:ma...@apache.org]
> Sent: 08 December 2017 13:58
> To: user@commons.apache.org
> Subject: Re: [dbcp] Exposing JMXbeans
> 
> On 08/12/17 12:47, Walter Heestermans (TME) wrote:
>> Hi,
>>
>> We have Struts application using  the commons DBCP and commons Pool 
>> implementation. I like to have the pool information exposed as JMX beans, so 
>> that I can use JConsole to look a t the pool behaviour. The application is 
>> deployed inside a Jetty container. I can see a lot of info already via 
>> JConsole but the pool information is missing.
>>
>> What is required to be able to do that?
> 
> A good place to start would be you telling the list which versions of Commons 
> DBCP and Commons Pool are being used.
> 
> Mark
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 
> This e-mail may contain confidential information. If you are not an addressee 
> or otherwise authorised to receive this message, you should not use, copy, 
> disclose or take any action based on this e-mail. If you have received this 
> e-mail in error, please inform the sender promptly and delete this message 
> and any attachments immediately.
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 


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



Re: [dbcp] Exposing JMXbeans

2017-12-08 Thread Mark Thomas
On 08/12/17 12:47, Walter Heestermans (TME) wrote:
> Hi,
> 
> We have Struts application using  the commons DBCP and commons Pool 
> implementation. I like to have the pool information exposed as JMX beans, so 
> that I can use JConsole to look a t the pool behaviour. The application is 
> deployed inside a Jetty container. I can see a lot of info already via 
> JConsole but the pool information is missing.
> 
> What is required to be able to do that?

A good place to start would be you telling the list which versions of
Commons DBCP and Commons Pool are being used.

Mark

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



Re: [daemon] Can init() be called more than once in a single JVM session?

2017-11-29 Thread Mark Thomas
On 29/11/17 11:09, Andrea Lo Pumo wrote:
> Does anyone have an answer?

My expectation is that init() will be call once per JVM but that the
jsvc process may create multiple JVMs (sequentially, not concurrently)
and that init() will be called for each.

If jsvc detects that the JVM has aborted (OOME, crash, etc.) it uses
exit code 123 to signal a restart. You can call System.exit(123); to
achieve the same result.

Any other clean exit will be treated as a normal shutdown and there will
be no restart.

HTH,

Mark


> 
> Best regards.
> 
> 2017-10-23 15:53 GMT+02:00 Andrea Lo Pumo :
> 
>> Since now, I have always assumed that init() is called once, and no
>> more. Now I am not sure anymore. My doubt is that init() can be called
>> a second time, after destroy() has been called, for example, if the
>> program is restarted by Jsvc. Is this so? If yes, I should use a
>> static variable "alreadyInitialized" and do nothing in init() if it is
>> true, at least for things that have not to be done more than once.
>>
>> A second question: when does Jsvc restart the program exactly? If I
>> kill the program, or use -stop. It simply stop()s and destroy()s and
>> exits. I have been able to simulate a restart using System.exit(123).
>> Are there other cases when Jsvc restarts the program?
>>
> 


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



[ANNOUNCEMENT] Commons Daemon 1.1.0 Released

2017-11-24 Thread Mark Thomas
The Apache Commons Team is pleased to announce the availability of
Apache Commons Daemon 1.1.0.

The Apache Commons Daemon software library provides a generic Daemon
(unix) or Service (Windows) wrapper for Java code.

Version 1.1.0 is a maintenance release with a particular focus of
providing support for Java 9 along with numerous other bug fixes.

A full list of changes can be found at
  http://commons.apache.org/proper/commons-daemon/changes-report.html

Source and binary distributions are available for download from the
Apache Commons download site:

http://commons.us.apache.org/proper/commons-daemon/download_daemon.cgi

Please verify signatures using the KEYS file available at the above
location when downloading the release.

For complete information on Commons Daemon, including
instructions on how to submit bug reports, patches, or suggestions for
improvement, see the Apache Commons Daemon website:

http://commons.us.apache.org/proper/commons-daemon/

Mark, on behalf of the Apache Commons community

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



Re: [pool] preparePool that only registers key, doesn't create new object

2017-02-09 Thread Mark Thomas

On 06/02/17 10:55, Mark Thomas wrote:

On 05/02/17 22:21, Gary Gregory wrote:

Anyone care to opine?


I think there is a bug in ensureMinIdle. If the objectDeque is null, it
needs to obtain a reference to the objectDeque once created in the for
loop. Otherwise the call from preparePool will always create
minIdlePerKey objects regardless of any objects created by the evictor.


Fixed in r1782329 for 2.4.3 onwards.

Mark




Mark



G

On Fri, Jan 20, 2017 at 7:38 AM, Martin Klepsch <
martinklep...@googlemail.com> wrote:


Hey,

With a KeyedObjectPool I can use `setMinIdlePerKey` &  `preparePool` to
"bootstrap" an object pool. Now `preparePool` creates new objects
synchronously and the evictor thread doesn't seem to ensure min idle
objects if there are none yet (since it can't know the keys I guess).

Because of that I run into the situation that the evictor thread creates
objects for keys that are currently being created by `preparePool`. It's
not an absolute deal breaker but it would be nice to be able to register
keys without synchronously creating the minimum idle objects. Instead
I'd
like to wait for the evictor thread to pick up newly registered keys and
create the required objects for it.

Unfortunately `register` is private and I don't see another way to
trigger
key-registering. (Calling `preparePool` with `minIdlePerKey` set to 0
will
short circuit and not register the key).

Any suggestions welcome!

Cheers :)








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




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



Re: Unsubscribe me from all

2016-09-06 Thread Mark Thomas
Done.

Mark


On 06/09/2016 12:21, carrie.ctr.w...@faa.gov wrote:
> 
> 
> -Original Message-
> From: Michael Knigge [mailto:michael.kni...@set.de] 
> Sent: Friday, September 02, 2016 8:57 AM
> To: user@commons.apache.org
> Subject: commons lang 3.5 - official release?
> 
> Hi,
> 
> is there a plan for an official 3.5 release of apache commons lang? 3.4 was 
> released over two years ago…
> 
> thank you,
> Michael
> 
> 
> Mit freundlichen Grüßen
> 
> Michael Knigge
> Software Engineer
> 
> SET GmbH
> Lister Straße 15
> 30163 Hannover
> 
> phone: +49 511 39780-23
> fax: +49 511 39780-65
> 
> www.set.de
> michael.kni...@set.de
> 
> Handelsregister: HRB52778 Amtsgericht Hannover
> Geschäftsführer: Till Dammermann, Dr. Bernd Huber
> 
> Weitere Informationen finden Sie auf unserer Homepage...
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 


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



Re: Prefix for mails to user@commons.apache.org?

2016-08-30 Thread Mark Thomas
On 30/08/2016 16:14, Thomas Brand wrote:
> 
> Hi,
> when i receive mail from other lists, they have a subject like
> [listname] subject, which makes it easy to quickly sort and overview mails
> from multiple lists in one box (i.e. the inbox). It also makes it easier
> to quickly filter from spam messages.
> Would it be possible that listserver from  user@commons.apache.org would
> automagically prefix the subject?

Unlikely.

The ASF mail server sets the List-Id mail header which can be used for
sorting / filtering.

Mark


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



Re: [IO] Query on Veracode issue

2016-02-10 Thread Mark Thomas
On 10/02/2016 12:00, Parag Joshi wrote:
> Hi,
> 
> 
> 
> I am using Apache Commons IO v2.4 (commons-io-2.4.jar) in one of my
> projects. My organization uses Veracode to scan the deliveries of my
> project. Veracode scans the projects for vulnerability issues and flags the
> flaws if the code and/or third-party libraries used in the project are
> vulnerable for some external attacks.
> 
> 
> During the recent scan the Veracode system flagged an issue in
> commons-io-2.4.jar.
> 
> 
> Below are the details:
> 
> 
> *CWE ID:* 78
> 
> http://cwe.mitre.org/data/definitions/78.html
> 
> *Name:* Improper Neutralization of Special Elements used in an OS Command
> ('OS Command Injection')
> 
> *Module:* commons-io-2.4.jar
> 
> *Source:* FileSystemUtils.java: *Line#* 535
> 
> *Attack Vector: *java.lang.Runtime.exec
> 
> *Description:* This call to java.lang.Runtime.exec() contains a command
> injection flaw. The argument to the function is constructed using
> user-supplied input. If an attacker is allowed to specify all or part of
> the command, it may be possible to execute commands on the server with the
> privileges of the executing process. The level of exposure depends on the
> effectiveness of input validation routines, if any. The first argument to
> exec() contains tainted data from the variable cmdAttribs. The tainted data
> originated from earlier calls to java.lang.string.!operator_javanewinit,
> java.io.file.!operator_javanewinit,
> org.apache.commons.io.filesystemutils.freespacekb,
> org.apache.commons.io.filesystemutils.freespacekb,
> org.apache.commons.io.filenameutils.normalize,
> org.apache.commons.io.filenameutils.getprefixlength, and
> org.apache.commons.io.filesystemutils.freespace.
> 
> *Remediation:* Validate all user-supplied input to ensure that it conforms
> to the expected format, using centralized data validation routines when
> possible. When using black lists, be sure that the sanitizing routine
> performs a sufficient number of iterations to remove all instances of
> disallowed characters. Most APIs that execute system commands also have a
> "safe" version of the method that takes an array of strings as input rather
> than a single string, which protects against some forms of command
> injection.
> 
> Now, my organization needs an assessment report for the above issue from
> the author of the third-party library which in this case it is Apache. Can
> you please provide me the assessment report for above issue?

With my ASF security team member hat on:
No.

> Is this a known issue?

That question is based on the assumption that an issue exists.

> And is it safe to use commons-io-2.4.jar keeping in mind the
> above issue?

No idea. It is your code using the library so they only person who can
say how the library is used is you.

Is if possible to use this library in such a way as to expose you to a
remote code execution vulnerability? Sure. It is also possible to use
the library safely. How you use it is up to you and you have to take
responsibility for that.

Mark


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



Re: [bcel] perspective?

2015-10-06 Thread Mark Thomas
On 06/10/2015 22:30, Stephan Herrmann wrote:
> Thanks, Mark,
> 
> This is very helpful information!
> 
> Please don't read my questions as demanding.
> I know the tragedy of the commons.
> 
> As an Eclipse committer I'm used to time-boxed releases, but I understand
> that things work differently at Apache. OK.
> 
> After playing a bit with an RC of BCEL 6.0 I have one more question:
> I see that progress has been made to support the mandatory StackMapTable,
> but BCEL does not automatically update this when modifying / creating an
> instruction list.
> 
> So, how are people using (going to use) BCEL 6 on a JVM 8, in particular,
> tools that need to create new byte codes? Are you happily adding new
> Frames to the StackMapTable as you insert instructions?
> In our existing implementation we forced the class file version of
> modified classes to be 50.0 so that falling back to the old verifier
> would still work. This probably won't work as soon as bytecodes
> contain lambdas, right?

Sorry, I've only gone as far as using BCEL to scan Java 8 to extract
annotations. Tomcat ignores 99% of the byte code.

> Anybody using BCEL to transform Java 8 bytecodes?

I believe some the people reporting issues against BCEL are doing
exactly that and reporting bugs when they hit issues.

Sorry I can't be of more help.

Mark

> 
> thanks,
> Stephan
> 
> 
> On 10/04/2015 11:22 PM, Mark Thomas wrote:
>> On 04/10/2015 17:56, Stephan Herrmann wrote:
>>> Hence, my primary question: can we realistically expect a release of
>>> BCEL 6.0 any time soon?
>>
>> Define soon. Progress is being made. The more folks that contribute
>> (particularly patches and reviews of proposed patches) the faster that
>> progress will be. There is no set date I am aware of.
>>
>> I'll note at this point there has been an awful lot of people demanding
>> more progress in BCEL and very few actually stepping up and contributing.
>>
>>> Secondly, what happens when future versions of Java introduce new
>>> bytecodes? Currently it seems like Java 9 will only introduce one new
>>> access flag and a new attribute, but of course future additions can
>>> never be ruled out. Is there any commitment in the BCEL team to
>>> support future bytecodes? I would be happy to help by way of bug
>>> reports, possibly patches, but obviously some committer(s) would need
>>> to drive this process. Is this something I could expect?
>>
>> As long as BCEL is in Commons proper then that is a reasonable
>> expectation.
>>
>> Tomcat depends on BCEL so it is a safe bet that BCEL will be updated to
>> handle any parsing issues that emerge with new bytecodes. However,
>> Tomcat depends on fork of the source so it doesn't drive BCEL releases.
>>
>>> Lastly, already in version 5.2 we had to patch two files, because two
>>> mutable static fields in BCEL prohibit the use in a multi threaded
>>> application [3]. Note, that I'm not asking to make BCEL thread safe,
>>> just to make client-side synchronization possible (without forcing
>>> "stop-the-world-we-want-to-call-into-bcel"). As we have a modified
>>> version of the two affected classes in use for several years, I wonder
>>> if the proposed change could get some support?
>>
>> Sounds reasonable to me. Open a Jira, provide the patch and someone
>> should take a look.
>>
>>> In all those years we were quite happy with BCEL. Unfortunately, we
>>> have to make a hard decision pretty soon. From what I saw on this list,
>>> I'm not sure, if staying with BCEL is viable.
>>
>> Only you can make that choice.
>>
>> Mark
>>
>>
>>>
>>> Can anyone comment?
>>> TIA,
>>> Stephan
>>> -- 
>>> https://projects.eclipse.org/users/stephan-herrmann
>>>
>>>
>>> [1] http://www.eclipse.org/objectteams
>>> [2] http://www.eclipse.org/orbit
>>> [3] https://issues.apache.org/jira/browse/BCEL-267
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>>> For additional commands, e-mail: user-h...@commons.apache.org
>>>
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 


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



Re: [bcel] perspective?

2015-10-04 Thread Mark Thomas
On 04/10/2015 17:56, Stephan Herrmann wrote:
> Hence, my primary question: can we realistically expect a release of
> BCEL 6.0 any time soon?

Define soon. Progress is being made. The more folks that contribute
(particularly patches and reviews of proposed patches) the faster that
progress will be. There is no set date I am aware of.

I'll note at this point there has been an awful lot of people demanding
more progress in BCEL and very few actually stepping up and contributing.

> Secondly, what happens when future versions of Java introduce new
> bytecodes? Currently it seems like Java 9 will only introduce one new
> access flag and a new attribute, but of course future additions can
> never be ruled out. Is there any commitment in the BCEL team to
> support future bytecodes? I would be happy to help by way of bug
> reports, possibly patches, but obviously some committer(s) would need
> to drive this process. Is this something I could expect?

As long as BCEL is in Commons proper then that is a reasonable expectation.

Tomcat depends on BCEL so it is a safe bet that BCEL will be updated to
handle any parsing issues that emerge with new bytecodes. However,
Tomcat depends on fork of the source so it doesn't drive BCEL releases.

> Lastly, already in version 5.2 we had to patch two files, because two
> mutable static fields in BCEL prohibit the use in a multi threaded
> application [3]. Note, that I'm not asking to make BCEL thread safe,
> just to make client-side synchronization possible (without forcing
> "stop-the-world-we-want-to-call-into-bcel"). As we have a modified
> version of the two affected classes in use for several years, I wonder
> if the proposed change could get some support?

Sounds reasonable to me. Open a Jira, provide the patch and someone
should take a look.

> In all those years we were quite happy with BCEL. Unfortunately, we
> have to make a hard decision pretty soon. From what I saw on this list,
> I'm not sure, if staying with BCEL is viable.

Only you can make that choice.

Mark


> 
> Can anyone comment?
> TIA,
> Stephan
> -- 
> https://projects.eclipse.org/users/stephan-herrmann
> 
> 
> [1] http://www.eclipse.org/objectteams
> [2] http://www.eclipse.org/orbit
> [3] https://issues.apache.org/jira/browse/BCEL-267
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 


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



Re: [POOL2] Pooling mutable objects

2015-02-09 Thread Mark Thomas
On 09/02/2015 18:47, Adrian Crum wrote:
 I have been reading this thread for days, and I am confused.
 
 I might be wrong, but it seems to me the discussion started with a
 simple problem - an object borrowed from an object pool could not be
 returned to the pool because the object's hash value changed.
 
 Now the discussion seems to be about how to create the proper hash
 function so the object can be returned to the pool successfully.
 
 In other words, object A can be borrowed from the pool, and object B can
 be returned to the pool (instead of object A) - as long as object A and
 object B both return the same hash value.
 
 Does that make sense? Is that what you really want?
 
 It seems to me the object being returned to the pool should be the same
 object that was borrowed from the pool. A simple equality check (this
 object == that object) would do that.
 
 What am I missing?

That a scalable solution is required when there are 10s or 100s of
thousands of objects currently borrowed and we need to work out which
one of those is currently being returned.

Mark



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



Re: [daemon] Unable to read tomcat.pid file created by Tomcat process

2014-11-11 Thread Mark Thomas
On 11/11/2014 16:47, Gary Gregory wrote:
 Sorry, I meant what version of Commons Daemon.

It is the latest release. 1.0.15.

Mark

 
 Gary
 
 On Tue, Nov 11, 2014 at 11:37 AM, Anil Ambati aamb...@us.ibm.com wrote:
 
 I am using Apache Tomcat 7.0.56. I think that is the latest.

 Regards,
   --
   *Anilkumar Ambati*  4205 S Miami Blvd
  WebSphere Virtual Enterprise Development  Durham, 27703-9141 Phone:
 +1-919-254-6152  USA Mobile: +1-919-434-5674e-mail: aamb...@us.ibm.com

 --
 You have no responsibility to live up to what other people think you
 ought to accomplish. -Richard Feynman (1918-1988)



  From: Gary Gregory garydgreg...@gmail.com To: Commons Users List 
 user@commons.apache.org,  Date: 11/11/2014 10:18 AM Subject: Re:
 [daemon] Unable to read tomcat.pid file created by Tomcat process
 --



 So which version of [daemon] are you using? Can you try the latest and
 greatest. It might not matter but it'll make debugging easier for anyone on
 this ML.

 Gary

 On Tue, Nov 11, 2014 at 10:06 AM, Anil Ambati aamb...@us.ibm.com wrote:

 I was asked to post this question in this forum.

 We have a requirement to read the PID file created by the Tomcat server
 process on Windows, but we are not able to using RandomAccessFile or
 FileInputStream because the file seems to be
 locked by the Tomcat process.

 Why does the Tomcat server keep the PID file locked, preventing other
 processes to even read the file? Is there a work around or solution for
 this problem?


 Christopher Schultz wrote this in Tomcat user forum:
 
 I took a quick look, and it looks like the PID file is being created
 with a file option FILE_FLAG_DELETE_ON_CLOSE which causes the OS to
 delete the file off the disk when all file handles are closed. So,
 closing the file handle will result in the PID file being deleted.

 This option was added because the PID file wasn't being removed if the
 service crashed, which kept the service from restarting (oops).

 https://issues.apache.org/jira/browse/DAEMON-183

 It seems like an option to control what happens on startup when the
 PID file already exists would be a good idea. You'll have to ask the
 procrun folks about what the options are. It seems reasonable to be
 able to read the PID file, since not being able to read it makes it
 kind of useless other than as a lock-file (i.e. its contents are
 irrelevant).


 Regards,
   --
   *Anilkumar Ambati*  4205 S Miami Blvd
  WebSphere Virtual Enterprise Development  Durham, 27703-9141 Phone:
 +1-919-254-6152  USA Mobile: +1-919-434-5674e-mail:
 aamb...@us.ibm.com

 --
 You have no responsibility to live up to what other people think you
 ought to accomplish. -Richard Feynman (1918-1988)




 --
 E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
 Java Persistence with Hibernate, Second Edition
 http://www.manning.com/bauer3/
 JUnit in Action, Second Edition http://www.manning.com/tahchiev/
 Spring Batch in Action http://www.manning.com/templier/
 Blog: http://garygregory.wordpress.com
 Home: http://garygregory.com/
 Tweet! http://twitter.com/GaryGregory



 
 


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



Re: [OT] - Can anyone add me to the Shiro mailing list?

2014-09-10 Thread Mark Thomas
On 10/09/2014 22:33, Konrad Zuse wrote:
 I tried joining the Shiro mailing list a few weeks ago and I couldn't.  I 
 replied to this one exactly the same and got a confirmation.  Every time I 
 tried to confirm with the Shiro mailing list, nothing.
 
 After I subscribed to this one, I tried it again, and nothing.
 
 Apparently my shiro user posts from the forum are making it to the mailing 
 list, but I am not getting mail sent to this email.

Forum? Are you posting to user@shiro.a.o via some mechanism other than
e-mailing the list directly?

I've checked and you are subscribed to the allow list which means you
can post but you won't receive e-mail.

 I tried to send the mail to the correct subscription, I tried to confirm 
 multiple times through multiple channels, and nothing.

I wonder if the fact you are subscribed to the allow list means the
normal subscription fails.

 There was something for contacting the owner of the user-group, but I 
 didn't get an email either.

Without knowing which e-mail address you sent that to, I can't comment.

 Sorry to bother everyone, I just figured that someone on here might have 
 access to it.

In this case, someone does but that is more luck than anything else.

Generally, the route to follow is:
- subscribe using the automated address
- if that doesn't work try again and make sure you send plain text email
- if that doesn't work contact the list owners (a.k.a moderators)
- if the moderators don't reply, contact the ASF infra team

I'm on the infra team so I can help you in this instance.

I've removed you from the user-allow list and subscribed you to the user
list. Enjoy the extra e-mail in your inbox :)

Mark


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



Re: [OT] - Can anyone add me to the Shiro mailing list?

2014-09-10 Thread Mark Thomas
On 10/09/2014 22:56, Konrad Zuse wrote:
 Forum? Are you posting to user@shiro.a.o via some mechanism other than
 e-mailing the list directly?
 
 shiro-user.582556.n2.nabble.com is the forum I am referring to, as I said I 
 couldn't get on the mailing list, so this is the next best thing.

I suspected you were using Nabble.

 I've checked and you are subscribed to the allow list which means you
 can post but you won't receive e-mail.
 
 Weird, is there is a reason why I cannot receive the emails?

That is how the allow group works. If you are in the allow group you can
post to the list but you don't receive e-mails. It is intended for
things like folks who post from multiple addresses but only want to get
one copy of the emails from the mailing list.

 I wonder if the fact you are subscribed to the allow list means the
 normal subscription fails.
 
 Not too sure, I tried everything that I could on the list, and nothing, so I 
 gave up for awhile until I was subscribed to this very simply.  After the 
 confirmation email I got a welcome subscribed email to Commons which I did 
 not to Shiro.

Strange.

 Without knowing which e-mail address you sent that to, I can't comment.
 
 It was one of the list owners emails, I could go find it if needed, but it's 
 in that list somewhere.

No matter.

 In this case, someone does but that is more luck than anything else.
 
 I figured I could count on you :).
 
 Generally, the route to follow is:
 - subscribe using the automated address
 - if that doesn't work try again and make sure you send plain text email
 - if that doesn't work contact the list owners (a.k.a moderators)
 - if the moderators don't reply, contact the ASF infra team
 
 I tried replying with the reply button, then I tried to email the exact link 
 they gave me about 3x, both plain text and reply.  I tried to contact the 
 list owners, nothing.
 
 How do I contact the ASF Intra Team is there a special email you could give 
 me for that in case I need it in the future?

http://www.apache.org/dev/infra-contact

 I'm on the infra team so I can help you in this instance.
 
 Thanks for your time and help I appreciate it greatly!
 
 I've removed you from the user-allow list and subscribed you to the user
 list. Enjoy the extra e-mail in your inbox :)

 Mark
 
 What's the difference between the allow and the regular list?

See above.

Cheers,

Mark


 I hope that if this is an issue as you mentioned above this seemed weird, 
 that it is hopefully fixed for others! :).
 
 Thanks again for everything Mark, and everyone else who tried to help me.
 
 Have a great day.
 
 
 Date: Wed, 10 Sep 2014 22:47:46 +0100
 From: ma...@apache.org
 To: user@commons.apache.org
 Subject: Re: [OT] - Can anyone add me to the Shiro mailing list?

 On 10/09/2014 22:33, Konrad Zuse wrote:
 I tried joining the Shiro mailing list a few weeks ago and I couldn't.  I 
 replied to this one exactly the same and got a confirmation.  Every time I 
 tried to confirm with the Shiro mailing list, nothing.

 After I subscribed to this one, I tried it again, and nothing.

 Apparently my shiro user posts from the forum are making it to the mailing 
 list, but I am not getting mail sent to this email.

 

 

 I tried to send the mail to the correct subscription, I tried to confirm 
 multiple times through multiple channels, and nothing.

 

 There was something for contacting the owner of the user-group, but I 
 didn't get an email either.

 Without knowing which e-mail address you sent that to, I can't comment.

 Sorry to bother everyone, I just figured that someone on here might have 
 access to it.

 In this case, someone does but that is more luck than anything else.

 Generally, the route to follow is:
 - subscribe using the automated address
 - if that doesn't work try again and make sure you send plain text email
 - if that doesn't work contact the list owners (a.k.a moderators)
 - if the moderators don't reply, contact the ASF infra team

 I'm on the infra team so I can help you in this instance.

 I've removed you from the user-allow list and subscribed you to the user
 list. Enjoy the extra e-mail in your inbox :)

 Mark


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

 
 


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



[OT] Re: [fileupload] - Question about uploading additional files other than the ones in the form?

2014-09-08 Thread Mark Thomas
On 08/09/2014 18:06, Dave Newton wrote:
 On Sun, Sep 7, 2014 at 12:55 PM, Mark Thomas ma...@apache.org wrote:
 
 [...] banned from the Tomcat users mailing list [...]
 
 
 Is there official Apache precedence for this? I tried that on the S2 list
 and it didn't take.

Technically, unsub them from user@ and sub them to user-deny@. If that
doesn't work, contact infra.

There isn't an official position on how to handle this sort of issue as
far as I know. It is left to the community to decide.

I've seen it happen a few times. In each case the banned person ignored
repeated requests both privately and publicly to correct their
behaviour, they were warned would would happen if they continued, they
continued so the community banned them.

In theory you could have a moderator get all dictatorial and start
banning people for trivial stuff. In that case I'd expect the community
to step in and deal with the moderator.

Unless the community got very disfunctional, I don't see the board
getting involved at all. I will say in all the cases I am aware of the
project did include a note in their next board report as it was viewed
as an unusual enough action to highlight to the board. The board
response in all cases was Fine. Carry on.

If you have a determined troll then blocking them from the mailing list
is unlikely to be effective. On the other hand, blocking an idiot takes
less effort than creating a new e-mail account and subscribing to the
mailing list so that is a game I'm happy to play if necessary.

HTH,

Mark


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



Re: [fileupload] - Question about uploading additional files other than the ones in the form?

2014-09-07 Thread Mark Thomas
On 06/09/2014 20:29, Konrad Zuse wrote:
 I'm not sure you understood my question correctly, because I have no idea 
 what your answer is supposed to be.

Konrad,

I think you hit the nail on the head. For background Martin has already
got himself banned from the Tomcat users mailing list for posting
responses with little or no relevance the question being asked, refusing
to accept there was anything wrong with his responses and refusing to
take on board the feedback he was given both privately and publicly on
how to make his responses more useful.

 Lets try this again.

My personal recommendation is to configure a procmailrc rule that routes
any mail from Martin to /dev/null.

Mark


 
 I have an web app that uses Apache Commons FileUpload to upload files.  I am 
 using the streaming api to stream files up, and then save them to my server.  
 This has nothing to do with my war file, or application files, this has to do 
 with user submitted files that they themselves will be using on.
 
 I haven't exactly done the saving, but I know I can save it to my own 
 filesystem, so I don't think there should be much of a problem saving it to 
 my server.
 
 
 What I am asking is this.
 
 The FileUpload uses a multipart form which is how the data is sent.
 
 
 form method=POST enctype=multipart/form-data action=fup.cgi
   File to upload: input type=file name=upfilebr/
   Notes about the file: input type=text name=notebr/
   br/
   input type=submit value=Press to upload the file!
 /form
 With this I will select multiple files for upload.
 
 The issue is, I am upload a file, that contains additional data for files to 
 be uploaded.  Lets call this file A.  File A has to be read in order to 
 upload additional files which are images.
 
 So when we look at this.
 
 // Check that we have a file upload request
 boolean isMultipart = ServletFileUpload.isMultipartContent(request);// Create 
 a new file upload handler
 ServletFileUpload upload = new ServletFileUpload();
 
 // Parse the request
 FileItemIterator iter = upload.getItemIterator(request);
 while (iter.hasNext()) {
 FileItemStream item = iter.next();
 String name = item.getFieldName();
 InputStream stream = item.openStream();
 We see that the data for the file to be uploaded was sent over through a 
 request.
 
 My question is basically I want to be able to add additional data to that 
 request, but I am not adding it myself.  Once I submit a file through the 
 form, I want to be able to submit more data, and how I do that is my 
 question.  I want to know what exactly is FileUpload doing to grab the images 
 and parse them into the Input Stream?  What exactly is the multipart/data 
 form doing to make this happened, that is what I'm really looking for.  I 
 will go look over the SRC, but I figured I would ask here.
 
 
 As I mentioned before I have a few options that I thought of.
 
 
 1.  Red the data mid stream, and then upload the file(how do I upload)?
 2.  Save the file then upload.
 
 
 A.  Use a Servlet to fake a form and pass the data to itself?
 
 
 So again, user selects file, I read file, then select other files from their 
 system that are needed for the first file, and upload them all up at the same 
 time.
 
 Thanks!
 
 From: mgai...@hotmail.com
 To: user@commons.apache.org
 Subject: RE: [fileupload] - Question about uploading additional files other 
 than the ones in the form?
 Date: Sat, 6 Sep 2014 11:44:46 -0400

 Morning Konradthe htp/file/ftpuploader will need to have apriori knowledge 
  of both:location of Main distro usually 'baseDir'
 location of ancillary files..pics, classes, sources, html,css

 This is the reason why you will never see an apache server provisioning 
 individual files(except for SVN/GIT) source ctl

 package ALL files(resource/source/classes/README/doc/etc) up into a jar and 
 drop the jar into basedir and let your customers figure out how to 
 untar/unzip/unjar the filehttp://maven.apache.org/plugins/maven-jar-plugin/
 lets pickup this thread on us...@maven.apache.org
 HTH
 Martin-


 From: thekonradz...@hotmail.com
 To: user@commons.apache.org
 Subject: [fileupload] - Question about uploading additional files other 
 than the ones in the form?
 Date: Fri, 5 Sep 2014 20:05:03 -0400

 Hello all,

 I am basically uploading a file to my server, but within that file contains 
 path information to images that also need to be uploaded.  I am looking to 
 read the file mid stream and get the data for the images to upload.  It 
 seems I am able to do this, but if this is not possible will I be able save 
 the file, read it, and then be able to get these images?

 I am curious about how I will go about grabbing the additional files?  I 
 see that streaming works with InputStream from JavaIO as well as something 
 from CommonsIO, so I figured I could configure something to work with the 
 fileupload stream.

 I also thought that I could possibly try to create a form through my 
 servlet and pass the data through 

Re: [dbcp] How to create replication aware connection pool ?

2014-08-06 Thread Mark Thomas
On 06/08/2014 01:34, Parth Patil wrote:
 Hi Friends,
 I am using DBCP2 in my project and I am pleased with the performance of the
 library. Though I am only able to provide a single mysql host in the
 connection string. What do I need to do inorder to make the DBCP connection
 pool replication aware ?

Write some code :). DBCP 2 is not replication aware. There was an
enhancement request for this [1] but I resolved it as WONTFIX on the
bases that:
quote
...generally, failover requires some form of database replication and
databases that provide that tend to provide JDBC drivers that support
failover as well.
/quote

 I am going to use 1 master and 2 slaves in my
 setup. Am I correct in assuming that its possible to create connection pool
 over several mysql hosts ?

No, you are not correct.

 I tried to use the replication aware mysql jdbc driver
 (com.mysql.jdbc.ReplicationDriver)

That is the correct way to do this.

 but that doesn't seem to work and I am
 getting an exception. Following is my test code

snip/

 Following is the exception that I am getting :
 
 [error] (run-main-0) java.lang.AbstractMethodError:
 com.mysql.jdbc.ReplicationConnection.isValid(I)Z

snip/

DBCP2 uses JDBC4 (Java 1.6) and that is a new method introduced in that
release.

You can avoid the call to that method by setting a validation query for
your connection pool. For MySQL the following should work:
/* ping */ SELECT 1


Mark

[1] https://issues.apache.org/jira/browse/DBCP-393

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



[ANNOUNCEMENT] Apache Commons DBCP 2.0 released

2014-03-04 Thread Mark Thomas
The Apache Commons Team is pleased to announce the release of Apache
Commons DBCP 2.0.

The Apache Commons DBCP open source software library provides Database
Connection Pooling.

DBCP 2.x is based on Commons Pool 2 and provides increased performance,
JMX support as well as numerous other new features compared to DBCP 1.x.
Users upgrading to 2.x should be aware that the Java package name has
changed, as well as the Maven co-ordinates, since DBCP 2.x is not binary
compatible with DBCP 1.x. Users should also be aware that some
configuration options have been renamed (e.g. maxActive to maxTotal) to
align them with the new names used by Commons Pool 2.

Source and binary distributions are available for download from the
Apache Commons download site:
  http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi

When downloading, please verify signatures using the KEYS file available
at the above location when downloading the release.

Full details of all the changes in 2.0 can be found in the changelog:
  http://commons.apache.org/proper/commons-dbcp/changes-report.html

For complete information on Commons DBCP, including instructions on how
to submit bug reports, patches, or suggestions for improvement, see the
Apache Commons DBCP website:

http://commons.apache.org/proper/commons-dbcp/

Mark Thomas, on behalf of the Apache Commons community

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



Re: commons-fileupload 1.3.1 maven release

2014-02-19 Thread Mark Thomas
On 19/02/2014 16:07, Zheng, Xiahong wrote:
 Hi,
 
 We are looking to mitigate CVE-2014-0050 provided by 1.3.1. The release can 
 be downloaded but not available in public Maven repo. When will it be pushed 
 to Maven central?

It was published to Maven central at the same time it was released -
almost 2 weeks ago. I've just checked and it is available in Maven Central.

Mark


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



[ANNOUNCE][SECURITY] Apache Commons FileUpload 1.3.1 released

2014-02-07 Thread Mark Thomas
The Apache Commons Team is pleased to announce the release of Apache
Commons FileUpload 1.3.1.

The Apache Commons FileUpload software library makes it easy to add
robust, high-performance, file upload capability to your servlets and
web applications.

The release is primarily a security release to address CVE-2014-0050, a
denial of service vulnerability in all previous releases.

Source and binary distributions are available for download from the
Apache Commons download site:

http://commons.apache.org/proper/commons-fileupload/download_fileupload.cgi

When downloading, please verify signatures using the KEYS file available
at the above location when downloading the release.

Full details of all the changes in 1.3.1 can be found in the changelog:
  http://commons.apache.org/proper/commons-fileupload/changes-report.html


For complete information on Commons FileUpload, including instructions
on how to submit bug reports, patches, or suggestions for improvement,
see the Apache Commons FileUpload website:

http://commons.apache.org/proper/commons-fileupload/

Mark Thomas, on behalf of the Apache Commons community

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



[SECURITY] CVE-2014-0050 Apache Commons FileUpload and Apache Tomcat DoS

2014-02-06 Thread Mark Thomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

CVE-2014-0050 Apache Commons FileUpload and Apache Tomcat DoS

Severity: Important

Vendor: The Apache Software Foundation

Versions Affected:
- - Commons FileUpload 1.0 to 1.3
- - Apache Tomcat 8.0.0-RC1 to 8.0.1
- - Apache Tomcat 7.0.0 to 7.0.50
- - Apache Tomcat 6 and earlier are not affected

Apache Tomcat 7 and Apache Tomcat 8 use a packaged renamed copy of
Apache Commons FileUpload to implement the requirement of the Servlet
3.0 and later specifications to support the processing of
mime-multipart requests. Tomcat 7 and 8 are therefore affected by this
issue. While Tomcat 6 uses Commons FileUpload as part of the Manager
application, access to that functionality is limited to authenticated
administrators.

Description:
It is possible to craft a malformed Content-Type header for a
multipart request that causes Apache Commons FileUpload to enter an
infinite loop. A malicious user could, therefore, craft a malformed
request that triggered a denial of service.
This issue was reported responsibly to the Apache Software Foundation
via JPCERT but an error in addressing an e-mail led to the unintended
early disclosure of this issue[1].

Mitigation:
Users of affected versions should apply one of the following mitigations
- - Upgrade to Apache Commons FileUpload 1.3.1 or later once released
- - Upgrade to Apache Tomcat 8.0.2 or later once released
- - Upgrade to Apache Tomcat 7.0.51 or later once released
- - Apply the appropriate patch
  - Commons FileUpload: http://svn.apache.org/r1565143
  - Tomcat 8: http://svn.apache.org/r1565163
  - Tomcat 7: http://svn.apache.org/r1565169
- - Limit the size of the Content-Type header to less than 4091 bytes

Credit:
This issue was reported to the Apache Software Foundation via JPCERT.

References:
[1] http://markmail.org/message/kpfl7ax4el2owb3o
[2] http://tomcat.apache.org/security-8.html
[3] http://tomcat.apache.org/security-7.html
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJS83P8AAoJEBDAHFovYFnnbOwP/0m80St7x63n6VCiR0aGuGLz
/J004spHfbc+vtg2RumObBTX6mSfvPgO2R4FzE17Etg8QtWreoxb7kjnVXUwjdMX
nb3Yt6IY1yBW1K+YcZRziOQXkRnnjnpC7Lh2o5eqpJ1S7wpXl5PBIXYSxMAsJCuv
axFA0aq5cc17uDAH1z6DPk4149oZz2lHdlBUTTkCh/0PrvcIFxwpej75gUfyaV0y
DGZLs3IpRYcJMS131q72DUt9wBsIqJN0mqUOq2svBS3mlXBcKDjy21b8QiEr8itK
UqwsYUtOZP4nZ4u8j6euxF2fC/ivm/930OGOl9pn2SbkoHJKm/4rz2GYDA9jq07K
XEDeGdTx3ZuDaTaBER8xquETRZ/Rb8dbBxQwzmo6doJNOjsMQFlR+1F+p56AhYd0
klbT6Q7i/Ic3BdRJkUpaYshhtXeAOnH+0u9j4kRXMgJbkMgOacopomFX6HoXr9/i
RHGbwwSZViLooR88Yg0FU2230+9mJLXxaJ6usHrtq4dS9ElSV320OCyisNjMX5hi
5SFYMSy+z0nsK2O6yCzlukztoFhvaNecvy3I8w5EKytweyFlPzxXn6QpQjG+ffb5
ql7TZRrApiaewp4crzBcZSAjDzRNiQpcI2xTTN/H9u/yk8lrhOULi4pljKCudvmM
eIWblFdpoPVl0iqvsXA9
=uzLf
-END PGP SIGNATURE-

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



Re: [fileupload] CVE-2013-2186

2013-11-18 Thread Mark Thomas
On 18/11/2013 17:21, Albrecht Scheidig wrote:
 Hi there, I have not found any issues in JIRA regarding 
 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2186
 Should not this get fixed in fileupload?

No.

This vulnerability requires that an application accepts data from a
client and then, without validating it, de-serializes it. That is
equivalent to using untrusted, unvalidated client input to build an SQL
statement (SQL injection) or using untrusted, unvalidated client input
to generate an HTML response (XSS). The vulnerability is, therefore, an
application vulnerability not a Commons FileUpload vulnerability.

There are some things we could do to mitigate this application
vulnerability in FileUpload. One possible change would be to
automatically generate a new temporary filename on deserialization. This
actually has advantages for the real use case of deserialization which
is migrating objects in an HTTP session between JVMs since it better
handles the case where the JVMs have different temporary locations. As
always, patches welcome.

Aside: Validating data before deserializing it is hard. However, just
because it is hard, it doesn't shift the responsibility for doing it.

Mark

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



[ANNOUNCE] Apache Commons Pool 2.0 released

2013-11-11 Thread Mark Thomas
The Apache Commons Team is pleased to announce the release of Apache
Commons Pool 2.0.

The Apache Commons Pool open source software library provides an
object-pooling API and a number of object pool implementations.

Version 2 of Apache Commons Pool contains a completely re-written
pooling implementation compared to the 1.x series. In addition to
significant performance and scalability improvements - particularly
under highly concurrent loads, version 2 includes robust instance
tracking and pool monitoring. Version 2 requires JDK level 1.6 or above.


Source and binary distributions are available for download from the
Apache Commons download site:
  http://commons.apache.org/proper/commons-pool/download_pool.cgi

When downloading, please verify signatures using the KEYS file available
at the above location when downloading the release.


Version 2.0 is not backwards compatible with earlier releases. There
have been numerous API changes to support new features as well as to
clarify behaviour and improve consistency across the API. Therefore, to
support side-by-side usage of 2.x and earlier versions, the packaging of
version 2.0 has been changed to org.apache.commons.pool2.

Full details of all the changes in 2.0 can be found in the changelog:
  http://commons.apache.org/proper/commons-pool/changes-report.html


For complete information on Commons Pool, including instructions
on how to submit bug reports, patches, or suggestions for improvement,
see the Apache Commons Pool website:

http://commons.apache.org/proper/commons-pool/

Mark Thomas, on behalf of the Apache Commons community

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



Re: [dbcp] memory leak: org.apache.commons.pool.impl.CursorableLinkedList$Listable

2013-10-22 Thread Mark Thomas
On 22/10/2013 09:27, Andrea Bosio wrote:
 Hello all,
 
 I have an application running on Tomcat, with dbcp 1.4, which shows an
 abnormal memory usage.
 Heap memory usage grows without releasing.
 
 Analyizing an heap dump with Eclipse Memory Analyzer, I find some strange
 objects instances of
 class org.apache.commons.pool.impl.CursorableLinkedList$Listable
 
 A few objects (10) occupy a large amount of memory (50Mb or so).

That looks perfectly normal if a connection object takes around 5Mb.
That does seem a little large for a connection but you'd need to dig
into exactly what was taking up all that space. Depending on the
configured caches that could be fine too.

 Then I have a big number of objects (10.000) each one occupying small
 amount of memory (less than 10kb).

What is retaining the references to these objects?

 I think that both situations are strange.

Nothing reported so far looks strange.

 Do you have any suggestion?

Do more research.

Mark


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



Re: commons pool benchmark issue

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

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

Pool 2 was designed to address those performance issues.

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

Mark

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



Re: commons pool benchmark issue

2013-09-30 Thread Mark Thomas
On 30/09/2013 08:58, Daniel Wu wrote:
 Hi Thomas,
 
 Thanks a lot. For now, I have to use my own implementation which is 50 times 
 faster than CP but lack of many features from CP. 
 Looking forward to CP 2.x release, and I don't like invent my own wheels.

You can get a Pool 2.x snapshot release from here to test with.

https://repository.apache.org/content/groups/snapshots/org/apache/commons/commons-pool2/2.0-SNAPSHOT/

Mark


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



Re: Apache Commons Pool performance issue

2013-09-05 Thread Mark Thomas
On 05/09/2013 17:15, Phil Steitz wrote:
 What version of [pool] are you running?

The code stack trace matches up with Pool 1.3 configured with
WHEN_EXHAUSTED_BLOCK

Hence the behaviour.

There are two issues here:
- one the configuration isn't doing what you think it is which is a
question for a Spring forum
- you are using an old version of pool with many known issues - you need
to upgrade.

Mark


 
 Phil
 
 On 9/5/13 9:08 AM, Programmer wrote:
 Hi,

 We use Spring LDAP for LDAP connection pooling in our application. Spring
 LDAP in turn uses apache commons pool API for managing its connection pool. 

 On testing our application for performance, we find stuck threads at our
 weblogic thread dump. It appears that when the connection pool is exhausted
 and request for new connection objects are not rejected by apache commons
 with a NoSuchElement exception.

 Please advise on the problem

 *
 Here is our connection pool configuration:*

 /bean id=contextSource
 class=org.springframework.ldap.pool.factory.PoolingContextSource
   property name=contextSource ref=contextSourceTarget / 
   property name=dirContextValidator ref=dirContextValidator / 
   property name=testOnBorrow value=true / 
   property name=testWhileIdle value=true / 
   property name=maxActive value=10 / 
 - property name=whenExhaustedAction
   ref
 bean=org.apache.commons.pool.impl.GenericObjectPool.WHEN_EXHAUSTED_FAIL / 
   /property
   /bean/

 *
 Here is the weblogic thread dump:*

  [ACTIVE] ExecuteThread: '34' for queue: 'weblogic.kernel.Default
 (self-tuning)' waiting for lock
 org.apache.commons.pool.impl.GenericKeyedObjectPool@6e812376 WAITING
   
  java.lang.Object.wait(Native Method)
   
  java.lang.Object.wait(Object.java:485)
   
 
 org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:812)
   
 
 org.springframework.ldap.pool.factory.PoolingContextSource.getContext(PoolingContextSource.java:422)
   
 
 org.springframework.ldap.pool.factory.PoolingContextSource.getReadOnlyContext(PoolingContextSource.java:401)
   
 
 org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:287)
   
 
 org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:237)
   
 
 org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:624)
   
 
 org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:535)
   
 
 org.springframework.ldap.odm.core.impl.OdmManagerImpl.search(OdmManagerImpl.java:246)
   
 
 com.rogers.yyy.servicebean.BaseServiceBean.queryDO(BaseServiceBean.java:148)
   
 
 com.rogers.yyy.servicebean.OdmRoleServiceBean.queryRolXXXorDN(OdmRoleServiceBean.java:43)
   
 
 com.rogers.yyy.ruleengine.RuleEngineManagerImpl.testoperation(RuleEngineManagerImpl.java:560)
   
  sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source)
   
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   
  java.lang.reflect.Method.invoke(Method.java:597)
   
 
 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
   
 
 org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   
 
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   
 
 org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
   
 
 com.rogers.yyy.aspects.LoggerAspect.profile(LoggerAspect.java:45)
   
  sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
   
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   
  java.lang.reflect.Method.invoke(Method.java:597)
   
 
 org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
   
 
 org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
   
 
 org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
   
 
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   
 
 org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
   
 
 

Re: Apache Commons Pool performance issue

2013-09-05 Thread Mark Thomas
On 05/09/2013 17:58, Programmer wrote:
 Thanks for the reply guys.
 
 I use 1.6 JAR in my classpath. Is there anyway I can verify the 'when
 exhausted action' at run time?

The stack trace reported is definitely not Pool 1.6. It is a perfect
match for Pool 1.3.

A profiler like YourKit would let you look at the objects on the heap
and confirm the value of whenExhaustedAction. I can't think of an easier
way to do it.

Mark


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



Re: [fileupload] How to prevent file upload ddos ?

2013-08-21 Thread Mark Thomas
On 21/08/2013 20:21, Albert Kam wrote:
 My assumption here is that file upload will validate the maximum number of
 files after all files have been received and parsed.
 And if that's the case, how to avoid hundreds of large file uploads that
 can bring the system down ?
 
 I am currently using tomcat 7.0.x here, and the latest version
 commons-fileupload.

Your assumption is incorrect.

Mark



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



[SECURITY] CVE-2013-0248 Apache Commons FileUpload - Insecure examples

2013-03-06 Thread Mark Thomas
CVE-2013-0248 Apache Commons FileUpload - Insecure examples

Severity: Low

Vendor: The Apache Software Foundation

Versions Affected:
- Commons FileUpload 1.0 to 1.2.2

Description:
Commons FileUpload provides file upload capability for Servlets and web
applications. During the upload process, FileUpload may (depending on
configuration) save the uploaded file temporarily on disk. By default
this will be in the system wide tmp directory. Because the temporary
files have predictable file names and are stored in a publicly writeable
location they are vulnerable to a TOCTOU attack.

A successful attack requires that the attacker has write access to the
tmp directory. The attack can be prevented by setting the repository to
a non-publicly writeable location.

The documentation for FileUpload does not highlight the potential
security implications of not setting a repository, nor do the provided
examples set a repository. This may have caused users to use FileUpload
in an insecure manner.

Mitigation:
Setting the repository to a non-publicly writeable location such as that
defined by the ServletContext attribute javax.servlet.context.tempdir
will prevent the TOCTOU attack.

Credit:
This issue was identified by Karl Dyszynski and Hugo Vazquez Carames of
SonicWall

References:
[1] http://commons.apache.org/fileupload/

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



Re: commons-daemon.1.0.11 linux binaries

2013-02-01 Thread Mark Thomas
On 31/01/2013 23:23, Suresh Srinivas wrote:
 Ping. Any comments?

Only Windows binaries are provided. You have to build them yourself for
all other platforms.

Mark

 
 
 On Wed, Jan 30, 2013 at 3:19 PM, Suresh Srinivas 
 sur...@hortonworks.comwrote:
 
 In earlier releases (I see it from 1.0.0 to 1.0.5), the native binaries
 for a specific OS was available in archives. For example -
 http://archive.apache.org/dist/commons/daemon/binaries/1.0.5/linux/

 It is no longer available post 1.0.6. Is there a similar download URL for
 linux for release 1.0.11?

 Regards,
 Suresh

 
 
 


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



Re: Licensing questions

2012-09-12 Thread Mark Thomas
On 12/09/2012 21:04, Radel, Ted wrote:
 We have a business requirement to support SFTP and FTPS transfers.
 From looking at Commons, it would appear we would need Net, Logging,
 and VFS components.
 
 Is the standard software license for Net, Logging, and VFS free for
 use in business/commercial/corporate environment?

All software developed by the Apache Software Foundation (ASF) is
provided at zero cost under the Apache License version 2. [1]

It is up to you to determine if that license meets your needs (I would
be surprised if it didn't but that is not my call to make).

 Also is it
 possible to purchase a commercial license for the three products and
 how much would it cost?

See above. The ASF does not sell licenses to use its software.

Support is available for these products via this users mailing list
although there are no guarantees as to the quality of the advice
provided nor are there any guarantees regarding response time.

Numerous third parties do sell support for ASF software. I do not know
off-hand who sells support for the products you are interested in.

HTH,

Mark

[1] http://www.apache.org/licenses/LICENSE-2.0


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



Re: [dbcp] prepared statement caching when connections are closed but connection pool still has connection

2012-07-27 Thread Mark Thomas
On 25/07/2012 15:01, Amish Shah wrote:
 
 Does the DBCP support prepared statement caching in the following condition
 1) connection is opened from connection pool
 2) Prepared statement are used
 3) Connection is closed but returned to connection pool
 
 If we reuse the connection from the connection pool is there a way the
 prepared statement from step #2,
 could be used without parsing again.
 
 
 What I am seeing is that prepared statement are being parsed again?
 We are using version of DBCP 1.2.1
 
 Any help/response would be good.

I took a quick look at the source code. The DBCP code is a bit of a maze
and I'd need to test it to be sure but I think the statement cache is
retained while the connection is checked out but cleared when the
connection is returned. I suspect you'll be able to check this faster
than I can.

Mark


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



Re: unsubscribe failure - 552 spam score (7.2) exceeded threshold

2012-06-27 Thread Mark Thomas
On 27/06/2012 09:49, Brendan Crowley wrote:
 Hi,
 
  
 
 I'm trying to unsubscribe to this list, but get the following failure:
 
 Hi. This is the qmail-send program at vps--283.cp.blacknight.com.
 
 I'm afraid I wasn't able to deliver your message to the following addresses.
 
 This is a permanent error; I've given up. Sorry it didn't work out.
 
  
 
 user-requ...@commons.apache.org:
 
 192.87.106.230 failed after I sent the message.
 
 Remote host said: 552 spam score (7.2) exceeded threshold
 (DCC_CHECK,HTML_MESSAGE,MIME_HTML_MOSTLY,MSGID_MULTIPLE_AT,SPF_PASS
 
 Please help?

Don't use HTML formatted e-mail.

Mark

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



Re: [pool] Does borrowObject block?

2012-05-05 Thread Mark Thomas
On 04/05/2012 23:25, Gautam Bakshi wrote:
 Thanks for the answer Miroslav.  This brings up a few other questions to
 me, mainly can I extend the life of a object in pool(these objects
 shouldn't be dying if there is work)?  Also, can I somehow specify a
 minimum limit of objects so I can have them match the number of threads I
 have(this way if the pool does get low the thread doesn't have to wait for
 it to be created)?

Hmm. A couple of points.

You are always going to see some blocking with a pooling implementation.
What you see with 1.5/1.6 is less then you'll see with 1.4 an earlier.
2.x (currently a work in progress) will have even less blocking.

If you each thread only uses one object at a time and you have a minimum
pool size equal to the number of threads why bother with a pool? Just
create an object when you create the thread and dedicate the object to
the thread.

Mark


 
 On Fri, May 4, 2012 at 5:41 PM, Miroslav Pokorny miroslav.poko...@gmail.com
 wrote:
 
 On Sat, May 5, 2012 at 12:07 AM, Gautam Bakshi gautam.bak...@gmail.com
 wrote:

 Hi Everyone,

 I'm trying to pool some objects and share them but I noticed blocking in
 the threads. I'm a bit new to Java so not sure if this is a problem with
 my
 lack of experience or something specific to pools. Here's some code that
 replicates the problem(Create 10 threads and share 20 objects, do this
 in a
 long loop so you can catch the blocking). If you profile it(Java visualvm
 or yourkit in the thread view), you'll notice that borrowObject seems to
 be
 blocking the thread. So the question is, is this normal behavior or am I
 doing something wrong? Is there any way I can get around it?

 Hi Gautum,

 What your describing is normal behaviour, after all if you ask the pool for
 an object and one is not available what else should it do. The best thing
 is to wait(block) until another thread returns a pooled item and then
 return with that. The reason for using pooling is typically the pooled
 objects are expensive or limited resources which is why your code does not
 simply create another one when it needs it, but rather waits its turn and
 then returns the pooled object when its used.

 hth

 mP

 


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



Re: [pool] comparison with other pool library

2012-03-03 Thread Mark Thomas
On 03/03/2012 18:32, Chris Vest wrote:
 Hey guys,
 
 I've written an object pool myself, and make a short comparison between it
 and commons-pool in my documentation, to help people choose between the two.
 It's here http://chrisvest.github.com/stormpot/ (under the why choose...
 headline)
 and some more here
 https://github.com/chrisvest/stormpot/blob/master/package-info.md (under
 the Introduction headline)
 
 Let me know if I've misrepresented commons-pool. I don't want to spread
 misinformation.

A few areas where your statements are not entirely accurate:

Thread safety:
- Commons Pool *is* thread safe.

APIs:
- There are two types of Pool hence two APIs (ObjectPool and
KeyedObjectPool). Each type has multiple implementations. Users are free
to use implementation specific methods *if they want to* but to suggest
that there are many implementations each with a different API is not
correct.

Performance:
Any numbers to back up the claim that Commons Pool is less performant?
It wouldn't surprise me on multi-core machines - that is after all one
of the primary goals of Commons Pool 2.

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



Re: [pool] Way to destroy all the objects in a pool

2012-01-20 Thread Mark Thomas
On 20/01/2012 20:19, Gary Gregory wrote:
 On Fri, Jan 20, 2012 at 1:59 PM, Sandeep More moresand...@gmail.com wrote:
 

 On Jan 20, 2012, at 12:43 PM, Gary Gregory garydgreg...@gmail.com wrote:

 On Jan 20, 2012, at 13:29, Sandeep More moresand...@gmail.com wrote:

 Thanks Gary,
 Sorry for not being clear with my question. You are right, clear()
 method
 calls the destroyObject() method but only for the objects sitting idle
 in
 the pool.

 What I want is a way to call destroyObject()  method on all the objects
 in
 the pool (including the active abjects).

 Do you mean the objects that have borrowed out of the pool?

 Yup !

 The pools
 do not track objects once they are borrowed out. The pools start
 tracking an object again once returned.

 I think this might change in 2.0...

 So, there is no way for a pool to call destroyObject() method on active
 objects currently right ?

 
 That's how I understand it. Anyone else?

Correct. In pool 1.x once an object leaves the pool, there is no way for
the pool to track that object.

In pool 2.x it will be possible to do this as active, idle and all
objects may be obtained from the pool.

One way to work around this in poll 1.x is to modify your object factory
to keep a reference to the objects it has created.

Mark

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



Re: [pool] Approximate release date for commons-pool2 (beta or RC)

2011-12-17 Thread Mark Thomas
On 17/12/2011 15:05, Andreas Maza wrote:
 Hi,
 
 is there any approximate date for a pool2 beta or RC release?

No date planned, but we are certainly moving closer at a reasonable
rate. If you'd like to see it move faster, please join the dev list and
take a look at the remaining open JIRA issues to see where you can help out.

Mark

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



Re: [daemon] 64 bit daemon for ActiveMQ 5.4

2011-11-03 Thread Mark Thomas
On 03/11/2011 20:58, Moshe Solomon wrote:
 I'm am trying to run ActiveMQ 5.4 on Intel XEON  e7450 2.4 GHz. I get an
 error The image file ... is valid, but is for machine type other than
 the current machine. I used the file
 .\commons-daemon-1.0.7-bin-windows\ia64\prunsrv.exe. My Java version is
 64 bit, so I can't use the 32bit wrapper that comes with ActiveMQ. Any
 insights?

That is the wrong 64-bit wrapper. You want the amd64 one.

Mark

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



Re: [daemon] running class with 32 bit JVM on AMD64 Windows machine

2011-06-23 Thread Mark Thomas
On 23/06/2011 11:50, philip.schw...@thomsonreuters.com wrote:
 Hi all,
  
 I need to use apache daemon to run Java class Foo on a 32-bit JVM that
 runs on an AMD64 Windows machine.

snip/

 Running the Win32 version of prunsrv.exe on an AMD64 Windows machine: 
 
 * Is this one of the intended usages of prunsrv.exe? 
 * Is the idea that on an AMD64 Windows machine, to run Foo on a
 32bit JVM I use the Win32 version of prunsrv.exe, whereas to run Foo on
 a 64bit JVM I use amd64\prunsrv.exe?

The version of prunsrv.exe you use must match the JVM you are using. So,
32-bit JVM means 32-bit prunsrv.exe regardless of whether you are
running on 32-bit or 64-bit Windows.

Mark



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



Re: [NET] Fwd: [jira] Account username(s)

2011-03-20 Thread Mark Thomas
On 20/03/2011 18:32, Phil Steitz wrote:
 On 3/20/11 11:13 AM, Steve Cohen wrote:
 that username exists.  The system knows me yet doesn't know me.

 I would direct this at the administrator of the Jira itself, but I
 find that I cannot do that without logging on to the system, which
 I can't do.  Does anyone know who I must contact and how?
 
 Unless some more JIRA-foo endowed person has a better idea, I would
 just go ahead and create a new account for the username below and
 then one of us can add you to the Commons group.

I'll take a look. Expect a reply off-list shortly.

Mark

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



Re: [NET] Fwd: [jira] Account username(s)

2011-03-20 Thread Mark Thomas
On 20/03/2011 19:02, Mark Thomas wrote:
 On 20/03/2011 18:32, Phil Steitz wrote:
 On 3/20/11 11:13 AM, Steve Cohen wrote:
  that username exists.  The system knows me yet doesn't know me.

 I would direct this at the administrator of the Jira itself, but I
 find that I cannot do that without logging on to the system, which
 I can't do.  Does anyone know who I must contact and how?

 Unless some more JIRA-foo endowed person has a better idea, I would
 just go ahead and create a new account for the username below and
 then one of us can add you to the Commons group.

Password reset triggered. Added to commons-developers group.

Mark

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



Re: [daemon] what is the service wrapper replacement for Procrun and Jsvc?

2010-12-14 Thread Mark Thomas
On 13/12/2010 23:20, Trei, Roberta L wrote:
 I saw in the archives that Jsvc and Procrun are now deprecated.

Really? Where? Not to my knowledge.

Mark

 It
 suggested that a service wrapper class was now being used.  Is this
 class something that is provided within Apache Commons, or is it the
 Java Server Wrapper provided by tanukisoftware, or is it something else
 entirely?
 
 Regards,
 
 Robin Trei 
 CA 
 Director, Development 
 Infrastructure Management
 Tel: 508-628-8498 
 Con Call: 866-376-6162  974-3156-383
 email: roberta.t...@ca.com 
 
 
 


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



Re: [dbcp] Trying to replace Tomcat 5.5 dbcp with original dbcp

2010-11-26 Thread Mark Thomas
On 26/11/2010 08:59, Hildebrand, Nils, 232 wrote:
 I did the upgrade to 1.4 (and to
 commons-pool-1.5.5) -
 and as you suspeced - the error remains.
  
 Is there a short howto how to accomplish the task of exchanging the 
 Tomcat dbcp with a different version?
 Not that I recall. Plenty of places for you to create one 
 (Tomcat wiki, Commons wiki) once you have the steps figured out.
 
 What about the DBCP-FAQ?
 How can I add the procedure to it?

http://wiki.apache.org/commons/DBCP

It is a wiki so you can create an account and start editing. I'd suggest
a new page for this procedure linked from the FAQ.

 Now the next step is a downgrade to dbcp 1.2.x - do I have to downgrade
 commons-pool for that step, too?

You should be fine with pool 1.5.5 but there are a number of known
deadlock / sync / performance issues with DBCP 1.2.2 that using pool
1.5.5 won't completely eliminate.

Mark

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



Re: [dbcp] Trying to replace Tomcat 5.5 dbcp with original dbcp

2010-11-24 Thread Mark Thomas
On 24/11/2010 16:06, Hildebrand, Nils, 232 wrote:
 Hi,
 
 I am trying to track down a problem propably related to DBCP 1.3.
 
 For details see https://issues.apache.org/bugzilla/show_bug.cgi?id=50326
 
 To get further I need to replace dbcp 1.3 - as supplied with Tomcat
 5.5.30 or 5.5.31 with the original.

Don't waste your time. The code is identical just in a different
package. Using DBCP 1.3 directly isn't going to help.

 I a first step I would like to upgrade to dbcp 1.4 if then my error
 still persists, I will donwgrade to dbcp 1.2.x if then the error is gone
 I will open a bug report for dbcp.

That is worth doing although I'd be amazed if the upgrade to 1.4 helps
since apart from adding some JDBC4 methods, DBCP 1.3 and DBCP 1.4 are
identical.

 Is there a short howto how to accomplish the task of exchanging the
 Tomcat dbcp with a different version?
Not that I recall. Plenty of places for you to create one (Tomcat wiki,
Commons wiki) once you have the steps figured out.

 From what I until now know I presume:
 
 - change conf/server.xml DB-Resource-Secation factory attribute
Correct.
 - put some jar-files into common/lib (which ones?)
commons-dbcp and commons-pool for the version you want to use. Use the
latest pool (1.5.5)

 - perhaps delete some tomcat-included dbcp-files (which ones?)
No need.

 Somewhere I read something about some security settings, too that will
 have to be changed to allow access to the new jars (where and how)?
No need. Tomcat grants full permissions to all JARs in lib/

Mark

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



Re: Buffer Overflow

2010-11-16 Thread Mark Thomas
On 16/11/2010 18:12, Tyson Lowery wrote:
 I'm seeing this in my catalina.out log file.

That suggests that this is an Apache Tomcat question. You want the
Apache Tomcat users list. This is the Apache Commons users list.

Mark

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



Re: DBCP - unclosed connections

2010-11-11 Thread Mark Thomas
On 11/11/2010 05:11, Phil Steitz wrote:
 I will check or someone else can confirm DBCP and pool versions.
http://svn.apache.org/viewvc/tomcat/tc6.0.x/tags/TOMCAT_6_0_26/build.properties.default?view=markup

DBCP 1.2.2
Pool 1.5.4

  If not the latest you can upgrade them independently of Tomcat and you 
 should try that.  See the Tomcat datasource docs for instructions on how to 
 do this.  Ask here or on tomcat-user if you need help.

1. Add latest DBCP  Pool JARs to CATALINA_BASE/lib

2. Modify your Resource to include:
factory=org.apache.commons.dbcp.BasicDataSourceFactory

3. Restart

Mark

 The answer to your question is no, so if this is happening it indicates a 
 DBCP or pool bug or something else happening in your code to hold the 
 connections.
 
 Phil
 
 
 
 On Nov 10, 2010, at 1:39 PM, Tyson Lowery tysonlow...@gmail.com wrote:
 
 Thanks Phil for the reply.  I've changed maxWait to 1000 and 
 removeAbandonedTimeout to 300.   MySQL wait_timeout is set to 500.

 I've put some System.out.printlns in and can see that this page is taking 
 less than 1 second to process, even in the cases where I get the DBCP object 
 created 2010-11-10 12:54:14 by the following code was never closed:
 java.lang.Exception errors.  So I don't think the timeout is being hit.  I 
 can also see that the finally block is being executed, I'm now printing to 
 catalina.out after each object is closed.

 Note that this isn't being reported everytime the page loads, just once in a 
 while.

 Are there cases where this exception is generated even though the 
 connections were successfully closed?  Or is there a way to get more info 
 from AbandonedTrace.java?

 Thanks,
 Tyson

 On 11/10/2010 2:44 AM, Phil Steitz wrote:
 On 11/8/10 7:19 PM, Tyson Lowery wrote:
 I have a JSP page that is getting reported for not closing
 connections in catalina.out. I'm running Tomcat 6.0.26, so I believe
 we are on DBCP 1.2. I've racked my brain trying to figure out how
 these connections could possible remain unclosed. Does anyone have
 any tips or suggestions on how I can further troubleshoot this?


 If your page holds onto a connection for longer than 55 seconds or there 
 are queries taking longer than 55 seconds to execute, DBCP will consider 
 the associated connection abandoned.  Try increasing this setting.  Note 
 also that maxWait is specified in milliseconds, so below is a pretty low 
 setting.

 Phil

 Here's the latest version of our connection pool settings:
 Resource name=jdbc/myDB auth=Container type=javax.sql.DataSource
 maxActive=350 maxIdle=40 minIdle=10 maxWait=45
 removeAbandoned=true
 removeAbandonedTimeout=55
 validationQuery=select 1
 testWhileIdle=true
 testOnBorrow=true
 logAbandoned=true
 timeBetweenEvictionRunsMillis=10
 minEvictableIdleTimeMillis=40
 numTestsPerEvictionRun=3
 username=user password=password
 driverClassName=com.mysql.jdbc.Driver
 url=jdbc:mysql://1.2.3.4/myDB?autoReconnect=trueamp;jdbcCompliantTruncation=false/
  



 The JSP page literally has everything enclosed in a try block and
 all connections closed in a finally statement. See below:

 Connection con = null;
 Statement stmt = null;
 ResultSet rset = null;
 String query = ;
 Statement stmt2 = null;
 ResultSet rset3 = null;
 try {
 // page executes
 }
 catch (SQLException ex) {
 out.println (\n*** SQLException caught ***\n);
 while (ex != null) {
 out.println (SQLState:  + ex.getSQLState ());
 out.println (Message:  + ex.getMessage ());
 out.println (Vendor:  + ex.getErrorCode ());
 ex = ex.getNextException ();
 out.println ();
 }
 }
 catch (java.lang.Exception ex) { // Got some other type of
 exception. Dump it.
 ex.printStackTrace ();
 }
 finally {
 if(rset != null) {
 try {rset.close();}
 catch(Exception e) {
 System.out.println(Exception in finally rset);
 e.printStackTrace();
 }
 rset = null;
 }
 if(rset3 != null) {
 try {rset3.close();}
 catch(Exception e) {
 System.out.println(Exception in finally rset3);
 e.printStackTrace();
 }
 rset3 = null;
 }
 if(stmt != null) {
 try {stmt.close();}
 catch(Exception e) {
 System.out.println(Exception in finally stmt);
 e.printStackTrace();
 }
 stmt = null;
 }
 if(stmt2 != null) {
 try {stmt2.close();}
 catch(Exception e) {
 System.out.println(Exception in finally stmt2);
 e.printStackTrace();
 }
 stmt2 = null;
 }
 if(con != null) {
 try {con.close();}
 catch(Exception e) {
 System.out.println(Exception in finally con);
 e.printStackTrace();
 }
 con = null;
 }
 }


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



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



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

Re: DBCP - unclosed connections

2010-11-11 Thread Mark Thomas
On 11/11/2010 18:57, Tyson Lowery wrote:
 Thanks Mark for taking the time to reply.
 
 I've upgraded Tomcat to 6.0.29.  Do I still need to explicitly set the
 factory to make sure I'm using DBCP 1.3?

Maybe. 6.0.29 ships with DBCP 1.3 and Pool 1.5.4. To get the benefits of
Pool 1.5.5 you'd need to follow the instructions below.

6.0.30 will include Pool 1.5.5

Mark

 
 On 11/11/2010 12:37 AM, Mark Thomas wrote:
 On 11/11/2010 05:11, Phil Steitz wrote:
 I will check or someone else can confirm DBCP and pool versions.
 http://svn.apache.org/viewvc/tomcat/tc6.0.x/tags/TOMCAT_6_0_26/build.properties.default?view=markup


 DBCP 1.2.2
 Pool 1.5.4

   If not the latest you can upgrade them independently of Tomcat and
 you should try that.  See the Tomcat datasource docs for instructions
 on how to do this.  Ask here or on tomcat-user if you need help.
 1. Add latest DBCP  Pool JARs to CATALINA_BASE/lib

 2. Modify your Resource to include:
 factory=org.apache.commons.dbcp.BasicDataSourceFactory

 3. Restart

 Mark

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



Re: Static versus Transient Logger Declarations

2010-09-10 Thread Mark Thomas
On 10/09/2010 13:29, Leon Rosenberg wrote:
 Hello,
 
 as to my knowledge the modern containers do not encourage the usage of
 shared data anymore, and this was the only possible problem cause
 anyway:
 
 The real root cause of this problem is that SHARED data (static
 members on a class) is being shared across supposedly independent
 applications. If no classes are shared between applications then
 the problem does not exist. However it appears that (to my personal
 frustration) container vendors continue to encourage the use of shared
 classes, and application developers continue to use it.
 
 In other words, if the application developer is dumb enough to put his
 logging library in the shared lib folder of the container he will
 encounter a problem. If he's a brave soul and deploys each webapp
 independtly he will have no problems. Right?
 
 Since the dumb developer will always find a way to mess stuff up, I
 would say the whole discussion is pointless ;-)

With my Tomcat hat on +1.

Sharing libraries between web applications is a really bad idea in so
many different ways. The benefits (less disk space, less memory) are
very, very rarely worth the associated costs of significantly more
complex upgrades  restarts, scope for memory leaks, etc.

 P.S. talking about modern containers I was referring to tomcat.

Nice to know it is thought of as modern :)

Mark

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



Re: [GenericObjectPool] problem with numActive counter

2010-01-15 Thread Mark Thomas
On 15/01/2010 10:59, Daniele Bonetto wrote:
 yes, but if i don't invalidate the object i continue to have the problem
 
 Timeout waiting for idle object
 
 that blocks my pool as u can see in the following examples... :(

Which version of pool are you using? If not 1.5.4, try upgrading as
there were a couple of bugs in the earlier 1.5.x releases that could
cause this.

Mark

 */Example 1: without invalidateObject/*
 
 MaxActive = 2
 NumActive = 0
 
 -- Network is ok.
 Borrow obj1 -- ok [numActive 1]
 Borrow obj2 -- ok [numActive 2]
 Borrow obj3 -- nok, maxActive reached [numActive 2]
 Return obj1 [numActive 1]
 Return obj2 [numActive 0]
 Borrow obj3 -- ok [numActive 1]
 Return obj3 [numActive 0]
 
 -- Network turns nok.
 Borrow obj1 -- nok, cannot create an activated object [numActive 0]
 Borrow obj2 -- nok, cannot create an activated object [numActive 0]
 Borrow obj3 -- nok, timeout waiting for idle object [numActive 0]
 
 -- Network turns ok.
 Borrow obj1 -- nok, timeout waiting for idle object [numActive 0]
 Borrow obj2 -- nok, timeout waiting for idle object [numActive 0]
 Borrow obj3 -- nok, timeout waiting for idle object [numActive 0]
 
 and so on... It persists forever, locking my pool...
 
 
 
 */Example 2: with invalidateObject/*
 
 MaxActive = 2
 NumActive = 0
 
 -- Network is ok.
 Borrow obj1 -- ok [numActive 1]
 Borrow obj2 -- ok [numActive 2]
 Borrow obj3 -- nok, maxActive reached [numActive 2]
 Return obj1 [numActive 1]
 Return obj2 [numActive 0]
 Borrow obj3 -- ok [numActive 1]
 Return obj3 [numActive 0]
 
 -- Network turns nok.
 Borrow obj1 -- nok, cannot create an activated object [numActive 0]
 Invalidate obj1 [numActive -1]
 Borrow obj2 -- nok, cannot create an activated object [numActive -1]
 Invalidate obj2 [numActive -2]
 Borrow obj3 -- nok, cannot create an activated object [numActive -2]
 Invalidate obj3 [numActive -3]
 
 -- Network turns ok.
 Borrow obj1 -- ok [numActive -2]
 Borrow obj2 -- ok [numActive -1]
 Borrow obj3 -- ok [numActive 0]
 Return obj1 [numActive -1]
 Return obj2 [numActive -2]
 Return obj3 [numActive -3]
 
 In this case the object are correctly borrowed and the pool works well,
 but the numActive counter isn't correct and it make me borrow more than
 2 objects (and it's a big problem cause i have limited connections to
 respect).
 
 Byez!
 Daniele Bonetto
 
 
 
 
 
 Il 15/01/2010 11.37, Simone Tripodi ha scritto:
 In the example, the catch group catches exceptions that could be
 thrown by the object _use_, I *suppose* whenever you catch a
 java.util.NoSuchElementException you don't need to invalidate the
 object, that's what Mark was pointing.
 let us know, all the best,
 Simo

 On Fri, Jan 15, 2010 at 11:26 AM, Daniele Bonetto
 daniele.bone...@dnshosting.it  wrote:
   
 Ok, if the borrow throws an exceptin the obj was null.
 But i'm not sure that the invalidate was unnecessary. take a look at
 this:
 http://commons.apache.org/pool/apidocs/org/apache/commons/pool/ObjectPool.html


 Example of use:

   Object obj =|null|;

   |try|  {
  obj = pool.borrowObject();
  |//...use the object...|
   }|catch|(Exception e) {
  |// invalidate the object|
  pool.invalidateObject(obj);
  |// do not return the object to the pool twice|
  obj =|null|;
   }|finally|  {
  |// make sure the object is returned to the pool|
  |if|(|null|  != obj) {
  pool.returnObject(obj);
 }
   }


 In this example u can see that if the borrow throws an exception u
 have to
 invalidate the object from pool.

 So. What happends to the object that i tried to borrow?

 I have maxActive = 2 and without invalidate if i try more than 2
 times the
 pool returns always:

 java.util.NoSuchElementException: Timeout waiting for idle object


 I think that without the invalidate the object remains in idle and it
 locks
 my pool... With invalidateObject the pool works correctly, but the
 counter
 wasn't correct.

 Thanks guys for your replies.

 Byez!
 Daniele Bonetto




 Il 15/01/2010 11.08, Mark Thomas ha scritto:
 
 On 15/01/2010 10:03, Simone Tripodi wrote:

   
 Ciao Daniele ;)
 First, I suggest you to start the subject line with [componentname],
 i.e. [POOL] if you're referring commons-pool, otherwise people risk to
 get confused and not able to reply.

 I don't know the Pool so deeply and maybe I didn't understand the
 problem, but reading your code I'm worried 'invalidateObject()' always
 takes 'null' as argument... take a look at this with the
 logger/debugger.

  
 Yep. That's the problem. That call is almost certainly unnecessary. If
 want to keep it, wrap it in acodeif  (obj != null)/codetest.

 Mark


   
 All the best,
 Simo

 On Fri, Jan 15, 2010 at 10:53 AM, Daniele Bonetto
 daniele.bone...@dnshosting.itwrote:

 
 Hello everyone!

 I notice a problem using GenericObjectPool.

 My code is like this:

 Object obj = null;
 try
 {
 obj = this.borrowObject

Re: [IO] Problem finding right filepath

2009-11-23 Thread Mark Thomas
Ludwig Magnusson wrote:
 Hello!
 
 We are a team developing a webapp running on a tomcat server. We need to
 list the files in a certain directory in our application, but we cannot find
 a way to always get the correct path on the different platforms and
 environments. Is this solvable through some IO-function or do we need to
 specify the path to our project in each environment?

This is probably better suited to the Tomcat users list.

That said, as a general rule it is not safe to assume that your web
application is deployed on a file system. Your app could be packaged as
a WAR file sitting on a database.

That said, there are some Servlet API calls that can tell you if you or
on a file system and if you are, where you are on the file system.

Follow up on the Tomcat users list if you need more info.

Mark




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



Re: DBCP deadlock

2009-11-12 Thread Mark Thomas
Marc Logemann wrote:
 Uh sorry, misread that. Commons-pool is at  1.3. As i said, i am using
 ivy/maven to resolve that stuff and since i am not explicitely grabbing
 commons-pool, 1.3 was pushed in because of dependency definition of
 commons-dhcp 1.2.2

I don't see a deadlock in the thread dump (although they are easy to miss so
feel free to correct me on that).

It looks more like pool exhaustion to me. Try using logAbandoned and
removeAbandonedTimeout to see if you have a connection leak. (Ignore any
warnings you see about these being deprecated - those warnings should have been
removed and have been for the next release).

Mark

 
 
 ---
 regards
 Marc Logemann
 http://www.logemann.org
 http://www.logentis.de
 
 
 
 
 Am 12.11.2009 um 10:13 schrieb James Carman:
 
 That's the version of commons-dbcp (which is current).  What version
 of commons-pool are you using?

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


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




 Am 12.11.2009 um 10:04 schrieb Cyrille Roy:

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

 get the source

 1.4 source

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


 1.3 source

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


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


 |Regards,
 Cyrille

 Marc Logemann wrote:

 Hi,

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

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


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


 See the stack for the real facts:

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

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

 - locked 0x3b278270 (a
 org.apache.tomcat.util.net.JIoEndpoint$Worker)
 at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:449)

 at java.lang.Thread.run(Unknown Source)

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

 - locked 0x3b277ee8 (a
 org.apache.tomcat.util.net.JIoEndpoint$Worker)
 at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:449)

 at java.lang.Thread.run(Unknown Source)

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

 at
 com.ibm.as400.access.AS400ThreadedServer.run(AS400ThreadedServer.java:340)

 at java.lang.Thread.run(Unknown Source)

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

 at
 com.ibm.as400.access.AS400ThreadedServer.run(AS400ThreadedServer.java:340)

 at java.lang.Thread.run(Unknown Source)

 Managed directory poller 

Re: DBCP deadlock

2009-11-12 Thread Mark Thomas
Marc Logemann wrote:
 Hi,
 
 its a deadlock as also Cyrille pointed out.

No, it isn't.

 There is no exhaustion

Yes there is. Look at the source code for the line you quoted:
at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:810)


That is the wait() call in
case WHEN_EXHAUSTED_BLOCK:

Every thread in your thread dump that referenced commons.pool (all six of them)
was stuck at that point. It looks very much like your pool was exhausted
previously or is still exhausted.

 because as i said, there a 3 of 30 DB connections active on the DB
 Server.

Which indicates that you likely have a connection leak.

 I even defined all those *Abandoned Timeouts and stuff w/o any
 difference.

Interesting. I'm surprised you didn't see something in catalina.out. It is
probably worth checking the configuration you were using for that.

 Will try commons-pool 1.4 to see if it solves the problem. I
 am quite sure that 1.4 solves the issue because you cant have a monitor
 on a method thats not syncronized ;-) So lets see how that goes

It is going to depend on what the root cause is. If you are going to upgrade
then I'd suggest going for the latest (1.5.3) as it fixes a number of dead-lock
issues known to exist in 1.4 as well as offering fairer object allocation. This
should enabled the exhausted pool situation to be handled better. Be aware there
is a known issue in 1.5.3 that will be fixed shortly in 1.5.4.

Mark


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



Re: commons.pool 1.5.2 PoolUtils.synchronizedPool question

2009-09-11 Thread Mark Thomas
Emanuele Gheradini wrote:
 Watching the source code, it seems to me the implementation of
 Generic{Keyed}ObjectPool is thread-safe.
 
 So what is the need of PoolUtils.synchronizedPool ?
 
 Can someone explain me ? I can't find the answer in the docs :(

Look at the JavaDocs.

Mark




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



Re: dbcp issue: unable load commons-dbcp.jar and commons-pool.jar in lib/ext

2009-07-29 Thread Mark Thomas
bye webster wrote:
 I had follow through the guideline from
 http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html.
 It is not working, it unable locate the resource in context. The
 datasource.getConnection was return null. My appBase is mainhost and web
 application is webapps directory.

You will probably have more luck asking for help on the Tomcat users list.

Mark

 
 This is my context in server.xml
 
 Context path=/webapps docBase=webapps debug=5
 reloadable=true crossContext=true
 Resource name=jdbc/myinformix auth=Container
   type=javax.sql.DataSource
 driverClassName=com.informix.jdbc.IfxDriver
 
 url=jdbc:informix-sqli://hostname:port/dbname:INFORMIXSERVER=servernum;
   username=uid password=password maxActive=20
 maxIdle=10 maxWait=-1/
 
 /Context
 
 This is my web.xml
 
 resource-ref
 descriptionDB Connection/description
 res-ref-namejdbc/myinformix/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
 /resource-ref
 
 this is how system invoked
 
   Context initContext = new InitialContext();
   Context envContext = (Context) initContext.lookup(java:/comp/env);
   DataSource ds = (DataSource) envContext.lookup(jdbc/myinformix);
   Connection conn = ds.getConnection();
 
 
 
 On Tue, Jul 28, 2009 at 8:45 PM, Mark Shifman mark.shif...@yale.edu wrote:
 
 You need to follow the tomcat documentation
 http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
 and you don't need to download anything.

 DBCP uses the Jakarta-Commons Database Connection Pool. It relies on
 number of Jakarta-Commons components:

* Jakarta-Commons DBCP
* Jakarta-Commons Collections
* Jakarta-Commons Pool

 These libraries are located in a single JAR at
 |$CATALINA_HOME/common/lib/naming-factory-dbcp.jar|. However, only the
 classes needed for connection pooling have been included, and the packages
 have been renamed to avoid interfering with applications.


 bye webster wrote:

 Hello,

 I recently research on how to implement Database Connection Pooling into
 Tomcat 5.5 server.
 After downloaded dbcp.jar and pool.jar from Jakarta project and I follow
 through the guideline provided.
 Unfortunately, It is only working when i set jar file path in CLASSPATH
 but
 it unable load it when it is keep inside jre/lib/ext directory.
 I thought all the jar will load in /lib/ext directory for all tomcat user.

 Who's know what's happening? i don't want messy my classpath setting so
 who's know how to load it from lib/ext directory?




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


 



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



Re: DBCP initialSize

2009-07-06 Thread Mark Thomas
CrystalCracker wrote:
 I am using dbcp with its default settings inside Grails. When the app boots
 up, I print out the settings as below, which is as per the DBCP docs.
 
 maxIdle=8
 defaultCatalog=null
 testOnBorrow=false
 logwriter=java.io.printwri...@3c4c3922
 defaultTransactionIsolation=-1
 validationQuery=null
 testOnReturn=false
 maxActive=8
 numActive=0
 numTestsPerEvictionRun=3
 minIdle=0
 maxWait=-1
 defaultAutoCommit=true
 connection=org.apache.commons.dbcp.poolableconnect...@27837c8b
 numIdle=0
 testWhileIdle=false
 driverClassName=org.postgresql.Driver
 class=class org.apache.commons.dbcp.BasicDataSource
 accessToUnderlyingConnectionAllowed=false
 removeAbandonedTimeout=300
 defaultReadOnly=false
 logAbandoned=false
 poolPreparedStatements=false
 maxOpenPreparedStatements=-1
 removeAbandoned=false
 minEvictableIdleTimeMillis=180
 timeBetweenEvictionRunsMillis=-1
 initialSize=0
 
 Notice the initialSize is 0 as expected.
 
 But when I do netstat -na, I see a tcp connection established to the
 database.
 With the initial size 0, and no database calls made yet, I would assume
 there would be no connections to the database as shown by netstat.
 
 Am I missing anything here?

Driver initialisation maybe?

Mark


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



Re: Connection Pool Tuning

2009-06-30 Thread Mark Thomas
daniel steel wrote:
 hi all,
   we are running a load test using tomcat6 with SQL Server and dbcp 
 connection pooling.
 This is our current conn pool set up - Some of the parameters are not ideal 
 for prod env..
 
 initialSize=5
 maxActive=-2
 maxIdle=85
 maxWait=1
 timeBetweenEvictionRunsMillis=180
 removeAbandoned=true
 removeAbandonedTimeout=4
 
 During the run, for some of the long running jsp  we started getting errors 
 and logs had these kind of errors..
 
 1.
 java.sql.SQLException: Connection 
 net.sourceforge.jtds.jdbc.connectionjd...@a6ebc0c is closed.
 at 
 org.apache.tomcat.dbcp.dbcp.DelegatingConnection.checkOpen(DelegatingConnection.java:354)
 at 
 org.apache.tomcat.dbcp.dbcp.DelegatingConnection.createStatement(DelegatingConnection.java:222)
 at 
 org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.createStatement(PoolingDataSource.java:205)
 
 2. 
 java.sql.SQLException: Invalid state, the Connection object is closed.
 at net.sourceforge.jtds.jdbc.TdsCore.checkOpen(TdsCore.java:448)
 at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:946)
 at 
 net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:406)
 at 
 net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1258)
 at 
 org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
 
 Is these errors because of removeAbandonedTimeoutsetting?

Almost certainly.

 would increasing the timeout help in reducing the errors?

Have you tried increasing it?

 or 
 what would cause these errors? 
 would turning on logAbandoned help to correlate these errors to connection 
 closed by dbcp?

That won't hurt and will at least give you more information about what
is going on.

Mark


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



Re: DBCP: Recovering all Connections

2009-06-24 Thread Mark Thomas
Patrick Lightbody wrote:
 I have a somewhat unique use case: I want to be able to, on command,
 tell my BasicDataSource to recover any outstanding open Connections.
 I don't see any methods in the API that indicate there is a way to
 force that. There are timeouts that will recover it, but is there a
 way to say: do it now?

In short, no. Depending on configuration, DBCP might not even be holding
references to the open connections.

Mark



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



  1   2   >