Woonsan Ko | 22 Jul 23:50 2015

[lang] StrSubstitutor - a dollar sign before a variable

Hi there,

I tried to use the following, expecting "...ick brown fox paid $20.00
to jump over the la…":

    // In org.apache.commons.lang3.text.StrSubstitutorTest.java locally
    // after cloning https://github.com/woonsan/commons-lang.
     <at> Test
    public void testReplaceEscapingDollarSign() {
        values.put("amount", "20.00");
        doTestReplace("The quick brown fox paid $20.00 to jump over
the lazy dog.",
                      "The ${animal} paid $$${amount} to jump over the
${target}.", true);

(I put double dollar signs like $$${amount} because $ is the default
escape character.)

But, the result was:"...ick brown fox paid $${amount} to jump over the la…".

Is it a bug or did I miss something?


Daniel H. Peger | 21 Jul 17:07 2015

[daemon] Howto setup a Daemon implementation as windows service


I didn't find any really good example (actually I did not find a single example) on how to register a class
that implements the org.apache.commons.daemon.Daemon interface as Windows service.

Do I have to register this implementation using procrun? But than there doesn't seem to be a point in
implementing the interface as procrun can register any program as windows service.

Furthermore there seems to be a docu-bug on the procrun page (http://commons.apache.org/proper/commons-daemon/procrun.html):

The description of the --StartMethod parameter states:
> Note: in jvm mode, the start method should not return until the stop method has been called.

But further down the page in the "Using Procrun in jvm mode" section:
> Note that the method handling service start should create and start a separate thread to carry out the
processing, and then return. The start and stop methods are called from different threads.

Am I reading this wrong or is this a little conflicting?? And what would be the correct behavior of a static
start(String[] args) method?

Best regards
norm | 16 Jul 18:51 2015

[util.regex] A package that provides the power of regular expressions without regular expressions

(I am sorry if this Email is improperly addressed. If it is, would somebody
tell me how to address it).

We have a package, which provides Java programmers with the power of
regular expressions without regular expressions. We would like to make the
package part of Apache Commons. Can somebody tell us what steps are involved?

>From the package's package description:

Provides the power of regular expressions without regular expressions.

Some people, when confronted with a problem, think, "I know, I'll use regular
expressions." Now they have two problems. - Jaimie Zawinski

Naomi is a package that enables Java programmers to search for and optionally
replace textual patterns in documents or strings. Simple tasks of this
sort--such as systematically changing multiple filenames or modifying text in
documents--are often performed using inline or one-shot scripts written using
tools such as awk, sed, or Perl, all of which use (somewhat different)
variants of regular expression ("RE") syntax. The standard java.util.regex
package provides its own set of RE tools for use in Java. But performing
complex searching and match-and-replace tasks or performing such tasks
repetitively with minor variations can be quite difficult using REs, and RE
syntax is inherently alien to Java's object-oriented style of programming.
Naomi offers a much more transparent way of attacking such problems that is
more compatible with Java style and much better suited to larger problems.

That is, Naomi provides the power of regular expressions without regular

(Continue reading)

Tim Cronin | 2 Jul 15:13 2015

JCS Region No longer alive so returning false for key

JCS 1.3

i periodically get the above error.

what do i need to do to recover from this?
Geraldo Netto | 25 Jun 20:21 2015

[lang] StringEscapeUtils - from &euro; to &#8364;

Dear All,

Sorry for cross-posting between user/dev lists
I'm trying to escape special chars using StringEscapeUtils

And i would like to ask
how can i change the escape format from html string code to html number code

StringEscapeUtils.escapeHtml4(EURO_SIGN) is returning &euro;

But i would like to return: &#8364;

Do you have any suggestions on how to handle this?
In any case i'm willing to volunteer myself to write the code as long
as a mentor shows up :)

Thank You Very Much and Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
São Paulo, Brasil, -3gmt
site: http://exdev.sf.net/
Li Li | 24 Jun 11:21 2015

is BCEL the tool for me?

Hi all,
     I have a jar file and without the source code, I want to replace
a package and all classes of this package with my own.
     e.g.  There is a package
    The com.abc.tool.A.class and com.abc.tool.B.class are used in many
other classes.
    I want to use my own implementation, So I can create my
package(com.def.tool) and my A.java B.java which has exactly the same
method as  com.abc.tool.A.class and  com.abc.tool.B.class
    But other classes in this jar still use com.abc.tool.A.class and
com.abc.tool.B.class. I want to use a byte code library to modify the
jar so it can run and use my implementation.
    Is BCEL suitable for this? Thank you
Kiran Badi | 24 Jun 01:22 2015

Commons Apache Fileupload from Classic web app and Struts 2 Integration

Hi All,

I was using Apache FileUpload 1.2 for my classic web app based on
jsp/servlets and now I have integrated Struts 2.3.20 with this application.

For some reason after adding S2 with my classic app, its breaking file
upload functionality which was working fine earlier.Nothing shows up in
logs other than that all parameters values goes as null.

After doing some analysis I see that S2 ships with file upload jar , along
with bunch commons jars. Does S2 file upload jars has any conflict with
classic file uploads like probably file upload interceptor of S2
intercepting earlier functionality etc.

Any thoughts please.

- Kiran
Andrew E. Davidson | 23 Jun 19:08 2015

[math] noob; performance metrics?

sorry if this has been asked many times before. (maybe this can be added to the FAQ?)

has anyone done any bench marking?

The idea of having a math package that is implemented pure java is very attractive. My experience with
machine learning is that java is very slow. To go fast you need to take advantage of assembler or libraries
written in fortran or C. For example http://jblas.org/ <http://jblas.org/>

Kind Regards


Gopi Ramesh | 23 Jun 14:38 2015

[beanutils] Getting issue with Bean Utils v1.9.2.

In our application, we upgraded the BeanUtils jar from 1.6 version to 1.9.2.After upgrading the jar, we are
facing issues while setting the bean properties for two dimensional or multi dimensional arrays.The
same code is used to work fine with 1.6 BeanUtils version. 
The error is shown below:java.lang.NullPointerException	at
org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:925)	at
org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:821)	at
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:431)	at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)	at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)	Truncated.
see log file for complete stacktrace
Please let me know if is there any solution for the issue.
Note: We are using BeanUtils with JDK 1.8.0_45.
tech | 23 Jun 03:31 2015

