Environment                  JBoss 4.0.4 GA
Deployment                   Servicemix deployment in JBoss
Servicemix version         3.1-incubating

We have a service assembly comprising of servicemix-http and
servicemix-jsr181 service units to expose a web service. We have other
supporting service units that coexist.

Our requirement is to expose a newer version of this web service by
deploying another service assembly with newer versions of the same service
unit.
The deployment failed because the service unit names were same even though
the service assemblies differed in their names.
To overcome this issue, the service units were uniquely named by adding a
version to the artifactId. 

E.g. 
sa-a (service assembly), sm-http-1.0-su (service unit), sm-jsr-1.0-su
(service unit)
sa-b (service assembly), sm-http-1.1-su (service unit), sm-jsr-1.1-su
(service unit)

The service assembly jbi descriptor did not include the service unit details
when the artifactId of the service units were filtered i.e
sm-http-${version}-su, sm-jsr-${version}-su. Analysing the reason for the
same, we found that it is because the comparison of the artifactId names is
failing because on one side the artifactId is being compared is after
applying the filter i.e. sm-http-1.0-su and on the other side it is the
artifactId is unfiltered i.e. sm-http-${version}-su from the service
assembly pom.xml in reorderServiceUnits method of
GenerateServiceAssemblyDescriptorMojo.java of servicemix-tooling.
The artifactId name obtained by iterating the project.getArtifacts() in
generateJbiDescriptor() has the artifactId names filtered. 
The artifactId name read from the sa pom in getReparsedDependencies does not
have the artifactId name filtered

                List orderedServiceUnits = new ArrayList();
                while (dependencies.hasNext()) {
                        Dependency dependency = (Dependency) 
dependencies.next();
                        for (Iterator it = serviceUnits.iterator(); 
it.hasNext();) {
                                DependencyInformation serviceUnitInfo = 
(DependencyInformation) it
                                                .next();
                                if (dependency.getArtifactId()
                                                
.equals(serviceUnitInfo.getName())) {
                                        System.out.println("Adding "
                                                        + 
serviceUnitInfo.getFilename());
                                        
orderedServiceUnits.add(serviceUnitInfo);
                                }

                        }
                } 

Please let me know if this is the intended behavior or the comparison should
have been done after the application of filters on the artifactId in the
reorderServiceUnits method.

Also, let me know if the methodology we have adopted to solve the versioning
of service units is correct or is there another way.
-- 
View this message in context: 
http://www.nabble.com/Deploying-multiple-versions-of-service-units-using-artifactId-filtering-tf4215049s12049.html#a11991823
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to