Re: url.openConnection() doesn't allow to pass objects or attributes
I used doPost only but still it doesn't. From: Kesav Kumar [EMAIL PROTECTED] Reply-To: Orion-Interest [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Subject: Re: url.openConnection() doesn't allow to pass objects or attributes Date: Sun, 3 Feb 2002 08:23:09 -0800 I just noticed one more thing with your servlet. It seems that you are using doGet method in your servlet. If you do a post request through URL you need to write doPost method in your servlet. -kesav kumar [EMAIL PROTECTED] - Original Message - From: prasanth sb [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Sunday, February 03, 2002 2:51 AM Subject: Re: url.openConnection() doesn't allow to pass objects or attributes I set the doOuptut parameters ,but still in orion it is not working. Can you please help me in this? From: Kesav Kumar [EMAIL PROTECTED] Reply-To: Orion-Interest [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Subject: Re: url.openConnection() doesn't allow to pass objects or attributes Date: Sat, 26 Jan 2002 08:12:31 -0800 For Posting data from through URLs you have to set doOutput to true. con.setDoOutput(true); con.setDoInput(true); Once you set the above you can get the OutputStream associated with connection and send parameters. For more info read the article at JavaWorld http://www.javaworld.com/javaworld/javatips/jw-javatip34.html -kesav kumar - Original Message - From: prasanth sb [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Saturday, January 26, 2002 1:27 AM Subject: url.openConnection() doesn't allow to pass objects or attributes Hello dear friends, Please help me with a strange problem happening with orion. I am calling url.openConnection() to a servlet page.When I call this, the call goes to doGet method of the servlet. But it has to go to the doPost method. Second problem is I am able to read the values from the callee servlet. But I am not able to pass the values to the callee servlet.I am trying to pass objects in a stream.I have seen this problem reported in the mailing list. Can anyone help me in this? Please find the sample code, Caller Servlet URLConncetion con =url.openConnection(http://ipname:port/Servlet1;); ObjectOutputStream os = new ObjectOutputStream(con.getOutputStream()); os.writeObject(string object); Callee servlet(Servlet1.java) public void doGet(HttpServletRequest req,HttpServletResponse res) { ObjectInputStream ois = new ObjectInputStream(req.getInputStream()); ois.readObject();//This line , it prints null.It wont print the string //string object.But if I return values from the servlet1, then Caller servlet is able to read. Can some one throw some light on this. _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com
Re: url.openConnection() doesn't allow to pass objects or attributes
If you can post your java code and servlet code may be its helpful in debug. -kesav [EMAIL PROTECTED] - Original Message - From: prasanth sb [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Sunday, February 10, 2002 3:15 AM Subject: Re: url.openConnection() doesn't allow to pass objects or attributes I used doPost only but still it doesn't. From: Kesav Kumar [EMAIL PROTECTED] Reply-To: Orion-Interest [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Subject: Re: url.openConnection() doesn't allow to pass objects or attributes Date: Sun, 3 Feb 2002 08:23:09 -0800 I just noticed one more thing with your servlet. It seems that you are using doGet method in your servlet. If you do a post request through URL you need to write doPost method in your servlet. -kesav kumar [EMAIL PROTECTED] - Original Message - From: prasanth sb [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Sunday, February 03, 2002 2:51 AM Subject: Re: url.openConnection() doesn't allow to pass objects or attributes I set the doOuptut parameters ,but still in orion it is not working. Can you please help me in this? From: Kesav Kumar [EMAIL PROTECTED] Reply-To: Orion-Interest [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Subject: Re: url.openConnection() doesn't allow to pass objects or attributes Date: Sat, 26 Jan 2002 08:12:31 -0800 For Posting data from through URLs you have to set doOutput to true. con.setDoOutput(true); con.setDoInput(true); Once you set the above you can get the OutputStream associated with connection and send parameters. For more info read the article at JavaWorld http://www.javaworld.com/javaworld/javatips/jw-javatip34.html -kesav kumar - Original Message - From: prasanth sb [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Saturday, January 26, 2002 1:27 AM Subject: url.openConnection() doesn't allow to pass objects or attributes Hello dear friends, Please help me with a strange problem happening with orion. I am calling url.openConnection() to a servlet page.When I call this, the call goes to doGet method of the servlet. But it has to go to the doPost method. Second problem is I am able to read the values from the callee servlet. But I am not able to pass the values to the callee servlet.I am trying to pass objects in a stream.I have seen this problem reported in the mailing list. Can anyone help me in this? Please find the sample code, Caller Servlet URLConncetion con =url.openConnection(http://ipname:port/Servlet1;); ObjectOutputStream os = new ObjectOutputStream(con.getOutputStream()); os.writeObject(string object); Callee servlet(Servlet1.java) public void doGet(HttpServletRequest req,HttpServletResponse res) { ObjectInputStream ois = new ObjectInputStream(req.getInputStream()); ois.readObject();//This line , it prints null.It wont print the string //string object.But if I return values from the servlet1, then Caller servlet is able to read. Can some one throw some light on this. _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com
Re: url.openConnection() doesn't allow to pass objects or attributes
This article is an excellent intro to posting objects: http://developer.java.sun.com/developer/technicalArticles/RMI/rmi/ Bill. - Original Message - From: prasanth sb [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Sunday, February 10, 2002 4:15 AM Subject: Re: url.openConnection() doesn't allow to pass objects or attributes I used doPost only but still it doesn't. From: Kesav Kumar [EMAIL PROTECTED] Reply-To: Orion-Interest [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Subject: Re: url.openConnection() doesn't allow to pass objects or attributes Date: Sun, 3 Feb 2002 08:23:09 -0800 I just noticed one more thing with your servlet. It seems that you are using doGet method in your servlet. If you do a post request through URL you need to write doPost method in your servlet. -kesav kumar [EMAIL PROTECTED] - Original Message - From: prasanth sb [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Sunday, February 03, 2002 2:51 AM Subject: Re: url.openConnection() doesn't allow to pass objects or attributes I set the doOuptut parameters ,but still in orion it is not working. Can you please help me in this? From: Kesav Kumar [EMAIL PROTECTED] Reply-To: Orion-Interest [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Subject: Re: url.openConnection() doesn't allow to pass objects or attributes Date: Sat, 26 Jan 2002 08:12:31 -0800 For Posting data from through URLs you have to set doOutput to true. con.setDoOutput(true); con.setDoInput(true); Once you set the above you can get the OutputStream associated with connection and send parameters. For more info read the article at JavaWorld http://www.javaworld.com/javaworld/javatips/jw-javatip34.html -kesav kumar - Original Message - From: prasanth sb [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Saturday, January 26, 2002 1:27 AM Subject: url.openConnection() doesn't allow to pass objects or attributes Hello dear friends, Please help me with a strange problem happening with orion. I am calling url.openConnection() to a servlet page.When I call this, the call goes to doGet method of the servlet. But it has to go to the doPost method. Second problem is I am able to read the values from the callee servlet. But I am not able to pass the values to the callee servlet.I am trying to pass objects in a stream.I have seen this problem reported in the mailing list. Can anyone help me in this? Please find the sample code, Caller Servlet URLConncetion con =url.openConnection(http://ipname:port/Servlet1;); ObjectOutputStream os = new ObjectOutputStream(con.getOutputStream()); os.writeObject(string object); Callee servlet(Servlet1.java) public void doGet(HttpServletRequest req,HttpServletResponse res) { ObjectInputStream ois = new ObjectInputStream(req.getInputStream()); ois.readObject();//This line , it prints null.It wont print the string //string object.But if I return values from the servlet1, then Caller servlet is able to read. Can some one throw some light on this. _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com
RE: Orion freezing, Deadlocking, optimistic locking etc.
Mike, I am not sure why you are saying that I am using Thread in the beans since I don't. I am starting two client processes (i.e. virtual machines) but that is entirely valid. I have spoken to many developers regarding deadlocks in general and I have come to the conclusion that surprisingly few developers actually stress test their programs to determine whether deadlocks would actually be a problem. Here I have written an extremely simple program consisting of two entity beans that consistently gives deadlock exceptions and even freeze up Orion. Cheers Hans -Original Message- From: Mike Cannon-Brookes [mailto:[EMAIL PROTECTED]] Sent: 09 February 2002 12:37 To: Orion-Interest [EMAIL PROTECTED]; Hans Barnard Subject: Re: Orion freezing, Deadlocking, optimistic locking etc. Hans, I believe your bean violates the EJB Spec by using Thread so a lot of your conclusions may be incorrect based on that. I haven't come across any serious deadlock bugs when using specification valid beans. Cheers, Mike Mike Cannon-Brookes [EMAIL PROTECTED] Atlassian :: www.atlassian.com Supporting YOUR world On 8/2/02 7:46 PM, Hans Barnard ([EMAIL PROTECTED]) penned the words: Hi I am a great fan of OrionServer generally find it an excellent application server. However, lately I have become aware of a fairly serious problem with OrionServer that I do not know how to solve and may force me to use another application server. The problem is deadlocking. I am further surprised as to how little this problem is actually discussed on the mailing lists. Consider the following code. (Only the important parts are shown.) I have two identical CMP Entity Beans A and B: public class ABean implements EntityBean { * Some Entity Bean methods and properties not shown. * public int value; public B b; public int getValue() { return this.value; } public void setValue(int value) { this.value = value; } public void setB(B b) { this.b = b; } public int getBValue(int i) { try { try { Thread.sleep(20); } catch (Exception ex) { } return b.getValue(); } catch (com.evermind.server.DeadlockException de) { System.out.println(Catching deadlock exception in A and rolling back! Iteration=+i); throw new EJBException(de); } catch (Exception ex) { System.out.println(Catching and throwing other exceptions in A!); throw new EJBException(ex); } } } Bean B is just the reverse of A, i.e. it has a reference on A and has a method getAValue(int i). All bean methods have transaction property set to Required. Also, max-tx-retries=60. Then I have the following client application C: . Some initialization code and then the following loop: for (int i=0; itimes; i++) { try { av = b.getAValue(i); bv = a.getBValue(i); System.out.println(it=+i); } catch (Exception ex) { ex.printStackTrace(); } } If I run more than one instance of C then OrionServer has the following behavior: - if exclusive-write-access=false then one instance of C runs for a while. After a couple of iterations both instances of C report com.evermind.server.DeadLockException. After that the entire application (including OrionServer) just hangs. This Orion freeze-up is not a database deadlock either. - if exclusive-write-access=true then OrionServer instance (not the clients) reports deadlock exceptions in both instances of A and B. After that Orion freezes up again. I got this behavior with 1.5.3 but also for all other versions as far a I can remember since 1.3.8. Based on this I have made the following conclusions: 1OrionServer does not support optimistic caching at all. This is a critical limitation since you are guaranteed to get deadlock exceptions and Orion does not provide any way deal with this situation. Retrying just gives another DeadlockException. Anyway, according to Sun the container is supposed to deal with deadlocks. 2There is a serious bug in the implementation of locks on objects. If Orion freezes up with just two bean instances this just can't be good. Often the advice given by people to avoid deadlocks is that you should design your code to avoid deadlocks. In any serious program this is not really practical. If you have an application with 50 beans, 10 methods each, you have to design 500 methods so that any combination of 2 of the five hundred methods will not cause a deadlock, i.e. you have to check for approximately 125000 combinations of methods to make sure you do not get a deadlock. Shouldn't the EJB framework have made development more efficient? I have read somewhere that optimistic caching avoids deadlocks. With deadlocks in Orion Exceptions are thrown in both threads. With optimistic caching however, the first thread that modifies an object will always go through. The other threads get something
Re: orion + php
Hi. In order for this setup to work you need to compile php as a stand-alone executable, name it php and put it in the execution path (/usr/bin/ may be a good location). Try it. Orion wraps the php pages with a CGI-servlet, which executes external commands to parse the files. Lachezar I am getting the following error, 500 Internal Server Error Couldnt find/launch the interpreter, searched for php My configuration file has the following, servlet servlet-namephp/servlet-name servlet- classcom.evermind.server.http.CGIServlet/serv init-param param-nameinterpreter/param-name param-valuephp/param-value /init-param /servlet I have php working with Apache no problem (mod_php4 port for fbsd). Is there something obvious that I'm just missing? Thanks, Justen Stepka