Re: mySQL connector error

2013-11-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Phillip, On 11/17/13, 1:56 PM, Philipp Kraus wrote: Hello, I'm new with Tomcat, so I hope for some help. I try to run www.icescrum.org on my Tomcat 7 on Ubuntu 12.04 with OpenJDK. I have installed Tomcat with apt-get and also I have installed

Re: mySQL connector error

2013-11-17 Thread ישראל מלאכי
Hi Phil try to add Class.forName(com.mysql.jdbc.Driver); to your code Israel On Sun, Nov 17, 2013 at 8:56 PM, Philipp Kraus philipp.kr...@tu-clausthal.de wrote: Hello, I'm new with Tomcat, so I hope for some help. I try to run www.icescrum.org on my Tomcat 7 on Ubuntu 12.04 with OpenJDK.

Re: MySql Connector

2007-07-27 Thread Mohammed Zabin
Ok guys, here we are. I have define the new resource inside a Context tag inside a Host tag, as suggested by Tomcat documentation. I removed it and put it inside GlobalNamingResources tag like the following: 1. Configure naming Resource: inside GlobalNamingResources i put the following:

Re: MySql Connector

2007-07-26 Thread David Smith
1. This can't be the complete jsp code. If it is, you need to minimally wrap it in %% markers to indicate it's raw java code, not jsp/html. Additionally your System.out.println() call would end up going to the JVM's standard output instead of the browser. 2. The listed exception is

Re: MySql Connector

2007-07-26 Thread Pid
ClassNotFoundException? ObviousStatement Your JSP can't find one of the classes you refer to in the scriptlet. /ObviousStatement We can't tell which one, because we don't know what's at line 266 in the generated java file (you could look). Which of the classes you're using in the JSP haven't

Re: MySql Connector

2007-07-26 Thread David Smith
Oh and just one more thing -- use com.mysql.jdbc.Driver as org.gjt.mm.mysql.Driver is ancient. --David David Smith wrote: 1. This can't be the complete jsp code. If it is, you need to minimally wrap it in %% markers to indicate it's raw java code, not jsp/html. Additionally your

Re: MySql Connector

2007-07-26 Thread Mohammed Zabin
It's already wrapped man, i just copied the code snippet from within %% marker ;), and for System.out, or out.println, It's still the same problem. If you looked at the exception you will find ClassNotFoundException at line 66 in the generated servlet, and this occurs withing the try block, so, i

Re: MySql Connector

