PDA

View Full Version : GWT compiler error at PagingToolBar onLoad()



Kutu
4 Jul 2008, 8:36 AM
GWT compiler recently blows up due to PagingToolBar.onLoad() method. Any idea why?



Compiling permutations
Analyzing permutation #1
[ERROR] An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:538)
at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:529)
at com.google.gwt.dev.jjs.ast.JVisitor.doAccept(JVisitor.java:509)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:65)
at com.google.gwt.dev.jjs.ast.JBinaryOperation.traverse(JBinaryOperation.java:77)
at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
at com.google.gwt.dev.jjs.ast.JVisitor.doAccept(JVisitor.java:509)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:65)
at com.google.gwt.dev.jjs.ast.JExpressionStatement.traverse(JExpressionStatement.java:42)
at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
at com.google.gwt.dev.jjs.ast.JVisitor.doAcceptWithInsertRemove(JVisitor.java:521)
at com.google.gwt.dev.jjs.ast.JVisitor.acceptWithInsertRemove(JVisitor.java:81)
at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:36)
at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
at com.google.gwt.dev.jjs.ast.JVisitor.doAccept(JVisitor.java:509)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:73)
at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:52)
at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
at com.google.gwt.dev.jjs.ast.JVisitor.doAccept(JVisitor.java:509)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:69)
at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:189)
at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
at com.google.gwt.dev.jjs.ast.JVisitor.doAcceptWithInsertRemove(JVisitor.java:521)
at com.google.gwt.dev.jjs.ast.JVisitor.acceptWithInsertRemove(JVisitor.java:81)
at com.google.gwt.dev.jjs.ast.JClassType.traverse(JClassType.java:62)
at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
at com.google.gwt.dev.jjs.ast.JVisitor.doAccept(JVisitor.java:515)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:77)
at com.google.gwt.dev.jjs.ast.JProgram.traverse(JProgram.java:799)
at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
at com.google.gwt.dev.jjs.ast.JVisitor.doAccept(JVisitor.java:509)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:69)
at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST.execImpl(GenerateJavaScriptAST.java:1838)
at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST.exec(GenerateJavaScriptAST.java:1634)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compile(JavaToJavaScriptCompiler.java:432)
at com.google.gwt.dev.GWTCompiler.realizePermutation(GWTCompiler.java:511)
at com.google.gwt.dev.GWTCompiler.compilePermutations(GWTCompiler.java:442)
at com.google.gwt.dev.GWTCompiler.distill(GWTCompiler.java:358)
at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:564)
at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:554)
at com.google.gwt.dev.GWTCompiler.main(GWTCompiler.java:214)
Caused by: java.lang.NullPointerException
at com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$GenerateJavaScriptVisitor.endVisit(GenerateJavaScriptAST.java:904)
at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:124)
at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
... 39 more
[ERROR] at PagingToolBar.java(250): event.config.getOffset()
com.google.gwt.dev.jjs.ast.JMethodCall
[ERROR] at PagingToolBar.java(250): this$static.start = event.config.getOffset()
com.google.gwt.dev.jjs.ast.JBinaryOperation
[ERROR] at PagingToolBar.java(250): this$static.start = event.config.getOffset()
com.google.gwt.dev.jjs.ast.JExpressionStatement
[ERROR] at PagingToolBar.java(248): {
this$static.start = event.config.getOffset();
this$static.totalLength = null.nullMethod();
this$static.activePage = Cast.round_int(Math.ceil((this$static.start + this$static.pageSize) / this$static.pageSize));
TextBoxBase.$setText(this$static.pageText, "" + this$static.activePage);
this$static.pages = this$static.totalLength < this$static.pageSize ? 1 : Cast.round_int(Math.ceil(this$static.totalLength / this$static.pageSize));
String after = null;
String display = null;
after = "of " + (GXT.$clinit(), this$static.pages);
Label.$setText(this$static.afterText, after);
Component.$setEnabled(this$static.first, this$static.activePage != 1);
Component.$setEnabled(this$static.prev, this$static.activePage != 1);
Component.$setEnabled(this$static.next, this$static.activePage != this$static.pages);
Component.$setEnabled(this$static.last, this$static.activePage != this$static.pages);
final int temp = this$static.activePage == this$static.pages ? this$static.totalLength : this$static.start + this$static.pageSize;
if (Cast.jsNotEquals(display, null)) {
final String[] params = Array.initValues(String[].class, 464, 1, ["" + this$static.start + 1, "" + temp, "" + this$static.totalLength]);
display = Format.substitute(this$static.afterPageText, params);
} else {
display = "Displaying " + (GXT.$clinit(), this$static.start + 1) + " - " + temp + " of " + this$static.totalLength;
}
String msg = display;
if (this$static.totalLength == 0) {
msg = this$static.emptyMsg;
}
Label.$setText(this$static.displayText, msg);
}

