Re: [SCXML] getting set datats in the datamodel
Hi Linda, This is not really an answer to the problem but a simple question: which kind of graphical editor do you use to build state machines? Was it built from scratch or did you use any specific software to do this? I am indeed interesting in using one like that to model my system and generate the corresponding SCXML document. B.R. -- Armel 2009/3/31 Linda Erlenhov linda.erlen...@gmail.com Hello again! I have a problem with my datamodel. Or rather the fetching of datas that are used in the datamodel. I have my editor for building statemachines graphical, this is then translated into a corresponding SCXML document that then is run normally with Apache commons. The person that uses the editor shoul amongst other things be able select if she/he has want´s some data to be set (integers or strings) when entering states. The GUI that communicates with the machine does this via an interface wich is the thing I´m writing now. The GUI can send subscriptions requests for data wich basically means that it wants to subscribe certain data and wants the interface to send it when the data is changed. How I solved the part of saving checking the data is somewhat irrelevant, the problem is when I want to fetch the data that is saved. Since the model doesn´t tell when data has changed I check whenever entering a state (onEntry Listner) but where do I check this. Where is this, the data, saved? best regards //Linda
DriverManager.getConnection hangs if connectionLimit is reached
Hello, i'am trying to debug a certain problem in an application using Apache Commons DBCP. The app is a webapp with jetty as integrated webserver. Jetty's worker threads handle the request, obtaining a database connection to a MySQL database using DriverManager.getConnection(jdbc:apache:commons:dbcp:example) (no Hibernate, Ibatis around, a self written OR Mapper instead) This works fine until a certain scenario: if the number of concurrent requests reaches the number of maximum connections in the connection pool. If the connection pool can store 30 connections and you fire 29 concurrent requests to the webapp, everything is fine and you can go with another request. If you fire 30 concurrent (this means #connections = #concurrentRequests) it is not possible to go on in the application getting another connection. Debugging this shows that DriverManager.getConnection(jdbc:apache:commons:dbcp:example) hangs for another request (after the 30 concurrent ones). I can reproduce this with any connection pool size. Limiting the pool to 5 works fine up to 4 concurrent requests, until 5 or more concurrent requests occur. Have you got an idea how this can happen? (there're no exceptions and concurrent connections below the threshold are all 'closed' (returned to the pool), I've checked this with connectionPool.getNumActive()). Thanks in advance Mark - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
RE: DriverManager.getConnection hangs if connectionLimit is reached
How would you want it to work? Isn't that what maximum connections means? You get that many, and if you want more, you wait. -Original Message- From: Mork0075 [mailto:mork0...@googlemail.com] Sent: Friday, April 03, 2009 9:53 AM To: user@commons.apache.org Subject: DriverManager.getConnection hangs if connectionLimit is reached Hello, i'am trying to debug a certain problem in an application using Apache Commons DBCP. The app is a webapp with jetty as integrated webserver. Jetty's worker threads handle the request, obtaining a database connection to a MySQL database using DriverManager.getConnection(jdbc:apache:commons:dbcp:example) (no Hibernate, Ibatis around, a self written OR Mapper instead) This works fine until a certain scenario: if the number of concurrent requests reaches the number of maximum connections in the connection pool. If the connection pool can store 30 connections and you fire 29 concurrent requests to the webapp, everything is fine and you can go with another request. If you fire 30 concurrent (this means #connections = #concurrentRequests) it is not possible to go on in the application getting another connection. Debugging this shows that DriverManager.getConnection(jdbc:apache:commons:dbcp:example) hangs for another request (after the 30 concurrent ones). I can reproduce this with any connection pool size. Limiting the pool to 5 works fine up to 4 concurrent requests, until 5 or more concurrent requests occur. Have you got an idea how this can happen? (there're no exceptions and concurrent connections below the threshold are all 'closed' (returned to the pool), I've checked this with connectionPool.getNumActive()). Thanks in advance Mark - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: DriverManager.getConnection hangs if connectionLimit is reached
Waiting is ok, but in this special case i wait for ever. Even after some hours it is not possible to get another connection. Only restarting the application does it, until the next occurance of #concurrentRequests = #connections Wes Clark schrieb: How would you want it to work? Isn't that what maximum connections means? You get that many, and if you want more, you wait. -Original Message- From: Mork0075 [mailto:mork0...@googlemail.com] Sent: Friday, April 03, 2009 9:53 AM To: user@commons.apache.org Subject: DriverManager.getConnection hangs if connectionLimit is reached Hello, i'am trying to debug a certain problem in an application using Apache Commons DBCP. The app is a webapp with jetty as integrated webserver. Jetty's worker threads handle the request, obtaining a database connection to a MySQL database using DriverManager.getConnection(jdbc:apache:commons:dbcp:example) (no Hibernate, Ibatis around, a self written OR Mapper instead) This works fine until a certain scenario: if the number of concurrent requests reaches the number of maximum connections in the connection pool. If the connection pool can store 30 connections and you fire 29 concurrent requests to the webapp, everything is fine and you can go with another request. If you fire 30 concurrent (this means #connections = #concurrentRequests) it is not possible to go on in the application getting another connection. Debugging this shows that DriverManager.getConnection(jdbc:apache:commons:dbcp:example) hangs for another request (after the 30 concurrent ones). I can reproduce this with any connection pool size. Limiting the pool to 5 works fine up to 4 concurrent requests, until 5 or more concurrent requests occur. Have you got an idea how this can happen? (there're no exceptions and concurrent connections below the threshold are all 'closed' (returned to the pool), I've checked this with connectionPool.getNumActive()). Thanks in advance Mark - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Problem uploading files with FileUpload and HttpClient
Hi, I'm trying to upload a file, but I dont achieve it. I'm using a class that extends from JApplet. When I execute the applet in my apache server, I have this message: File Length = 20 statusLineHTTP/1.1 200 OK But file, isn't uploaded. This is the source code of my applet: -- package multi; import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.UsernamePasswordCredentials; import org.apache.commons.httpclient.auth.AuthScope; import org.apache.commons.httpclient.methods.PostMethod; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import javax.swing.JApplet; public class PostAFile extends JApplet{ private static final long serialVersionUID = -514976829358415881L; private static String url =http://localhost:8080/multi-jsp/ProcessFileUpload.jsp;; @SuppressWarnings(deprecation) public void init(){ HttpClient client = new HttpClient(); PostMethod postMethod = new PostMethod(url); client.setConnectionTimeout(8000); File f = new File(D://Documentos//messages.properties); System.out.println(File Length = + f.length()); FileInputStream fis = null; try { fis = new FileInputStream(f); } catch (FileNotFoundException exc) { // TODO Auto-generated catch block exc.printStackTrace(); } postMethod.setRequestBody(fis); postMethod.setRequestHeader(Content-type, text/html;charset=windows-1252); try { client.executeMethod(postMethod); } catch (Exception exce) { // TODO Auto-generated catch block exce.printStackTrace(); } System.out.println(statusLine + postMethod.getStatusLine()); postMethod.releaseConnection(); }//Fin de init(). } - The file ProcessFileUpload.jsp is this: --- %@ page contentType=text/html;charset=windows-1252% %@ page import=org.apache.commons.fileupload.servlet.ServletFileUpload% %@ page import=org.apache.commons.fileupload.FileItem% %@ page import=org.apache.commons.fileupload.FileItemStream% %@ page import=org.apache.commons.fileupload.FileItemIterator% %@ page import=org.apache.commons.fileupload.FileItemFactory% %@ page import=org.apache.commons.fileupload.disk.DiskFileItemFactory% %@ page import=java.io.InputStream% %@ page import=java.io.FileOutputStream% %@ page import=java.util.List% %@ page import=java.util.Iterator% %@ page import=java.io.File% % try{ // Create a factory for disk-based file items DiskFileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload fu = new ServletFileUpload(factory); fu.setSizeMax(100); FileItemIterator iterator = fu.getItemIterator(request); FileItemStream item = iterator.next(); InputStream stream = item.openStream(); File fNew= new File(application.getRealPath(/),item.getName()); FileOutputStream outputstream = new FileOutputStream(fNew); }catch(Exception e){ e.printStackTrace(); } % --- I don't find the problem. Could anyone help me please? Thanks in advance. -- View this message in context: http://www.nabble.com/Problem-uploading-files-with-FileUpload-and-HttpClient-tp22872589p22872589.html Sent from the Commons - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
RE: DriverManager.getConnection hangs if connectionLimit is reached
Are you closing the connections being used so they can be returned to the pool? -Original Message- From: Mork0075 [mailto:mork0...@googlemail.com] Sent: Friday, April 03, 2009 10:12 AM To: Commons Users List Subject: Re: DriverManager.getConnection hangs if connectionLimit is reached Waiting is ok, but in this special case i wait for ever. Even after some hours it is not possible to get another connection. Only restarting the application does it, until the next occurance of #concurrentRequests = #connections Wes Clark schrieb: How would you want it to work? Isn't that what maximum connections means? You get that many, and if you want more, you wait. -Original Message- From: Mork0075 [mailto:mork0...@googlemail.com] Sent: Friday, April 03, 2009 9:53 AM To: user@commons.apache.org Subject: DriverManager.getConnection hangs if connectionLimit is reached Hello, i'am trying to debug a certain problem in an application using Apache Commons DBCP. The app is a webapp with jetty as integrated webserver. Jetty's worker threads handle the request, obtaining a database connection to a MySQL database using DriverManager.getConnection(jdbc:apache:commons:dbcp:example) (no Hibernate, Ibatis around, a self written OR Mapper instead) This works fine until a certain scenario: if the number of concurrent requests reaches the number of maximum connections in the connection pool. If the connection pool can store 30 connections and you fire 29 concurrent requests to the webapp, everything is fine and you can go with another request. If you fire 30 concurrent (this means #connections = #concurrentRequests) it is not possible to go on in the application getting another connection. Debugging this shows that DriverManager.getConnection(jdbc:apache:commons:dbcp:example) hangs for another request (after the 30 concurrent ones). I can reproduce this with any connection pool size. Limiting the pool to 5 works fine up to 4 concurrent requests, until 5 or more concurrent requests occur. Have you got an idea how this can happen? (there're no exceptions and concurrent connections below the threshold are all 'closed' (returned to the pool), I've checked this with connectionPool.getNumActive()). Thanks in advance Mark - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
[math]: MATH-199 revisited
This is a revisit of a earlier issue detailed here: http://issues.apache.org/jira/browse/MATH-199 Previously, I was getting this error with values for error terms like 4.4E-323. Now, I am getting the exception with values of larger magnitude (see below). If I replace wm[0] and wm[52] with values of greater magnitude, 0.01, for example, then the error does not occur. Is this to be expected? It may very well be that it is been this way all along, and I am now just running into this error in this way because this data hasn't been encountered before. wm[0] = -2.665619767686342E8 wm[1] = 0.798492725595 wm[2] = 0.9998388017600578 wm[3] = 0.9994560253705471 wm[4] = 0.9987108991053469 wm[5] = 0.9974832564406259 wm[6] = 0.9956537255853777 wm[7] = 0.9931041659101397 wm[8] = 0.9897181994009216 wm[9] = 0.9853818354429454 wm[10] = 0.9799841865789758 wm[11] = 0.9734182721172175 wm[12] = 0.965581905583982 wm[13] = 0.9563786610265852 wm[14] = 0.9457189120722208 wm[15] = 0.9335209364388676 wm[16] = 0.9197120772746321 wm[17] = 0.9042299512722974 wm[18] = 0.8870236919662449 wm[19] = 0.868055214969349 wm[20] = 0.8473004901478971 wm[21] = 0.8247508038630685 wm[22] = 0.800413992428026 wm[23] = 0.7743156258402076 wm[24] = 0.7465001186489801 wm[25] = 0.7170317425094144 wm[26] = 0.6859955125535663 wm[27] = 0.6534979171813012 wm[28] = 0.6196674582333949 wm[29] = 0.5846549657603337 wm[30] = 0.5486336487410065 wm[31] = 0.511798840136219 wm[32] = 0.4743673915827879 wm[33] = 0.4365766698447724 wm[34] = 0.39868310383927763 wm[35] = 0.3609602276451295 wm[36] = 0.3236961613836456 wm[37] = 0.2871904682316555 wm[38] = 0.25175032208790377 wm[39] = 0.2176859165649541 wm[40] = 0.18530504201974918 wm[41] = 0.15490675326702819 wm[42] = 0.1267740464408861 wm[43] = 0.10116545918087608 wm[44] = 0.0783055039201884 wm[45] = 0.058373839544611276 wm[46] = 0.04149308207217504 wm[47] = 0.027715150274604253 wm[48] = 0.017006037322957985 wm[49] = 0.009228894591118357 wm[50] = 0.004125308692098945 wm[51] = 0.0012946476534832214 wm[52] = 1.7134685967009215E-4 wm[53] = 0.0 - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [commons-exec] How to exec scp from cygwin?
It turned out to be relatively simple. All I had to do was create a command line with a string of the absolute path of cygwin (relative path probably works as well if cygwin is in your PATH or System Path): Executor exec = new DefaultExecutor(); CommandLine cl = new CommandLine(c:\\cygwin\\cygwin.bat); The part that I was confused about was how to get the Executor to take the scp as part of the cygwin and not a windows command since the openssh package works as part of cygwin and not windows (if anyone knows how to use a cygwin ssh package directly from Windows please let me know). All I needed was a pipe ('|'). I didn't think it would be that simple, as it's been years since I've done any real work on *NIX without a GUI interface of some sort. cl.addArgument(|); cl.addArgument(scp); cl.addArgument(-B); cl.addArgument(StringUtils.quoteArgument(/cygdrive/c/Documents and Settings/michael/some _file)); cl.addArgument(mich...@my_remote_host:/home/michael); exec.executive(cl); Of course I had to use the quoteArgument() method for the absolute path of the file to be transferred since it has spaces and *NIX doesn't like spaces. That was it. I think cygwin would stay 'active' as long as you kept adding pipes and *NIX commands/scripts to the command line. I haven't played with it. It's just a guess. For me, the hardest part was just getting openssh setup properly since I hadn't used it before. Thanks for your interest. Michael K. Craghead From: Siegfried Goeschl siegfried.goes...@it20one.at To: Commons Users List user@commons.apache.org Sent: Friday, April 3, 2009 4:38:52 PM Subject: Re: [commons-exec] How to exec scp from cygwin? Hi Michael, no idea since I never used cygwin but it would be highly appreciated if you share your insights Thanks in advance Siegfried Goeschl Michael K. Craghead wrote: Looking at the tutorial for exec it doesn't look to difficult to use, but I'm not sure how to go about setting up an exec for an scp command that runs inside of cygwin. Can someone point me in the right direction? Thanks. Michael K. Craghead - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org