views:

43

answers:

2

Hi all, I am looking for a commons beanutils alternative. The reason is that beanutils relies on commons-logging which is conflicting with existing libraries I am using.

I would like a small self-contained alternative which will cause no/minimal conflicts.

The main functionality I am after is nested property retrieval.

Thanks in advance, Steven

+1  A: 

You may be able to resolve the conflict with commons-logging by using the alternate commons-logging bridge implementation provided by SFL4j.

Often times, replacing commons-logging.jar with jcl-over-slf4j.jar will immediately and permanently solve class loader issues related to commons logging.

Thilo
I will give this a go first and let you know
Steven
Did not help, just caused more dependency problems.
Steven
+1  A: 

Ended up writing my own mini beanutils to get around this dependency and removed commons-beanutils completely.

The SLF4J did not end up helping since it broke some other dependencies (damn you weblogic!).

My own implementation is probably slower since the commons-beanutils appears to cache some fetches to remove some reflective calls.

Msg me if your interested in getting the source code of my implementation.

Steven
"My own implementation is probably slower since the commons-beanutils " Commons-beanutils is open-source. Maybe you just download the source, and rip out the calls to commons logging. OTOH, your code is probably not slower to a degree that makes any difference anyway.
Thilo
I tried that but it ended up pulling in digest and other things as well. Just got a little bit too tedious and my solution was very small and easy anyway.
Steven