Glassfish deployement严重:加载应用程序时出现异常

时间:2017-10-26 10:16:55

标签: java-ee glassfish glassfish-3

当我部署我的应用程序时,我遇到以下错误:

  

严重:调用类com.sun.enterprise.web.WebApplication start方法时出现异常   java.lang.Exception:java.lang.IllegalStateException:ContainerBase.addChild:start:org.apache.catalina.LifecycleException:java.lang.RuntimeException:com.sun.faces.config.ConfigurationException:java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError:org / apache / xerces / jaxp / validation / ValidatorHandlerImpl $ XMLSchemaTypeInfoProvider       在com.sun.enterprise.web.WebApplication.start(WebApplication.java:138)       在org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)       在org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)       在org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)       在com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)       在com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)       在org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)       在com.sun.enterprise.v3.admin.CommandRunnerImpl $ 1.execute(CommandRunnerImpl.java:348)       在com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)       在com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)       在com.sun.enterprise.v3.admin.CommandRunnerImpl.access $ 1200(CommandRunnerImpl.java:95)       at com.sun.enterprise.v3.admin.CommandRunnerImpl $ ExecutionContext.execute(CommandRunnerImpl.java:1291)       at com.sun.enterprise.v3.admin.CommandRunnerImpl $ ExecutionContext.execute(CommandRunnerImpl.java:1259)       在com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)       在com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)       在com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)       在com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)       at com.sun.enterprise.v3.services.impl.ContainerMapper $ Hk2DispatcherCallable.call(ContainerMapper.java:354)       at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)       在com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)       at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)       在com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)       在com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)       at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)       在com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)       在com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)       在com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)       at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)       在com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)       在com.sun.grizzly.ContextTask.run(ContextTask.java:71)       at com.sun.grizzly.util.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:532)       在com.sun.grizzly.util.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:513)       在java.lang.Thread.run(Thread.java:745)

  

严重:加载应用时出现异常   信息:文件:/ C:/Users/Administrateur/Documents/NetBeansProjects/Gparc_V1.0/Gparc-ear/target/gfdeploy/Gparc-ear/Gparc-ejb-1.0_jar/_Gparc-ejbPU注销成功   信息:[7]计时器已删除ID:98894641828724736

  

严重:加载应用程序时出现异常:java.lang.IllegalStateException:ContainerBase.addChild:start:org.apache.catalina.LifecycleException:java.lang.RuntimeException:com.sun.faces.config.ConfigurationException:java.util .concurrent.ExecutionException:java.lang.NoClassDefFoundError:org / apache / xerces / jaxp / validation / ValidatorHandlerImpl $ XMLSchemaTypeInfoProvider

我的实体Glassfish版本 3.1.2.2

每当我遇到此错误时,我需要杀死JVM以使其重新启动或停止glassfish服务器并清理,构建和部署我的应用程序。

2 个答案:

答案 0 :(得分:0)

错误

  

java.lang.NoClassDefFoundError:org / apache / xerces / jaxp / validation

似乎是原因。你在类路径上有适当的罐子吗?

修改

要使其正常工作,请从Xerces download 开始下载Xerces jar。

下载JAR后,只需复制/过去你的glassfish(... \ glassfish3 \ glassfish \ lib)。

答案 1 :(得分:0)

必须将xerces jar添加到您的ear文件中。一种方法是将以下代码添加到pom.xml的构建部分:

[...]
   <build>
    <plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-ear-plugin</artifactId>
    <version>2.10.1</version>
    <configuration>
       [...]
       <modules>
         <jarModule>
           <groupId>xerces</groupId>
           <artifactId>xercesImpl</artifactId>
           <includeInApplicationXml>true</includeInApplicationXml>
         </jarModule>
      </modules>
    </configuration>
  </plugin>
</plugins>
</build>
[...]

注意:artifarct id和群组ID migth在您的情况下是不同的。检查你的pom是否正确值。

来源:Including A Third Party Library