Eclipse E4无法从其他插件加载类

时间:2017-10-09 06:26:31

标签: eclipse-plugin eclipse-rcp e4

我将我的应用程序的主要模型移动到将在客户端和服务器上使用的另一个插件。现在,当我将新插件添加到我的第一个插件中的所需插件时,它会提供一个java.lang.NoClassDefFoundError。

我的主插件中找不到共享插件中的所有类。是否有一些简单的方法使其工作。我还检查了运行配置,但是选择了加载共享插件。

我的主要插件清单如下:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CR-IT System Platform
Bundle-SymbolicName: CR-IT_client;singleton:=true
Bundle-Version: 0.26.2
Bundle-Activator: com.test.client.eclipse.Activator
Bundle-Vendor: test
Application-Name: CR-IT System Platform
Permissions: all-permissions
Require-Bundle: javax.inject;bundle-version="1.0.0",
 org.eclipse.core.runtime;bundle-version="3.11.1",
 org.eclipse.swt;bundle-version="3.104.2",
 org.eclipse.e4.ui.model.workbench;bundle-version="1.1.100",
 org.eclipse.jface;bundle-version="3.11.1",
 org.eclipse.e4.ui.services;bundle-version="1.2.0",
 org.eclipse.e4.ui.workbench;bundle-version="1.3.1",
 org.eclipse.e4.core.di;bundle-version="1.5.0",
 org.eclipse.e4.ui.di;bundle-version="1.1.0",
 org.eclipse.e4.core.contexts;bundle-version="1.4.0",
 org.eclipse.nebula.widgets.pshelf;bundle-version="1.1.0",
 org.eclipse.e4.core.services;bundle-version="2.0.0",
 org.eclipse.nebula.widgets.nattable.core;bundle-version="1.4.0",
 org.eclipse.e4.core.commands;bundle-version="0.11.100",
 org.eclipse.nebula.widgets.nattable.extension.e4;bundle-version="1.0.0",
 org.eclipse.nebula.widgets.nattable.extension.glazedlists;bundle-version="1.4.0",
 ca.odell.glazedlists;bundle-version="1.9.0",
 org.eclipse.ui.forms;bundle-version="3.7.0",
 org.eclipse.equinox.launcher;bundle-version="1.3.200",
 org.eclipse.rcp;bundle-version="4.6.2",
 org.eclipse.equinox.p2.core;bundle-version="2.4.100",
 org.eclipse.equinox.p2.engine;bundle-version="2.4.100",
 org.eclipse.equinox.p2.operations;bundle-version="2.4.200",
 org.eclipse.equinox.p2.metadata.repository;bundle-version="1.2.300",
 org.eclipse.nebula.widgets.nattable.extension.poi;bundle-version="1.5.0",
 org.apache.poi;bundle-version="3.9.0",
 org.eclipse.e4.ui.workbench.swt,
 CR-IT_Models;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.test.shared.custom,
 com.test.shared.models,
 org.osgi.framework;version="1.3.0"
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
 libs/json-simple-1.1.1.jar,
 libs/gettext-commons-0.9.8.jar,
 libs/java_websocket.jar,
 libs/jackson-core-2.8.2.jar,
 libs/jackson-databind-2.8.2.jar,
 libs/jackson-annotations-2.8.2.jar,
 libs/org.swtchart_0.10.0.v20160212.jar,
 libs/org.swtchart.ext_0.10.0.v20160212.jar,
 libs/commons-io-2.5.jar,
 libs/swing2swt.jar,
 libs/logback-classic-1.1.7.jar,
 libs/logback-core-1.1.7.jar,
 libs/slf4j-api-1.7.21.jar,
 libs/jackson-datatype-jsr310-2.8.2.jar,
 libs/guava-21.0.jar

共享插件清单如下所示:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CR-IT_Models
Bundle-SymbolicName: CR-IT_Models
Bundle-Version: 1.0.0
Bundle-ClassPath: libs/hibernate-c3p0-5.1.1.Final.jar,
 libs/hibernate-commons-annotations-5.0.1.Final.jar,
 libs/hibernate-core-5.1.1.Final.jar,
 libs/hibernate-java8-5.1.1.Final.jar,
 libs/hibernate-jpa-2.1-api-1.0.0.Final.jar,
 libs/lombok.jar,
 libs/logback-core-1.1.7.jar,
 libs/slf4j-api-1.7.21.jar
