[JAVA-230] Getting [02:04:16.158] java.lang.NoClassDefFoundError: com/mongodb/util/ThreadUtil Created: 10/Dec/10  Updated: 04/Dec/13  Resolved: 17/Feb/11

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Blocker - P1
Reporter: Joseph Wang Assignee: Antoine Girbal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

bash-3.2$ uname -a
Linux lpsapp3.la2.estalea.net 2.6.18-194.17.4.el5 #1 SMP Mon Oct 25 15:50:53 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

bash-3.2$ ls mongo
mongo-java-driver-2.3.jar



 Description   

[02:04:16.158] java.lang.NoClassDefFoundError: com/mongodb/util/ThreadUtil
[02:04:16.158] at com.mongodb.DBPort._open(DBPort.java:222)
[02:04:16.158] at com.mongodb.DBPort.go(DBPort.java:85)
[02:04:16.158] at com.mongodb.DBPort.go(DBPort.java:66)
[02:04:16.158] at com.mongodb.DBPort.call(DBPort.java:56)
[02:04:16.158] at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:211)
[02:04:16.158] at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:284)
[02:04:16.158] at com.mongodb.DBCursor._check(DBCursor.java:297)
[02:04:16.158] at com.mongodb.DBCursor._hasNext(DBCursor.java:420)
[02:04:16.158] at com.mongodb.DBCursor.hasNext(DBCursor.java:445)



 Comments   
Comment by Antoine Girbal [ 17/Feb/11 ]

thanks Joseph.
Sorry, we've fixed quite a few long standing bugs, so it's tough to know what is the status of certain tickets.

Comment by Joseph Wang [ 17/Feb/11 ]

Please close it for now. We don't have time to test new sw for other people.

Comment by Antoine Girbal [ 17/Feb/11 ]

joseph, is this still occuring or can I close ticket?
If possible, do some tests with 2.4 driver or better latest from trunk (not against production).
thx

Comment by Joseph Wang [ 10/Dec/10 ]

The problem java.lang.NoClassDefFoundError exception.

[02:04:16.158] java.lang.NoClassDefFoundError: com/mongodb/util/ThreadUtil
[02:04:16.158] at com.mongodb.DBPort._open(DBPort.java:222)
[02:04:16.158] at com.mongodb.DBPort.go(DBPort.java:85)
[02:04:16.158] at com.mongodb.DBPort.go(DBPort.java:66)
[02:04:16.158] at com.mongodb.DBPort.call(DBPort.java:56)
[02:04:16.158] at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:211)
[02:04:16.158] at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:284)
[02:04:16.158] at com.mongodb.DBCursor._check(DBCursor.java:297)
[02:04:16.158] at com.mongodb.DBCursor._hasNext(DBCursor.java:420)

Comment by Joseph Wang [ 10/Dec/10 ]

The problem is mainly on the client side. We need to change the web server socket limit.

Comment by Scott Hernandez (Inactive) [ 10/Dec/10 ]

I'm really confused. What is the problem? Can you start with a new issue (that is clean)?

Comment by Jeff Behl [ 10/Dec/10 ]

I'm on the sysadmin side of things with Joseph and wanted to add ulimit settings in case there was a question:

[lps-mongodb_prod@lpsdb1.la2 ~]$ ulimit -a

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 399360
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 8192
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 399360
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

Comment by Joseph Wang [ 10/Dec/10 ]

change max_connection to 200. Apparently, this is not max connection per pool, but per server. Can someone confirm this?

bash-3.2$ netstat -an| grep 4110 | wc -l
603

Comment by Joseph Wang [ 10/Dec/10 ]

Sorry, in the resin startup, we do set to 1.6 java.

JAVA_HOME=/usr/java/jdk1.6.0_21

Comment by Joseph Wang [ 10/Dec/10 ]

We've wrong java installed. Please wait till we install correct sw.

bash-3.2$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-48)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash-3.2$
bash-3.2$ hostname -f
lpsapp3.la2.estalea.net

Comment by Joseph Wang [ 10/Dec/10 ]

specified max_connection=500, yet see 872.

bash-3.2$ netstat -an | grep 4110 | wc -l
872

public void init(String server_list) {
if (m == null) {
MongoOptions opt = new MongoOptions();
opt.autoConnectRetry = true;
opt.connectionsPerHost = max_connection;

String[] servers = server_list.split(",");
ArrayList<ServerAddress> addr = new ArrayList<ServerAddress>();
int serverCount = 0;
for (int i = 0; i < servers.length; ++i) {
String[] serverInfo = servers[i].split(":");

try {
if (serverInfo.length == SERVER_INFORMATION_FIELD_SIZE)

{ log.info("MongoConnnection: add server " + serverInfo[SERVER_NAME_FIELD] + " at port " + serverInfo[SERVER_PORT_FIELD]); ServerAddress host = new ServerAddress( serverInfo[SERVER_NAME_FIELD], Integer.parseInt(serverInfo[SERVER_PORT_FIELD])); addr.add(host); serverCount++; }

} catch (Exception ex)

{ log.fatal( "MongoConnnection: problem with adding server list " + server_list, ex); }

}

if (serverCount > 0) {
try

{ m = new Mongo(addr, opt); }

catch (Exception ex)

{ log.fatal("MongoConnnection: problem with creating MongoDB instance for server list " + server_list, ex); m = null; }

} else

{ log.fatal("MongoConnnection: empty server list " + server_list); }

}
}

Generated at Thu Feb 08 08:51:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.