[Design of JBoss Web Services] - Re: VirtualFileAdaptor behavior seems incorrect
by scott.stark@jboss.org
I see you added a test that did not show the problem. I went through the server code to see exactly how the VirtualFile being passed to the ws VirtualFileAdaptor was being created. The issue is that a VirtualFile with a DelegatingHandler pointing to the client jar is asked for itself using getChild(""), and its this VirtualFile that is passed to the VirtualFileAdaptor. It is this file that
| public void testVirtualFileAdaptorEarInnerJar() throws Exception
| {
| URL rootURL = getResource("/vfs/test/interop_W2JREMarshallTest_appclient_vehicle.ear");
| VFS vfs = VFS.getVFS(rootURL);
| VirtualFile file = vfs.getChild("interop_W2JREMarshallTest_appclient_vehicle_client.jar");
| assertNotNull(file);
| VirtualFile file2 = file.getChild("");
| assertNotNull(file2);
| VirtualFileAdaptor adaptor = new VirtualFileAdaptor(file2);
| // serialize
| adaptor = serializeDeserialize(adaptor, VirtualFileAdaptor.class);
| VirtualFileAdaptor child = adaptor.findChild("MarshallTest.xml");
| assertNotNull(child);
| }
|
| java.io.IOException: Child not found interop_W2JREMarshallTest_appclient_vehicle_client.jar for ZipEntryHandler@15675922[path= context=vfszip:/Users/svn/JBossAS/projects/vfs/trunk/target/test-classes/vfs/test/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar real=vfszip:/Users/svn/JBossAS/projects/vfs/trunk/target/test-classes/vfs/test/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar], available children: [ZipEntryHandler@12612903[path=META-INF context=vfszip:/Users/svn/JBossAS/projects/vfs/trunk/target/test-classes/vfs/test/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar real=vfszip:/Users/svn/JBossAS/projects/vfs/trunk/target/test-classes/vfs/test/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar/META-INF], ZipEntryHandler(a)4945063[path=MarshallTest.xml context=vfszip:/Users/svn/JBossAS/projects/vfs/trunk/target/test-classes/vfs/test/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar real=vfszip:/Users/svn/JBossAS/projects/vfs/trunk/target/test-classes/vfs/test/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar/MarshallTest.xml], ZipEntryHandler@14126576[path=com context=vfszip:/Users/svn/JBossAS/projects/vfs/trunk/target/test-classes/vfs/test/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar real=vfszip:/Users/svn/JBossAS/projects/vfs/trunk/target/test-classes/vfs/test/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar/com]]
| at org.jboss.virtual.VirtualFile.findChild(VirtualFile.java:409)
| at org.jboss.test.virtual.support.VirtualFileAdaptor.getFile(VirtualFileAdaptor.java:83)
| at org.jboss.test.virtual.support.VirtualFileAdaptor.findChild(VirtualFileAdaptor.java:91)
| at org.jboss.test.virtual.test.JARSerializationUnitTestCase.testVirtualFileAdaptorEarInnerJar(JARSerializationUnitTestCase.java:264)
|
See http://jira.jboss.com/jira/browse/JBVFS-36.
The current testVirtualFileAdaptorEarInnerJar should have other tests that validate basic navigation assertations as serialization really is not the issue here.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159738#4159738
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159738
15 years, 11 months
[Design of JBoss Web Services] - VirtualFileAdaptor behavior seems incorrect
by scott.stark@jboss.org
The current problem with the cts test serialization has to due with the behavior of the VirtualFileAdaptor. A VirtualFileAdaptor is created with a VirtualFile whose underlying handler is a ZipEntryHandler is created that has a path interop_W2JREMarshallTest_appclient_vehicle_client.jar, and a uri of vfszip:/Users/svn/JBossHead/jboss-head/build/output/jboss-5.0.0.CR1/server/cts/tmp/jsr88/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar:
ZipEntryHandler(a)2656127[path=interop_W2JREMarshallTest_appclient_vehicle_client.jar context=vfszip:/Users/svn/JBossHead/jboss-head/build/output/jboss-5.0.0.CR1/server/cts/tmp/jsr88/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar real=vfszip:/Users/svn/JBossHead/jboss-head/build/output/jboss-5.0.0.CR1/server/cts/tmp/jsr88/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar]
When the VirtualFileAdaptor that wraps the associated VirtualFile, ends up writing out the path and rootURL as interop_W2JREMarshallTest_appclient_vehicle_client.jar and vfszip:/Users/svn/JBossHead/jboss-head/build/output/jboss-5.0.0.CR1/server/cts/tmp/jsr88/interop_W2JREMarshallTest_appclient_vehicle.ear/interop_W2JREMarshallTest_appclient_vehicle_client.jar.
| private void writeObject(ObjectOutputStream out) throws IOException, URISyntaxException
| {
| URL url = rootUrl;
| if (url == null)
| {
| VFS vfs = getFile().getVFS();
| url = vfs.getRoot().toURL();
| }
| String pathName = path;
| if (pathName == null)
| pathName = getFile().getPathName();
|
| ObjectOutputStream.PutField fields = out.putFields();
| fields.put("rootUrl", url);
| fields.put("path", pathName);
| out.writeFields();
| }
|
This will not work when deserialized with the VirtualFileAdaptor.getFile() implementation. The only way this could work is if the following code used to return the root URL of the ear previously:
| VFS vfs = getFile().getVFS();
| url = vfs.getRoot().toURL();
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159656#4159656
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159656
15 years, 11 months