Unable to parse source (during databinding setup).

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Unable to parse source (during databinding setup).

Postby octavio » Wed Feb 10, 2010 8:29 pm

WindowBuilder is not working well from an "old" workspace, but it works fine on a new project in a new workspace.

While trying to setup databinding between a text box and a bean property in an old project, I'm getting the following error:

WindowBuilder was not able to parse source protected org.eclipse.core.databinding.DataBindingContext initDataBindings() { org.eclipse.core.databinding.DataBindingContext bindingContext = new org.eclipse.core.databinding.DataBindingContext(); // org.eclipse.core.databinding.observable.value.IObservableValue officialNameTextObserveTextObserveWidget = org.eclipse.jface.databinding.swt.SWTObservables.observeText(officialNameText, org.eclipse.swt.SWT.Modify); org.eclipse.core.databinding.observable.value.IObservableValue orgOfficialNameObserveValue = org.eclipse.core.databinding.beans.BeansObservables.observeValue(org, "officialName"); bindingContext.bindValue(officialNameTextObserveTextObserveWidget, orgOfficialNameObserveValue, null, null); // return bindingContext; } . Possible reasons:

Using old versions of libraries in your Java project.
Compilation errors in your Java project.
Bug in WindowBuilder.


I included a stack trace below.

I have no errors in my java project. Since I can't replicate the error in a new workspace, Windowbuilder must be fine. So I must have some old libraries. However, I see no Instantiations libraries in my dependencies and all eclipse dependencies are recent.

I'm having difficulty troubleshooting. Any guidance would be appreciated,
Octavio

Code: Select all
com.instantiations.designer.core.utils.exception.DesignerException: 205 (Unable to parse source.).    protected org.eclipse.core.databinding.DataBindingContext initDataBindings() {
      org.eclipse.core.databinding.DataBindingContext bindingContext = new org.eclipse.core.databinding.DataBindingContext();
      //
      org.eclipse.core.databinding.observable.value.IObservableValue officialNameTextObserveTextObserveWidget = org.eclipse.jface.databinding.swt.SWTObservables.observeText(officialNameText, org.eclipse.swt.SWT.Modify);
      org.eclipse.core.databinding.observable.value.IObservableValue orgOfficialNameObserveValue = org.eclipse.core.databinding.beans.BeansObservables.observeValue(org, "officialName");
      bindingContext.bindValue(officialNameTextObserveTextObserveWidget, orgOfficialNameObserveValue, null, null);
      //
      return bindingContext;
   }

   at com.instantiations.designer.core.utils.ast.ASTParser.parseBodyDeclaration(ASTParser.java:173)
   at com.instantiations.designer.core.utils.ast.ASTEditor.addBodyDeclaration(ASTEditor.java:2021)
   at com.instantiations.designer.core.utils.ast.ASTEditor.addMethodDeclaration(ASTEditor.java:1744)
   at com.instantiations.designer.core.utils.ast.ASTEditor.addMethodDeclaration(ASTEditor.java:1712)
   at com.instantiations.designer.rcp.databinding.model.DataBindingsRootInfo.commit(DataBindingsRootInfo.java:161)
   at com.instantiations.designer.rcp.databinding.DatabindingsProvider$4.run(DatabindingsProvider.java:663)
   at com.instantiations.designer.core.utils.execution.ExecutionUtils.run(ExecutionUtils.java:240)
   at com.instantiations.designer.rcp.databinding.DatabindingsProvider.saveEdit(DatabindingsProvider.java:661)
   at com.instantiations.designer.rcp.databinding.DatabindingsProvider.addBinding(DatabindingsProvider.java:618)
   at com.instantiations.designer.core.databinding.ui.EditComposite.createBinding(EditComposite.java:171)
   at com.instantiations.designer.core.databinding.ui.EditComposite$4.widgetSelected(EditComposite.java:147)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
   at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
   at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
   at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: com.instantiations.designer.core.utils.exception.DesignerException: 205 (Unable to parse source.). package com.oxbsystems.client.element.wizard.create.org;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import com.oxbsystems.bean.org.Org;
class OrgNameWizardPage extends WizardPage {
com.oxbsystems.bean.org.Org org=(com.oxbsystems.bean.org.Org) null;
org.eclipse.swt.widgets.Text officialNameText=(org.eclipse.swt.widgets.Text) null;
org.eclipse.swt.widgets.Text shortNameText=(org.eclipse.swt.widgets.Text) null;
public void createControl(Composite parent) {}
public Org getOrg() {return (com.oxbsystems.bean.org.Org) null;}
OrgNameWizardPage(Object __wbp_param) {
super((java.lang.String) null);}
   protected org.eclipse.core.databinding.DataBindingContext initDataBindings() {
      org.eclipse.core.databinding.DataBindingContext bindingContext = new org.eclipse.core.databinding.DataBindingContext();
      //
      org.eclipse.core.databinding.observable.value.IObservableValue officialNameTextObserveTextObserveWidget = org.eclipse.jface.databinding.swt.SWTObservables.observeText(officialNameText, org.eclipse.swt.SWT.Modify);
      org.eclipse.core.databinding.observable.value.IObservableValue orgOfficialNameObserveValue = org.eclipse.core.databinding.beans.BeansObservables.observeValue(org, "officialName");
      bindingContext.bindValue(officialNameTextObserveTextObserveWidget, orgOfficialNameObserveValue, null, null);
      //
      return bindingContext;
   }

}
   at com.instantiations.designer.core.utils.ast.ASTParser.findNode(ASTParser.java:716)
   at com.instantiations.designer.core.utils.ast.ASTParser.parseBodyDeclaration(ASTParser.java:171)
   ... 35 more
Caused by: com.instantiations.designer.core.utils.check.AssertionFailedException: null argument:
   at com.instantiations.designer.core.utils.check.Assert.fail(Assert.java:198)
   at com.instantiations.designer.core.utils.check.Assert.isNotNull(Assert.java:151)
   at com.instantiations.designer.core.utils.check.Assert.isNotNull(Assert.java:138)
   at com.instantiations.designer.core.utils.ast.ASTParser$3.postVisit(ASTParser.java:869)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2483)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
   at org.eclipse.jdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:225)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
   at org.eclipse.jdt.core.dom.VariableDeclarationStatement.accept0(VariableDeclarationStatement.java:273)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
   at org.eclipse.jdt.core.dom.Block.accept0(Block.java:136)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
   at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:502)
   at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
   at com.instantiations.designer.core.utils.ast.ASTParser.copyBindings(ASTParser.java:838)
   at com.instantiations.designer.core.utils.ast.ASTParser.findNode0(ASTParser.java:748)
   at com.instantiations.designer.core.utils.ast.ASTParser.findNode(ASTParser.java:714)
   ... 36 more
