0
我正在实现允许外部人员创建工厂的AbstractFactory模式。我正在从属性文件读取工厂实现名称,加载工厂类并使用它来构造对象。问题是,在什么地方我的工厂实现时,我试图创建一个任务,我得到以下错误的对象:加载类时java.lang.ClassFormatError
Exception in thread "Thread-1" java.lang.ClassFormatError: Code segment has wrong length in class file com/testsuite/loadperformancetesterusage/tasks/GetUrl
以下是使用getURL构造,没有什么花哨!
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;
}
对这里可能发生的事情有任何反馈? Cross发布here
你的意思是不匹配是什么意思? –
这是一段时间后,但据我记得,我已经编译了类使用一些Java版本,并试图加载它使用另一个版本。 –