Re: Two Question for NoSql MongoDB appender

2013-08-17 Thread Nick Williams
YuCheng, LOG4J2-358 has been filed and fixed now. You can compile from trunk immediately to get the fixes for both bugs (including LOG4J2-330, which was fixed a few weeks ago), or you can wait for the next version to come out. Shouldn't be to much longer now. N On Aug 14, 2013, at 2:10 AM, YuC

Re: Two Question for NoSql MongoDB appender

2013-08-17 Thread Gary Gregory
Detective Nick is one the case! :) Do those other projects use third party line for this or roll their own? Gary On Aug 17, 2013, at 4:17, Nick Williams wrote: > Solved it! > > And you're never gonna believe what I learned tonight...(well, maybe you will) > > I solved the error by changing this

Re: Two Question for NoSql MongoDB appender

2013-08-17 Thread Remko Popma
That's a tricky one. Well done! (Much better than me: I'm on day two of my struggle with LOG4J2-315 and not making much progress... :-) On Sat, Aug 17, 2013 at 5:17 PM, Nick Williams < nicho...@nicholaswilliams.net> wrote: > Solved it! > > And you're never gonna believe what I learned tonight...

Re: Two Question for NoSql MongoDB appender

2013-08-17 Thread Nick Williams
Solved it! And you're never gonna believe what I learned tonight...(well, maybe you will) I solved the error by changing this: public final class MongoDBProvider implements NoSQLProvider { ... +try { +if (!database.authenticate(username, password.toCharAr

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Ralph Goers
I'll reiterate what I wrote. Catch the RuntimeException and then do if (e.class.getName().equals("com.mongodb.MongoException")) { LOGGER.error("..."); } else { throw e; } This should give you the same behavior. Ralph On Aug 16, 2013, at 9:49 PM, Nick Williams wrote: > That approach concer

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Scott Deboy
Is there any way it could be getting loaded in another class loader? Verbose classes flag help to determine that? On Aug 16, 2013 10:37 PM, "Nick Williams" wrote: > The problem is we don't know what's missing and we can't tell what's > missing. I'm not even convinced that the problem IS a missin

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Nick Williams
The problem is we don't know what's missing and we can't tell what's missing. I'm not even convinced that the problem IS a missing dependency. Whenever I've seen a missing dependency, the NoClassDefFoundError was for the actual missing dependency, not for the class that depended on it. This NoCl

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Gary Gregory
Why not try to create the proper dependencies and see if we can get it working? How else can we unit test otherwise? Gary On Sat, Aug 17, 2013 at 12:49 AM, Nick Williams < nicho...@nicholaswilliams.net> wrote: > That approach concerns me. Catching RuntimeException essentially opens it > up to t

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Nick Williams
That approach concerns me. Catching RuntimeException essentially opens it up to thousands of possible exceptions that could be the cause, as opposed to looking for that exact cause. I suppose I don't have a choice, though. This apparently just isn't going to work. Definitely agreed that there i

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Ralph Goers
After following the chain of stuff that gets brought in via BSONObject I still recommend the approach in my other email of just catching RuntimeException. A bunch of other classes are being referenced, one of which is creating a static Logger from java.util.logging. I have no idea why that migh

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Nick Williams
https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/DB.java That also shows an import for org.bson.BSONObject, but the tests still run with just DB and no MongoException. org.bson is in the org.mongodb:mongo-java-driver JAR file. So, no, that's not the problem. There's

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Ralph Goers
FWIW, rather than drag in another dependency you might just want to catch RuntimeException instead of MongoException. Of course it will have to come after the catch block for the IllegalStateException. And if you want you can just do if (e.getClass.getName().equals("com.mongodb.MongoException

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Ralph Goers
https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/MongoException.java shows an import for org.bson.BSONObject. The pom.xml for mongo-java-driver doesn't contain a transitive dependency for that and mvn dependency:tree on core doesn't show it. Ralph On Aug 16, 2013

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Nick Williams
On Aug 16, 2013, at 8:38 PM, Gary Gregory wrote: > On Fri, Aug 16, 2013 at 8:31 PM, Nick Williams > wrote: > Several inline comments. > > On Aug 16, 2013, at 6:43 PM, Gary Gregory wrote: > >> Make sure you can see the messages from the status logger, maybe there is an >> error processing the

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Gary Gregory
On Fri, Aug 16, 2013 at 8:31 PM, Nick Williams < nicho...@nicholaswilliams.net> wrote: > Several inline comments. > > On Aug 16, 2013, at 6:43 PM, Gary Gregory wrote: > > Make sure you can see the messages from the status logger, maybe there is > an error processing the log4j config file early on.

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Nick Williams
Several inline comments. On Aug 16, 2013, at 6:43 PM, Gary Gregory wrote: > Make sure you can see the messages from the status logger, maybe there is an > error processing the log4j config file early on. There are no messages from the status logger. > G > > > On Fri, Aug 16, 2013 at 7:38 PM,

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Gary Gregory
Make sure you can see the messages from the status logger, maybe there is an error processing the log4j config file early on. G On Fri, Aug 16, 2013 at 7:38 PM, Remko Popma wrote: > What is this " LoggingTest.cleanupClass:49 NullPointer" at the bottom of > your list of errors? What does that d

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Remko Popma
What is this " LoggingTest.cleanupClass:49 NullPointer" at the bottom of your list of errors? What does that do? On Sat, Aug 17, 2013 at 8:27 AM, Gary Gregory wrote: > It's likely that MongoDB needs another jar on the CP. > > G > > > On Fri, Aug 16, 2013 at 6:48 PM, Nick Williams < > nicho...@ni

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Gary Gregory
It's likely that MongoDB needs another jar on the CP. G On Fri, Aug 16, 2013 at 6:48 PM, Nick Williams < nicho...@nicholaswilliams.net> wrote: > Guys, I'm having a hard time with this simple fix that should have taken > five minutes. I'm getting test failures due to NoClassDefFoundErrors that >

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Nick Williams
Guys, I'm having a hard time with this simple fix that should have taken five minutes. I'm getting test failures due to NoClassDefFoundErrors that shouldn't happen. Here are the tests in error: CategoryTest.setupClass:52 ? NoClassDefFound com/mongodb/MongoException LoggerTest.testTraceWithEx

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Gary Gregory
Thank you for the update Nick! :) Gary On Fri, Aug 16, 2013 at 5:39 PM, Nick Williams < nicho...@nicholaswilliams.net> wrote: > Answers inline. > > On Aug 14, 2013, at 2:10 AM, YuCheng Ting wrote: > > Hi all, > > I use *beta8 *log4j2 and wrote log4j2.xml like example in document ( > http://loggi

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Nick Williams
Answers inline. On Aug 14, 2013, at 2:10 AM, YuCheng Ting wrote: > Hi all, > > I use beta8 log4j2 and wrote log4j2.xml like example in document > (http://logging.apache.org/log4j/2.x/manual/appenders.html#NoSQLAppender ): > > > > > server="mongo.example.org" >

Re: Two Question for NoSql MongoDB appender

2013-08-16 Thread Gary Gregory
Nick? Gary On Wed, Aug 14, 2013 at 3:10 AM, YuCheng Ting wrote: > Hi all, > > I use *beta8 *log4j2 and wrote log4j2.xml like example in document ( > http://logging.apache.org/log4j/2.x/manual/appenders.html#NoSQLAppender ): > > > * > > collectionName="applicationLog" >