Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] ExceptionInInitializerError

Hi Tim,


Tim Terlegård wrote:
You have to select 'Required plugins' when you 'Run...' your application.
Here, the required minimal plugin is org.eclipse.ecf
    
Where do I find "Required plugins"? Is this related to MANIFEST.MF?
I tried this code in a simple Java Project. Do I have to create a
Plug-In Project to be able to use ECF?
  

Although you don't have to, it's much easier to use a plug-in project to use ECF.  The reason for this is that with ecf plugin initialization extension plugins (e.g. the one(s) that provides the "ecf.generic.client") automatically pre-populate the ContainerFactory registry (and this pre-population comes from the OSGI platform registry).  This *can* be done manually, but it's a fair amount of trouble. 

For an example of some code that goes to this trouble, see the org.eclipse.ecf.provider plugin, the org.eclipse.ecf.provider.app.ClientApplication (line 72) which explicitly sets up the ContainerFactory with ContainerFactory.addDescription(contd) after defining the description.  See also the

Similarly you can do this in your java application...if you do this you should make sure you include the code from *all* the needed plugins on the classpath.

But as you can see it's much easier if you allow the OSGI runtime to a) manage the classpath for you; b) use the extension registry; c) get all kinds of nice bundle mgmt features that the OSGI runtime provides.

Scott

/Tim


  
2006/4/15, Tim Terlegård <tim@xxxxxxxxxxxx>:
    
I get an error when I try to create a container. I suspect that the
different container types aren't registered, but when/how is that done?

public static void main(String[] args) throws Exception
{
    IContainer container =
        ContainerFactory.getDefault().createContainer("ecf.generic.client
");
}

This simple code doesn't work. I get

Exception in thread "main" java.lang.ExceptionInInitializerError
        at client.Start.main(Start.java:20)
Caused by: java.lang.NullPointerException
        at org.eclipse.ecf.core.ContainerFactory.<init>(
ContainerFactory.java:55)
        at org.eclipse.ecf.core.ContainerFactory.<clinit>(
ContainerFactory.java:51)

I'm using Eclipse 3.1.1 and ECF 0.7.6

/Tim
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev

      

--
Pierre
    
  
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev
    
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev
  


Back to the top