无法在jboss 7.1上添加apache poi jar

时间:2014-05-08 17:51:47

标签: java jboss apache-poi

我无法添加le poi-3.9-20121203.jar模块 我已经创建了这个目录

$JBOSS_HOME\modules\org\apache\poi\main

并将jar放在其上并创建此module.xml文件

<module xmlns="urn:jboss:module:1.1" name="org.apache.poi">
<resources>
  <resource-root path="poi-3.9-20121203.jar" /> 
  </resources>
  <dependencies /> 
  </module>

但是当我重新启动JBOSS时,我没有创建新的module.index文件。

我想将使用上面列出的jar的应用程序从jboss 4.2.3迁移到jboss 7.1

POI-3.9-20121203.jar POI-OOXML-3.9-20121203.jar POI-OOXML-架构 - 3.9-20121203.jar STAX的API-1.0.1.jar XMLBeans的-2.3.0.jar DOM4J-1.6.1.jar

在jboss 4.2.3中我只复制服务器目录的lib文件夹中的jar 但现在我不知道该怎么办

请你帮忙吗?

仍然无法正常使用这是我的日志

    2:58:58,531 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."BridgeCore.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."BridgeCore.jar".POST_MODULE: Failed to process phase POST_MODULE of deployment "BridgeCore.jar"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_35]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_35]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_35]
Caused by: java.lang.RuntimeException: Error getting reflective information for class com.btknet.bridge.infoc.reporting.facade.SqlRequestService with ClassLoader ModuleClassLoader for Module "deployment.BridgeCore.jar:main" from Service Module Loader
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 5 more
Caused by: java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Workbook
    at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0_35]
    at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [rt.jar:1.6.0_35]
    at java.lang.Class.getDeclaredFields(Class.java:1743) [rt.jar:1.6.0_35]
    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 10 more
Caused by: java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.Workbook from [Module "deployment.BridgeCore.jar:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
    ... 15 more

这也是我的jboss-deployment-structure.xml

<jboss-deployment-structure> 
<module name="deployment.org.apache.poi" />
</jboss-deployment-structure>

这是我的MANIFEST.MF

Manifest-Version: 1.0
Class-Path: 
Dependencies: org.apache.poi

我还将罐子添加到构建路径中 最后我创建了一个文件夹$ JBOSS_HOME / modules / org / apache / poi / main我放了那些罐子

POI-3.9-20121203.jar POI-OOXML-3.9-20121203.jar POI-OOXML-架构 - 3.9-20121203.jar STAX的API-1.0.1.jar XMLBeans的-2.3.0.jar DOM4J-1.6.1.jar

这也是我的module.xml

<?xml version="1.0" encoding="UTF-8"?>

<module xmlns="urn:jboss:module:1.1" name="org.apache.poi">

    <resources>
        <resource-root path="poi-3.9-20121203.jar"/>
      <resource-root path="dom4j-1.6.1.jar"/>
      <resource-root path="poi-ooxml-3.9-20121203.jar"/>
      <resource-root path="poi-ooxml-schemas-3.9-20121203.jar"/>
      <resource-root path="stax-api-1.0.1.jar"/>
      <resource-root path="xmlbeans-2.3.0.jar"/>

    </resources>
 <dependencies>
      </dependencies>

</module>

你能否告诉我如何将jars添加到项目中,因为我们可以使用jboss AS 4将puttin'em添加到服务器的lib目录中

0 个答案:

没有答案