开发者

XSLT not calling method belonging to Java parent class: ClassNotFoundException & NoClassDefFoundError

I am trying to make a call to a method, let's say getFullName() within an XSL stylesheet. The method belongs to a class Person, which is a superclass of Student. I have defined the Student class in the XSL stylesheet namespace as follows: xmlns:std="java:example.code.Student". However, during runtime, I get the following two errors: ClassNotFoundException and NoClassDefFoundError for example.code.abstract.Person. Seems like the class definitio开发者_如何学Pythonns for Person isn't available during runtime? Shouldn't the Student object have access to its parent's methods?


Seems like the class definitions for Person isn't available during runtime?

Yes, that would be the correct interpretation of the error.

Shouldn't the Student object have access to its parent's methods?

Yes, the Student object will have access to the parent's non-private methods. That is, provided the parent's class is available at runtime. In other words, the child class does not embed the parent's methods, so it will need the parent class to be made available for access.

The parent class is unavailable during the load of the child class, resulting in the NoClassDefFoundError. You'll need to ensure that the both the parent and child classes are available at runtime to prevent the error from occuring.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