Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor
org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #654087] Mon, 14 February 2011 05:18
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Hello,

I am using e4 (41) and Google WindowBuilder to generate my UI.

I have the following UI in plugin 'a' which are exported and imported for use in plugin 'b' ('com.epimss.shared)
NameTblViewer.xwt
NameTblViewer.java


<Composite 
    xmlns="http://www.eclipse.org/xwt/presentation" 
    xmlns:x="http://www.eclipse.org/xwt" 
    x:Class="com.epimss.reg.ui.viewers.NameTblViewer" 
    x:Name="root"
    dataContext="{StaticResource names}"
    xmlns:p1="clr-namespace:com.epimss.shared.ui.viewers" 
    xmlns:p2="clr-namespace:org.eclipse.nebula.widgets.pgroup" 
    xmlns:p3="clr-namespace:com.epimss.shared.ui.reg" 
    xmlns:p4="clr-namespace:com.epimss.shared.ui" 
    xmlns:p5="clr-namespace:org.eclipse.ui.forms.widgets" >
	<Composite.layout>
		<GridLayout/>
	</Composite.layout>
    <Composite.Resources>
        <p1:Names x:Key="names"/>
    </Composite.Resources>
    <p2:PGroup text="Search Database By:">
    	<p2:PGroup.layoutData>
    		<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    	</p2:PGroup.layoutData>
    	<p2:PGroup.layout>
    		<FillLayout/>
    	</p2:PGroup.layout>
    	<Composite>
    		<Composite.layout>
    			<GridLayout/>
    		</Composite.layout>
    		<Form>
    			<Form.body>
    				<Form.body.layout>
    					<GridLayout/>
    				</Form.body.layout>
    			</Form.body>
    		</Form>
    		<Section text="Medical Registration Number (MRN)" x:Style="Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED">
    			<Section.layoutData>
    				<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    			</Section.layoutData>
    			<Section.client>
    				<Composite>
    					<Composite.layout>
    						<GridLayout numColumns="3"/>
    					</Composite.layout>
    					<p3:MrnForm x:Name="mrnForm">
    						<p3:MrnForm.layoutData>
    							<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    						</p3:MrnForm.layoutData>
    					</p3:MrnForm>
    					<p4:VLabelSeparator>
    						<p4:VLabelSeparator.layoutData>
    							<GridData grabExcessVerticalSpace="true" verticalAlignment="FILL"/>
    						</p4:VLabelSeparator.layoutData>
    					</p4:VLabelSeparator>
    					<Button text="Search" x:Name="searchByMrnBtn">
    						<Button.layoutData>
    							<GridData horizontalAlignment="CENTER" grabExcessVerticalSpace="true"/>
    						</Button.layoutData>
    					</Button>
    				</Composite>
    			</Section.client>
    		</Section>
    		<Section text="Date of Birth" x:Style="(p5:Section).CLIENT_INDENT | (p5:Section).EXPANDED | (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
    			<Section.layoutData>
    				<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    			</Section.layoutData>
    			<Section.client>
    				<Composite>
    					<Composite.layout>
    						<GridLayout numColumns="3"/>
    					</Composite.layout>
    					<p3:DobForm x:Name="dobForm">
    						<p3:DobForm.layoutData>
    							<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    						</p3:DobForm.layoutData>
    					</p3:DobForm>
    					<p4:VLabelSeparator>
    						<p4:VLabelSeparator.layoutData>
    							<GridData verticalAlignment="FILL" grabExcessVerticalSpace="true" horizontalAlignment="RIGHT"/>
    						</p4:VLabelSeparator.layoutData>
    					</p4:VLabelSeparator>
    					<Button text="Search" x:Name="searchByDobBtn"/>
    				</Composite>
    			</Section.client>
    		</Section>
    		<Section text="Name" x:Style="(p5:Section).CLIENT_INDENT | (p5:Section).EXPANDED | (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
    			<Section.layoutData>
    				<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    			</Section.layoutData>
    			<Section.client>
    				<Composite>
    					<Composite.layout>
    						<GridLayout numColumns="8"/>
    					</Composite.layout>
    					<Label text="First">
    						<Label.layoutData>
    							<GridData horizontalAlignment="RIGHT"/>
    						</Label.layoutData>
    					</Label>
    					<Text x:Style="BORDER" x:Name="firstNameTxt">
    						<Text.layoutData>
    							<GridData horizontalAlignment="FILL" grabExcessHorizontalSpace="true"/>
    						</Text.layoutData>
    					</Text>
    					<Label text="Middle">
    						<Label.layoutData>
    							<GridData horizontalAlignment="RIGHT"/>
    						</Label.layoutData>
    					</Label>
    					<Text x:Style="BORDER" x:Name="middleNameTxt">
    						<Text.layoutData>
    							<GridData horizontalAlignment="FILL" grabExcessHorizontalSpace="true"/>
    						</Text.layoutData>
    					</Text>
    					<Label text="Last">
    						<Label.layoutData>
    							<GridData horizontalAlignment="RIGHT"/>
    						</Label.layoutData>
    					</Label>
    					<Text x:Style="BORDER" x:Name="lastNameTxt">
    						<Text.layoutData>
    							<GridData horizontalAlignment="FILL" grabExcessHorizontalSpace="true"/>
    						</Text.layoutData>
    					</Text>
    					<p4:VLabelSeparator bounds="0, 0, 14, 25">
    						<p4:VLabelSeparator.layoutData>
    							<GridData verticalAlignment="FILL" grabExcessVerticalSpace="true"/>
    						</p4:VLabelSeparator.layoutData>
    					</p4:VLabelSeparator>
    					<Button text="Search" x:Name="searchByNameBtn"/>
    				</Composite>
    			</Section.client>
    		</Section>
    		<Section text="Address" x:Style="(p5:Section).CLIENT_INDENT | (p5:Section).EXPANDED | (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
    			<Section.layoutData>
    				<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    			</Section.layoutData>
    			<Section.client>
    				<Composite>
    					<Composite.layout>
    						<GridLayout numColumns="6"/>
    					</Composite.layout>
    					<Label text="Street">
    						<Label.layoutData>
    							<GridData horizontalAlignment="RIGHT"/>
    						</Label.layoutData>
    					</Label>
    					<Text x:Style="BORDER" x:Name="streetTxt">
    						<Text.layoutData>
    							<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    						</Text.layoutData>
    					</Text>
    					<Label text="State/Province">
    						<Label.layoutData>
    							<GridData horizontalAlignment="RIGHT"/>
    						</Label.layoutData>
    					</Label>
    					<Combo x:Name="stateProvinceCmbo">
    						<Combo.layoutData>
    							<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    						</Combo.layoutData>
    					</Combo>
    					<p4:VLabelSeparator size="14, 164">
    						<p4:VLabelSeparator.layoutData>
    							<GridData grabExcessVerticalSpace="true" verticalAlignment="FILL" verticalSpan="4"/>
    						</p4:VLabelSeparator.layoutData>
    					</p4:VLabelSeparator>
    					<Label/>
    					<Label text="City">
    						<Label.layoutData>
    							<GridData horizontalAlignment="RIGHT"/>
    						</Label.layoutData>
    					</Label>
    					<Text x:Style="BORDER" x:Name="cityTxt">
    						<Text.layoutData>
    							<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    						</Text.layoutData>
    					</Text>
    					<Label text="Region/Other"/>
    					<Text x:Style="BORDER" x:Name="regionOtherTxt">
    						<Text.layoutData>
    							<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    						</Text.layoutData>
    					</Text>
    					<Button text="Search" x:Name="searchByAddressBtn"/>
    					<Label text="Apt.  #">
    						<Label.layoutData>
    							<GridData horizontalAlignment="RIGHT"/>
    						</Label.layoutData>
    					</Label>
    					<Text x:Style="BORDER" x:Name="aptNumTxt">
    						<Text.layoutData>
    							<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    						</Text.layoutData>
    					</Text>
    					<Label text="Country">
    						<Label.layoutData>
    							<GridData horizontalAlignment="RIGHT"/>
    						</Label.layoutData>
    					</Label>
    					<Combo x:Name="countryCmbo">
    						<Combo.layoutData>
    							<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    						</Combo.layoutData>
    					</Combo>
    					<Label/>
    					<Label text="Post Code">
    						<Label.layoutData>
    							<GridData horizontalAlignment="RIGHT"/>
    						</Label.layoutData>
    					</Label>
    					<Text x:Style="BORDER" x:Name="postCodeTxt">
    						<Text.layoutData>
    							<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    						</Text.layoutData>
    					</Text>
    					<Label/>
    					<Label/>
    					<Label/>
    				</Composite>
    			</Section.client>
    </Section>
    	</Composite>
    </p2:PGroup>
    <p4:HLabelSeparator>
    	<p4:HLabelSeparator.layoutData>
    		<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
    	</p4:HLabelSeparator.layoutData>
    </p4:HLabelSeparator>
	<TableViewer x:Style="BORDER | FULL_SELECTION" input="{Binding Path=names}" x:Name="tableViewer">
		<TableViewer.table headerVisible="true" linesVisible="true" x:Name="table">
			<TableViewer.table.layoutData>
				<GridData verticalAlignment="FILL" grabExcessVerticalSpace="true" grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
			</TableViewer.table.layoutData>
		</TableViewer.table>
		<TableViewerColumn text="Title" width="50" displayMemberPath="title"/>
		<TableViewerColumn text="Last" width="75"/>
		<TableViewerColumn text="First" width="75" displayMemberPath="firstName"/>
		<TableViewerColumn text="Middle" width="75"/>
	</TableViewer>
</Composite>



package com.epimss.shared.ui.viewers;


import java.util.HashMap;
import java.util.Map;

import org.eclipse.e4.xwt.IConstants;
import org.eclipse.e4.xwt.IXWTLoader;

import org.eclipse.swt.layout.FillLayout;

import org.eclipse.swt.widgets.Composite;


public class NameTblViewer extends Composite
{
    //~ public -----------------------------------------------------------------




    public NameTblViewer( Composite parent, int style )
    {
        super( parent, style );
        setLayout( new FillLayout() );

        // load XWT
        String name = NameTblViewer.class.getSimpleName() + IConstants.XWT_EXTENSION_SUFFIX;

        try
        {
            // URL url = NameTableViewer.class.getResource( name );
            Map< String, Object > options = new HashMap< String, Object >();
            options.put( IXWTLoader.CLASS_PROPERTY, this );
            options.put( IXWTLoader.CONTAINER_PROPERTY, this );
            // XWTForms.loadWithOptions( url, options );

        }
        catch( Throwable e )
        {
            throw( new Error( "Unable to load " + name, e ) );

        }   // end try-catch

    }   // end ctor NameTblViewer

}   // end class NameTblViewer


I place the NameTblViewer in the e4 model under the following:
TrimmedWindow > Control > Sash > Part Stack.

When I run the plugin 'b' I now get the following:


ERROR: Unable to create class 'com.epimss.shared.ui.viewers.NameTblViewer' from bundle '578'
org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor in com.epimss.shared.ui.viewers.NameTb
lViewer
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(In jectorImpl.java:301)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorIm pl.java:219)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(Co ntextInjectionFactory.java:152)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF actory.createFromBundle(ReflectionContributionFactory.ja
va:90)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF actory.doCreate(ReflectionContributionFactory.java:64)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF actory.create(ReflectionContributionFactory.java:53)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRen derer.createWidget(ContributedPartRenderer.java:51)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createWidget(PartRenderingEngine.java:612)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:403)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.show Tab(StackRenderer.java:511)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer. postProcess(LazyStackRenderer.java:107)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:419)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr ocessContents(SWTPartRenderer.java:58)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:415)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr ocessContents(SWTPartRenderer.java:58)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRendere r.processContents(PerspectiveRenderer.java:59)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:415)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRe nderer.showTab(PerspectiveStackRenderer.java:103)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer. postProcess(LazyStackRenderer.java:107)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRe nderer.postProcess(PerspectiveStackRenderer.java:77)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:419)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr ocessContents(SWTPartRenderer.java:58)
at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.proces sContents(WBWRenderer.java:464)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:415)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine $4.run(PartRenderingEngine.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .run(PartRenderingEngine.java:633)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRu nUI(E4Workbench.java:106)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start (E4Application.java:127)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
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(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

If I run the NameTblViewer as a JFace application, everything runs normally.

I would appreciate any help here.

Thanks
Previous Topic:org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor
Next Topic:e4 RCP application: (1) error log view (2) about dialog (3) app hooks
Goto Forum:
  


Current Time: Fri Apr 19 01:45:09 GMT 2024

Powered by FUDForum. Page generated in 0.01928 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top