Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ApacheKaraf2.2.8需要使用ApachePOI3.8OSGi包_Osgi_Apache Poi_Apache Karaf_Osgi Bundle - Fatal编程技术网

ApacheKaraf2.2.8需要使用ApachePOI3.8OSGi包

ApacheKaraf2.2.8需要使用ApachePOI3.8OSGi包,osgi,apache-poi,apache-karaf,osgi-bundle,Osgi,Apache Poi,Apache Karaf,Osgi Bundle,我使用的是Karaf2.2.8,在我的代码中,我正在阅读使用ApachePOI的excel文件 try{ Workbook wb=WorkbookFactory.create(inp); } Unable to resolve 266.0: missing requirement [266.0] package; (package=org.apache.poi)) 应用程序在Tomcat6和Tomcat7中使用poi-ooxml-3.8.jar运行良好 在karaf 2.2.8中:- *

我使用的是Karaf2.2.8,在我的代码中,我正在阅读使用ApachePOI的excel文件

try{

Workbook wb=WorkbookFactory.create(inp);

}
Unable to resolve 266.0: missing requirement [266.0] package; (package=org.apache.poi))
应用程序在Tomcat6和Tomcat7中使用poi-ooxml-3.8.jar运行良好

在karaf 2.2.8中:-

***使用servicemix捆绑包时

ClassNotFoundException: org.apache.poi.ss.usermodel.WorkbookFactory not found by org.apache.servicemix.bundles.poi
***使用ApachePOI时

try{

Workbook wb=WorkbookFactory.create(inp);

}
Unable to resolve 266.0: missing requirement [266.0] package; (package=org.apache.poi))
用于安装servicemix poi的命令:-

install -s mvn:avalon-framework/avalon-framework/4.1.3;
install -s mvn:junit/junit/3.8.2;
install -s mvn:commons-codec/commons-codec/1.5;
install -s mvn:commons-logging/commons-logging/1.1;
install -s mvn:javax.servlet/servlet-api/2.3;
install -s mvn:log4j/log4j/1.2.13;
install -s mvn:logkit/LogKit/1.2;
install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi/3.8_1;
用于安装apache poi的命令:-

install -s mvn:org.apache.poi/poi-ooxml/3.8;
install -s mvn:org.apache.poi/poi-ooxml-schemas/3.8;
install -s mvn:org.apache.poi/poi/3.8;
install -s mvn:commons-codec/commons-codec/1.5;
install -s mvn:dom4j/dom4j/1.6.1;
install -s mvn:stax/stax-api/1.0.1;
install -s mvn:org.apache.xmlbeans/xmlbeans/2.3.0;

有什么帮助吗?

我想出来了。我不必把ApachePOI作为osgi包。 我将其添加到karaf内的“Lib”目录中并导出

所需的包装如下:-

karaf.home/etc/custom.properties 
karaf.systemBundlesStartLevel=50 
... 
com.sun.jndi.ldap; \ 
oracle.jdbc; \ 
org.apache.poi.ss.usermodel; \ 
org.apache.poi; 

现在它工作得很好

我知道了。我不必把ApachePOI作为osgi包。我将其添加到karaf内的“Lib”目录中,并按如下方式导出所需的包:-karaf.home/etc/custom.properties karaf.SystemBundlessStartLevel=50。。。com.sun.jndi.ldap;\oracle.jdbc;\org.apache.poi.ss.usermodel;\org.apache.poi;现在它工作得很好,你可能应该把它作为一个答案而不是一个评论来发布,所以其他人看到你的文章时更容易发现我不建议将这些类型的jar放在lib文件夹中的修复方法。对于您来说,将这些JAR放入应用程序包可能更容易。是的,阿希姆您是对的,我应该将其作为包添加。。。但是karaf没有正确地公开jar的包,并且apache poi的sevicemix和springsource的捆绑版本很旧,不支持docx和XLSx。他意味着你应该将jar嵌入到你的捆绑包中。看来你的解决方案对我不起作用。请在下面找到错误:执行命令时出错:无法启动捆绑包mvn:在功能中:捆绑包[306]中的未解决约束:无法解决306.0:缺少要求[306.0]osgi.willing.package;(osgi.willing.package=org.apache.poi.xssf.usermodel)