Getting NoClassDefFoundError: IObservableValue

71 views
Skip to first unread message

Guddu

unread,
Aug 26, 2009, 10:02:35 AM8/26/09
to vogella
Hi Lars,

I am not able to get the instance of IObservableValue" when running
the below code for EMF DataBinding.

I have used these plug-ins for databinding purpose:
- "org.eclipse.core.databinding" ,"org.eclipse.emf.databinding" and
"org.eclipse.emf.databinding.edit".

IObservableValue is available in "org.eclipse.core.databinding".

CO_Person is an interface that is extending EObject interface and
there is CO_PersonImpl class that is implementing CO_Person and
extending EObjectImpl class.

I have created a EMFDataBindingView as per your example and using
CO_Person. I am getting error in "createPartControl()" method when
tring to bind values using bindingContext.bindValue().

public void createPartControl(Composite parent) {

// Lets put thing to order
Layout layout = new GridLayout(2, false);
parent.setLayout(layout);

private CO_Person coPerson;

// Initialize the model
PersonPackage.eINSTANCE.eClass();
// Retrieve the default factory singleton
PersonFactory factory = PersonFactory.eINSTANCE;
coPerson = factory.createCO_Person();

GenericName fname = new GenericNameImpl();
fname.setValue("Ajay");
coPerson.setFirstName(fname);

GenericName lname = new GenericNameImpl();
lname.setValue("Chauhan");
coPerson.setLastName(lname);

EmailAddress email = new EmailAddressImpl();
email.setValue("ajay.c...@ps.net");
coPerson.getEmailAddresses().add(email);


Label firstLabel = new Label(parent, SWT.NONE);
firstLabel.setText("FirstName: ");
// New text element
Text firstName = new Text(parent, SWT.BORDER);
firstName.setText("");

GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.horizontalSpan = 2;
firstName.setLayoutData(gridData);

DataBindingContext bindingContext = new DataBindingContext();
bindingContext.bindValue(SWTObservables.observeText(firstName,
SWT.Modify), EMFObservables.observeValue
(coPerson,PersonPackage.Literals.CO_PERSON__FIRST_NAME), null, null);

Exception details:

java.lang.NoClassDefFoundError: org/eclipse/core/databinding/
observable/value/IObservableValue
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension
(RegistryStrategyOSGI.java:170)
at


Please let me know the reasons why it is not being available as I have
used "org.eclipse.core.databinding" plug-in in my application



Thanks & Regards,

Ajay Chauhan

Lars Vogel

unread,
Aug 26, 2009, 10:20:24 AM8/26/09
to vog...@googlegroups.com
Hi,

does my example work?
http://www.vogella.de/articles/EclipseDataBinding/article.html

Best regars, Lars

2009/8/26 Guddu <call...@gmail.com>:
--
Lars
http://www.vogella.de - Tutorial about Java, Eclipse and Web programming
http://www.twitter.com/vogella - Lars on Twitter

Guddu

unread,
Aug 27, 2009, 5:35:40 AM8/27/09
to vogella
Hi Lars,

Data Binding is working fine with Beans, POJOs, and JFace given in
your example but not working with EMF.


On Aug 26, 7:20 pm, Lars Vogel <lars.vo...@googlemail.com> wrote:
> Hi,
>
> does my example work?http://www.vogella.de/articles/EclipseDataBinding/article.html
>
> Best regars, Lars
>
> 2009/8/26 Guddu <call2...@gmail.com>:
> > email.setValue("ajay.chau...@ps.net");
> Larshttp://www.vogella.de- Tutorial about Java, Eclipse and Web programminghttp://www.twitter.com/vogella- Lars on Twitter

Lars Vogel

unread,
Aug 27, 2009, 5:38:19 AM8/27/09
to vog...@googlegroups.com
The code your provided is not based on my EMF example. Please try my
example and let me know if you face problems there.
Reply all
Reply to author
Forward
0 new messages