PDA

View Full Version : [2.0.1] java.lang.VerifyError in HostedMode



ErikL
3 Aug 2009, 1:28 AM
Hi,

environment: Windows XP, JDK 1.5_12, EXT-GWT 2.0.1, GWT 1.7.

I'm currently migrating our EXT-GWT 1.2.4 / GWT 1.5 based application to EXT-GWT 2.0.1 / GWT 1.7. After adapting to the new GWT 1.6+ project structure and fixing hundreds of compilation errors due to EXT-GWT 2.0 API changes, I have things running pretty well.

However - I have a severely strange runtime error in Hosted Mode which may - or may not - be related to EXT-GWT. Exception is:


java.lang.VerifyError: (class: com.myapp.MyClass$5$1$1, method: read signature: (Ljava/lang/Object;Ljava/lang/Object;)Lcom/extjs/gxt/ui/client/data/BasePagingLoadResult;) Expecting to find unitialized object on stack.
The actual code in "MyClass" that's failing is the bold one. The method is part of an @Override of the "read" method as specified by the DataReader interface:



@Override
public BasePagingLoadResult<BaseModel> read(Object loadConfig, Object data) {
RpcDtoListResult result = (RpcDtoListResult) data;
return new BasePagingLoadResult<BaseModel>(createGridData(result), result.getFirstResult(), result.getTotalSize());
}
The RpcDtoListResult is an app-specific class containing data fetched from the server.

So - I've tried searching this and other forums and I've come up with extremely little information regarding this "Expecting to find unitialized object on stack." error. The most common source seems to be interoperability problems with JDK versions 1.2 and 1.3. Im using JDK 1.5_12.

A possible indication regarding JDK version inconsistency might be the misspelled "unitalized" word which someone thought were specific to JDK 1.4 - maybe a problem with the new Jetty-based Hosted Mode in GWT 1.6? I know that it is quite likely this error has nothing to do with EXT-GWT, but since it is the implementation of an EXT-GWT interface that's causing the probem, I thought I would start here.

Thanks in advance for any suggestions regarding this issue.

ErikL
3 Aug 2009, 4:11 AM
A small update...


public BasePagingLoadResult<BaseModel> read(Object loadConfig, Object data) {
RpcDtoListResult result = (RpcDtoListResult) data;
return new BasePagingLoadResult<BaseModel>(createGridData(result), result.getFirstResult(), result.getTotalSize());
}
Ok, the problem is almost certainly not related to EXT-GWT. The method above is part of an anonymous inner class, which in it's turn is part of another anonymous inner class. In the latter, a app-specific superclass defines a "protected abstract List<M> createGridData(U result), where M is a "<M extends ModelData> and U is a app-specific RPC result (sub)class). This is implemented in the latter anonymous class.

Anyway, something about this doesn't work in hosted mode. If I, for example, replace this call to the "createGridData" method with a call to a class-local "createGridDataLocal" with the exact same method body, it works just fine.

It might be something about the combination of several levels of inheritence and generics which the HostedMode crashes on. I saw some forum post about Groovy users getting the same VerifyError in some special inheritance cases, who knows what magic tricks the HostedMode app uses internally...

Sorry for wasting EXT-GWT forum space with a very probable non-EXT-GWT issue. Maybe it can help someone in the future who runs into the same problem...