octavio
 
Posts: 8
Joined: Sun May 04, 2008 4:50 pm

Re: Unable to parse source (during databinding setup).

Postby Eric Clayberg » Wed Feb 10, 2010 8:32 pm

No idea. Please make sure that you are using the latest SWT Designer v7.3 build and submit the case using the "Contact Support" button in the error window. Include the entire project so that we can properly test it.

What happens if you open the old project in the new workspace?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Unable to parse source (during databinding setup).

Postby octavio » Fri Feb 12, 2010 9:52 pm

Eric,
I spent all day troubleshooting this one.
SWT designer fails if you declare an instance variable using the name "org". :shock: :cry: :( :? :x
Something in that ASTParser, I guess.

Code: Select all
import com.oxbsystems.bean.org.Org;

public class BindingFailureComposite extends Composite {
   private Org org;   // name this variable anything other than org and swt designer works fine
   private Text nameText;


I submitted the error report and included a project that replicates the failure.

Octavio
octavio
 
Posts: 8
Joined: Sun May 04, 2008 4:50 pm

Re: Unable to parse source (during databinding setup).

Postby Eric Clayberg » Sat Feb 13, 2010 11:53 am

octavio wrote:I spent all day troubleshooting this one.
SWT designer fails if you declare an instance variable using the name "org".
Something in that ASTParser, I guess.

I'm sorry you spent all day troubleshooting this, but you didn't need to. Had you reported this immediately (using the Contact Support button in the error window) rather than waiting so long, we could have diagnosed the problem for you very quickly.

What you have run into is a classic (and subtle) problem/bug/feature(?) of the Java compiler itself (not the ASTParser)...

http://my.safaribooksonline.com/0321336 ... iew=search

"To avoid conflicts between variable names and package names, don’t use a top-level package or domain name as a variable name. Specifically, don’t name a variable com, org, net, edu, java, or javax."

Try this...

Code: Select all
public class Fail {
    private Object org;
    public Fail() {
        int value = org.eclipse.swt.SWT.NONE;
    }
}

...or this...

Code: Select all
public class Fail {
        private Object java;
        public Fail() {
                String value = java.awt.BorderLayout.NORTH;
        }
}

In the latest build, we have added another possible reason to the "Unable to parse source" exception...

    Use of conflicting variable name such as com, org, net, edu, java, or javax.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: Google [Bot] and 2 guests