Re: Tomcat RMI and Eclipse
Well as promised, am reporting back. Christian was right and installing Tomcat into a directory with no spaces embedded in the path names fixes the RMI problem. I noted in bugzilla that this problem has already been reported, (Bug #4543) and was resolved with the solution that it is not going to be fixed. The basis for this decision appears to be that the problem with creating the URL is deep within the JDK itself, and not within Tomcat's code. Unless Sun is willing to commit to a quick resolution and provide a fix soon in the JDK, I would like to vote against this decision. (I was unable to do so in the Bugzilla data base, as it appears to have a bug also and will not allow me to gain access or change my password.) This could be fixed by changing the default installation directory for Tomcat such that no embedded spaces are allowed in the installation path. Otherwise, this will render the development of RMI code within servlets to be extremely difficult for new/other developers. I feel that RMI is an important technology, should be supported by Tomcat, and not be handicapped by such obstacles. Marc - Original Message - From: Marc Chamberlin [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 10:40 PM Subject: Re: Tomcat RMI and Eclipse OH Hey! Bingo! I bet you are right Christian!! That makes sense... I will reinstall Tomcat tomorrow and let you/group know... Thanks!!! Marc... - Original Message - From: Christian Traber [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 10:26 PM Subject: Re: Tomcat RMI and Eclipse Hi, I had the same problem:-( Group/Tomcat is part of the installation directory of tomcat (C:\Apache Group\Tomcat 4.1) If you install tomcat in a directory without spaces is the directory-names, it should works! I have this problem since tomcat4.0. Where and how can we report this problem? Regards, Christian Marc Chamberlin wrote: However, when I run the Tomcat server standalone, when the servlet makes this particular RMI call, to this method passing and returning the complex Java object, I get the following exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.net.MalformedURLException: no protocol: Group/Tomcat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat RMI and Eclipse
Hi, I have a puzzler and hope someone on this group might be able to give me a few pointers as to where to look for a solution I am running the Tomcat 4.1.18 server on a Win2000 machine and am developing a servlet which will act as an RMI client and makes remote calls to another machine. For the most part this RMI link is working, especially for remote method calls which pass and/or return simple Java objects such as ints or strings. However, I have one method which I call that passes and returns a more complex object (which has been declared as serializable) and it is with this method that I am having a problem/puzzler. For development purposes, I am using the Eclipse IDE with the Tomcat plugin. When I run the Tomcat server from within the Eclipse IDE, and test out my servlet, everything works fine including all RMI calls, and in particular the call to this remote method to which I am passing and returning a more complex Java object! However, when I run the Tomcat server standalone, when the servlet makes this particular RMI call, to this method passing and returning the complex Java object, I get the following exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.net.MalformedURLException: no protocol: Group/Tomcat Note, the servlet has made a number of RMI calls to the remote object, successfully, prior to making this particular call. Why this particular call works when Tomcat is running within the Eclipse IDE and fails when Tomcat is running standalone has got me puzzled! It does not matter whether I turn debugging on or off for the Tomcat server either. I thought maybe there could be some kind of race condition but these calls all occur within the main servlet thread, so I don't understand how that could be the case. Nor can I come up with anything that might be timing related I have also checked all supporting Jar files and made sure they were the same... Any ideas on what else might be different between the Eclipse IDE and the Tomcat standalone environment? Any thoughts appreciated Marc - Do you think the software industry will ever make software that is as easy and reliable for a user to use as the automobile industry makes a car easy and reliable for a user to drive? A man said unto the universe - Sir, I exist! However, replied the universe I do not see where that creates in me a sense of an obligation. - Stephen Crane
Re: Tomcat RMI and Eclipse
Thanks Chris for your thoughts... Hmmm there is no string Group/Tomcat anywhere in my code, so maybe it is somewhere within the Tomcat code?? I don't have the Tomcat source code, but guess I could download it :-( and take a look see if no one else has more info or a better idea Marc - Original Message - From: Chris Gokey [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 6:31 PM Subject: Re: Tomcat RMI and Eclipse Sometimes it helps to recreate the exception... URL url = new URL(Group/Tomcat); will result in: java.net.MalformedURLException: no protocol: Group/Tomcat My guess is that since you are getting an java.rmi.ServerException, the exception is being generated on the server after the RMI connection takes place. So, it seems to me you need to find that string Group/Tomcat (e.g., grep for it) and find out where that is being placed into a URL. I have no idea why this would happen with Tomcat and not in eclipse though. Chris On Wed, 2003-04-02 at 20:41, Marc Chamberlin wrote: Hi, I have a puzzler and hope someone on this group might be able to give me a few pointers as to where to look for a solution I am running the Tomcat 4.1.18 server on a Win2000 machine and am developing a servlet which will act as an RMI client and makes remote calls to another machine. For the most part this RMI link is working, especially for remote method calls which pass and/or return simple Java objects such as ints or strings. However, I have one method which I call that passes and returns a more complex object (which has been declared as serializable) and it is with this method that I am having a problem/puzzler. For development purposes, I am using the Eclipse IDE with the Tomcat plugin. When I run the Tomcat server from within the Eclipse IDE, and test out my servlet, everything works fine including all RMI calls, and in particular the call to this remote method to which I am passing and returning a more complex Java object! However, when I run the Tomcat server standalone, when the servlet makes this particular RMI call, to this method passing and returning the complex Java object, I get the following exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.net.MalformedURLException: no protocol: Group/Tomcat Note, the servlet has made a number of RMI calls to the remote object, successfully, prior to making this particular call. Why this particular call works when Tomcat is running within the Eclipse IDE and fails when Tomcat is running standalone has got me puzzled! It does not matter whether I turn debugging on or off for the Tomcat server either. I thought maybe there could be some kind of race condition but these calls all occur within the main servlet thread, so I don't understand how that could be the case. Nor can I come up with anything that might be timing related I have also checked all supporting Jar files and made sure they were the same... Any ideas on what else might be different between the Eclipse IDE and the Tomcat standalone environment? Any thoughts appreciated Marc - Do you think the software industry will ever make software that is as easy and reliable for a user to use as the automobile industry makes a car easy and reliable for a user to drive? A man said unto the universe - Sir, I exist! However, replied the universe I do not see where that creates in me a sense of an obligation. - Stephen Crane -- Christopher D. Gokey, SSAI, NASA/GCMD 18 Martin Road, Shelburne Falls, MA 01370 Phone: Voice (413) 625-8129 / FAX 208-248-9055 [EMAIL PROTECTED] AOL: chrisgokey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat RMI and Eclipse
Thanks Jean for replying.. No, this complex object just contains a lot of ints, doubles, strings, 2 vectors, and associated accessor methods. I tracked down what was being stored in the two vectors that this object has, and one just contains strings, the other contains a set of another complex object, (defined in the same package) but this second object is also serializable and only contains strings, booleans, and ints. So there are no references to an Eclipse object or any other non-seralizeable objects or unknown objects. All these class definitions are contained within the jar file that is registered to the codebase for the RMI server. Also all these class definitions are stored within jar files that are placed within the WEB-INF/lib directory of the servlet context of the Tomcat server. It was a good thought though :-) but I am still perplexed! Marc - Original Message - From: Jean-Francois Arcand [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 7:53 PM Subject: Re: Tomcat RMI and Eclipse Well, are you sure your complex object doesn't have any reference to an Eclipse object? I guess that's the problem. Since the missing object is not on the Tomcat classpath, then it is normal you receive that error. -- Jeanfrancois Marc Chamberlin wrote: Thanks Chris for your thoughts... Hmmm there is no string Group/Tomcat anywhere in my code, so maybe it is somewhere within the Tomcat code?? I don't have the Tomcat source code, but guess I could download it :-( and take a look see if no one else has more info or a better idea Marc - Original Message - From: Chris Gokey [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 6:31 PM Subject: Re: Tomcat RMI and Eclipse Sometimes it helps to recreate the exception... URL url = new URL(Group/Tomcat); will result in: java.net.MalformedURLException: no protocol: Group/Tomcat My guess is that since you are getting an java.rmi.ServerException, the exception is being generated on the server after the RMI connection takes place. So, it seems to me you need to find that string Group/Tomcat (e.g., grep for it) and find out where that is being placed into a URL. I have no idea why this would happen with Tomcat and not in eclipse though. Chris On Wed, 2003-04-02 at 20:41, Marc Chamberlin wrote: Hi, I have a puzzler and hope someone on this group might be able to give me a few pointers as to where to look for a solution I am running the Tomcat 4.1.18 server on a Win2000 machine and am developing a servlet which will act as an RMI client and makes remote calls to another machine. For the most part this RMI link is working, especially for remote method calls which pass and/or return simple Java objects such as ints or strings. However, I have one method which I call that passes and returns a more complex object (which has been declared as serializable) and it is with this method that I am having a problem/puzzler. For development purposes, I am using the Eclipse IDE with the Tomcat plugin. When I run the Tomcat server from within the Eclipse IDE, and test out my servlet, everything works fine including all RMI calls, and in particular the call to this remote method to which I am passing and returning a more complex Java object! However, when I run the Tomcat server standalone, when the servlet makes this particular RMI call, to this method passing and returning the complex Java object, I get the following exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.net.MalformedURLException: no protocol: Group/Tomcat Note, the servlet has made a number of RMI calls to the remote object, successfully, prior to making this particular call. Why this particular call works when Tomcat is running within the Eclipse IDE and fails when Tomcat is running standalone has got me puzzled! It does not matter whether I turn debugging on or off for the Tomcat server either. I thought maybe there could be some kind of race condition but these calls all occur within the main servlet thread, so I don't understand how that could be the case. Nor can I come up with anything that might be timing related I have also checked all supporting Jar files and made sure they were the same... Any ideas on what else might be different between the Eclipse IDE and the Tomcat standalone environment? Any thoughts appreciated Marc - Do you think the software industry will ever make software that is as easy and reliable for a user to use as the automobile industry makes a car easy and reliable for a user to drive
Re: Tomcat RMI and Eclipse
OH Hey! Bingo! I bet you are right Christian!! That makes sense... I will reinstall Tomcat tomorrow and let you/group know... Thanks!!! Marc... - Original Message - From: Christian Traber [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 10:26 PM Subject: Re: Tomcat RMI and Eclipse Hi, I had the same problem:-( Group/Tomcat is part of the installation directory of tomcat (C:\Apache Group\Tomcat 4.1) If you install tomcat in a directory without spaces is the directory-names, it should works! I have this problem since tomcat4.0. Where and how can we report this problem? Regards, Christian Marc Chamberlin wrote: However, when I run the Tomcat server standalone, when the servlet makes this particular RMI call, to this method passing and returning the complex Java object, I get the following exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.net.MalformedURLException: no protocol: Group/Tomcat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getServletConfig returning null
Hello I am trying to understand how servlet configuration and initialization parameters work and am running into a difficulty in Tomcat Version 4.1.18 I have the following configuration in in web.xml file - servlet servlet-nameStarChartServlet/servlet-name servlet-classstarchart.StarChartServlet/servlet-class init-param param-namestarChartWorkingDirectory/param-name param-valueC:\temp\/param-value /init-param /servlet In the servlets init method, I have the following code: try { starChartWorkingDirectory = getServletConfig().getInitParameter(starChartWorkingDirectory); } catch (java.lang.Exception ie) { System.out.println(Init Exception = + ie.toString()); } and I am getting a null pointer exception thrown here... Nothing else appears to be wrong in the log files and the servlet does function except for this issue. Any help and guidance would be much appreciated! Thanks... Marc... - Do you think the software industry will ever make software that is as easy and reliable for a user to use as the automobile industry makes a car easy and reliable for a user to drive? A man said unto the universe - Sir, I exist! However, replied the universe I do not see where that creates in me a sense of an obligation. - Stephen Crane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getServletConfig returning null
Thanks Craig for your reply... Yes I read about using the init(ServletConfig config) version of init in the Javadocs... Trouble is I am not using this version of init, but AM using the parameterless version... :-( SO no joy yet! Perhaps I will try the parameter version and see if that helps... Marc... - Original Message - From: Craig R. McClanahan [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, February 16, 2003 3:52 PM Subject: Re: getServletConfig returning null On Sun, 16 Feb 2003, Marc Chamberlin wrote: Date: Sun, 16 Feb 2003 14:33:12 -0800 From: Marc Chamberlin [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: getServletConfig returning null Hello I am trying to understand how servlet configuration and initialization parameters work and am running into a difficulty in Tomcat Version 4.1.18 I have the following configuration in in web.xml file - servlet servlet-nameStarChartServlet/servlet-name servlet-classstarchart.StarChartServlet/servlet-class init-param param-namestarChartWorkingDirectory/param-name param-valueC:\temp\/param-value /init-param /servlet In the servlets init method, I have the following code: try { starChartWorkingDirectory = getServletConfig().getInitParameter(starChartWorkingDirectory); } catch (java.lang.Exception ie) { System.out.println(Init Exception = + ie.toString()); } and I am getting a null pointer exception thrown here... Nothing else appears to be wrong in the log files and the servlet does function except for this issue. Any help and guidance would be much appreciated! Thanks... The simplest way to cause this problem is to mess up your init(ServletConfig) method, and forget to call super.init(config) before calling getServletConfig(): public void init(ServletConfig config) throws ServletException { ... do some stuff but ... ... do not call super.init(config) ... String foo = getServletConfig().getInitParameter(foo); // NPE super.init(config); String bar = getServletConfig().getInitParameter(bar); // Works } The superclass init() method is where a pointer to the initial ServletConfig object gets saved, so that getServletConfig() can find it. To avoid ever embarassing yourself with this mistake (trust me, nearly everyone who programs servlets makes it at least once :-), you should change your servlets to use the no-args version of init(): public void init() throws ServletException { ... do some stuff ... } because the container will call the init(ServletConfig) method in the base class, which will in turn call your init() method -- no risk of forgetting the superclass call. Marc... Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat on Win98
Hi, I am running the Tomcat 4.0 server under Win98 and so far I have used it under a light load condition, i.e. only a few users access it at any one time. But, I have recently set up a set of JSP questionaires coupled to a data base, and I am about to be hit by an onslaught of 60 to 100 users hitting my server simultaniously So, my question is, is there anything I need to do to prepare for this heavier usage? Do I need to, for example, increase or control memory allocation for Tomcat? And if so, how? (It use to be that Tomcat was started via a .bat file and I knew how to manage memory for them, but now the distribution supples a different shortcut which directly invokes the Tomcat server via calling java.exe on and a bootstrap.jar file so now I am not sure how) I did find a Startup.bat and a Shutdown.bat file in the bin directory of the distribution, and wonder if I should use these instead of the supplied shortcuts... For these, I could set the memory properties directly, if the Auto settings didn't work properly... Sorry if this is a dumb question (I am not a Windows expert) or has been already asked/answered, and yes I have already tried to RTFMs but am still confused ;-) Marc... Do you think the software industry will ever make software that is as easy and reliable for a user to use as the automobile industry makes a car easy and reliable for a user to drive? A man said unto the universe - Sir, I exist! However, replied the universe I do not see where that creates in me a sense of an obligation. - Stephen Crane
Re: How to install Tomcat on network -- is there any network version of Tomcat
Uma - Having just gone through setting up my own LAN, with a Tomcat server on it, I can give you a bit of guidance... Tomcat is simply a server and thus you treat it like any other server, i.e. an email server or an ftp server tex... There is no special configuration or special version of the Tomcat server which is dependent upon whether you are running it stand-alone or within a network. What you need to assure is that your DHCP/NAT server or network routers are configured so as to route your web traffic to the computer which is running your Tomcat server.Configuring your network is dependent upon how your network has been designed, which is beyond the scope of this group... ;-) You may also need to be concerned about configuring any firewalls you have running so they will pass traffic from your network to the computer running the Tomcat server, if you are using any firewalls. Hope this helps get you pointed in the right directionMarc... - Original Message - From: Uma Munugala [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Tuesday, April 16, 2002 12:34 PM Subject: RE: How to install Tomcat on network -- is there any network version of Tomcat Hi All Iam working on Tomcat 4.0.3 standalone. It works well. I want to install tomcat 4.0.3 on network so that other developers can access. How do I do that. Do I need to configure in some different way or is there any different copy of Tomcat 4.0.3 for network. Can any body help me. Thanks Uma -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: HTTP Tunnel (a response please????)
Stuart I am using an HTTP Tunneling protocol (for serialized Java objects) to handle communication from my servlets back to my applet front ends and it works great... I designed my applets to maintain state information and send this along with a request for new data, from it's associated servlet, at regular intervals (which is settable by the applet user for periods up to several minutes between requests) and the connection appears to stay open for as long as the applet/browser is running If you want a good source of info on how to set up a applet/servlet pair that uses HTTP tunneling protocols, get a copy of Core Servlets and Java Server Pages by Marty Hall and published by Sun Microsystems He has a very good example of how to set these up Marc Chamberlin - Original Message - From: [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, April 09, 2002 6:24 AM Subject: RE: HTTP Tunnel (a response please) That's the way HTTP works. You browser connects to a web server when it makes a request. And once it gets a response, it disconnects. The connection, it creates, may be persistent (default with HTTP/1.1) though. But servers generally timeout after being idle for sometime. So what you are looking for in terms of consistent or persistent connections may not be guaranteed this way. You should consider using sessions in your servlet or jsp (that is if you just want to persist the user state) or maybe use sockets (may run into firewall/security issues) RS Stuart Stephen [EMAIL PROTECTED] on 04/09/2002 07:41:22 AM Please respond to Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] cc: Subject: RE: HTTP Tunnel (a response please) -Original Message- From: Stuart Stephen [mailto:[EMAIL PROTECTED]] Sent: 08 April 2002 22:16 To: Tomcat Users List Subject: HTTP Tunnel Hi everybody, I'm looking to make an HTTP tunnel servlet or jsp page that will keep the user connected consistently rather than it disconnecting and re-connecting each time a request is sent. Could anyone help me out here? Stuart -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Tomcat 4.0 and Windows XP
Hate to ask a straightfoward question, but can't seem to find any answers and the FAQ is down I currently am running Tomcat 4.0 under Win98 and am thinking of upgrading to Windows XP Pro. Has anyone encountered any problems or know of any hitches I should be aware of to do this? Has Tomcat 4.0 been tested under Windows XP? Thanks for any/all replies, just trying to forsee any roadblocks! ;-) Marc.. Do you think the software industry will ever make software that is as easy and reliable for a user to use as the automobile industry makes a car easy and reliable for a user to drive? A man said unto the universe - Sir, I exist! However, replied the universe I do not see where that creates in me a sense of an obligation. - Stephen Crane
Fw: Tomcat 4.0 and Windows XP
I think I am going to resend this, I didn't see show up the first time... - Original Message - From: Marc Chamberlin To: [EMAIL PROTECTED] Sent: Sunday, March 17, 2002 3:34 PM Subject: Tomcat 4.0 and Windows XP Hate to ask a straightfoward question, but can't seem to find any answers and the FAQ is down I currently am running Tomcat 4.0 under Win98 and am thinking of upgrading to Windows XP Pro. Has anyone encountered any problems or know of any hitches I should be aware of to do this? Has Tomcat 4.0 been tested under Windows XP? Thanks for any/all replies, just trying to forsee any roadblocks! ;-) Marc.. Do you think the software industry will ever make software that is as easy and reliable for a user to use as the automobile industry makes a car easy and reliable for a user to drive? A man said unto the universe - Sir, I exist! However, replied the universe I do not see where that creates in me a sense of an obligation. - Stephen Crane