java.lang.ClassFormatError while loading class

此生再无相见时 提交于 2019-12-11 16:29:59

问题


I am implementing the AbstractFactory pattern allowing outsiders to create Factories. I am reading the factory implementation name from a properties file, loading the factory class and using it to construct objects. Problem is that somewhere in my factory implementation when I'm trying to create an object of a task I get the following error:

Exception in thread "Thread-1" java.lang.ClassFormatError: Code segment has wrong length in class file com/testsuite/loadperformancetesterusage/tasks/GetUrl

Following is the GetUrl constructor, nothing fancy!

public GetUrl( String protocol, String port, String hostname, String path, String producerClassName ) {
    super(producerClassName);
    this.protocol = protocol;
    this.hostname = hostname;
    this.port = port;
    this.path = path;
}

Any feedback on what might be happening here? Cross posted here


回答1:


There was some mismatch in the version of classes i was using. It works now.



来源:https://stackoverflow.com/questions/12667377/java-lang-classformaterror-while-loading-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!