RE: servlet to portlet
Sorry, I mixed up two different things: The EcsServletElement uses the RequestDispatcher - that's absolutely safe. I thought it'd open an URL connection (as it the DiskCach does) and this would result in looping from the servlet container, through the web server back to the servlet container - that's bad as you can deadlock the system with this setup. We ran into this problem: A portlet used a servlet as a connector to it's data. For demonstration purposes we tried to run this connector servlet on the same machine... So don't use the DiskCache to access servlets on the same machine. ingo. At 17:17 02/15/01, David Sean Taylor wrote: Ingo, What you wrote here is of interest to me: (Note that the latter way is very easy, but it is generally bad practise to open HTTP connections from within a servlet container to a servlet in the same container. In systems under high load, the EcsServletElement sould only be used with remote servlets.) Isn't that what TurbineJspService does with a RequestDispatcher? This implies that the current Jetspeed/JSP impl. is 'bad practice'. Is this subject covered in the servlet spec? Could you point me to some sources on this subject? I'd like to learn more about the reasons why this is bad practice. If you remember, last week I posted a message about the Jetspeed-JSP code failing to run under one particular servlet container. Well, it turns out that problem is that the RequestDispatcher in TurbineJspService fails to include. I have reported a bug to the vendor, they have acknowledged that it is a bug, but I haven't heard back from them yet Thanks, - david -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED] -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED]
Re: servlet to portlet
ingo schuster wrote: Sorry, I mixed up two different things: The EcsServletElement uses the RequestDispatcher - that's absolutely safe. I thought it'd open an URL connection (as it the DiskCach does) and this would result in looping from the servlet container, through the web server back to the servlet container - that's bad as you can deadlock the system with this setup. We ran into this problem: A portlet used a servlet as a connector to it's data. For demonstration purposes we tried to run this connector servlet on the same machine... So don't use the DiskCache to access servlets on the same machine. Please Ingo, tell me more about this. I am working on DiskCache v2, and I want to know all potential problems that can arise. If the call is done through the DiskCache, and the response is worked through a servlet container thread, I cannot see where the problem can be, except if it is deep down in the java protocol handler or you exahust worker threads in the servlet container. I know there are some issues with InetAddress name resolution, specially in older versions of the jdk, that can deadlock the involved threads. But I have not seen these issues happen in jdk1.3 (only in 1.2.2 and 1.1.x green threads, where it really stinks) -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED]
Re: servlet to portlet
At 14:04 02/16/01, Santiago Gala wrote: ingo schuster wrote: Sorry, I mixed up two different things: The EcsServletElement uses the RequestDispatcher - that's absolutely safe. I thought it'd open an URL connection (as it the DiskCach does) and this would result in looping from the servlet container, through the web server back to the servlet container - that's bad as you can deadlock the system with this setup. We ran into this problem: A portlet used a servlet as a connector to it's data. For demonstration purposes we tried to run this connector servlet on the same machine... So don't use the DiskCache to access servlets on the same machine. Please Ingo, tell me more about this. I am working on DiskCache v2, and I want to know all potential problems that can arise. If the call is done through the DiskCache, and the response is worked through a servlet container thread, I cannot see where the problem can be, except if it is deep down in the java protocol handler or you exahust worker threads in the servlet container. I know there are some issues with InetAddress name resolution, specially in older versions of the jdk, that can deadlock the involved threads. But I have not seen these issues happen in jdk1.3 (only in 1.2.2 and 1.1.x green threads, where it really stinks) Imagine following scenario: Your servlet container has a thread pool of 50 threads. Now, if 50 requests hit the servlet container at the same time, all threads are in use, if there comes another one, it'll be queued. If the 50 working threads open an HTTP connection to a servlet that runs in the same container, these new requests will have to wait until the other threads have finished. So they'll wait forever - or at least very long until they get a timeout. A second scenario: The webserver accepts 500 connections and has a threadpool of 200. If 200 request hit the HTTP server at once, they are pased on to the servlet engine, open an HTTP connection to a servlet on the same server - and are queued in the HTTP server forever (as all HTTP server threads are busy at this time). The likelyhood of such problems raises dramatically with long request processing times (which we have in Jetspeed). I'm not sure if you can prevent developers from using the diskcache to connect to the same servlet engine that Jetspeed is running in. But it doesn't make much sense anyway, within a servlet engine you can direct calls. So a recommendation not to use the DIskCache for connections to the same server might be good enough. ingo. -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED] -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED]
RE: servlet to portlet
xbill wrote: For development- another option is to put your JDBC calls in a basic JSP and run it from: WRT MVC, is this really the kind of advice we want to be giving on the list? :) I remember seeing that you could generate JSP using ECS- but I haven't tested this yet. yes, create a new EcsJSPElement, and in the output() method, include the JSP with a RequestDispatcher - david -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED]
Re: servlet to portlet
The postings below pointed to the two most promising approaches: - Either take your servlets code and pack it into a portlet or - using the EcsServletElement to include the output of a servlet within a portlet (see earlier postings about this topic). (Note that the latter way is very easy, but it is generally bad practise to open HTTP connections from within a servlet container to a servlet in the same container. In systems under high load, the EcsServletElement sould only be used with remote servlets.) ingo. At 20:22 02/14/01, xbill wrote: David Sean Taylor wrote: try this link, it covers the basic steps to writing a portlet http://www.bluesunrise.com/jetspeed/PortletHowTo.htm -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Reddy, Ayndla Srinivas Sent: Tuesday, February 13, 2001 11:32 AM To: '[EMAIL PROTECTED]' Subject: servlet to portlet Hello, I have a simple servlet which connects to mysql database running under tomcat (4.0). I am trying to make a portlet from it and make it run in jetspeed (1.3a.). I am presently checking out the documentation on portlet API/examples etc but have not been able to find the right information. Can somebody kindly point me to the right resource? Thanks in Advace Best Regards Srinivas -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED] -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED] I believe the current version of jetspeed expects the output of the portlet to be ECS elements. You can write a small sample program to use JDBC and then build an ECS screen. I remember seeing that you could generate JSP using ECS- but I haven't tested this yet. Another approach is to have your servlet standalone and run it in the same tomcat environment. You can mount your servlet under a relative URL and then use the HTML instance of the FileServerPortlet. For development- another option is to put your JDBC calls in a basic JSP and run it from: $(TOMCAT_HOME)webapps/jetspeed/WEB-INF/templates/jsp/screens It will not be a portlet- but is a quick way to debug JSPs within the jetspeed environment. For database calls- I found that the Village APIS worked well. The village jar file is included along with Jetspeed. For more advanced apps- you can use the Turbine peer model and generate your classes with torque. -bill -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED] -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED]
Re: servlet to portlet
Hi, I think org.apache.jetspeed.util.servlet.EcsServletElement should do the job, but didn't try it yet. It extends the ECS concrete element. Regards Udo On Tue, 13 Feb 2001 20:32:11 +0100, Reddy, Ayndla Srinivas wrote: Hello, I have a simple servlet which connects to mysql database running under tomcat (4.0). I am trying to make a portlet from it and make it run in jetspeed (1.3a.). I am presently checking out the documentation on portlet API/examples etc but have not been able to find the right information. Can somebody kindly point me to the right resource? Thanks in Advace Best Regards Srinivas -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED] -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED]
RE: servlet to portlet
Ingo, What you wrote here is of interest to me: (Note that the latter way is very easy, but it is generally bad practise to open HTTP connections from within a servlet container to a servlet in the same container. In systems under high load, the EcsServletElement sould only be used with remote servlets.) Isn't that what TurbineJspService does with a RequestDispatcher? This implies that the current Jetspeed/JSP impl. is 'bad practice'. Is this subject covered in the servlet spec? Could you point me to some sources on this subject? I'd like to learn more about the reasons why this is bad practice. If you remember, last week I posted a message about the Jetspeed-JSP code failing to run under one particular servlet container. Well, it turns out that problem is that the RequestDispatcher in TurbineJspService fails to include. I have reported a bug to the vendor, they have acknowledged that it is a bug, but I haven't heard back from them yet Thanks, - david -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED]
RE: servlet to portlet
David Sean Taylor wrote: Ingo, What you wrote here is of interest to me: (Note that the latter way is very easy, but it is generally bad practise to open HTTP connections from within a servlet container to a servlet in the same container. In systems under high load, the EcsServletElement sould only be used with remote servlets.) That's a misconception. The ECSServletElement does not open an HTTP connection, it just uses the request dispatcher to include the JSP or Servlet. This is just the normal way of adding content created by a JSP to a page. There is no performance problem here. A problem occurs only when a portlet opens a URL connection to a servlet in the same container, because under high load requests queue in front of the servlet container, waiting for a thread to become available. However, the threads waiting for their URL connection to return data cannot be used, as the request they sent are also queued in front of the container, but cannot handled because there are no free threads ... Nice loop. Isn't that what TurbineJspService does with a RequestDispatcher? This implies that the current Jetspeed/JSP impl. is 'bad practice'. Is this subject covered in the servlet spec? Could you point me to some sources on this subject? I'd like to learn more about the reasons why this is bad practice. If you remember, last week I posted a message about the Jetspeed-JSP code failing to run under one particular servlet container. Well, it turns out that problem is that the RequestDispatcher in TurbineJspService fails to include. I have reported a bug to the vendor, they have acknowledged that it is a bug, but I haven't heard back from them yet Thanks, - david Best regards, Thomas Thomas Schaeck Portal Architect IBM Pervasive Computing Division Phone: +49-(0)7031-16-3479 Mobile: +49-(0)171-6928407 e-mail: [EMAIL PROTECTED] Fax: +49-(0)7031-16-4888 Address: IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen, Germany -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED]
Re: servlet to portlet
David Sean Taylor wrote: try this link, it covers the basic steps to writing a portlet http://www.bluesunrise.com/jetspeed/PortletHowTo.htm -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Reddy, Ayndla Srinivas Sent: Tuesday, February 13, 2001 11:32 AM To: '[EMAIL PROTECTED]' Subject: servlet to portlet Hello, I have a simple servlet which connects to mysql database running under tomcat (4.0). I am trying to make a portlet from it and make it run in jetspeed (1.3a.). I am presently checking out the documentation on portlet API/examples etc but have not been able to find the right information. Can somebody kindly point me to the right resource? Thanks in Advace Best Regards Srinivas -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED] -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED] I believe the current version of jetspeed expects the output of the portlet to be ECS elements. You can write a small sample program to use JDBC and then build an ECS screen. I remember seeing that you could generate JSP using ECS- but I haven't tested this yet. Another approach is to have your servlet standalone and run it in the same tomcat environment. You can mount your servlet under a relative URL and then use the HTML instance of the FileServerPortlet. For development- another option is to put your JDBC calls in a basic JSP and run it from: $(TOMCAT_HOME)webapps/jetspeed/WEB-INF/templates/jsp/screens It will not be a portlet- but is a quick way to debug JSPs within the jetspeed environment. For database calls- I found that the Village APIS worked well. The village jar file is included along with Jetspeed. For more advanced apps- you can use the Turbine peer model and generate your classes with torque. -bill -- -- To subscribe:[EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: http://www.mail-archive.com/jetspeed@list.working-dogs.com/ List Help?: [EMAIL PROTECTED]