我们正试图在JBoss 7.0.1上部署一个简单的grails(1.3.7)war文件。但是我们遇到了阻止应用程序部署的异常。
$ sudo bin/standalone.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /opt/jboss-as-7.0.1.Final
JAVA: java
JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman
=========================================================================
16:32:28,744 INFO [org.jboss.modules] JBoss Modules version 1.0.1.GA
16:32:28,992 INFO [org.jboss.msc] JBoss MSC version 1.0.0.GA
16:32:29,061 INFO [org.jboss.as] JBoss AS 7.0.1.Final "Zap" starting
16:32:29,856 WARN [org.jboss.as] No security realm defined for native management service, all access will be unrestricted.
16:32:29,874 INFO [org.jboss.as] creating http management service using network interface (management) port (9990)
16:32:29,876 WARN [org.jboss.as] No security realm defined for http management service, all access will be unrestricted.
16:32:29,886 INFO [org.jboss.as.logging] Removing bootstrap log handlers
16:32:29,907 INFO [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)
16:32:29,922 INFO [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.
16:32:30,081 INFO [org.jboss.as.naming] (Controller Boot Thread) Activating Naming Subsystem
16:32:30,091 INFO [org.jboss.as.naming] (MSC service thread 1-4) Starting Naming Service
16:32:30,095 INFO [org.jboss.as.osgi] (Controller Boot Thread) Activating OSGi Subsystem
16:32:30,119 INFO [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem
16:32:30,122 INFO [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 3.2.0.Beta2
16:32:30,139 INFO [org.xnio] (MSC service thread 1-2) XNIO Version 3.0.0.Beta3
16:32:30,154 INFO [org.xnio.nio] (MSC service thread 1-2) XNIO NIO Implementation Version 3.0.0.Beta3
16:32:30,346 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-4) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
16:32:30,370 INFO [org.jboss.as.remoting] (MSC service thread 1-3) Listening on /127.0.0.1:9999
16:32:30,381 INFO [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-3) Starting remote JMX connector
16:32:30,414 INFO [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem
16:32:30,453 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
16:32:30,820 INFO [org.jboss.as.connector] (MSC service thread 1-2) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)
16:32:30,917 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) Bound data source [java:jboss/datasources/ExampleDS]
16:32:31,279 INFO [org.jboss.as.deployment] (MSC service thread 1-4) Started FileSystemDeploymentService for directory /opt/jboss-as-7.0.1.Final/standalone/deployments
16:32:31,297 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.1.Final "Zap" started in 2821ms - Started 93 of 148 services (55 services are passive or on-demand)
16:32:31,334 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "helloGrails-0.1.war"
16:32:34,278 WARN [org.jboss.as.server.deployment.service-loader] (MSC service thread 1-2) Encountered invalid class name "org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer" for service type "org.xmlpull.v1.XmlPullParserFactory"
16:32:34,331 INFO [org.jboss.as.jpa] (MSC service thread 1-4) added javax.persistence.api dependency to helloGrails-0.1.war
16:32:34,338 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."helloGrails-0.1.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."helloGrails-0.1.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "helloGrails-0.1.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.6.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.6.0_20]
at java.lang.Thread.run(Thread.java:636) [:1.6.0_20]
Caused by: java.lang.NullPointerException
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:72)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
... 5 more
16:32:34,348 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "helloGrails-0.1.war" was rolled back with failure message {"Failed services" => {"jboss.deployment.unit.\"helloGrails-0.1.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"helloGrails-0.1.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"helloGrails-0.1.war\""}}
16:32:34,434 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) Stopped deployment helloGrails-0.1.war in 92ms
16:32:34,441 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.deployment.unit.\"helloGrails-0.1.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"helloGrails-0.1.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"helloGrails-0.1.war\""}}}}
我们发现了一些包含例外情况的JIRA问题:
https://issues.jboss.org/browse/AS7-1551
https://issues.jboss.org/browse/AS7-1601
但是由于我们没有更改BuildConfig.groovy上的任何内容,我们怀疑它可能是JBoss如何处理OSGi依赖项的问题。