[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: JBoss with spaces in the directory name
mstruk
do-not-reply at jboss.com
Sun Jul 27 06:03:27 EDT 2008
I think I fixed spaces handling in VFS.
FileSystemContext.getFile(URI) was already doing a proper decoding - since it uses File constructor that takes URI as parameter.
The only place to fix was really in AbstractVFSHandler . openConnection() where URL was converted to string without being properly decoded.
There are still some issues that seem to be outside VFS.
I'm testing spaces support with jboss trunk, and there's something going on here I can't quite get to the bottom of ...
When I run jboss in a directory with spaces it still crashes:
| 10:32:18,955 INFO [ServerImpl] Server Home Dir: C:\Users\Devel\svnroot\jboss-5\build\output\jboss 5.0.0.CR2\server\default
| 10:32:18,955 INFO [ServerImpl] Server Home URL: file:/C:/Users/Devel/svnroot/jboss-5/build/output/jboss%205.0.0.CR2/server/default/
| 10:32:18,955 INFO [ServerImpl] Server Data Dir: C:\Users\Devel\svnroot\jboss-5\build\output\jboss 5.0.0.CR2\server\default\data
| 10:32:18,955 INFO [ServerImpl] Server Temp Dir: C:\Users\Devel\svnroot\jboss-5\build\output\jboss 5.0.0.CR2\server\default\tmp
| 10:32:18,956 INFO [ServerImpl] Server Config URL: file:/C:/Users/Devel/svnroot/jboss-5/build/output/jboss%205.0.0.CR2/server/default/conf/
| 10:32:18,956 INFO [ServerImpl] Server Library URL: file:/C:/Users/Devel/svnroot/jboss-5/build/output/jboss%205.0.0.CR2/server/default/lib/
| 10:32:18,956 INFO [ServerImpl] Root Deployment Filename: jboss-service.xml
| ...
| ...
|
Notice a space in the name: 'jboss 5.0.0.CR2'.
In URLs it gets properly escaped: 'jboss%205.0.0.CR2'
But as deployment starts getting serious some code somewhere does another round of escaping ...
| 10:28:27,397 ERROR [AbstractKernelController] Error installing to Configured: name=VFSBootstrapScanner state=Instantiated
| java.lang.RuntimeException: Error configuring property: URIList for VFSBootstrapScanner
| at org.jboss.kernel.plugins.dependency.ConfigureAction.dispatchSetProperty(ConfigureAction.java:114)
| at org.jboss.kernel.plugins.dependency.ConfigureAction.setAttributes(ConfigureAction.java:87)
| at org.jboss.kernel.plugins.dependency.ConfigureAction.installActionInternal(ConfigureAction.java:44)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| ...
| ...
| ...
| Caused by: java.lang.IllegalArgumentException: Null root, rootURI: file:/C:/Users/Devel/svnroot/jboss-5/build/output/jboss%25205.0.0.CR2/server/default/conf/jboss-service.xml, file: C:\Users\Devel\svnroot\jboss-5\build\output\jboss%205.0.0.CR2\server\default\conf\jboss-service.xml
| at org.jboss.virtual.plugins.context.file.FileSystemContext.<init>(FileSystemContext.java:198)
| at org.jboss.virtual.plugins.context.file.FileSystemContext.<init>(FileSystemContext.java:170)
| at org.jboss.virtual.plugins.context.file.FileSystemContextFactory.getVFS(FileSystemContextFactory.java:65)
| at org.jboss.virtual.VFS.getVFS(VFS.java:89)
| at org.jboss.system.server.profileservice.VFSScanner.getVFforURI(VFSScanner.java:582)
| at org.jboss.system.server.profileservice.VFSScanner.addURI(VFSScanner.java:280)
| at org.jboss.system.server.profileservice.VFSScanner.setURIList(VFSScanner.java:179)
| ...
| ...
| ...
|
'jboss%205.0.0.CR2' suddenly became 'jboss%25205.0.0.CR2', and I'm pretty sure it's not VFS code that does that.
I tried to find how and where URIList for VFSBootstrapScanner gets set. I tracked it down to PropertyDispatcherWrapper where for VFSBootstrapScannerImpl a property value for URIList is specified as '${jboss.server.home.url}conf/jboss-service.xml'. So it uses variable resolution but I had no success finding anything more specific about it.
It's the following code in PropertyDispatchWrapper . execute() method:
| PropertyInfo propertyInfo = BeanInfoUtil.getPropertyInfo(beanInfo, target, name);
| ValueMetaData valueMetaData = property.getValue();
| Object value = valueMetaData.getValue(propertyInfo.getType(), cl);
| validatePropertyValue(context, target, propertyInfo, value);
| beanInfo.setProperty(target, name, value);
|
It's call to valueMetaData.getValue() in the third line that expands the property value from '${jboss.server.home.url}conf/jboss-service.xml' to 'file:/C:/Users/Devel/svnroot/jboss-5/build/output/jboss%25205.0.0.CR2/server/default/conf/jboss-service.xml'.
Here I get lost :)
- marko
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166834#4166834
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166834
More information about the jboss-dev-forums
mailing list