Donald Woods (JIRA) wrote:
[ http://issues.apache.org/jira/browse/GERONIMO-2314?page=all ]Donald Woods updated GERONIMO-2314: ----------------------------------- Patch Info: [Patch Available] Fix Version/s: 1.2 Assignee: (was: Donald Woods) Unassigning from me so a committer can grab it....Can not create a datasource with the name "jdbc/EmployeeDatasource" from console -------------------------------------------------------------------------------- Key: GERONIMO-2314 URL: http://issues.apache.org/jira/browse/GERONIMO-2314 Project: Geronimo Issue Type: BugSecurity Level: public(Regular issues) Components: consoleAffects Versions: 1.1, 1.1.1, 1.1.2, 1.2 Reporter: Yunfeng Ma Fix For: 1.1.2, 1.2 Attachments: G2314-1.1.patch Follow the database pool wizard, create a datasource with the name "jdbc/EmployeeDatasource", the connection test is successful, but when click on the button "deploy", see the following stacktrace in the server output window: org.apache.geronimo.common.DeploymentException: java.lang.IllegalArgumentException: Invalid id: console.dbpool/jdbc/EmployeeDatasource/1.0/rar at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:364) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:124) at org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$$734a235d.invoke(<generated>) at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53) at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:122) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:852) at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239) at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:106) at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:60) at java.lang.Thread.run(Thread.java:797)Caused by: java.lang.IllegalArgumentException: Invalid id: console.dbpool/jdbc/EmployeeDatasource/1.0/rarat org.apache.geronimo.kernel.repository.Artifact.create(Artifact.java:49) at org.apache.geronimo.deployment.Deployer.notifyWatchers(Deployer.java:376) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:325) ... 10 more This error just happens in the condition of the database pool name includes the character "/", such as "jdbc/EmployeeDatasource". If database pool name is "EmployeeDatasource", then everything is OK. Have a look at the souce codes of Artifact.java, the snippet of create method as following: public static Artifact create(String id) { String[] parts = id.split("/", -1);if (parts.length != 4) { throw new IllegalArgumentException("Invalid id: " + id);} for (int i = 0; i < parts.length; i++) { if (parts[i].equals("")) { parts[i] = null; } } return new Artifact(parts[0], parts[1], parts[2], parts[3]); } If database pool name is "jdbc/EmployeeDatasource", the parts.length would be 5 and IllegalArgumentException would be throwed.
I'm not a committer, but I did test this patch and it allowed me to create a database pool with a 'jdbc/' prefix. The actual name after the pool was created did not include the 'jdbc/' in the database pool portlet. The entry in j2ee connectors is slightly different between tags/1.1.1 and branches/1.1: tags/1.1.1 -> console.dbpool/plc/1.0/rar branches/1.1 -> jdbc/plc/1.0/rar 'plc' is the name of my database pool. I could not test further because some other change is preventing me from deploying my webapp (the thing that is blocking my deployment is that I'm not very good a changing my deployment descriptors). I will try again to get my app deployed with the new datasource on Monday. Jay
