Re: [JBoss-dev] (no subject)
I think if found a possible workaround... It involves using the URL.setURLStreamHandlerFactory(..) method to implement custom Protocol handlers for file and jar. We just encode the URL ' ' with '+''es.. I'm going to clean up a bit and post some source in a little bit.. Regards, Hiram From: Scott M Stark [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [JBoss-dev] (no subject) Date: Fri, 24 Aug 2001 15:46:16 -0700 This may due to existing bug report on File.toURL() not escaping chars correctly. Here is a trival example that demonstrates the problem: Space Here 1162ls ASerializable.java ser.jar tstMO.class tstMO.java Space Here 1163pwd /tmp/Space Here Space Here 1164java tstMO cwd = file:/tmp/Space Here/./ serializable class = class java.lang.Class serializable codesource = null Exception in thread main java.net.MalformedURLException: no protocol: Here/./ser.jar at java.net.URL.init(URL.java:473) at java.net.URL.init(URL.java:376) at java.net.URL.init(URL.java:330) at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:387) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:132) at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:143) at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:918) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236) at java.rmi.MarshalledObject.get(MarshalledObject.java:138) at tstMO.main(tstMO.java:21) Space Here 1165cat tstMO.java import java.io.*; import java.net.*; import java.rmi.*; import java.security.*; class tstMO { public static void main(String[] args) throws Exception { File cwd = new File(.); File jarFile = new File(cwd, ser.jar); System.out.println(cwd = +cwd.toURL()); URL[] urls = {jarFile.toURL()}; URLClassLoader cl = new URLClassLoader(urls); Object serializable = cl.loadClass(ASerializable); Class sc = serializable.getClass(); System.out.println(serializable class = +sc); CodeSource cs = sc.getProtectionDomain().getCodeSource(); System.out.println(serializable codesource = +cs); MarshalledObject mo = new MarshalledObject(serializable); System.out.println(mo.get() -+mo.get()); } } Space Here 1166cat ASerializable.java public class ASerializable implements java.io.Serializable { } Space Here 1167jar -tf ser.jar META-INF/ META-INF/MANIFEST.MF ASerializable.class Space Here 1168 - Original Message - From: Scott M Stark [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 24, 2001 3:07 PM Subject: Re: [JBoss-dev] (no subject) This looks to be a bug in the sun.rmi.server.LoaderHandler class as it takes the URLs from the class's URLClassLoader and converts these into a space seperated list of url strings for use as the codebase, but these are not x-www-form-urlencoded string and so they will contain spaces if the file url contains a space. Thus, when the codebase is parsed into url strings by spaces the result is invalid url strings. The only workaround I can see at this point is to not install the server in a directory with spaces. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] Starting RH errors
Based on the CVS as of Sat 25/19:00 EST .. Why would I be getting a runtime exception starting the ConfigurationService ?? Could not create MBean DefaultDomain:service=Webserver(org.jboss.web.WebService) javax.management.RuntimeErrorException: Error thrown in the MBean's constructor at com.sun.management.jmx.MBeanServerImpl.internal_instantiate(MBeanServerImpl.java:2227) at com.sun.management.jmx.MBeanServerImpl.createMBean(MBeanServerImpl.java:761) at org.jboss.configuration.ConfigurationService.create(ConfigurationService.java:652) at org.jboss.configuration.ConfigurationService.loadConfiguration(ConfigurationService.java:437) at java.lang.reflect.Method.invoke(Native Method) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at org.jboss.Main.init(Main.java:201) at org.jboss.Main$2.run(Main.java:115) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.Main.main(Main.java:111) The jboss.jcml mbean code=org.jboss.web.WebService name=DefaultDomain:service=Webserver attribute name=Port8083/attribute /mbean ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] Starting RH errors
Because you compiled with jikes and it generates bad code for org.jboss.web.WebService - Original Message - From: Dave Smith [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 25, 2001 5:38 PM Subject: [JBoss-dev] Starting RH errors Based on the CVS as of Sat 25/19:00 EST .. Why would I be getting a runtime exception starting the ConfigurationService ?? Could not create MBean DefaultDomain:service=Webserver(org.jboss.web.WebService) javax.management.RuntimeErrorException: Error thrown in the MBean's constructor at com.sun.management.jmx.MBeanServerImpl.internal_instantiate(MBeanServerImpl. java:2227) at com.sun.management.jmx.MBeanServerImpl.createMBean(MBeanServerImpl.java:761) at org.jboss.configuration.ConfigurationService.create(ConfigurationService.jav a:652) at org.jboss.configuration.ConfigurationService.loadConfiguration(Configuration Service.java:437) at java.lang.reflect.Method.invoke(Native Method) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at org.jboss.Main.init(Main.java:201) at org.jboss.Main$2.run(Main.java:115) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.Main.main(Main.java:111) The jboss.jcml mbean code=org.jboss.web.WebService name=DefaultDomain:service=Webserver attribute name=Port8083/attribute /mbean ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] (no subject)
It would also break doing things like. url.openStream() Cause it does not expect the file url to be URLEncoded. Regards, Hiram From: Dain Sundstrom [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [JBoss-dev] (no subject) Date: Sat, 25 Aug 2001 10:16:47 -0500 Can we just construct the url by hand before it is loaded into the class loader? Here is the code for toURL() public URL toURL() throws MalformedURLException { String path = getAbsolutePath(); if (File.separatorChar != '/') { path = path.replace(File.separatorChar, '/'); } if (!path.startsWith(/)) { path = / + path; } if (!path.endsWith(/) isDirectory()) { path = path + /; } return new URL(file, , path); } We then just write a new function to do a toURL with the last line changed to: return new URL(file, , URLEncoder.encode(path)); Of course this only works if we control the code that constructs the url. -dain - Original Message - From: Hiram Chirino [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 25, 2001 8:40 AM Subject: Re: [JBoss-dev] (no subject) Well, if it's leaving the VM the code base should be going through the WebService. The WebService URL will not have a space in it, plus it will not be a file: URL and will not be affected by the Fix below. I think that's why the JRMP test suite was not failing. How about we install this fix via an MBean (maybe the info mbean) into the VM. We run the testsuite against it and see what happens. Hey, at least it should not not make things MUCH worse, jboss is allready screwed if installed on paths with a space. Regards, Hiram From: Scott M Stark [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [JBoss-dev] (no subject) Date: Sat, 25 Aug 2001 00:31:00 -0700 This won't work if the codebase leaves the vm, and now what happens if the path contains a '+' ? - Original Message - From: Hiram Chirino [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 24, 2001 11:54 PM Subject: Re: [JBoss-dev] (no subject) Ok.. if finished that workaround. I don't know if it will break anything else, but at least it fixes our test case. To use it, add the following line to the top of the tstMO main() method. FileURLSpaceFixer.install(); below is the FileURLSpaceFixer.java file. - import java.net.URL; import java.net.URLStreamHandlerFactory; import java.net.URLStreamHandler; import java.net.URLConnection; /** * Used to fix the problem with the RMI classloader for * when a space appears in the path to where a class * should be loaded from. * * @author: Hiram Chirino */ class FileURLSpaceFixer { private static FileHandler fileHander= new FileHandler(); private static CustomURLStreamHandlerFactory customURLStreamHandlerFactory= new CustomURLStreamHandlerFactory(); // // This class is used to hook into the URL protocol parsing sysytem // private static class CustomURLStreamHandlerFactory implements URLStreamHandlerFactory { public URLStreamHandler createURLStreamHandler(String protocol) { if (protocol.equals(file)) return fileHander; return null; } } // // This class will override how the file handler is implemented. // private static class FileHandler extends sun.net.www.protocol.file.Handler { // When we externalize the URL we want to make all the spaces in the file name // a '+' character protected String toExternalForm(URL u) { String s= super.toExternalForm(u); return s.replace(' ', '+'); } // When we load a URL in we want to convert all the '+' characters in the file name // into spaces. protected void parseURL(URL u, String spec, int start, int limit) { super.parseURL(u, spec, start, limit); setURL(u, u.getProtocol(), u.getHost(), u.getPort(), u.getFile().replace('+', ' '), u.getRef()); } } // use this method to install this fix. public static void install() { URL.setURLStreamHandlerFactory(customURLStreamHandlerFactory); } } - Regards, Hiram ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp ___ Jboss-development mailing list [EMAIL
[JBoss-dev] CVS update: jboss/src/main/org/jboss/util FileURLPatch.java FileURLPatchMBean.java
User: chirino Date: 01/08/25 20:20:39 Added: src/main/org/jboss/util FileURLPatch.java FileURLPatchMBean.java Log: Adding a MBean that will patch sun's file URL implementation so that JBoss does not get an error when it is run in a directory with a space in it. Revision ChangesPath 1.1 jboss/src/main/org/jboss/util/FileURLPatch.java Index: FileURLPatch.java === /* * JBoss, the OpenSource EJB server * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.util; import java.util.Enumeration; import javax.management.MBeanRegistration; import javax.management.MBeanServer; import javax.management.ObjectName; import org.apache.log4j.Category; import java.net.URLStreamHandlerFactory; import java.net.URL; import java.net.URLStreamHandler; import java.net.URLConnection; /** A MBean that patches the file URL handing implementation so that JBoss * can be run in directories with a space in it. Has the weird side-effect that * all file based URLs when externalized with have spaces replaced with pluses. * * @author a href=mailto:[EMAIL PROTECTED];Hiram Chirino/a. * @version $Revision: 1.1 $ */ public class FileURLPatch implements FileURLPatchMBean, MBeanRegistration { public static final String OBJECT_NAME= :service=FileURLPatch; Category log= Category.getInstance(FileURLPatch.class); private CustomURLStreamHandlerFactory customURLStreamHandlerFactory= new CustomURLStreamHandlerFactory(); private boolean enabled= false; private FileHandler fileHander= new FileHandler(); // // This class is used to hook into the URL protocol parsing sysytem // private class CustomURLStreamHandlerFactory implements URLStreamHandlerFactory { public URLStreamHandler createURLStreamHandler(String protocol) { if (protocol.equals(file)) return fileHander; return null; } } // // This class will override how the file handler is implemented. // private class FileHandler extends sun.net.www.protocol.file.Handler { // When we externalize the URL we want to make all the spaces in the file name // a '+' character protected String toExternalForm(URL u) { if (enabled) { String s= super.toExternalForm(u); return s.replace(' ', '+'); } return super.toExternalForm(u); } // When we load a URL in we want to convert all the '+' characters in the file name // into spaces. protected void parseURL(URL u, String spec, int start, int limit) { super.parseURL(u, spec, start, limit); if (enabled) { setURL(u, u.getProtocol(), u.getHost(), u.getPort(), u.getFile().replace('+', ' '), u.getRef()); } } } public void setEnabled(boolean enable) { this.enabled= enable; if (enabled) log.info(The file URL patch has been enabled.); else log.info(The file URL patch has been disabled.); } public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception { URL.setURLStreamHandlerFactory(customURLStreamHandlerFactory); return new ObjectName(OBJECT_NAME); } public void postRegister(java.lang.Boolean registrationDone) { } public void preDeregister() throws java.lang.Exception { } public void postDeregister() { } } 1.1 jboss/src/main/org/jboss/util/FileURLPatchMBean.java Index: FileURLPatchMBean.java === /* * JBoss, the OpenSource EJB server * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.util; import java.lang.Object; /** * description * * @see related * @author a href=mailto:[EMAIL PROTECTED];Rickard Öberg/a. * @author a href=mailto:[EMAIL PROTECTED];Hiram Chirino/a. * @version $Revision: 1.1 $ */ public interface FileURLPatchMBean { public void setEnabled(boolean enable); } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: newsite faq.jsp
User: chirino Date: 01/08/25 20:59:14 Modified:.faq.jsp Log: Added some doco on how to enable the FileURLPatchMBean Revision ChangesPath 1.8 +37 -12newsite/faq.jsp Index: faq.jsp === RCS file: /cvsroot/jboss/newsite/faq.jsp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- faq.jsp 2001/08/15 01:18:11 1.7 +++ faq.jsp 2001/08/26 03:59:14 1.8 @@ -42,18 +42,32 @@ lia class=link href=#FAQ-BEANDEV-RESOURCEPREFIXWhen do I need to prefix a lookup with quot;java:comp/envquot; ?/a lia class=link href=#FAQ-BEANDEV-ACCESSBEANSHow do I access beans in a different jar ?/a/ul -p class=headSERVER ADMINISTRATION QUESTIONSul -lia class=link href=#FAQ-ADMIN-STARTHow is JBoss started ?/a -lia class=link href=#FAQ-ADMIN-SHUTDOWNHow do I cleanly shutdown JBoss ?/a -lia class=link href=#FAQ-ADMIN-NTSERVICEHow can I set up JBoss as a service in Windows NT ?/a -lia class=link href=#FAQ-ADMIN-BOOTHow do I configure JBoss to start when the server boots ?/a -lia class=link href=#FAQ-ADMIN-SECURITYHow do I configure security with JBoss ?/a -lia class=link href=#FAQ-ADMIN-DEPLOYWhat tasks must be completed to deploy an EJB using JBoss ?/a -lia class=link href=#FAQ-ADMIN-UNDEPLOYHow do I undeploy an application ?/a -lia class=link href=#FAQ-ADMIN-CLUSTERCan I cluster multiple JBoss servers ?/a -lia class=link href=#FAQ-ADMIN-DATASOURCEHow do I configure [Database Type] with JBoss ?/a -lia class=link href=#FAQ-ADMIN-JAWSDTDIs a DTD available for jaws.xml ?/a -lia class=link href=#FAQ-ADMIN-JBOSSDTDIs a DTD available for jboss.xml ?/a/ul +p class=headSERVER ADMINISTRATION QUESTIONS +ul + lia class=link href=#FAQ-ADMIN-STARTHow is JBoss started ?/a + lia class=link href=#FAQ-ADMIN-SHUTDOWNHow do I cleanly shutdown JBoss +?/a + lia class=link href=#FAQ-ADMIN-NTSERVICEHow can I set up JBoss as a +service in Windows NT ?/a + lia class=link href=#FAQ-ADMIN-BOOTHow do I configure JBoss to start +when the server boots ?/a + lia class=link href=#FAQ-ADMIN-SECURITYHow do I configure security with +JBoss ?/a + lia class=link href=#FAQ-ADMIN-DEPLOYWhat tasks must be completed to +deploy an EJB using JBoss ?/a + lia class=link href=#FAQ-ADMIN-UNDEPLOYHow do I undeploy an application +?/a + lia class=link href=#FAQ-ADMIN-CLUSTERCan I cluster multiple JBoss servers +?/a + lia class=link href=#FAQ-ADMIN-DATASOURCEHow do I configure [Database +Type] with JBoss ?/a + lia class=link href=#FAQ-ADMIN-JAWSDTDIs a DTD available for jaws.xml +?/a + lia class=link href=#FAQ-ADMIN-JBOSSDTDIs a DTD available for jboss.xml +?/a + lia class=link href=#FAQ-ADMIN-RUN-PATH-WITH-A-SPACEJBoss won't run when installed +in a path with spaces?/a +/ul p class=headCONTAINER DEVELOPER QUESTIONSul lia class=link href=#FAQ-CONTAINER-SPECSWhere can I find technical specs for the JBoss server ?/a @@ -260,6 +274,17 @@ p class=textBack to a class=link href=#FAQ_CONTENTSFAQ Contents/anbsp;/p h3a name=FAQ-ADMIN-JBOSSDTD/aIs a DTD available for jboss.xml ?/h3 p class=texta class=link href=#FAQ-CREDITSYes/a./p +p class=textBack to a class=link href=#FAQ_CONTENTSFAQ Contents/a/p +p class=textnbsp; +p class=heada name=FAQ-CONTAINER/aCONTAINER DEVELOPER QUESTIONS +p class=text +h3a name=FAQ-ADMIN-RUN-PATH-WITH-A-SPACE/aJBoss won't run when installed in a path with spaces ?/h3 +p class=textDue to SUN feature (the implementation of URL + the RMI classloader) + JBoss may experience errors when it is run from a path that contains a space + in it. There is a feature in JBoss that you can enable that will cope with this + problem. To enable it, add the following MBean configuration section to the + top of jboss.jcml :/p +pre lt;mbean code=quot;org.jboss.util.FileURLPatchquot; name=quot;DefaultDomain:service=FileURLPatchquot;gt;brlt;attribute name=quot;Enabledquot;gt;truelt;/attributegt;br lt;/mbeangt;/pre p class=textBack to a class=link href=#FAQ_CONTENTSFAQ Contents/a/p p class=textnbsp; p class=heada name=FAQ-CONTAINER/aCONTAINER DEVELOPER QUESTIONS
[JBoss-dev] CVS update: jbossmx/etc local.properties-example
User: user57 Date: 01/08/25 21:02:19 Removed: etc local.properties-example Log: o removing source module's etc/local.properties-example, this was just adding complexity confusion. Put local properties in build/local.properties. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: contrib/jetty/etc local.properties-example
User: user57 Date: 01/08/25 21:02:20 Removed: jetty/etc local.properties-example Log: o removing source module's etc/local.properties-example, this was just adding complexity confusion. Put local properties in build/local.properties. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/etc local.properties-example
User: user57 Date: 01/08/25 21:02:21 Removed: etc local.properties-example Log: o removing source module's etc/local.properties-example, this was just adding complexity confusion. Put local properties in build/local.properties. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: admin/src/etc local.properties-example
User: user57 Date: 01/08/25 21:02:19 Removed: src/etc local.properties-example Log: o removing source module's etc/local.properties-example, this was just adding complexity confusion. Put local properties in build/local.properties. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: admin/etc local.properties-example
User: user57 Date: 01/08/25 21:02:19 Removed: etc local.properties-example Log: o removing source module's etc/local.properties-example, this was just adding complexity confusion. Put local properties in build/local.properties. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: manual/etc local.properties-example
User: user57 Date: 01/08/25 21:02:20 Removed: etc local.properties-example Log: o removing source module's etc/local.properties-example, this was just adding complexity confusion. Put local properties in build/local.properties. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jnp/etc local.properties-example
User: user57 Date: 01/08/25 21:02:20 Removed: etc local.properties-example Log: o removing source module's etc/local.properties-example, this was just adding complexity confusion. Put local properties in build/local.properties. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosssx/etc local.properties-example
User: user57 Date: 01/08/25 21:02:21 Removed: etc local.properties-example Log: o removing source module's etc/local.properties-example, this was just adding complexity confusion. Put local properties in build/local.properties. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: contrib/varia/etc local.properties-example
User: user57 Date: 01/08/25 21:02:20 Removed: varia/etc local.properties-example Log: o removing source module's etc/local.properties-example, this was just adding complexity confusion. Put local properties in build/local.properties. ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/util FileURLPatch.java FileURLPatchMBean.java
User: chirino Date: 01/08/25 21:03:27 Modified:src/main/org/jboss/util FileURLPatch.java FileURLPatchMBean.java Log: Fixed up the javadoc Revision ChangesPath 1.2 +20 -13jboss/src/main/org/jboss/util/FileURLPatch.java Index: FileURLPatch.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/FileURLPatch.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FileURLPatch.java 2001/08/26 03:20:39 1.1 +++ FileURLPatch.java 2001/08/26 04:03:27 1.2 @@ -24,19 +24,19 @@ * all file based URLs when externalized with have spaces replaced with pluses. * * @author a href=mailto:[EMAIL PROTECTED];Hiram Chirino/a. - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public class FileURLPatch implements FileURLPatchMBean, MBeanRegistration { - public static final String OBJECT_NAME= :service=FileURLPatch; + public static final String OBJECT_NAME= :service=FileURLPatch; Category log= Category.getInstance(FileURLPatch.class); private CustomURLStreamHandlerFactory customURLStreamHandlerFactory= new CustomURLStreamHandlerFactory(); private boolean enabled= false; private FileHandler fileHander= new FileHandler(); - // - // This class is used to hook into the URL protocol parsing sysytem - // + /** +* This class is used to hook into the URL protocol parsing sysytem +*/ private class CustomURLStreamHandlerFactory implements URLStreamHandlerFactory { public URLStreamHandler createURLStreamHandler(String protocol) { if (protocol.equals(file)) @@ -45,13 +45,15 @@ } } - // - // This class will override how the file handler is implemented. - // + /** +* This class will override how the file handler is implemented. + */ private class FileHandler extends sun.net.www.protocol.file.Handler { - // When we externalize the URL we want to make all the spaces in the file name - // a '+' character + /** +* When we externalize the URL we want to make all the spaces in the file name +* a '+' character +*/ protected String toExternalForm(URL u) { if (enabled) { String s= super.toExternalForm(u); @@ -60,8 +62,10 @@ return super.toExternalForm(u); } - // When we load a URL in we want to convert all the '+' characters in the file name - // into spaces. + /** +* When we load a URL in we want to convert all the '+' characters in the file name +* into spaces. +*/ protected void parseURL(URL u, String spec, int start, int limit) { super.parseURL(u, spec, start, limit); if (enabled) { @@ -70,6 +74,9 @@ } } + /** +* This patch can be enabled and disabled at runtime by calling this method. + */ public void setEnabled(boolean enable) { this.enabled= enable; if (enabled) @@ -92,4 +99,4 @@ public void postDeregister() { } -} \ No newline at end of file +} 1.2 +3 -8 jboss/src/main/org/jboss/util/FileURLPatchMBean.java Index: FileURLPatchMBean.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/FileURLPatchMBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FileURLPatchMBean.java2001/08/26 03:20:39 1.1 +++ FileURLPatchMBean.java2001/08/26 04:03:27 1.2 @@ -9,16 +9,11 @@ import java.lang.Object; /** - * description - * + * Used to show the managment interface of the FileURLPatch object. * @see related - * @author a href=mailto:[EMAIL PROTECTED];Rickard Öberg/a. * @author a href=mailto:[EMAIL PROTECTED];Hiram Chirino/a. - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public interface FileURLPatchMBean { - - - public void setEnabled(boolean enable); -} \ No newline at end of file +} ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Mutex.java
User: chirino Date: 01/08/25 21:07:39 Removed: src/main/org/jboss/mq Mutex.java Log: Not used anymore.. bye bye ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq SpyObjectMessage.java
User: chirino Date: 01/08/25 22:35:57 Modified:src/main/org/jboss/mq SpyObjectMessage.java Log: Fixed the a serialization problem. ClassNotFoundExceptions were being thrown when a MDB would receive a ObjectMessage. Revision ChangesPath 1.5 +20 -2 jbossmq/src/main/org/jboss/mq/SpyObjectMessage.java Index: SpyObjectMessage.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/SpyObjectMessage.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SpyObjectMessage.java 2001/08/17 23:32:26 1.4 +++ SpyObjectMessage.java 2001/08/26 05:35:57 1.5 @@ -17,7 +17,7 @@ * * @author Norbert Lataille ([EMAIL PROTECTED]) * @createdAugust 16, 2001 - * @version$Revision: 1.4 $ + * @version$Revision: 1.5 $ */ public class SpyObjectMessage extends SpyMessage @@ -65,7 +65,25 @@ retVal = new byte[objectBytes.length]; System.arraycopy( objectBytes, 0, retVal, 0, objectBytes.length ); } else { - ObjectInputStream input = new ObjectInputStream( new ByteArrayInputStream( objectBytes ) ); + +/** +* Default implementation ObjectInputStream does not work well +* when running an a micro kernal style app-server like JBoss. +* We need to look for the Class in the context class loader +* and not in the System classloader. +* +* Would this be done better by using a MarshaedObject?? +*/ +class ObjectInputStreamExt extends ObjectInputStream { + ObjectInputStreamExt(InputStream is) throws IOException { + super(is); + } + protected Class resolveClass(ObjectStreamClass v) throws IOException, ClassNotFoundException { + return Thread.currentThread().getContextClassLoader().loadClass(v.getName()); + } +} + +ObjectInputStream input= new ObjectInputStreamExt(new ByteArrayInputStream(objectBytes)); retVal = ( Serializable )input.readObject(); input.close(); } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development