Play! war command - Is it possible to exclude certain jar from the application /lib folder - jboss

I'm trying to automate deployment of a play application as a .war file.
In the end the application will be run on JBOSS AS7.
The problem I'm running into right now is that when I deploy the war to JBOSS I get this exception.
14:52:39,728 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "my-test-app-server-0.0.2-SNAPSHOT.war"
14:52:43,822 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."my-test-app-server-0.0.2-SNAPSHOT.war".PARSE: org.jboss.msc.service.Start
Exception in service jboss.deployment.unit."my-test-app-server-0.0.2-SNAPSHOT.war".PARSE: Failed to process phase PARSE of deployment "my-test-app-server-0.0.2-SNAPSHOT.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse POJO xml ["/C:/jboss-as-web-7.0.2.Final/bin/content/my-test-app-server-0.0.2-SNAPSHOT.war/WEB-INF/lib/netty-3.2.5.Final.jar/META-INF/jboss-beans.xml"]
at org.jboss.as.pojo.KernelDeploymentParsingProcessor.parseDescriptor(KernelDeploymentParsingProcessor.java:130)
at org.jboss.as.pojo.KernelDeploymentParsingProcessor.parseDescriptors(KernelDeploymentParsingProcessor.java:104)
at org.jboss.as.pojo.KernelDeploymentParsingProcessor.deploy(KernelDeploymentParsingProcessor.java:76)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[17,1] Message: Unexpected element '{urn:jboss:bean-deployer:2.0}deployment'
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:98) [staxmapper-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:59) [staxmapper-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.as.pojo.KernelDeploymentParsingProcessor.parseDescriptor(KernelDeploymentParsingProcessor.java:123)
... 8 more
I found that if I manually remove the lib/netty-3.2.5.Final.jar file from the war before deploying it to JBOSS the problem goes away.
Now is there a way to do this when I'm generating the war with the play war command?
Any information on this would be much appreciated.
Thanks

Not that I am aware of simply. The play war command allows you to pass an exclude list, which I have copied the comments from the python file below.
~ To exclude some directories, use the --exclude option and ':'-separator (eg: --exclude .svn:target:logs:tmp).
However, this suggests it will only work for directories.
The command that is executed is package_as_war in framework/pym/utils.py, so you can hack that to specifically delete the file, but obviously this will not be backward compatible if you update your version of Play.

Related

Problem during deployment to Wildfly, with error "name is empty"

we are migrating from Jboss 4.2.2 to Wildfly. During deployment we are facing the following error.
Googling the error diidn't find anything. The error doesn't provide useful details.
my-server.jar defines several ejb3 beans.
Does anybody has an idea what might be wrong?
16:51:55,788 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.subunit."myapp.ear"."my-server.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."myapp.ear"."my-server.jar".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment "my-server.jar" of deployment "myapp.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: name is empty
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:391)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
at org.jboss.as.ee.component.deployers.ResourceReferenceProcessor.getResourceRefEntries(ResourceReferenceProcessor.java:157)
at org.jboss.as.ee.component.deployers.ResourceReferenceProcessor.processDescriptorEntries(ResourceReferenceProcessor.java:74)
at org.jboss.as.ee.component.deployers.AbstractDeploymentDescriptorBindingsProcessor.deploy(AbstractDeploymentDescriptorBindingsProcessor.java:100)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
... 8 more
Try to delete every file and folder in wildfly --> standalone --> deployments and then run the standalone.bat file in wildfly --> bin.
Also, what made it work for us was to include the following dependency in the pom.xml file:
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
</dependency>

Unable to start a spring boot web application with spring batch admin

I am trying to run a web application with embedded tomcat including a number of spring batch jobs and the spring batch admin. However when I try to run the generated fat jar I get the following error, can anybody from spring batch or boot team help:
Error registering Tomcat:j2eeType=WebModule,name=//localhost/*,J2EEApplication=none,J2EEServer=none
Adding more information:
Version of spring boot: 1.1.9.RELEASE from spring.io parent pom version 1.0.3.RELEASE
I tried running it from STS as well as using mvn spring-boot:run with the same effect.
The batch jobs read from a file and write to hornetq.
The complete stack trace is as follows:
2014-11-14 14:22:45.236 ERROR 404 --- [ost-startStop-1] org.apache.tomcat.util.modeler.Registry : Error registering Tomcat:j2eeType=WebModule,name=//localhost/*,J2EEApplication=none,J2EEServer=none`
javax.management.RuntimeOperationsException: null
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:411)`
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)`
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
at org.apache.tomcat.util.modeler.Registry.registerComponent(Registry.java:742)
at org.apache.catalina.util.LifecycleMBeanBase.register(LifecycleMBeanBase.java:158)
at org.apache.catalina.util.LifecycleMBeanBase.initInternal(LifecycleMBeanBase.java:61)
at org.apache.catalina.core.ContainerBase.initInternal(ContainerBase.java:1084)
at org.apache.catalina.core.StandardContext.initInternal(StandardContext.java:6506)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Repository: cannot add mbean for pattern name Tomcat:j2eeType=WebModule,name=//localhost/*,J2EEApplication=none,J2EEServer=none
... 19 common frames omitted
I assume the name is not a valid object name: //localhost/*
Could you try with a different name, or either escape or quote the name. This should fix the problem.

Deploy kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war on wildfly-8.1.0.Final

