tag:blogger.com,1999:blog-3921399134165074878.post5764193554921437276..comments2023-06-14T16:00:52.541+03:00Comments on Marios' Java Programming Experience Corner: Mysql Connection Pool in GlassFish 2.x.xkomarioshttp://www.blogger.com/profile/10641918396968542194noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-3921399134165074878.post-65695663120769561092015-03-22T20:25:10.514+02:002015-03-22T20:25:10.514+02:00Hi,
The error is stating that glassfish can not fi...Hi,<br />The error is stating that glassfish can not find the DB Driver.<br />Please follow the instructions on this post carefully (e.g. restart glassfish after mysql jar is put in lib directory).<br />And if the problem persists, send me the error and the steps to reproduce the error.<br />Cheers.<br />p.s.<br />If you need your problem solved in less that 24 Hours, you can find me in fiverr:<br />https://www.fiverr.com/marios_debug/solve-configuration-problems-in-java-app-serverskomarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-66897139084137530342015-03-16T06:01:10.304+02:002015-03-16T06:01:10.304+02:00Hello marios, can help me with glassfish ..
my p...Hello marios, can help me with glassfish .. <br /><br />my pool connection is ok but when i put this statement <br /><br /><br /> SELECT * FROM proxies_priv;<br /> <br /><br />the browser give me this error<br /><br />exception<br /><br />javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver found for jdbc/myData"<br />root cause<br /><br />javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver found for jdbc/myData"<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-40550582840847547252013-02-06T10:46:51.607+02:002013-02-06T10:46:51.607+02:00Thanks man,it works!Thanks man,it works!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-4865460453929107702012-03-11T19:22:13.847+02:002012-03-11T19:22:13.847+02:00Could you give a little more information? What is ...Could you give a little more information? What is the error message. What steps you have done. The versions you have used. <br />And I'll try to help you.komarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-54553576199018283362012-03-11T14:36:26.961+02:002012-03-11T14:36:26.961+02:00Hi i m trying to connect and i m getting an error ...Hi i m trying to connect and i m getting an error similar to trupti's post<br /><br />now i have copied the jar files but i dont know how to set the class path names pls help meAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-78346438432057679832012-02-22T17:52:55.414+02:002012-02-22T17:52:55.414+02:00You could check again if the folder you have put t...You could check again if the folder you have put the library in, is correct. You could also check that you have restarted GlassFish after placing the mysql library in GlassFish. Generally, I would suggest that you follow the tutorial to the letter and you will succeedd. <br />In any other case, you can post me in detail all the steps you have taken, and I'll try to spot the problem.komarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-38309123611381006332012-02-22T15:42:45.950+02:002012-02-22T15:42:45.950+02:00Error An error has occurred
Class name is wrong or...Error An error has occurred<br />Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource<br /><br />How can I solve it?<br /><br />Thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-12163917384508766222011-12-10T00:13:14.384+02:002011-12-10T00:13:14.384+02:00Well komarios,
I did exactly as u said and i am wo...Well komarios,<br />I did exactly as u said and i am working with netbeans and glassfish 3.x but i get this problem komarios 'Class name is wrong or classpath is not set for .......' How can i solve this problem? Can u help me?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-31905046473148568392011-11-28T17:03:34.980+02:002011-11-28T17:03:34.980+02:00tanks a lot.tanks a lot.siraykuthttps://www.blogger.com/profile/16270566770084186016noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-60912063164451756882011-09-09T07:53:34.109+03:002011-09-09T07:53:34.109+03:00hey can anyone help me with this:
Ping Connection...hey can anyone help me with this:<br /><br />Ping Connection Pool for hope is Failed. Ping failed Exception - Connection could not be allocated because: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. Please check the server.log for more details. Ping failed Exception - Connection could not be allocated because: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. Please check the server.log for more details.<br /><br />thanks a lot!!!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-54978169030100492122011-05-30T15:32:05.850+03:002011-05-30T15:32:05.850+03:00Anonymous friend,
All I can think of is that you d...Anonymous friend,<br />All I can think of is that you did not restart your Glassfish server after putting the mysql jar file in lib directory.<br />Or you put it in a totally different directory.<br />It is obvious that the server cannot find the Driver inside this jar file.<br />If that doesn't help. I would suggest to redo this walkthrough from the beginning to end ( taking into account every little detail ) and if the error persists post to me again.<br />Cheers matekomarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-80907703425681978622011-05-30T00:17:18.518+03:002011-05-30T00:17:18.518+03:00hey i'm working on mac and want to access to m...hey i'm working on mac and want to access to my localhost database...<br />i did everything what you said.. particularly the jvm classpath setting and copying the jdbc connector in the folders... but he says all the time:<br />Ping Connection Pool for bookstore is Failed. Ping failed Exception - Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource Please check the server.log for more details.<br /> <br /> <br />What can i do?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-35824542631992544502011-05-28T11:40:03.205+03:002011-05-28T11:40:03.205+03:00Thanks it helpedThanks it helpedAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-23968353566112943102011-03-16T16:40:13.590+02:002011-03-16T16:40:13.590+02:00This helped! Thanks dude..This helped! Thanks dude..TJnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-53783555331772709772010-11-30T18:02:18.779+02:002010-11-30T18:02:18.779+02:00you can google (jpa combo box) it. The first resul...you can google (jpa combo box) it. The first result was this:<br />http://ikennaokpala.wordpress.com/2010/05/30/populating-jsf-combo-box-with-database-values/<br />hope it helps.komarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-20227153716976418472010-11-29T16:22:00.476+02:002010-11-29T16:22:00.476+02:00hi komarios is Anonymous Friend again
Man can yo...hi komarios is Anonymous Friend again<br /><br /><br />Man can you help me?? <br /><br />i need to full an ComboBox from a Table using JSF, JPA, Mysql.<br /><br />Thanks..Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-544716654518060562010-11-27T09:39:34.824+02:002010-11-27T09:39:34.824+02:00Anonymous Friend,
I would be glad to help you as m...Anonymous Friend,<br />I would be glad to help you as much as I can.<br />So send over your questions!<br />cheerskomarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-7454484044194506462010-11-27T02:39:43.712+02:002010-11-27T02:39:43.712+02:00hi!! is Anonymous Friend again hehe
it is workin...hi!! is Anonymous Friend again hehe <br /><br />it is working now, the problem was with the connection pool that i was using in the aplication but thanks anyway.<br /><br />thinking well I have many question about client-server aplication can i ask you all them?? hehe or a few??.<br /><br />see u.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-58026033432081082042010-11-26T08:36:04.693+02:002010-11-26T08:36:04.693+02:00Anonymous Friend,
You need to give a little more a...Anonymous Friend,<br />You need to give a little more about your connection pool configuration.<br />But you could try the "ping" functionality from the GlassFish Administration Console, as described on this tutorial.<br />Did it succeed? I presume that your connection details have a mispelling.<br />cheerskomarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-89185717490964913662010-11-26T05:32:28.761+02:002010-11-26T05:32:28.761+02:00hi komarios
i made a connection pool just like u...hi komarios<br /><br /><br />i made a connection pool just like u did say but i can't get connect to de database...<br /><br />i'm using MySQL, JSF, GlassFish all in netbeans and i got this error<br /><br />java.sql.SQLException: Error in allocating a connection. Cause: null<br /><br />Can you help me please??Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-49935417957800657762010-07-15T19:43:08.389+03:002010-07-15T19:43:08.389+03:00trupti,
Since you are using NetBeans with GlassFis...trupti,<br />Since you are using NetBeans with GlassFish things are a little different. The GlassFish installation has two important directories. The first is the binaries installation in Program Files and the other is the NetBaans instance's configuration files under Documents and Setting/user/.netbeans or something similar. <br />There two ways I can think of you can fix it. Either install the library inside the latter directory under directory lib (wherever you find it). Or customize the server from inside NetBeans and adding the mysql jar.<br />And I just remembered that when I took my first baby steps in NetBeans I had achieved it by adding a MySQL custom library with the MySQL jar only, and I just added it to my project. From there everything run smoothly!<br />Cheers.<br />p.s. I apologize for my vagueness in paths. It's been years now that I am using linux.komarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-37941632764970857502010-07-15T16:22:33.192+03:002010-07-15T16:22:33.192+03:00Hi Komarios,
Yes you are absolutely correct. ...Hi Komarios, <br /><br /> Yes you are absolutely correct. I am runnign my app via NetBeans 6.5. With NetBeans Glassfish v2 is running and on my pc, Glassfish 3v prelude is auto started via J2EESDK. <br /><br /> But now, I stopped glassfils v3 and started v2, set up all database & pool setting and got it ping at once. Added mysql-conn jar file in server JVM path System Classpath. Stopped & started the server. But yet when I run the app from netbeans, I get excep on "jdbc/.." it says NameNotFoundException:SurveyDBPool not found.<br />The configs are done in web & sun-web.xml's also.<br />The code I use to get the connection is :<br /><br />// This was seperated to find where the error is lying.<br />InitialContext ic = new InitialContext();<br />ctx = (Context) ic.lookup("java:comp/env");<br /><br />//DataSource ds = (DataSource) ctx.lookup("jdbc/SurveyDBPool"); // java:comp/env/jdbc/SurveyDBPool<br /><br />DataSource ds = (DataSource) ctx.lookup("jdbc/SurveyDBPool");<br />conn = ds.getConnection();<br /><br />Excep is thrown at ctx.lookup.<br /><br />Has it anything to do while running with netbeans. B'coz netbeans starts & stops server auto. How can I work with netbeans and how to deploy on Glassfish.<br /><br />What can be the problem yet. Any ideas. Your help is and will be highly appreciated.<br /><br />ThanksTrupti Daliahttps://www.blogger.com/profile/15777002510800727562noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-85744075384635295062010-07-14T19:30:42.863+03:002010-07-14T19:30:42.863+03:00And lastly, I think that GF3 needs the driver jar ...And lastly, I think that GF3 needs the driver jar to be put in ${GLASSFISH_HOME}/glassfish/modules and then restart the server. Try that as a last resort.komarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-17072472013598720862010-07-14T19:24:01.973+03:002010-07-14T19:24:01.973+03:00Trupti,
you could also check here http://old.nabbl...Trupti,<br />you could also check here http://old.nabble.com/MySql-connector-problems,-Class-name-is-wrong-or-classpath-td21833176.html. Check the last post, it is important. Hope this helps.komarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.comtag:blogger.com,1999:blog-3921399134165074878.post-51502649758353608582010-07-14T18:59:33.625+03:002010-07-14T18:59:33.625+03:00Hey Trupti,
As fas as I can tell, first of all you...Hey Trupti,<br />As fas as I can tell, first of all you need to check which glassfish is running. When you log in the we b administrator, you can see in the top left the version of the server you are administering. Next, you don't need to restart the computer every time you start the server. All you need to do is open a command window --> cd C:\Program Files (x86)\glassfish-v2.1\bin --> and run the following command 'asadmin stop-domain domain1' (or the name of the domain you have created, which you can tell by the name of the directory under C:\Program Files (x86)\glassfish-v2.1\domains\). To start the server run 'asadmin start-domain domain1'.<br />I presume you are administering the v3 glassfish. <br />I will suggest that you check the 'Datasource Classname' to say MySQL or something at the first step of the wizard.<br />Tell me if it works.komarioshttps://www.blogger.com/profile/10641918396968542194noreply@blogger.com