-
1. Re: Clustering remote deployment whit farmURIS
rhusar Oct 22, 2013 8:49 AM (in response to abacchi)AS 6... ouch. Have you considered upgrading to AS 7.x, EAP 6.x or even WildFly 8.x?
I am not familiar with this, however I am guessing that you could possibly spoof the profile to only include your desired directory in the list of URIs for the sake of deploying? Seems like the /farm, the default directory, gets picked first (there could be something like of type List<URI>.get(0));
-
2. Re: Clustering remote deployment whit farmURIS
abacchi Oct 23, 2013 12:05 PM (in response to rhusar)Hi Radoslav
many thanks for you reply.
unfortunately we can't upgrade to another version of jboss, so we need to integrate with AS 6.1.0 Final :-(
About the list of uri, yes, if I delete "/farm" direcotry and include only "mydir" , it's wotk and the deployemntmanager deploy may app in this dir. But i need to add some dir (mydir1,mydir2..) and I'd like to choose the right dir to use in my code.
For example, for applicationURIS, if I configure jboss like this (all/conf/boostrap/profile.xml):
<property name="applicationURIs">
<list elementClass="java.net.URI">
<value>${jboss.server.home.url}deploy</value><value>${jboss.server.home.url}mydir1</value>
<value>${jboss.server.home.url}mydir2</value>
</list>
</property>in my code, i can choose application (to use "deploy") , application1 (to use "mydir1" ) or application2 (to use "mydir2") profile:
for (ProfileKey pk : ps.getProfileKeys()) {
if(pk.getName().contains("application1"))
//deploy app1 in mydir1
if(pk.getName().contains("application2"))
//deploy app2 in mydir2
}
but with farmURIS, there is only one profile and there isn't (or I'm not able to find this ) a method to get another dir.
I'm reading various api for spi implementation:
org.jboss.deployers.spi.management.deploy.DeploymentManager
org.jboss.profileservice.spi.ProfileKey
import org.jboss.profileservice.spi.ProfileService
but for now, no result :-(
thanks
-
3. Re: Re: Clustering remote deployment whit farmURIS
rhusar Oct 24, 2013 4:31 AM (in response to abacchi)I am guessing this could be the code that picks the first directory in the list for farm deployment (BasicDeploymentRepository.java):
public URI getUploadUri() { if(uploadUri != null) return uploadUri; if(getRepositoryURIs() != null && getRepositoryURIs().length > 0) return getRepositoryURIs()[0]; throw new IllegalArgumentException("No upload uri available."); }
There is also setUploadUri(URI) you may give it a try..
-
4. Re: Re: Clustering remote deployment whit farmURIS
abacchi Oct 31, 2013 1:10 PM (in response to rhusar)Hi Radoslav
I have done some test, but i can't find a solution :-(
About your post, i can't take the DeploymentRepository
My code is like this :ProfileService DeploymentManager in 5.x and I use the profileservice spi that don't have a method to manage repository
In my test I find a new behavior for deplyment: if I deploy and undeploy my app into /server/all/mydir manually, when i retry deployment with DeploymentManager, it use /server/all/mydir and not /server/all/farm. So there is some "choosing phase" to select the path to use for deployment, not only the first.
During the process
DeploymentProgress distribute = deployMgr.distribute("testwebapp.war", new File("/tmp/distTWA/testwebapp.war").toURI().toURL(), true);
//here I don't see the deploy path
distribute.run();
repositoryNames = distribute.getDeploymentID().getRepositoryNames(); //here I find the path ( /servr/all/farm for default and /servr/all/mydir if I used this path for deploy/undeploy manually)