Export-Package: Class50.lombok.eclipse.agent,
 Class50.lombok.launch,
 ch.qos.logback.core,
 ch.qos.logback.core.boolex,
 ch.qos.logback.core.db,
 ch.qos.logback.core.db.dialect,
 ch.qos.logback.core.encoder,
 ch.qos.logback.core.filter,
 ch.qos.logback.core.helpers,
 ch.qos.logback.core.hook,
 ch.qos.logback.core.html,
 ch.qos.logback.core.joran,
 ch.qos.logback.core.joran.action,
 ch.qos.logback.core.joran.conditional,
 ch.qos.logback.core.joran.event,
 ch.qos.logback.core.joran.event.stax,
 ch.qos.logback.core.joran.node,
 ch.qos.logback.core.joran.spi,
 ch.qos.logback.core.joran.util,
 ch.qos.logback.core.joran.util.beans,
 ch.qos.logback.core.layout,
 ch.qos.logback.core.net,
 ch.qos.logback.core.net.server,
 ch.qos.logback.core.net.ssl,
 ch.qos.logback.core.pattern,
 ch.qos.logback.core.pattern.color,
 ch.qos.logback.core.pattern.parser,
 ch.qos.logback.core.pattern.util,
 ch.qos.logback.core.property,
 ch.qos.logback.core.read,
 ch.qos.logback.core.recovery,
 ch.qos.logback.core.rolling,
 ch.qos.logback.core.rolling.helper,
 ch.qos.logback.core.sift,
 ch.qos.logback.core.spi,
 ch.qos.logback.core.status,
 ch.qos.logback.core.subst,
 ch.qos.logback.core.util,
 com.test.shared.custom,
 com.test.shared.models,
 com.zwitserloot.cmdreader,
 javax.persistence,
 javax.persistence.criteria,
 javax.persistence.metamodel,
 javax.persistence.spi,
 lombok,
 lombok.bytecode,
 lombok.core,
 lombok.core.configuration,
 lombok.core.debug,
 lombok.core.handlers,
 lombok.core.runtimeDependencies,
 lombok.delombok,
 lombok.delombok.ant,
 lombok.eclipse,
 lombok.eclipse.agent,
 lombok.eclipse.handlers,
 lombok.eclipse.handlers.singulars,
 lombok.experimental,
 lombok.extern.apachecommons,
 lombok.extern.java,
 lombok.extern.jbosslog,
 lombok.extern.log4j,
 lombok.extern.slf4j,
 lombok.installer,
 lombok.installer.eclipse,
 lombok.javac,
 lombok.javac.apt,
 lombok.javac.handlers,
 lombok.javac.handlers.singulars,
 lombok.javac.java6,
 lombok.javac.java7,
 lombok.javac.java8,
 lombok.launch,
 lombok.patcher,
 lombok.patcher.equinox,
 lombok.patcher.inject,
 lombok.patcher.scripts,
 org.hibernate,
 org.hibernate.action.internal,
 org.hibernate.action.spi,
 org.hibernate.annotations,
 org.hibernate.annotations.common,
 org.hibernate.annotations.common.annotationfactory,
 org.hibernate.annotations.common.reflection,
 org.hibernate.annotations.common.reflection.java,
 org.hibernate.annotations.common.reflection.java.generics,
 org.hibernate.annotations.common.util,
 org.hibernate.annotations.common.util.impl,
 org.hibernate.boot,
 org.hibernate.boot.archive.internal,
 org.hibernate.boot.archive.scan.internal,
 org.hibernate.boot.archive.scan.spi,
 org.hibernate.boot.archive.spi,
 org.hibernate.boot.cfgxml.internal,
 org.hibernate.boot.cfgxml.spi,
 org.hibernate.boot.internal,
 org.hibernate.boot.jaxb,
 org.hibernate.boot.jaxb.cfg.spi,
 org.hibernate.boot.jaxb.hbm.internal,
 org.hibernate.boot.jaxb.hbm.spi,
 org.hibernate.boot.jaxb.internal,
 org.hibernate.boot.jaxb.internal.stax,
 org.hibernate.boot.jaxb.spi,
 org.hibernate.boot.model,
 org.hibernate.boot.model.naming,
 org.hibernate.boot.model.process.internal,
 org.hibernate.boot.model.process.spi,
 org.hibernate.boot.model.relational,
 org.hibernate.boot.model.source.internal,
 org.hibernate.boot.model.source.internal.annotations,
 org.hibernate.boot.model.source.internal.hbm,
 org.hibernate.boot.model.source.spi,
 org.hibernate.boot.registry,
 org.hibernate.boot.registry.classloading.internal,
 org.hibernate.boot.registry.classloading.spi,
 org.hibernate.boot.registry.internal,
 org.hibernate.boot.registry.selector,
 org.hibernate.boot.registry.selector.internal,
 org.hibernate.boot.registry.selector.spi,
 org.hibernate.boot.spi,
 org.hibernate.bytecode.enhance.internal,
 org.hibernate.bytecode.enhance.internal.tracker,
 org.hibernate.bytecode.enhance.spi,
 org.hibernate.bytecode.enhance.spi.interceptor,
 org.hibernate.bytecode.internal.javassist,
 org.hibernate.bytecode.spi,
 org.hibernate.c3p0.internal,
 org.hibernate.cache,
 org.hibernate.cache.internal,
 org.hibernate.cache.spi,
 org.hibernate.cache.spi.access,
 org.hibernate.cache.spi.entry,
 org.hibernate.cfg,
 org.hibernate.cfg.annotations,
 org.hibernate.cfg.annotations.reflection,
 org.hibernate.cfg.beanvalidation,
 org.hibernate.classic,
 org.hibernate.collection.internal,
 org.hibernate.collection.spi,
 org.hibernate.context,
 org.hibernate.context.internal,
 org.hibernate.context.spi,
 org.hibernate.criterion,
 org.hibernate.dialect,
 org.hibernate.dialect.function,
 org.hibernate.dialect.identity,
 org.hibernate.dialect.lock,
 org.hibernate.dialect.pagination,
 org.hibernate.dialect.unique,
 org.hibernate.engine,
 org.hibernate.engine.config.internal,
 org.hibernate.engine.config.spi,
 org.hibernate.engine.internal,
 org.hibernate.engine.jdbc,
 org.hibernate.engine.jdbc.batch.internal,
 org.hibernate.engine.jdbc.batch.spi,
 org.hibernate.engine.jdbc.connections.internal,
 org.hibernate.engine.jdbc.connections.spi,
 org.hibernate.engine.jdbc.cursor.internal,
 org.hibernate.engine.jdbc.cursor.spi,
 org.hibernate.engine.jdbc.dialect.internal,
 org.hibernate.engine.jdbc.dialect.spi,
 org.hibernate.engine.jdbc.env.internal,
 org.hibernate.engine.jdbc.env.spi,
 org.hibernate.engine.jdbc.internal,
 org.hibernate.engine.jdbc.spi,
 org.hibernate.engine.jndi,
 org.hibernate.engine.jndi.internal,
 org.hibernate.engine.jndi.spi,
 org.hibernate.engine.loading.internal,
 org.hibernate.engine.profile,
 org.hibernate.engine.query.internal,
 org.hibernate.engine.query.spi,
 org.hibernate.engine.query.spi.sql,
 org.hibernate.engine.spi,
 org.hibernate.engine.transaction.internal,
 org.hibernate.engine.transaction.internal.jta,
 org.hibernate.engine.transaction.jta.platform.internal,
 org.hibernate.engine.transaction.jta.platform.spi,
 org.hibernate.engine.transaction.spi,
 org.hibernate.event.internal,
 org.hibernate.event.service.internal,
 org.hibernate.event.service.spi,
 org.hibernate.event.spi,
 org.hibernate.exception,
 org.hibernate.exception.internal,
 org.hibernate.exception.spi,
 org.hibernate.graph.spi,
 org.hibernate.hql.internal,
 org.hibernate.hql.internal.antlr,
 org.hibernate.hql.internal.ast,
 org.hibernate.hql.internal.ast.exec,
 org.hibernate.hql.internal.ast.tree,
 org.hibernate.hql.internal.ast.util,
 org.hibernate.hql.internal.classic,
 org.hibernate.hql.spi,
 org.hibernate.hql.spi.id,
 org.hibernate.hql.spi.id.global,
 org.hibernate.hql.spi.id.local,
 org.hibernate.hql.spi.id.persistent,
 org.hibernate.id,
 org.hibernate.id.enhanced,
 org.hibernate.id.factory,
 org.hibernate.id.factory.internal,
 org.hibernate.id.factory.spi,
 org.hibernate.id.insert,
 org.hibernate.id.uuid,
 org.hibernate.integrator.internal,
 org.hibernate.integrator.spi,
 org.hibernate.internal,
 org.hibernate.internal.log,
 org.hibernate.internal.util,
 org.hibernate.internal.util.beans,
 org.hibernate.internal.util.collections,
 org.hibernate.internal.util.compare,
 org.hibernate.internal.util.config,
 org.hibernate.internal.util.io,
 org.hibernate.internal.util.jndi,
 org.hibernate.internal.util.type,
 org.hibernate.internal.util.xml,
 org.hibernate.jdbc,
 org.hibernate.jmx.internal,
 org.hibernate.jmx.spi,
 org.hibernate.jpa,
 org.hibernate.loader,
 org.hibernate.loader.collection,
 org.hibernate.loader.collection.plan,
 org.hibernate.loader.criteria,
 org.hibernate.loader.custom,
 org.hibernate.loader.custom.sql,
 org.hibernate.loader.entity,
 org.hibernate.loader.entity.plan,
 org.hibernate.loader.hql,
 org.hibernate.loader.plan.build.internal,
 org.hibernate.loader.plan.build.internal.returns,
 org.hibernate.loader.plan.build.internal.spaces,
 org.hibernate.loader.plan.build.spi,
 org.hibernate.loader.plan.exec.internal,
 org.hibernate.loader.plan.exec.process.internal,
 org.hibernate.loader.plan.exec.process.spi,
 org.hibernate.loader.plan.exec.query.internal,
 org.hibernate.loader.plan.exec.query.spi,
 org.hibernate.loader.plan.exec.spi,
 org.hibernate.loader.plan.spi,
 org.hibernate.loader.spi,
 org.hibernate.lob,
 org.hibernate.mapping,
 org.hibernate.metadata,
 org.hibernate.param,
 org.hibernate.persister.collection,
 org.hibernate.persister.entity,
 org.hibernate.persister.internal,
 org.hibernate.persister.spi,
 org.hibernate.persister.walking.internal,
 org.hibernate.persister.walking.spi,
 org.hibernate.pretty,
 org.hibernate.procedure,
 org.hibernate.procedure.internal,
 org.hibernate.procedure.spi,
 org.hibernate.property.access.internal,
 org.hibernate.property.access.spi,
 org.hibernate.proxy,
 org.hibernate.proxy.map,
 org.hibernate.proxy.pojo,
 org.hibernate.proxy.pojo.javassist,
 org.hibernate.resource.jdbc,
 org.hibernate.resource.jdbc.internal,
 org.hibernate.resource.jdbc.spi,
 org.hibernate.resource.transaction,
 org.hibernate.resource.transaction.backend.jdbc.internal,
 org.hibernate.resource.transaction.backend.jdbc.spi,
 org.hibernate.resource.transaction.backend.jta.internal,
 org.hibernate.resource.transaction.backend.jta.internal.synchronization,
 org.hibernate.resource.transaction.internal,
 org.hibernate.resource.transaction.spi,
 org.hibernate.result,
 org.hibernate.result.internal,
 org.hibernate.result.spi,
 org.hibernate.secure.internal,
 org.hibernate.secure.spi,
 org.hibernate.service,
 org.hibernate.service.internal,
 org.hibernate.service.spi,
 org.hibernate.sql,
 org.hibernate.sql.ordering.antlr,
 org.hibernate.stat,
 org.hibernate.stat.internal,
 org.hibernate.stat.spi,
 org.hibernate.tool.enhance,
 org.hibernate.tool.hbm2ddl,
 org.hibernate.tool.instrument.javassist,
 org.hibernate.tool.schema,
 org.hibernate.tool.schema.extract.internal,
 org.hibernate.tool.schema.extract.spi,
 org.hibernate.tool.schema.internal,
 org.hibernate.tool.schema.internal.exec,
 org.hibernate.tool.schema.spi,
 org.hibernate.transform,
 org.hibernate.tuple,
 org.hibernate.tuple.component,
 org.hibernate.tuple.entity,
 org.hibernate.type,
 org.hibernate.type.descriptor,
 org.hibernate.type.descriptor.converter,
 org.hibernate.type.descriptor.java,
 org.hibernate.type.descriptor.sql,
 org.hibernate.usertype,
 org.hibernate.xsd.cfg,
 org.hibernate.xsd.mapping,
 org.objectweb.asm,
 org.objectweb.asm.commons,
 org.objectweb.asm.signature,
 org.objectweb.asm.tree,
 org.slf4j,
 org.slf4j.event,
 org.slf4j.helpers,
 org.slf4j.spi
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: javax.inject;bundle-version="1.0.0",
 org.eclipse.core.runtime;bundle-version="3.11.1",
 org.eclipse.swt;bundle-version="3.104.2",
 org.eclipse.e4.ui.model.workbench;bundle-version="1.1.100",
 org.eclipse.jface;bundle-version="3.11.1",
 org.eclipse.e4.ui.services;bundle-version="1.2.0",
 org.eclipse.e4.ui.workbench;bundle-version="1.3.1",
 org.eclipse.e4.core.di;bundle-version="1.5.0",
 org.eclipse.e4.ui.di;bundle-version="1.1.0",
 org.eclipse.e4.core.contexts;bundle-version="1.4.0",
 org.eclipse.nebula.widgets.pshelf;bundle-version="1.1.0",
 org.eclipse.e4.core.services;bundle-version="2.0.0",
 org.eclipse.nebula.widgets.nattable.core;bundle-version="1.4.0",
 org.eclipse.e4.core.commands;bundle-version="0.11.100",
 org.eclipse.nebula.widgets.nattable.extension.e4;bundle-version="1.0.0",
 org.eclipse.nebula.widgets.nattable.extension.glazedlists;bundle-version="1.4.0",
 ca.odell.glazedlists;bundle-version="1.9.0",
 org.eclipse.ui.forms;bundle-version="3.7.0",
 org.eclipse.equinox.launcher;bundle-version="1.3.200",
 org.eclipse.rcp;bundle-version="4.6.2",
 org.eclipse.equinox.p2.core;bundle-version="2.4.100",
 org.eclipse.equinox.p2.engine;bundle-version="2.4.100",
 org.eclipse.equinox.p2.operations;bundle-version="2.4.200",
 org.eclipse.equinox.p2.metadata.repository;bundle-version="1.2.300",
 org.eclipse.nebula.widgets.nattable.extension.poi;bundle-version="1.5.0",
 org.apache.poi;bundle-version="3.9.0",
 org.eclipse.e4.ui.workbench.swt,
 org.eclipse.equinox.ds;bundle-version="1.4.400",
 org.jboss.tools.hibernate.runtime.v_3_5;bundle-version="5.1.3",
 ch.qos.logback.core;bundle-version="1.0.7"
Bundle-Vendor: test
Bundle-ActivationPolicy: lazy

1 个答案:

答案 0 :(得分:1)

假设缺少的类位于CR-IT_Models插件的主代码中,而不是其中一个库,则需要.中的Bundle-Classpath。所以:

Bundle-ClassPath: .,
 libs/hibernate-c3p0-5.1.1.Final.jar,
 libs/hibernate-commons-annotations-5.0.1.Final.jar,
 libs/hibernate-core-5.1.1.Final.jar,
 libs/hibernate-java8-5.1.1.Final.jar,
 libs/hibernate-jpa-2.1-api-1.0.0.Final.jar,
 libs/lombok.jar,
 libs/logback-core-1.1.7.jar,
 libs/slf4j-api-1.7.21.jar