I'm doing the following sequence of calls lifted directly from the tutorials
EJB3StandaloneDeployer deployer = new EJB3StandaloneDeployer();
URL deployDir = getDeployDirURL();
where getDeployDirURL() includes the following:
URL res = Thread.currentThread().getContextClassLoader().getResource(
if (res == null)
System.out.println("persistence.xml not found");
When I display 'res' after getting it from the getResource() call, it is:
Note the %20 codes inserted where spaces used to be -
But when I call deploy.create(), it fails, and displays the following message
17:37:02,116 WARN [XsdBinder] NOT HANDLED WILDCARD IN GLOBAL MODEL GROUP
java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/myawn/j2ee/com.kenai.examine/file:/C:/Documents%20and%20Settings/myawn/j2ee/com.kenai.examine
at java.net.URI$Parser.fail(Unknown Source)
at java.net.URI$Parser.checkChars(Unknown Source)
at java.net.URI$Parser.parseHierarchical(Unknown Source)
at java.net.URI$Parser.parse(Unknown Source)
at java.net.URI.(Unknown Source)
at java.net.URL.toURI(Unknown Source)
The URI is in there twice; the first time, the spaces have not been encoded and this (I think) is causing the deployment to fail.
I'm not sure if the warning prior to that (about the model group) is related to this in any way.
- Do I need to be concerned about the warning?
- Is it expected that the URL would appear twice as shown in the error message?
- Is there something I can do, either to the 'res' returned by the classloader or in the deployer call, to cause the URL encoding to be done right?