0
我知道还有其他关于这个问题的问题,但我已经试过了,并没有为我工作。我想写一些输出,从我在RCP插件Excel文件,但它显示:invalid activator
java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook
所以我做的:plugin.xml->runtime tab-> add the poi jars in the classpath section
。
但后来当我尝试运行,它表明:
org.osgi.framework.BundleException: The activator spyros.getInfo.Activator for
bundle spyros.getInfo is invalid.
我的问题:
- 我一定把POI jar文件中的特定文件夹中的META-INF文件夹(例如),然后将它们添加到类路径?
- 我该如何解决激活器错误?
我的MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: GetInfo
Bundle-SymbolicName: spyros.getInfo; singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: spyros.getInfo.Activator
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jdt.core;bundle-version="3.7.1",
org.eclipse.core.resources;bundle-version="3.7.100",
org.eclipse.ui,
org.eclipse.jdt.ui;bundle-version="3.7.1"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.apache.commons.collections
Bundle-ClassPath: lib/poi-3.8-20120326.jar,
lib/poi-examples-3.8-20120326.jar,
lib/poi-excelant-3.8-20120326.jar,
lib/poi-ooxml-3.8-20120326.jar,
lib/poi-ooxml-schemas-3.8-20120326.jar,
lib/poi-scratchpad-3.8-20120326.jar
我的生成属性
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
icons/,\
lib/poi-3.8-20120326.jar,\
lib/poi-examples-3.8-20120326.jar,\
lib/poi-excelant-3.8-20120326.jar,\
lib/poi-ooxml-3.8-20120326.jar,\
lib/poi-ooxml-schemas-3.8-20120326.jar,\
lib/poi-scratchpad-3.8-20120326.jar
我的plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="spyros.getInfo.handlers.GetInfo"
id="spyros.getInfo.commands.GetInfo"
name="GetInfo">
</command>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="menu:org.eclipse.ui.main.menu">
<menu
id="spyros.getInfo.commands.GetInfo"
label="My Info">
<command
commandId="spyros.getInfo.commands.GetInfo"
label="Get Info"
style="push"
tooltip="Get Info from methods">
</command>
</menu>
</menuContribution>
</extension>
</plugin>
我很困惑,但我确信,社区计算器会有所帮助,因为你是最棒的!感谢提前!
解决它!我在这里找到了解决方案:http://blog.chris-alex-thomas.com/2007/07/17/eclipse-activator-class-is-invalid/comment-page-1/#comment-19889 – spyros 2012-04-27 10:00:49