Bug 28663 - Nullpointer exception when using JDBCSampler remotely
Summary: Nullpointer exception when using JDBCSampler remotely
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.0.0
Hardware: PC other
: P3 normal with 1 vote (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-28 15:45 UTC by Johan Top
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
the requested log file where the server is runned local, together with JMeter (499.21 KB, text/plain)
2004-04-30 08:36 UTC, Johan Top
Details
the corresponding logging in the dos console (693 bytes, text/plain)
2004-04-30 08:38 UTC, Johan Top
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Top 2004-04-28 15:45:46 UTC
I start remotely a JDBC test as described in the user manual (7. Building a 
Database Test Plan)

The necessary steps as described in 
http://jakarta.apache.org/jmeter/usermanual/remote-test.html are performed ; 
including starting up the rmiregistry.

But I get no results back from the remote jmeter server. I do notice a 
NullPointer exception logged on this remote system.

When debugging this remote jmeter server, I remark that the transient private 
member, namely ‘manager’ is null for the JDCSSampler where testEnded() is 
called up on. This identifies the cause of the NullPointer exception.

    public synchronized void testEnded()
    {
    	log.debug("testEndded(), thread: "+Thread.currentThread().getName());
    	manager.shutdown();
    	dbkey = null;
    }

This JDBCSampler is involved in clone :
TreeCloner.addNode(Object, HashTree) line: 64
ListedHashTree(HashTree).traverseInto(HashTreeTraverser) line: 1006
ListedHashTree(HashTree).traverse(HashTreeTraverser) line: 985
StandardJMeterEngine.cloneTree(ListedHashTree) line: 178
StandardJMeterEngine.run() line: 303
Thread.run() line: 534 [local variables unavailable]
But there the private member manager is already null.

JDBCSampler is also derived from Serializable. So must the following method 
also not be implemented ?
private void writeObject(java.io.ObjectOutputStream out) throws IOException

Kind regards
Johan
Comment 1 Sebb 2004-04-28 16:34:30 UTC
COuld you perhaps attach the jmeter log file from the server?
Comment 2 Johan Top 2004-04-30 08:36:30 UTC
Created attachment 11393 [details]
the requested log file where the server is runned local, together with JMeter
Comment 3 Johan Top 2004-04-30 08:38:41 UTC
Created attachment 11394 [details]
the corresponding logging in the dos console
Comment 4 Sebb 2004-10-14 00:28:53 UTC
Removing the transient qualifier from the manager field causes a problem,
because DBConnectionManager is not serializable.

Adding writeObject() is one possibility; otherwise clone() can be used - I've
added this to the release 2.0 branch, and it is in the 20041014 nightly build.

Hope this solves the problem ... sorry for the long delay.

Comment 5 Sebb 2004-10-14 11:12:17 UTC
Dunno what I was thinking - clone() won't help here. I'll try again later.
Comment 6 Sebb 2004-10-17 16:03:53 UTC
Added readObject() method to create the manager object for remote testing.

Code fix applied to branch 2.0; will appear in 2.0.2.
Comment 7 The ASF infrastructure team 2022-09-24 20:37:32 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1358