2007-07-26 Thread Mohammed Zabin
This is my jsp code: try { Class.forName(org.gjt.mm.mysql.Driver); String url = jdbc:mysql://localhost:3306/exam; Connection con = DriverManager.getConnection(url,root, exam); Statement stmt = con.createStatement(); ResultSet rs =

Re: MySql Connector

2007-07-26 Thread David Smith
directory? I would have thought you'd want it in the common/lib dir. -Original Message- From: Mohammed Zabin [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 25, 2007 12:52 AM To: Tomcat Users List Subject: Re: MySql Connector In cotrast, i have installed Oracle and worked very well

RE: MySql Connector

2007-07-26 Thread Propes, Barry L
did you also have the Oracle jar file in that lib directory? I would have thought you'd want it in the common/lib dir. -Original Message- From: Mohammed Zabin [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 25, 2007 12:52 AM To: Tomcat Users List Subject: Re: MySql Connector

Re: MySql Connector

2007-07-26 Thread Pid
David's right, ignore my previous. p David Smith wrote: No... the exception you posted is it couldn't find the mysql_jsp.class file generated by compiling the jsp file. Do you have another stack trace somewhere you haven't shown us? Quoting from the stack trace posted below: *root

Re: MySql Connector

2007-07-26 Thread David Smith
Ok... I did ask for the *complete* jsp file. Please repost. --David Mohammed Zabin wrote: It's already wrapped man, i just copied the code snippet from within %% marker ;), and for System.out, or out.println, It's still the same problem. If you looked at the exception you will find

Re: MySql Connector

2007-07-26 Thread David Smith
No... the exception you posted is it couldn't find the mysql_jsp.class file generated by compiling the jsp file. Do you have another stack trace somewhere you haven't shown us? Quoting from the stack trace posted below: *root cause* java.lang.ClassNotFoundException: org.apache.jsp.mySql_jsp

Re: MySql Connector

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mohammed, Mohammed Zabin wrote: If you looked at the exception you will find ClassNotFoundException at line 66 in the generated servlet, and this occurs withing the try block, so, i think it's a problem of Connector. You are seriously confused,

Re: MySql Connector

2007-07-25 Thread Mohammed Zabin
For test purposes, i have wrote the following code as a java program and it worked fine, but when I tried it in a jsp page i got the following error: Class.forName(com.mysql.jdbc.Driver); String url = jdbc:mysql://localhost:3306/exam; Connection con = DriverManager.getConnection(url,root, exam);

Re: MySql Connector

2007-07-25 Thread David Smith
Your stack trace appears to be incomplete. Could you post more? It appears to be a compile error and should cite the code in question. --David Mohammed Zabin wrote: For test purposes, i have wrote the following code as a java program and it worked fine, but when I tried it in a jsp page i

Re: MySql Connector

2007-07-25 Thread Mohammed Zabin
This is all the exception message, I looked inside logs folder, i found an empty file, it continas nothing :~ On 7/25/07, David Smith [EMAIL PROTECTED] wrote: Your stack trace appears to be incomplete. Could you post more? It appears to be a compile error and should cite the code in

Re: MySql Connector

2007-07-25 Thread David Smith
I'm starting to think there's something really funny (ie broken) with your tomcat install. Could you clean install another instance of tomcat (preferably downloaded from the tomcat website) and check the code there? --David Mohammed Zabin wrote: This is all the exception message, I looked

Re: MySql Connector

2007-07-25 Thread Mohammed Zabin
I did this, but i think that there is an option to enable logging, do u know it? On 7/25/07, David Smith [EMAIL PROTECTED] wrote: I'm starting to think there's something really funny (ie broken) with your tomcat install. Could you clean install another instance of tomcat (preferably

Re: MySql Connector

2007-07-25 Thread David Smith
Not sure ... you could take a look at http://tomcat.apache.org/tomcat-5.5-doc/logging.html. Tomcat's always provided a complete stack and cited the code in error for me without any changes in logging config. You could also post the complete jsp you are using for a test. See if the error

Re: MySql Connector

2007-07-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mohammed, Mohammed Zabin wrote: I have the following error: org.apache.jasper.JasperException: Unable to compile class for JSP: Uhh... you have a syntax error in your JSP code. Fix that, then we'll get back to configuration issues. You didn't

Re: MySql Connector

2007-07-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mohammed, Mohammed Zabin wrote: I did this, but i think that there is an option to enable logging, do u know it? Logs should go to catalina.out, or to the console if you're using windows and startup.bat instead of a service. - -chris -BEGIN

Re: MySql Connector

2007-07-24 Thread Mohammed Zabin
Ok thank you, I did the following as you have stated: 1. in server.xml: Resource name=jdbc/TestMySql auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=root password=exam driverClassName= com.mysql.jdbc.Driver

Re: MySql Connector

2007-07-24 Thread David Smith
Try this variant of your code: Context initContext = new InitialContext(); DataSource ds = (DataSource)initContext.lookup(java:comp/env/jdbc/TestMySql); Connection conn = ds.getConnection(); out.println(Connection Established); Essentially when you lookup java:comp/env/jdbc/TestMySql,

Re: MySql Connector

2007-07-24 Thread Mohammed Zabin
No, the same error, You know what David?? I put nothing in web.xml, I am confused about this issue, when to use web.xml, and it might be the reason behind the unsuccessfull MySql Connection, I follow the same procedure I followed to configure Oracle DBCP, I think it must work for MySql, right?

Re: MySql Connector

2007-07-24 Thread David Smith
I've never dealt with Oracle but have done a lot of MySQL installs without a single failure. Your config outside of the web.xml doesn't look wrong in any way. You might want to put the resource-ref block in your web.xml as described in the how-to's. It doesn't hurt and is part of the

Re: MySql Connector

2007-07-24 Thread Mohammed Zabin
In cotrast, i have installed Oracle and worked very well, but MySql didn't work with me. I am using Connecter/J from MySql website, the beta version, I put the jar file in the CATALINA_HOME/lib, and i add it to the CLASSPATH. and I followed the instructions provided in Tomcat documentation,

Re: MySql Connector

2007-07-23 Thread Pid
Mohammed Zabin wrote: Thank you, what about testing the connection, i am afraid that the test code is the reason: Looks fine. Your log error messages? Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup(java:/comp/env); DataSource ds =

Re: MySql Connector

2007-07-23 Thread David Smith
A few things to consider: 1. Either place your Resource definition in server.xml as a GlobalResource *OR* in your webapp's context.xml file. 2. If you have the Resource defined in the GlobalResources, that's the only time you need to use a ResourceLink element in context.xml. 3. Drop the

Re: MySql Connector returning ?DataSource

2007-07-23 Thread Wade Chandler
returned and throwing an exception - code below) My problem is similar to the Re: MySql Connector thread of messages. I can see the resource listed in the Tomcat Administration Tool under Tomcat Server -- Service -- Host -- Context(/dbtest) and all the information for the datasource looks fine

Re: MySql Connector returning ?DataSource

2007-07-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Prem, Prem Padarath wrote: I am trying to set up a database resource in Tomcat 5.5.20 . I am having a problem getting a DataSource object back from a JNDI lookup. (I am getting a org.apache.tomcat.dbcp.dbcp.BasicDataSource object returned and

Re: MySql Connector returning ?DataSource

2007-07-23 Thread Prem Padarath
Hi Chris, o.a.t.d.d.BasicDataSource implements javax.sql.DataSource. What's the problem? The problem is that whatever is returned from the lookup call is causing an exception. I tested what is coming back and it is an o.a.t.d.d.B.D.S and it is putting it to a DataSource. The stack trace

Re: MySql Connector returning ?DataSource

2007-07-23 Thread Prem Padarath
- code below) My problem is similar to the Re: MySql Connector thread of messages. I can see the resource listed in the Tomcat Administration Tool under Tomcat Server -- Service -- Host -- Context(/dbtest) and all the information for the datasource looks fine (as from the context.xml file

Re: MySql Connector returning ?DataSource

2007-07-23 Thread David Smith
having a problem getting a DataSource object back from a JNDI lookup. (I am getting a org.apache.tomcat.dbcp.dbcp.BasicDataSource object returned and throwing an exception - code below) My problem is similar to the Re: MySql Connector thread of messages. I can see the resource listed

Re: MySql Connector returning ?DataSource

2007-07-23 Thread Prem Padarath
having a problem getting a DataSource object back from a JNDI lookup. (I am getting a org.apache.tomcat.dbcp.dbcp.BasicDataSource object returned and throwing an exception - code below) My problem is similar to the Re: MySql Connector thread of messages. I can see the resource

RE: MySql Connector returning ?DataSource

2007-07-23 Thread Caldarale, Charles R
From: Prem Padarath [mailto:[EMAIL PROTECTED] Subject: Re: MySql Connector returning ?DataSource I checked. The mysql jar file is in common\lib directory! Is it also in the webapp's WEB-INF/lib directory? Having it in two places at once can cause all sorts of interesting problems

Re: MySql Connector returning ?DataSource

2007-07-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, Caldarale, Charles R wrote: From: Prem Padarath [mailto:[EMAIL PROTECTED] Subject: Re: MySql Connector returning ?DataSource I checked. The mysql jar file is in common\lib directory! Is it also in the webapp's WEB-INF/lib directory

Re: MySql Connector returning ?DataSource

2007-07-23 Thread Prem Padarath
Chuck, Checked...it is only in the one place. Thx, Prem On 7/23/07, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Prem Padarath [mailto:[EMAIL PROTECTED] Subject: Re: MySql Connector returning ?DataSource I checked. The mysql jar file is in common\lib directory! Is it also

Re: MySql Connector

2007-07-22 Thread Pid
You only need one resource definition. You only need a resource link definition if your resource is a global one. Simplify your configuration and then post the error message from the logs so we can see Tomcat says is wrong. p Mohammed Zabin wrote: Hi All I have confiured oracle connection

Re: MySql Connector

2007-07-22 Thread Mohammed Zabin
Would you please be more specific? which file you mean? I have created Oracel connection Pool as the stated way above, and it's worked fine, shall i put resource defeninitoin in context.xml only? On 7/22/07, Pid [EMAIL PROTECTED] wrote: You only need one resource definition. You only need a

Re: MySql Connector

2007-07-22 Thread Pid
You can define either: a) Resource inside a Context - either in META-INF/context.xml or host/appname.xml b) ResourceLink inside a Context (as above) referring to a global Resource defined in server.xml. You're doing both at the moment, so one of them isn't being used, depending on where

Re: MySql Connector

2007-07-22 Thread Mohammed Zabin
Thank you, what about testing the connection, i am afraid that the test code is the reason: Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/TestMySql); Connection conn =