Bug in ServiceDeployerEjb's portURI
raja05 Jan 12, 2005 1:51 AMI have two webservices defined in a single EJB Jar archive. During deployment, an error pops out saying
"Cannot use the same url-pattern with different endpoints, check your port-uri in jboss.xml"
The server console tells me that the webservices are deployed as
12:18:44,529 INFO [AxisService] WSDD published to: /apps/jboss-4.0.0/server/default/data/wsdl/test-ejb.jar/CEE_TEST.wsdd
12:18:44,532 INFO [AxisService] Web Service deployed: http://localhost:8080/test-ejb/CEE_TEST
12:18:44,535 INFO [AxisService] WSDD published to: /apps/jboss-4.0.0/server/default/data/wsdl/test-ejb.jar/RAJA_TEST.wsdd
12:18:44,537 INFO [AxisService] Web Service deployed: http://localhost:8080/test-ejb/RAJA_TEST
12:18:44,538 ERROR [ServiceDeployer] Cannot startup webservice for: test-ejb.jar
java.lang.IllegalArgumentException: Cannot use the same url-pattern with different endpoints, check your port-uri in jboss.xml
at org.jboss.webservice.ServiceDeployerEJB.createWebXML(ServiceDeployerEJB.java:221)
at org.jboss.webservice.ServiceDeployerEJB.deployWebservices(ServiceDeployerEJB.java:103)
at org.jboss.webservice.ServiceDeployer.startWebservice(ServiceDeployer.java:203)
Stepping into the code, it shows that the url-pattern of "/*" is added to the urlPatters array during the first deployment(for CEE_TEST) and it bails out during the second deployment for RAJA_TEST as "/*" is already in the urlPatters array. The corresponding code is
String urlPattern = "/*"; SessionMetaData ejbMetaData = (SessionMetaData)applMetaData.getBeanByEjbName(ejbLink); EjbPortComponentMetaData pcMetaData = ejbMetaData.getPortComponent(); if (pcMetaData != null && pcMetaData.getPortURI() != null) { urlPattern = pcMetaData.getPortURI(); if (!urlPattern.startsWith("/")) urlPattern = "/" + urlPattern; if (!urlPattern.endsWith("/*")) urlPattern = urlPattern + "/*"; } if (urlPatters.contains(urlPattern)) throw new IllegalArgumentException("Cannot use the same url-pattern with different endpoints, " + "check your port-uri in jboss.xml");
I have nothing defined extra in my jboss.xml so the pcMetaData is always null. Should the check for urlPatters.contains(urlPattern) be not done if urlPattern has a value of "/*".
Thanks
Raja