Realm cannot be null

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

Realm cannot be null

Postby hogger » Fri Feb 27, 2009 12:04 am

When I try to add an composite (made by JFace Automatic Databinding, in this case "PeopleDB.java") to an existing Shell-Application (in this case "PersonList.java"), the error-message "Realm cannot be null" appears:

Code: Select all
org.eclipse.core.runtime.AssertionFailedException: null argument:Realm cannot be null
   at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:86)
   at org.eclipse.core.databinding.observable.ChangeManager.<init>(ChangeManager.java:36)
   at org.eclipse.core.databinding.observable.AbstractObservable.<init>(AbstractObservable.java:28)
   at org.eclipse.core.databinding.observable.value.AbstractObservableValue.<init>(AbstractObservableValue.java:42)
   at org.eclipse.core.internal.databinding.beans.JavaBeanObservableValue.<init>(JavaBeanObservableValue.java:63)
   at org.eclipse.core.internal.databinding.beans.JavaBeanObservableValue.<init>(JavaBeanObservableValue.java:52)
   at org.eclipse.core.databinding.beans.BeansObservables.observeValue(BeansObservables.java:89)
   at org.eclipse.core.databinding.beans.BeansObservables.observeValue(BeansObservables.java:69)
   at ch.clicdesign.artistadmin.simpleclient.PeopleDB.initDataBindings(PeopleDB.java:92)
   at ch.clicdesign.artistadmin.simpleclient.PeopleDB.<init>(PeopleDB.java:70)
   at ch.clicdesign.artistadmin.simpleclient.PersonList.createContents(PersonList.java:167)
   at ch.clicdesign.artistadmin.simpleclient.PersonList.open(PersonList.java:62)


I know, there're some workarounds to replace the code made by the Automatic Databinding, but it's not a real solution.
Does anyone have the same problem or a good tip?
Thx!
hogger
 
Posts: 1
Joined: Thu Feb 26, 2009 1:51 am

Re: Realm cannot be null

Postby Eric Clayberg » Fri Feb 27, 2009 4:17 am

The realm needs to be set up when your application starts. Composites will use the realm set up in the parent shell. If you don't have a realm set up in your shell, you need to do so.

The databinding example project provided with SWT Designer shows how to do this, or you can simply refer to the Eclipse Data Binding docs.
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: No registered users and 2 guests