Resource in context.xml and ObjectFactory
Hi, If I don't use the attribute factory in context.xml I get following error: javax.naming.NamingException: Cannot create resource instance at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory. java:132) Context debug=0 reloadable=false Resource name=cbrealm/RealmFactory auth=Container type=cv.security.realm.JNDIRealm factory=cv.security.realm.JNDIRealmFactory / In tc-5.0.28 I didn't need factory, why is it necessary now? I use tc-5.5.9 with jdk-1.5.0_05 Windows-XP. Zsolt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getting NoClassDefFound error for Rectangle.class (rt.jar)
Instead of rebuilding FOP, I wrote a simple test class that attempts to instantiate 'Rectangle'. It runs successfully on one system and fails on the other (the one with the NoClassDefFoundError): $ java -Djava.awt.headless=true TestRectangle Exception in thread main java.lang.UnsatisfiedLinkError: /usr/local/j2sdk1.4.2_08/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory Sure enough, /usr/X11R6/lib/libXp.so.6 exists on one box, but not the other. Hopefully, it won't be too much of an ordeal to get the missing piece(s) installed. - Bob --- Bob Hall [EMAIL PROTECTED] wrote: No joy with -Djava.awt.headless=true; looks a rebuild of FOP on the target system... though that *really* does not make sense. - Bob --- Bob Hall [EMAIL PROTECTED] wrote: Thanks, David. I'll try that. If that doesn't do the trick I plan to build fop.jar from source on the target machine. - Bob --- David Delbecq [EMAIL PROTECTED] wrote: if it's *java.awt.Rectangle* and the computer you are trying to run fop on does not have graphical environment, maybe you should wonsider using headless java see http://java.sun.com/j2se/1.4.2/docs/guide/awt/AWTChanges.html#headless Bob Hall a écrit : I'm getting a NoClassDefFoundError in a FOP class, PageViewport. At line 89, the code is attempting to do 'new Rectangle()'. The same code works fine on 3 other systems (2 Windows, and one Linux). It does not work on a Linux box. The two linux boxes have the same version of Java (1.4.2_08-b03) and the same version of Tomcat 5.0.28). The versions of RedHat *are* different. I even compiled the code on the target Linux system. Any ideas? - Bob __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com - 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] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[RESULT][VOTE] Tomcat 5.5.12 is stable
Hi, The 5.5.12 stability vote is now over, and the release is stable. The following votes were cast for stable: Jeanfrancois Arcand Allistair Crossley Henri Gomez Jim Jagielski (not sure if this one is binding in the strictest sense of the word) Remy Maucherat Peter Rossbach Yoav Shapira Mladen Turk There were no beta or alpha votes. I'll go update the web site. There have been no code changes since the alpha release, so if you already have the 5.5.12-alpha distribution you don't have to go download a new distro. Thank you, Yoav Shapira System Design and Management Fellow MIT Sloan School of Management Cambridge, MA, USA [EMAIL PROTECTED] / www.yoavshapira.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multipart Request
Are you using Struts? Struts has a bizarre idea that causes this type of problem. On 10/8/05, Dhiren Bhatia [EMAIL PROTECTED] wrote: Hi all, I'm having trouble with the HttpServletRequest object if my post contains multipart data. The request object loses all the parameters set from the html form. i.e. request.getParameter(myParam); always returns null. If I remove the multipart encoding from my form, I see the parameter values. If I use the OReilly MultipartRequest, the constructor needs me to set the directory to save the file in so I cannot make that value dynamic by receiving it from the HTTP post. I want to receive the dir name where the file will be saved from the HTML form. Any ideas? Hope this makes sense. Thanks, -D -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multipart Request
Yea, I'm using Struts. I like some of its features so I want to continue using it. But multipart is a mess. So, is there any way to retain the parameters in HTTPServletRequest? Thanks. On 10/9/05, Dakota Jack [EMAIL PROTECTED] wrote: Are you using Struts? Struts has a bizarre idea that causes this type of problem. On 10/8/05, Dhiren Bhatia [EMAIL PROTECTED] wrote: Hi all, I'm having trouble with the HttpServletRequest object if my post contains multipart data. The request object loses all the parameters set from the html form. i.e. request.getParameter(myParam); always returns null. If I remove the multipart encoding from my form, I see the parameter values. If I use the OReilly MultipartRequest, the constructor needs me to set the directory to save the file in so I cannot make that value dynamic by receiving it from the HTTP post. I want to receive the dir name where the file will be saved from the HTML form. Any ideas? Hope this makes sense. Thanks, -D -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5.12 and user-agent header
Hmm, I downloaded 5.5.12 and tried the agent-header specific code with it: public void processLogin(User user, HttpServletRequest req, HttpServletResponse res) { StringBuffer info = new StringBuffer(); info.append(login ); info.append(user.getUserName()); info.append( [); info.append(user.getUserId().getPlainPresentation()); info.append(] ); info.append(user.getEmail()); info.append( ); info.append(UserHelper.getGenderDescription(user.getGender())); info.append( ); info.append(UserHelper.getStatusDescription(user.getMembershipStatus())); info.append( ); info.append(req.getRemoteAddr()); info.append( / ); info.append(req.getRemoteHost()); info.append( Agent: ); info.append(req.getHeader(user-agent)); log.info(info); } outcome was: 2005-10-08 15:36:50,453 INFO - login leon [6] [EMAIL PROTECTED] male premium 127.0.0.1 / 127.0.0.1 Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040626 Firefox/0.8 which I think was same behaviour as before. I took tomcat out of the box (5.5.12 tar.gz) and only changed the http port. regards leon On 10/8/05, Richard Mixon [EMAIL PROTECTED] wrote: I am just using the standard HTTP connector. This is on my development workstation so I don't normally run JK and Apache, except for final testing. On the developer list I did see one mention of user-agent header, but on closer inspection it appeared to be for a completely different issue. Thanks - Richard -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Barker Sent: Friday, October 07, 2005 10:13 PM To: tomcat-user@jakarta.apache.org Subject: Re: Tomcat 5.5.12 and user-agent header Richard Mixon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I tested out my application on 5.5.12 yesterday and noticed one small anomally. I had a JSP in my sitemesh decorator default.jsp that ends up wrapping the login page for container managed authentication. This page had a statement String _userAgent = request.getHeader(user-agent).toLowerCase(); It gets a null-pointer exception in 5.5.12, but under 5.5.9 it runs fine. In 5.5.12, after the login succeeds then the user-agent headers appear to be there just fine, but not on the initial login page. Is this a known issue? It's certainly not a known issue. It would help a lot if you could tell us which Connector you are using at the time (e.g. HTTP/1.1, HTTP/1.1-APR, AJP/1.3, AJP/1.3-APR). Thank you - Richard - 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]
Re: OutOfMemoryException in Tomcat 5.0.28 (when using Thread / ThreadLocal)
I'm not the expert but... On 10/9/05, Binildas C [EMAIL PROTECTED] wrote: Hi, We are building a high volume site in Tomcat5.0.28. Our single Tomcat5.0.28 instance in the Web Farm is having 10 HTTP Threads. Each HTTP Thread collects request events in a ThreadLocal. At every 1000 requests (in a particular HTTP Thread) the HTTP Thread will collect events from the ThreadLocal, sets them in it's deamon thread (There is one-to-one correspondance between the number of Tomcat HTTP Threads and Deamon threads, hence we have 10 Deamon threads), notifies the deamon thread, and clears the ThreadLocal. The Deamon thread will pushes the events to a seperate single process through RMI. What exactly is the goal of all this? Why do you gather information in the HTTP Thread, and not in the daemon thread? It seems obvious to me to hold the data there (if at all). Btw, what do you mean by high volume? Everything works fine (functional and otherwise) for the first 1 or 2 hours or so, and then we can see the Tomcat 5.0.28 Process taking lot of memory and ultimately we are getting either an OutOfMemoryException or The Tomcat process stalls! Our Question is: 1. Is Tomcat 5.0.28 having a memory problem? Search Bugzilla (http://issues.apache.org). We have tomcat 5.0.25 and 28 in a high traffic site (approx. 100 requests per server per second) and not having any memory problems. 2. If so, what about other versions of Tomcat? Probably the same, unless you'd like to try the new garbage collector in jdk1.5 and test it with 5.5.12 3. Is this memory problem somehow related to Thread and/or ThreadLocal Usage? Are you sure your code is actually freeing the objects? If you keep a reference to the object somewhere, you'd never have your gc utilize them. How much memory do you give tomcat/jvm at startup? Have your tried a verbose mode for gc (or simply print out memory stats all 10 minutes) to see if it's a continous leak, or something cause it out of nowhere by chance? Are you creating new Threads? File handles? You must know that OutOfMemoryError in java can mean nearly anything. 4. Any work around for this. Besides, I don't like your solution, and would advice you to rewrite it in more conventional way, there is a simple workaround, if you can afford to loose some of your requests - use SoftReferences for holding your data, they are guaranteed to be freed before an OutOfMemory can occur. Reference: http://forum.java.sun.com/thread.jspa?messageID=3900219 Thankx in advance Regards Binildas C. A. Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.5.12 and user-agent header
Leon, Thank you for the test - but I still get a null user-agent right after the login. Here is a snippet of my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; %@ include file=/common/taglibs.jspf% %@ page import=com.ltoj.common.Constants % html:html locale=true head %@ include file=/common/meta.jspf % titledecorator:title//title script type=text/javascript src=c:url value='/scripts/environment.js'//script script type=text/javascript src=c:url value='/scripts/util.js'//script script type=text/javascript src=c:url value='/scripts/helptip.js'//script script type=text/javascript src=c:url value='/scripts/tabs.js'//script script type=text/javascript src=c:url value='/scripts/CalendarPopup.js'//script script type=text/javascript src=c:url value='/scripts/chartWizard.js'//script link rel=stylesheet type=text/css media=all href=c:url value='/styles/default.css'/ / link rel=stylesheet type=text/css media=all href=c:url value='/styles/messages.css'/ / link rel=stylesheet type=text/css media=all href=c:url value='/styles/tabs.css'/ / decorator:head/ % String _userAgent = request.getHeader(user-agent); out.write(USER-AGENT='+_userAgent+'); ... Here's the sequence: 1) I issue a request to this page. 2) CMA says oh, that's protected and shows my custom login page. I get user-agent displayed fine: USER-AGENT='Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7' 3) But on the next page (the original target page of the request), user-agent shows as null. USER-AGENT='null' I can refresh the page or go to any other page in my application and the user agent is fine again. The only thing a bit non-standard about this JSP page is that it is a SiteMesh decorator page. If I run the same test, same pages in Tomcat 5.5.9 I never get user-agent of null. Our application does check the user-agent header a good bit. We use Select lists with option groups - but some browsers do not support this so we simulate it by indenting the select options ourselves. Luckily all of this activity happens well after the initial login - so we are safe, now that I changed the decorator to make sure user-agent is not null before doing anything with it. But it seems other applications might be affected by this - no? Thanks again - Richard -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Sent: Sunday, October 09, 2005 1:45 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Tomcat 5.5.12 and user-agent header Hmm, I downloaded 5.5.12 and tried the agent-header specific code with it: public void processLogin(User user, HttpServletRequest req, HttpServletResponse res) { StringBuffer info = new StringBuffer(); info.append(login ); info.append(user.getUserName()); info.append( [); info.append(user.getUserId().getPlainPresentation()); info.append(] ); info.append(user.getEmail()); info.append( ); info.append(UserHelper.getGenderDescription(user.getGender())); info.append( ); info.append(UserHelper.getStatusDescription(user.getMembershipStatus())); info.append( ); info.append(req.getRemoteAddr()); info.append( / ); info.append(req.getRemoteHost()); info.append( Agent: ); info.append(req.getHeader(user-agent)); log.info(info); } outcome was: 2005-10-08 15:36:50,453 INFO - login leon [6] [EMAIL PROTECTED] male premium 127.0.0.1 / 127.0.0.1 Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040626 Firefox/0.8 which I think was same behaviour as before. I took tomcat out of the box (5.5.12 tar.gz) and only changed the http port. regards leon On 10/8/05, Richard Mixon [EMAIL PROTECTED] wrote: I am just using the standard HTTP connector. This is on my development workstation so I don't normally run JK and Apache, except for final testing. On the developer list I did see one mention of user-agent header, but on closer inspection it appeared to be for a completely different issue. Thanks - Richard -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Barker Sent: Friday, October 07, 2005 10:13 PM To: tomcat-user@jakarta.apache.org Subject: Re: Tomcat 5.5.12 and user-agent header Richard Mixon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I tested out my application on 5.5.12 yesterday and noticed one small anomally. I had a JSP in my sitemesh decorator default.jsp that ends up wrapping the login page for container managed authentication. This page had a statement String _userAgent = request.getHeader(user-agent).toLowerCase(); It gets a null-pointer exception in
Re: Multipart Request
You either have to stop using ActionForm or go in and rewrite the code on multiparts. The existing code is really sloppy and bad. There are references that do nothing. Others do things they shouldn't do, etc. Essentially, you really should avoid using it and write your own implementation of the commons implementation. Unfortunately, Martin Cooper has his finger in both pies and really does not play with others on this. He just keeps it to himself pretty much. If you want to get a snapshot before the next unrehearsed release, better do it now. On 10/9/05, Dhiren Bhatia [EMAIL PROTECTED] wrote: Yea, I'm using Struts. I like some of its features so I want to continue using it. But multipart is a mess. So, is there any way to retain the parameters in HTTPServletRequest? Thanks. On 10/9/05, Dakota Jack [EMAIL PROTECTED] wrote: Are you using Struts? Struts has a bizarre idea that causes this type of problem. On 10/8/05, Dhiren Bhatia [EMAIL PROTECTED] wrote: Hi all, I'm having trouble with the HttpServletRequest object if my post contains multipart data. The request object loses all the parameters set from the html form. i.e. request.getParameter(myParam); always returns null. If I remove the multipart encoding from my form, I see the parameter values. If I use the OReilly MultipartRequest, the constructor needs me to set the directory to save the file in so I cannot make that value dynamic by receiving it from the HTTP post. I want to receive the dir name where the file will be saved from the HTML form. Any ideas? Hope this makes sense. Thanks, -D -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using a datasource connection pool resource with username and password supplied by user
I have set up a connection pool using the following set up: ___- ?xml version=1.0 encoding=iso-8859-1? !-- Context configuration file for the Road Safety Audit Management System Web App -- Context path=/RSAMS docBase=RSAMS debug=1 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_rsams_log. suffix=.txt timestamp=true/ !--the RSAMS resource for connection pooling -- Resource name=jdbc/rsams_oracle auth=Container type=javax.sql.DataSource maxActive=150 maxIdle=30 maxWait=3 driverClassName=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:thin:@rockrsa:1521:rsams removeAbandoned=true removeAbandonedTimeout=600 username=jseaton password=ring2405/ /Context _ to access this pool I use the following code: Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/rsams_oracle); conn = ds.getConnection(); . It all works fine: But what I really want to do is to get a database user and password from the user and (after validating it) write this to a session cookie. Then when the user interacts with the database (which is all the time) the username and password will be extracted from the cookie and used in the following way: Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/rsams_oracle); conn = ds.getConnection(username,password); .. The problem is I have not been able to find a way to get this to work. I have tried removing the user and password from the connection pool resource (doesn't work) I have tried this code in the calling - conn = ds.doGetConnection(username,password) - Doesn't work. I thought javax.sql.datasource which is the type of the resource supported the getConnection(username, password) method but it doesn't seem to work when using a resource set up as above. If anyone can point me in the right direction I will be most grateful. I have trawled the forums with no success as everyone seems to be happy with the username and password being set in the context resource. Any help I can get would be most appreciated. Regards, Jeffery S. Eaton Opinions contained in this e-mail do not necessarily reflect the opinions of the Queensland Department of Main Roads, Queensland Transport or Maritime Safety Queensland, or endorsed organisations utilising the same infrastructure. If you have received this electronic mail message in error, please immediately notify the sender and delete the message from your computer. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using a datasource connection pool resource with username and password supplied by user
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: using a datasource connection pool resource with username and password supplied by user But what I really want to do is to get a database user and password from the user and (after validating it) write this to a session cookie. Then when the user interacts with the database (which is all the time) the username and password will be extracted from the cookie and used in the following way: I don't think you can do this with a connection pool. The connections in the pool are opened once only, and persist for the life of the application, not the session. Any user (session) can end up using any of the connections, which is why you have to configure the credentials with the ressource. I think if you want to authenticate on each session, you'll have to dispense with the pool and suffer the overhead of opening a DB connection each time. Perhaps someone else has a better idea... - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using a datasource connection pool resource with username and password supplied by user
Chuck is right in that it can't be done with the standard pool that Tomcat has. Due simply to the fact that the pool is established before anyone has made a call to the server. But what you could do is to create a connection for that user when they authenticate and hold on to the connection for the session. Two limitations are the time on the connection and the potential number of open connections. If you control the time the connection is held alive for the session and return it after some period of time to prevent time out on the database side or tying up a connector forever. In essence you will be creating a one connection pool for each session. Second is the total number of connections. How many users are there going to be on the system at once and can the system handle that many open connections? If you come up with a different/better solution let us know. Doug - Original Message - From: Caldarale, Charles R [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Sunday, October 09, 2005 11:26 PM Subject: RE: using a datasource connection pool resource with username and password supplied by user From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: using a datasource connection pool resource with username and password supplied by user But what I really want to do is to get a database user and password from the user and (after validating it) write this to a session cookie. Then when the user interacts with the database (which is all the time) the username and password will be extracted from the cookie and used in the following way: I don't think you can do this with a connection pool. The connections in the pool are opened once only, and persist for the life of the application, not the session. Any user (session) can end up using any of the connections, which is why you have to configure the credentials with the ressource. I think if you want to authenticate on each session, you'll have to dispense with the pool and suffer the overhead of opening a DB connection each time. Perhaps someone else has a better idea... - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - 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: using a datasource connection pool resource with username and password supplied by user
Thanks Doug and Chuck, I suspected as much re. the connection pool. This sort of negates the value of it a little (for me anyway). My original plan was to go with saving the connection to the session once it was established but I had read somewhere that connections are not 'serializable' and therefore the garbage cleanup in tomcat may kill the connection unexpectedly?!.? Has anyone used session tracking to store database connections? If so, has anything bad happened? Doug to answer your question How many users are there going to be on the system at once and can the system handle that many open connections?... I anticipate that the production version will have from 20 - 30 people updating information (in different cities ) and possibly 50 or so browsing the database for information. The backend database will be ORACLE 9i running in MS Server 2003 on an IBM server. In the pooled connection implementation I allowed for 150 concurrent users. I think oracle running on a pretty beefy application server should be able to handle it. The web server box will also be MS server 2003 on an older style server so I suppose the only scary part will be weaknesses (if there are any) in Tomcat itself. Anyway, I will implement storing the connection in the session with the log out killing the connection. Any comments or gotchas you know about would be useful. Jeffery S. Eaton Opinions contained in this e-mail do not necessarily reflect the opinions of the Queensland Department of Main Roads, Queensland Transport or Maritime Safety Queensland, or endorsed organisations utilising the same infrastructure. If you have received this electronic mail message in error, please immediately notify the sender and delete the message from your computer. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]