调试时如何处理ClassNotLoadedException? [英] How do I deal with a ClassNotLoadedException while debugging?

查看:455
本文介绍了调试时如何处理ClassNotLoadedException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我(远程)在Eclipse中调试一个java / jboss应用程序,逐行走过。有一点,一个数组 GridSquare 对象( GridSquare 是一个相当简单的独立类,包含一些属性和方法)由方法调用创建,即:

So I'm (remotely) debugging a java/jboss application in Eclipse, stepping through line by line. At one point, an array of GridSquare objects (GridSquare is a fairly simple, standalone class, contains a few properties and methods) is created by a method call, i.e:

GridSquare [] squares = this.theGrid.getSquares(14,18,220,222 );

...当我实际执行代码时,方块数组确实填满了 GridSquare 对象,当我执行代码和调试时,我会感到奇怪。在紧接着上述分配之后的断点上,如果我尝试查看 square 数组,而不是一个值,我得到这个:

...While when I actually execute the code, the squares array does get populated with GridSquare objects, I get something odd when stepping through the code and debugging. At a breakpoint on the line immediately following the assignment shown above, if I try to view the squares array, instead of a value I get this:

org.eclipse.debug.core.DebugException:com.sun.jdi.ClassNotLoadedException:在检索数组的组件类型时,没有加载类型。

...任何人都知道这是什么?

...Anyone know what that's about?

推荐答案

基本上这意味着类加载器没有加载GridSquare []类。话虽如此,这听起来像调试器中的一个错误。与代码的断点关联似乎略有打破。您需要重新编译才能使行号同步或其他问题正在发生。在代码中的那一点(分配之后)需要加载。除非getSquares实际返回一个子类(GridSquareSubclass []),否则JVM可能没有加载它,因为它不需要它(尚)。

Basically it means the class loader has not loaded the GridSquare[] class. That being said it sounds like a bug in the debugger in some way. The breakpoint association with the code seems to be slightly broken. Either you need to recompile to get the line numbers in sync or some other issue is going on. At that point in the code (after the assignment) it needs to be loaded. Unless getSquares actually returns a subclass (GridSquareSubclass[]) at which point the JVM may not have loaded it because it doesn't need it (yet).

这篇关于调试时如何处理ClassNotLoadedException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