Problem pointing jbossas-remote-6 container at a remote server
dan.j.allen Sep 8, 2010 12:19 AMI'm curious if anyone has managed to use the remote JBoss AS 6 container integration (jbossas-remote-6) with a remote server. I'm able to connect to the server and communicate w/ its ProfileService, but I get a strange exception when the archive is attempted to be streamed to the server from the temporary deployment HTTP server that the container impl sets up.
To attempt this, you need to do two things. First, you need to change the jndi.properties to point to the remote server. Let's assume it's 192.168.1.2.
jndi.properties
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming\:org.jnp.interfaces java.naming.provider.url=jnp://192.168.1.2:1099
Second, you need to set the remote server address in the Arquillian configuration file.
arquillian.xml
<?xml version="1.0" encoding="UTF-8"?> <arquillian xmlns="http://jboss.com/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jbossas="urn:arq:org.jboss.arquillian.container.jbossas.remote_6"> <jbossas:container> <jbossas:remoteServerAddress>192.168.1.2</jbossas:remoteServerAddress> </jbossas:container> </arquillian>
Finally, you need to start JBoss AS on the remote server with the bind address set to 0.0.0.0.
$JBOSS_HOME/bin/run.sh -b 0.0.0.0
When I do all that, here's the result when a test is deployed. hostA is the hostname of the server running the test.
Caused by: org.jboss.arquillian.spi.DeploymentException: Failed to deploy test.war at org.jboss.arquillian.container.jbossas.remote_6.JBossASRemoteContainer.deploy(JBossASRemoteContainer.java:169) at org.jboss.arquillian.impl.handler.ContainerDeployer.callback(ContainerDeployer.java:62) at org.jboss.arquillian.impl.handler.ContainerDeployer.callback(ContainerDeployer.java:50) at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:63) ... 38 more Caused by: java.lang.RuntimeException: java.io.IOException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://hostA:35679/] at org.jboss.profileservice.management.client.upload.StreamingDeploymentTarget.transferDeployment(StreamingDeploymentTarget.java:286) at org.jboss.profileservice.management.client.upload.StreamingDeploymentTarget.distribute(StreamingDeploymentTarget.java:106) at org.jboss.profileservice.management.client.upload.DeploymentProgressImpl.distribute(DeploymentProgressImpl.java:178) at org.jboss.profileservice.management.client.upload.DeploymentProgressImpl.run(DeploymentProgressImpl.java:83) at org.jboss.arquillian.container.jbossas.remote_6.JBossASRemoteContainer.deploy(JBossASRemoteContainer.java:144) ... 41 more Caused by: java.io.IOException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://hostA:35679/] at org.jboss.remoting.stream.StreamHandler.read(StreamHandler.java:382) at org.jboss.vfs.VFSUtils.copyStream(VFSUtils.java:439) at org.jboss.vfs.VFSUtils.copyStream(VFSUtils.java:419) at org.jboss.profileservice.repository.artifact.CopyStreamArtifactTransformer.transform(CopyStreamArtifactTransformer.java:59) at org.jboss.profileservice.repository.artifact.file.MutableFileArtifactRepository.addArtifact(MutableFileArtifactRepository.java:92) at org.jboss.profileservice.repository.artifact.file.MutableFileArtifactRepository.addArtifact(MutableFileArtifactRepository.java:46) at org.jboss.profileservice.plugins.deploy.actions.DeploymentDistributeAction.doPrepare(DeploymentDistributeAction.java:107) at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:100) at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) at org.jboss.profileservice.plugins.deploy.AbstractDeployHandler.addDeployment(AbstractDeployHandler.java:133) at org.jboss.profileservice.management.upload.remoting.DeployHandlerDelegate.distribute(DeployHandlerDelegate.java:68) at org.jboss.profileservice.management.upload.remoting.DeployHandler.handleStream(DeployHandler.java:192) at org.jboss.profileservice.management.upload.remoting.DeployHandler.handleStream(DeployHandler.java:52) at org.jboss.remoting.ServerInvoker.handleInternalInvocation(ServerInvoker.java:1809) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:885) at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791) at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744) at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548) at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234) at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:216) at org.jboss.remoting.Client.invoke(Client.java:1961) at org.jboss.remoting.Client.invoke(Client.java:804) at org.jboss.remoting.Client.invoke(Client.java:1683) at org.jboss.profileservice.management.client.upload.StreamingDeploymentTarget.transferDeployment(StreamingDeploymentTarget.java:277) ... 45 more
This seems to be a simple question of "how do I get JBoss AS to deploy a WAR from a remote client using the DeploymentManager?" Can it not read the test.war from the URL of the temporary server Arquillian is using in the container implementation?