[Design the new POJO MicroContainer] - Re: JarEntry as VFS root does not return empty vfspath
by adrian@jboss.org
"mstruk" wrote :
| This is our context URI:
|
| file:/vfs/test/outer.jar!/org/jboss/test/vfs/support
|
| These are parent child relationships for handlers within JarContext:
|
|
| null
| JarHandler (represents: file:/vfs/test/outer.jar)
| JarEntryHandler (represents org)
| JarEntryHandler (represents jboss)
| JarEntryHandler (represents test)
| JarEntryHandler (represents vfs)
| root = JarEntryHandler (represents support)
| JarEntryHandler (represents CommonClass.class)
| JarEntryHandler (represents jar1)
| JarEntryHandler (represents jar2)
|
|
| root handler has VF handler representing 'vfs' for its parent. getParent().getParent() returns VF handler representing 'test'.
|
|
| The solution would be to set root's parent to null.
|
Ok so the problem is that whatever is creating the JAR VFS
is letting you leak off the top when you create a VFS based on a jar entry
all the way back to the jar file.
In fact, the code says it is a hack in JarContext
| protected VirtualFileHandler createVirtualFileHandler(VirtualFileHandler parent, URL url) throws IOException
| {
| if (url == null)
| throw new IllegalArgumentException("Null url");
|
| String urlStr = url.toString();
| String jarName = extractJarName(urlStr);
| String entryPath = urlStr;
| entryPath = entryPath(entryPath);
| JarHandler jar = new JarHandler(this, parent, url, jarName);
| if (entryPath == null)
| return jar;
|
| // todo This is a hack until we can fix http://jira.jboss.com/jira/browse/JBMICROCONT-164
| AbstractVirtualFileHandler result = (AbstractVirtualFileHandler)jar.getChild(entryPath);
| result.setPathName("");
| return result;
| }
|
The issue has been around for a year. ;-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138892#4138892
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138892
16 years, 6 months
[Design of Security on JBoss] - Re: Security Injection in AS5
by adrian@jboss.org
Since this works in conf/bootstrap-beans.xml
| <bean name="ClassLoadingDefaultDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer">
| <property name="defaultMetaData">
|
| <!-- HERE -->
|
| <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true"/>
| </property>
| </bean>
|
you need to explain what you are doing (or more likely not doing).
This works in bootstrap-beans.xml because JBossXB knows not just where
the schema is, but what to do with it.
Where/how do you tell JBossXB what to do with that a schema called
urn:jboss:security-config:5.0
e.g. look at deployers/metadata-beans.xml for where we tell it how
to do javaee metadata parsing.
NOTE: The error message is misleading
urn:jboss:bean-deployer:2.0:property will take any element as a child
what it is really telling you is that it doesn't know what to do with
We know it found the schema (assuming that file exists in the classpath
and is reachable from the bean parsing deployer's classloader):
| TRACE [org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver] (main) found schema InputSou
| rce, nsURI=urn:jboss:security-config:5.0, baseURI=null, schemaLocation=resource:security-config_5_0.
| xsd
|
OFF TOPIC
Also, by tradition schemas are put in schema subfolders.
i.e. it should be resource:schema/security-config_5_0.xsd
The JBossEntityResolver will even look for this resource if you specify
a proper schema location, e.g. http://www.jboss.org/schemas/security-config_5_0.xsd
It strips the file name and tries to do getResource("schema/filename.xsd");
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138889#4138889
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138889
16 years, 6 months