darrellmeyer
7 Jul 2008, 10:27 AM
You need to include test code in this format (http://extjs.com/forum/showthread.php?t=40289) if you are still having problems.

Kutu
7 Jul 2008, 3:58 PM
Hi Darrell,

I'm currently still in v1.0B4 by the way. I don't see any bugs/reports mentioning about the GWT compiler error around PagingToolbar so I assume this bug is still a mistery.

Here's the code (straight copied from PagingTablePage.java example):



import java.util.ArrayList;
import java.util.List;

import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.binder.TableBinder;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.PagingToolBar;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.table.Table;
import com.extjs.gxt.ui.client.widget.table.TableColumn;
import com.extjs.gxt.ui.client.widget.table.TableColumnModel;
import com.google.gwt.user.client.Element;
import com.thatone.gwt.example.model.Stock;

public class PagingTablePage extends LayoutContainer {

@Override
protected void onRender(final Element parent, final int pos) {
super.onRender(parent, pos);

final FlowLayout layout = new FlowLayout(10);
this.setLayout(layout);

final List<TableColumn> columns = new ArrayList<TableColumn>();
columns.add(new TableColumn("forum", "Forum", 150));
columns.add(new TableColumn("username", "Username", 100));
columns.add(new TableColumn("subject", "Subject", 200));
columns.add(new TableColumn("date", "Date", 100));

// create the column model
final TableColumnModel cm = new TableColumnModel(columns);
final Table table = new Table(cm);

// store
final ListStore<Stock> store = new ListStore<Stock>();

// binder
new TableBinder<Stock>(table, store);

final PagingToolBar toolBar = new PagingToolBar(50);

final ContentPanel panel = new ContentPanel();
panel.setFrame(true);
panel.setCollapsible(true);
panel.setAnimCollapse(false);
panel.setButtonAlign(HorizontalAlignment.CENTER);
panel.setIconStyle("icon-table");
panel.setHeading("Paging Table");
panel.setLayout(new FitLayout());
panel.add(table);
panel.setSize(600, 450);
panel.setBottomComponent(toolBar);

this.add(panel);
}
}

darrellmeyer
8 Jul 2008, 6:09 AM
Beta 4 is not supported, you will need to move to 1.0 final.

Kutu
8 Jul 2008, 8:12 AM
Beta 4 is not supported, you will need to move to 1.0 final.

I understand that. But on the other hand, I see no bug (or bug-fixes) related to this issue. What makes 1.0 "erase" this bug?

darrellmeyer
9 Jul 2008, 8:26 AM
I have not confirmed there is a bug. See if you have any problems with 1.0 code.

Kutu
9 Jul 2008, 11:50 AM
I have not confirmed there is a bug. See if you have any problems with 1.0 code.

Will do when I get the "green-light" to update.

neonzebra
18 Aug 2008, 5:19 PM
I'm having the same problem. Upgraded to latest 1.0.2 release. Still getting the error.

darrellmeyer
18 Aug 2008, 7:25 PM
Please provide more information, including test code, OS, JDK, browser and version.

neonzebra
19 Aug 2008, 10:26 AM
Please provide more information, including test code, OS, JDK, browser and version.

Here is a java file which causes the error:




import com.extjs.gxt.ui.client.binder.TableBinder;
import com.extjs.gxt.ui.client.data.BasePagingLoader;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;

import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.PagingToolBar;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.table.Table;
import com.extjs.gxt.ui.client.widget.table.TableColumn;
import com.extjs.gxt.ui.client.widget.table.TableColumnModel;

import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.rpc.AsyncCallback;

import java.util.List;
import java.util.ArrayList;


public class GXTTest implements EntryPoint {
public void onModuleLoad() {
ContentPanel panel = new ContentPanel();

List columns = new ArrayList();
columns.add(new TableColumn("xx", "xx", 100));
columns.add(new TableColumn("yy", "yy", 100));

// create the column model
TableColumnModel cm = new TableColumnModel(columns);
Table table = new Table(cm);

// loader
final BasePagingLoader loader =
new BasePagingLoader(null) {

protected void loadData(BasePagingLoadConfig config,
AsyncCallback callback) {

// MY CUSTOM RPC CALL GOES HERE
}
};
// store
ListStore store = new ListStore(loader);

// binder
TableBinder binder = new TableBinder(table, store);
binder.init();

PagingToolBar toolBar = new PagingToolBar(50);
toolBar.bind(loader);


panel.add(table);
panel.setBottomComponent(toolBar);

// load after rendering
DeferredCommand.addCommand(new Command(){
public void execute() {
loader.load(0, 50);
}
});
RootPanel.get().add(panel);
}
}


I'm using GWT 1.5.1 and GXT 1.0.2 with java 1.6.0_06 JDK on Linux. The error appears when compiling the GWT module via a custom ANT target. Also, when compiled in hosted mode (on Mac OS X Leopard), no errors appear in the console. The hosted-mode browser just appears blank.

javarux
25 Aug 2008, 1:09 PM
I have the same issue while compiling with GXT 1.0.2, JDK 1.5.0_15 and GWT 1.5.1 on Win XP

Ant target:


<target name="gwtcompile" depends="compile" description="Compiles the GWT java code into javascript">
<path id="gwt.classpath">
<pathelement location="src"/>
<pathelement location="${build.home}/WEB-INF/classes"/>
<path refid="compile.classpath"/>
</path>
<java classpathref="gwt.classpath" classname="com.google.gwt.dev.GWTCompiler" fork="true">
<jvmarg value="-Xmx512m"/>
<arg value="-out"/>
<arg value="${build.home}"/>
<arg value="org.finra.hpw.Application"/>
</java>
</target>

gslender
25 Aug 2008, 6:08 PM
I'm using GWT 1.5.1 and GXT 1.0.2 with java 1.6.0_06 JDK on Linux. The error appears when compiling the GWT module via a custom ANT target. Also, when compiled in hosted mode (on Mac OS X Leopard), no errors appear in the console. The hosted-mode browser just appears blank.

I am not sure if this is the problem, but I do notice that....

GXT 1.0.2 is not officially supported/tested with GWT 1.5.1 (rc2). You should be using GWT 1.5.0 (rc1) with GXT 1.0.2

The 1.1 alpha release of GXT will move to and support GWT 1.5.1 (rc2).

cheers,
grant

javarux
26 Aug 2008, 6:30 AM
I am not sure if this is the problem, but I do notice that....

GXT 1.0.2 is not officially supported/tested with GWT 1.5.1 (rc2). You should be using GWT 1.5.0 (rc1) with GXT 1.0.2

The 1.1 alpha release of GXT will move to and support GWT 1.5.1 (rc2).

cheers,
grant

I just checked with GWT 1.5.0 - no, PagingToolBar does not compile with it either.
It throws an error at GWT compile time even if I call the constructor only:


PagingToolBar toolBar = new PagingToolBar(50);

gslender
26 Aug 2008, 1:56 PM
just checked and seems 1.1 alpha has this fixed...