[jsvc] in centos6.4 "Cannot find any VM in Java Home" & "Cannot locate JVM library file"

Hello everyone!I am a beginner. I got a centos6.4 64bit(on VPS) and now i set a tomcat8.0.23 in it.
open jdk 1.7x64 was installed and i compiled the jsvc from the source code in commons-daemon-native.tar.gz.
runup the tomcat with catalina.sh,startup.sh,shutdown.sh are all proper functioning.
but the daemon with jsvc was in faulting so that i can't make it auto running when os start.

i add those 2 lines into deamon.sh:
# chkconfig: - 85 15
# description: tomcat8( nike name catalina ).

then i install it with the chkconfig, it seems like fine.

unexpectable, at os started, the tomcat8 does not running.
and there are the logs( in catalina-daemon.out ):
Cannot find any VM in Java Home /usr       // i found this line in source code at java.c:78
Cannot locate JVM library file                      // java.c:158
Service exit with a return value of 1

BUT, the tomcat works if i run "sh daemon.sh start" manually.
in addition, i have faith in that the $JAVA_HOME,$JRE_HOME,$TOMCAT_HOME,$TOMCAT_BASE was correctly setted.
i considered the reasons is that the jsvc got incorrect args. but i have no methods and energy to research it.
are there any one help me ?

and there are the other one problem:
i have to place a copy of jsvc in /etc/bin, else i got a err log:"/etc/bin/jsvc: No such file or directory".
i was trouble and wonder the reason. my sys has not even got the "/etc/bin" at all.
(Continue reading)

Ercan Canlıer | 22 Jun 21:56 2015

Mutable BasicDynaBean Map

As i mentioned at the mail subject, i am having problem with not mutable
map inside BasicDynaBean.
As far as i know, it is the default behaviour of this map.
What i would like to do is, simply retrieve the resultset from db which
will create a list including DynaBeans.
For viewing the database table, everything works fine, the problem occurs
when i try to edit it and i get the following exception:

Caused by: javax.el.PropertyNotWritableException
    at javax.el.MapELResolver.setValue(MapELResolver.java:267)
    at com.sun.el.parser.AstValue.setValue(AstValue.java:201)
    at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:291)
    ... 50 more

I assume, this is because of the map inside dyna bean is not mutable.
I think one option is to change the default behaviour of the map by editing
the source code of BeanUtils library.
On the other hand, i think the implementors of this library must have
thought this functionality somehow...
Below is the code snippet that i use for retrieving the result set as

        String query = "SELECT * FROM test.a";
(Continue reading)