java.lang.ClassFormatError while loading class

2019-09-06 08:03发布

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条回答
该账号已被封号
2楼-- · 2019-09-06 08:53

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

查看更多
登录 后发表回答