I deployed successfully kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war on jboss-as-7.1.1.Final, running with jdk1.7.0_10.
But this configuration ...
kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war
wildfly-8.1.0.Final
jdk1.7.0_10
.. fails to deploy with this error :
14:58:06,531 WARN [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016011: Warning while parsing vfs:/C:/java/too
ls/wildfly-8.1.0.Final-guvnor/bin/content/kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war/WEB-INF/beans.xml:
1 cvc-elt.1 : DÚclaration de l'ÚlÚment 'beans' introuvable.
14:58:07,500 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.module
.service."deployment.kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war".main: org.jboss.msc.service.StartExcep
tion in service jboss.module.service."deployment.kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war".main: JBAS
018759: Failed to load module: deployment.kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war:main
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [wildfly-server-8.1.0.Fi
nal.jar:8.1.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-ms
c-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.F
inal.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_10]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_10]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_10]
Caused by: org.jboss.modules.ModuleNotFoundException: org.jboss.netty:main
at org.jboss.modules.Module.addPaths(Module.java:1050) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.Module.link(Module.java:1406) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1434) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:242) [jboss-modules.jar:1.3.3.Final]
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [wildfly-server-8.1.0.Fi
nal.jar:8.1.0.Final]
... 5 more
The drools-wb documentation here :
http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/wb.Workbench.html#wb.Installation
jboss-as7: tailored for JBoss AS 7 (which is being renamed to WildFly
in version 8)
So the doc, let me think that this 6.0.1.Final release of the workbench should work well with wildfly. I might be wrong ?
I managed to figured out.
Thanks to this blog entry :
https://mswiderski.blogspot.ch/2014/06/lets-wildfly-with-jbpm6.html
So, obviously a kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war cannot be deployed to wildfly. But the documentation was confused.
Starting from version 6.1.0, there is a kie-drools-wb-distribution-wars-6.1.0.CR1-wildfly.war - I found it here :
http://central.maven.org/maven2/org/kie/kie-drools-wb-distribution-wars/6.1.0.CR1/
Finally, wildfly can be started with the default standalone.xml profile
(the standalone-full.xml profile is required for the kie-wb)
Hope that will be helpful for someone.

Orbeon deployment on JBoss AS 7

We are trying to deploy Orbeon Forms 3.9 on JBoss AS 7 and getting the following errors:
15:34:36,621 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/adg-xforms]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate: org.orbeon.oxf.common.OXFException: no implementation of regexp was found.
at org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate.contextInitialized(OrbeonServletContextListenerDelegate.java:43) [orbeon.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
15:34:36,670 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart
15:34:36,670 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/adg-xforms] startup failed due to previous errors
15:34:36,682 ERROR [stderr] (MSC service thread 1-2) Starting Orbeon Forms 3.8.0.201005141856 CE
15:34:36,693 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/adg-xforms]] (MSC service thread 1-2) Exception sending context destroyed event to listener instance of class org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate: org.orbeon.oxf.common.OXFException: Could not initialize class com.sun.msv.datatype.xsd.AnyURIType
at org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate.contextDestroyed(OrbeonServletContextListenerDelegate.java:52) [orbeon.jar:]
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3465) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3970) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3888) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
Do you support JBoss AS 7 or anyone tried deploying orbeon on this app server.
I just added xsdlib-20030225.jar to lib directory (It's just one I had to hand ;-O). This is a HACK, I don't know what it affects and don't know if there are any side effects...but it works so far ;-)
This was tested with JBoss AS 7.1.1.Final "Brontes".
Follow the following steps:
for Orbeon Forms PE
unzip orbeon.war
place your license.xml file under WEB-INF/resources/config/license.xml
re-zip orbeon.war
start a standalone server with bin/standalone.sh
drop orbeon.war into the JBoss standalone/deployments folder
(source)
The joy of class loaders. Some code in MSV tries to load com.sun.msv.datatype.xsd.AnyURIType, which shouldn't fail as this class is in WEB-INF/lib/msv-xsdlib-20070407_orbeon_20100309.jar. I suspect that because of the way the class loaders is structured in JBoss, Orbeon ends up using a version of MSV coming from JBoss which is unable to load AnyURIType which is a jar that only comes with Orbeon. But I might be wrong on this.
This type of application-server specific question can be rather time consuming to resolve. So I would recommend you to use Tomcat or to get Orbeon to resolve this for you under a Development Support subscription.

JBoss EJB 3 issue DeploymentException

I am deploying a EJB3 Jar with several beans in it. The jar works fine on other instances and is deployed correctly. However if I try that on my machine, I get the DeploymentException.
I am on JBoss 5.1.0
Please help!!
Here is the stack trace:
*** DEPLOYMENTS IN ERROR: Name -> Error
vfszip:/D:/jboss-5.1.0.GA/server/default/deploy/Enhanced-QC-ejb.jar/ -> org.jboss.deployers.spi.DeploymentException: org.jboss.deployers.spi.DeploymentException: Error deploying: Factory$org.jboss.aspects.remoting.InvokeRemoteInterceptor
DEPLOYMENTS IN ERROR:
Deployment "vfszip:/D:/jboss-5.1.0.GA/server/default/deploy/Enhanced-QC-ejb.jar/" is in error due to the following reason(s): java.lang.IllegalStateException: Factory$org.jboss.aspects.remoting.InvokeRemoteInterceptor is already installed.
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Try to clean the tmp directory (D:/jboss-5.1.0.GA/server/default/tmp in your case) and restart JBoss.