This content has been marked as final.
Show 2 replies
-
1. Re: VFS Memory Deserialization
alesj Aug 12, 2008 11:56 AM (in response to kabirkhan)"kabir.khan@jboss.com" wrote:
Is the problem you are seeing that it tries to pass in the whole URL? If possible try breaking it up?
This fails when I try to (de)serialize VirtualFile created in InMemoryClassesDeployer,
- http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java
which is part of classpath.
For (de)serialization I use the before mentioned mechanism:
- http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/vfs/VirtualFileSerializator.java
Used here:
- http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java
On deserialization of that classpath in-memory VirtualFile, I get that exception. -
2. Re: VFS Memory Deserialization
kabirkhan Aug 12, 2008 1:48 PM (in response to kabirkhan)The following little test that I wrote to see how this fails passes for me
package org.jboss.test.deployers.vfs.memory; import java.net.URL; import java.rmi.MarshalledObject; import java.util.Collections; import java.util.List; import org.jboss.deployers.vfs.plugins.vfs.VirtualFileSerializator; import org.jboss.test.BaseTestCase; import org.jboss.virtual.MemoryFileFactory; import org.jboss.virtual.VFS; import org.jboss.virtual.VirtualFile; /** * * @author <a href="kabir.khan@jboss.com">Kabir Khan</a> * @version $Revision: 1.1 $ */ public class MemoryTestCase extends BaseTestCase { public MemoryTestCase(String name) { super(name); } public void testSerialize() throws Exception { URL url = new URL("vfsmemory://aopdomain/org/acme/test/Test.class"); MemoryFileFactory.createRoot(new URL("vfsmemory://aopdomain")); MemoryFileFactory.putFile(url, new byte[] {'a', 'b', 'c'}); VirtualFile classFile = VFS.getVirtualFile(new URL("vfsmemory://aopdomain"), "org/acme/test/Test.class"); assertNotNull(classFile); VirtualFileSerializator saved = VirtualFileSerializator.toVirtualFileSerializators(Collections.singletonList(classFile)).get(0); MarshalledObject mo = new MarshalledObject(saved); VirtualFileSerializator loaded = (VirtualFileSerializator)mo.get(); VirtualFile loadedFile = loaded.getFile(); assertNotNull(loadedFile); assertEquals(classFile, loadedFile); } protected void setUp() throws Exception { VFS.init(); super.setUp(); getLog().info("java.protocol.handler.pkgs: " + System.getProperty("java.protocol.handler.pkgs")); } }