db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1338) Client tests DerbyNetNewServer and NSinSameVM fail with NoClassDefFoundError: DRDAProtocolExceptionInfo when run from classes dir
Date Mon, 22 May 2006 15:26:30 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1338?page=comments#action_12412791 ] 

Dag H. Wanvik commented on DERBY-1338:
--------------------------------------

I have looked at this some more and I think I understand
more of what's happening, although the root cause is still 
an open question. Here are my findings so far:

- When I run this with JDK1.6 the test works.
- Running without security manager did not impact the error.
- I ran the test with -Duseprocess=false and the error still occurs,
  so I can see what happens in jdb. In jdb, I was able to find where
  the exception occurs: 

  As the NetworkServerStarter#blockingStart, released from its wait on
  shutdownSync, is dowing the actual shutdown (interrupting threads,
  closing server socket), the connection thread is blocked on a read:

DRDAConnThread_4[1] where
  [1] java.net.SocketInputStream.socketRead0 (native method)
  [2] java.net.SocketInputStream.read (SocketInputStream.java:129)
  [3] org.apache.derby.impl.drda.DDMReader.fill (DDMReader.java:1,720)
  [4] org.apache.derby.impl.drda.DDMReader.ensureALayerDataInBuffer (DDMReader.java:1,473)
  [5] org.apache.derby.impl.drda.DDMReader.readDssHeader (DDMReader.java:315)
  [6] org.apache.derby.impl.drda.DRDAConnThread.processCommands (DRDAConnThread.java:628)
  [7] org.apache.derby.impl.drda.DRDAConnThread.run (DRDAConnThread.java:238)

The read then fails when socket is closed, and gives an IOException
here:

> breakpoint hit: "thread=DRDAConnThread_4",
> org.apache.derby.impl.drda.DDMReader.fill(), line=1,724 bci=43
> 
> DRDAConnThread_4[1] print ioe
>  ioe = "java.net.SocketException: Socket closed"

At this point the method markCommunicationsFailure is called, which
tries to create an exception of class DRDAProtocolException. This is
where the class loader gives the error. I used jdb to check which
classes were loaded *before* this line:

	throw DRDAProtocolException.newDisconnectException(this,oa);

And I could see that *both* DRDAProtocolException and
DRDAProtocolExceptionInfo were unknown to the VM. After I step this
statement in jdb, DRDAProtocolException is known, but *not*
DRDAProtocolExceptionInfo, hence the error. Why it cannot load it, I
don't know.

If I make a dummy DRDAProtocolExceptionInfo object in
NetworkServerControlImpl, the error goes away.

This all leads me to believe that the Derby code is ok, and that this
is a class loader issue, all the more so, since the problem goes away
when the test is run with jars or with the newer JDK1.6.

I did run the test inside jdb with JDK1.6 and could see that both
classes got loaded correctly at this point in the code.

> Client tests DerbyNetNewServer and NSinSameVM fail with NoClassDefFoundError: DRDAProtocolExceptionInfo
when run from classes dir
> ---------------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1338
>          URL: http://issues.apache.org/jira/browse/DERBY-1338
>      Project: Derby
>         Type: Bug

>  Environment: Sun JDK 1.4.2, Sun JDK 1.5
>     Reporter: Dag H. Wanvik
>     Priority: Minor

>
> When run from Sun JDK 1.4.2 and Sun JDK 1.5, these two tests fail when run from the
> classes directory. They work, though, when run from jars.
> Running NSinSameVM in my sandbox:
> bash-3.00$ java   -Dframework=DerbyNetClient org.apache.derbyTesting.functionTests.harness.RunTest
derbynet/NSinSameJVM.java
> *** Start: NSinSameJVM jdk1.4.2_05 DerbyNetClient 2006-05-22 14:49:05 ***
> Initialize for framework: DerbyNetClient
> startServer = false. Bypass server startup
> 6 add
> > java.lang.NoClassDefFoundError: org/apache/derby/impl/drda/DRDAProtocolExceptionInfo
> Test Failed.
> *** End:   NSinSameJVM jdk1.4.2_05 DerbyNetClient 2006-05-22 14:49:27 ***
> I get similar behavior for DerbyNetNewServer.  I ran this on a Solaris 10/i86x box. Davis
has seen it too, see 
> initial discusson on this thread: http://www.nabble.com/forum/ViewPost.jtp?post=4477600&framed=y

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message