Hi list,

i am using the osgi-usable Guice-JAR-build 
google-guice-snapshot-20081123.jar and the Multibinder extension 
guice-multibindings-snapshot20081123.jar.

I would be pleased, if you could help me with following problem.
I get an exception, if I use following code line: 
Multibinder<IModuleReporting> multibinder = 
Multibinder.newSetBinder(binder(), IModuleReporting.class);
(At the bottom is the full code as attached)

...
Caused by: java.lang.VerifyError: Cannot inherit from final class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at 
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:165)
    at 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:554)
    at 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:524)
    at 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:455)
    at 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:443)
    at 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:423)
    at 
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:193)
    at 
org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:368)
    at 
org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
    at 
org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:432)
    at 
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:397)
    at 
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:385)
    at 
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at 
de.uni_due.s3.sylagen.master.MasterModule.configure(MasterModule.java:38) 
<<< This is the mentioned code line.
    at com.google.inject.AbstractModule.configure(AbstractModule.java:61)
    at 
com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:157)
    at com.google.inject.spi.Elements.getElements(Elements.java:91)
    at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:100)
    at com.google.inject.Guice.createInjector(Guice.java:92)
    at com.google.inject.Guice.createInjector(Guice.java:69)
    at com.google.inject.Guice.createInjector(Guice.java:59)
    at 
de.uni_due.s3.sylagen.master.SylagenMaster.createInstance(SylagenMaster.java:111)
    at 
de.uni_due.s3.sylagen.master.ui.impl.eclipseplugin.SylagenPlugin.start(SylagenPlugin.java:103)
    at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
    at java.security.AccessController.doPrivileged(Native Method)
    at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
    ... 52 more

IModuleReporting is a simple public java interface.

I tried a another simple example like:
    protected void configure() {
        Multibinder<IRep> m = Multibinder.newSetBinder(binder(), 
IRep.class);
        m.addBinding().to(Rep.class);
    }

and

public interface IRep {
    public void rep();
}

That works...but why not the other Multibinder?

Best Regards,
Michael Woelm

Code Attachment:

public class MasterModule extends AbstractModule {
    IModuleUI moduleUI;
    File tempDir;
   
    public MasterModule(IModuleUI moduleUI, File tempDir) {
        this.moduleUI = moduleUI;
        this.tempDir = tempDir;
    }

    @Override
    protected void configure() {
        bind(File.class).annotatedWith(TempDir.class).toInstance(tempDir);
        bind(IModuleUI.class).toInstance(moduleUI);
        bind(IModuleConfiguration.class).to(ConfigurationModule.class).in(
                Scopes.SINGLETON);
        bind(IModuleConnector.class).to(SocketConnectorModule.class).in(
                Scopes.SINGLETON);
        
bind(IModuleClients.class).to(ClientModule.class).in(Scopes.SINGLETON);
        bind(IModuleMeasurement.class).to(MeasurementModule.class).in(
                Scopes.SINGLETON);
        bind(IModuleValidation.class).to(ValidationModule.class).in(
                Scopes.SINGLETON);
        /* Line 38 */ Multibinder<IModuleReporting> multibinder = 
Multibinder.newSetBinder(binder(),
                IModuleReporting.class);
        //multibinder.addBinding().to(BirtReportModule.class);
    }

public interface IModuleReporting
{
    String getName();
    void createReport(String name, XmlMeasurementResults results, File 
template, File outputDirectory, boolean enhanceTemplate, 
IProgressNotification notification, OutputType... outputTypes) throws 
ReportingAbortedException, InternalReportException;
    OutputType[] getSupportedOutputTypes();
    ITemplateDefinition[] getTemplateDefinitions();
    File getRuntimeLocation();
    void setRuntimeLocation(File location);
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to