开发者

JBoss remote Deployments

I know the app servers like Websphere and 开发者_运维知识库Weblogic have remote deployment capabilities that can be scripted with either Ant tasks or Jython. Is there something equivalent for JBoss? Basically, if I have a server at some known location and I have appropriate credentials, how do I deploy to JBoss remotely?


Deploying to a remote JBoss AS is not easy because JBoss AS doesn't provide much help in that area. But here are some ideas/suggestions:

  • Use the JBoss JSR-88 implementation (which is pruned in Java EE 6 and will thus be removed in Java EE 7, but this give you some time).
  • Use the underlying DeployManager as suggested by @skaffman and either upload your deployable to the remote server and use the file:// protocol or put it on a web server and use http://.
  • Use Cargo (but there is a limitation, the deployable must be uploaded to the remote server first).
  • Use the jboss-maven-plugin which uses the JMX deployment interface and thus supports remote deployment (see MJBOSS-3) as we saw above.
  • Or simply upload your deployable (FTP, SCP) to the remote machine and move them remotely to the deploy directory.


Good question. You don't say which version of JBoss you're talking about (v4 and v5 are as different as chalk and cheese), so I'll assume JBoss 4.x. There may be some similarity with JBoss 5, but I'm only familiar with 4.

JBoss's deployer is based around the URL, and all scanning of deployable components is done by URL. The deployer itself is represented by the MainDeployer JMX bean, and being on the JMX tree, it can be invoked remotely via HTTP or RMI. One of the methods on the deployer is deploy(URL). I've only ever used this in the context of file:// URLs, but in theory it should work for HTTP URLs also. So you could give it the URL of a EAR/WAR file on another server, and it should work, copying the EAR/WAR locally and unpacking it.

What I don't think you can do is "upload" something directly to the server and get it to deploy it. I've never seen such functionality in JBoss (which isn't to say that it doesn't exist, of course, just that I haven't seen such a thing).


Depending on the server setup (you say you've got credentials), you could always sftp your EAR/WAR file to the deploy directory of JBoss. Mind you, one potential problem with this is that JBoss might actually start deploying the file before it has completed uploading which will result in a JBoss complaining about a corrupt EAR/WAR file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