RE: NullPointerException: causes?
Chinni, Absolutely right!! What a muppet - I though that the @host part of the connection string should be replaced with ahost.domain.com rather than @ahost.domain.com. I think it's old age - I'm approaching the quarter of a century mark. Thanks, John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 31 January 2002 20:31 To: Tomcat Users List Subject: Re: NullPointerException: causes? I think DB_URL string making should be jdbc:oracle:thin: @111.22.333.44:1521:SID looks like yor are missing '@' symbol. -Chinni. John Wadkin j.wadkin@hudTo: Tomcat Users List (E-mail) .ac.uk [EMAIL PROTECTED] cc: 01/31/02 Subject: NullPointerException: causes? 11:40 AM Please respond to Tomcat Users List Can anyone offer any suggestions about the cause of the attached NullPointerException trace? I've managed to setup and integrate Apache 1.3 and Tomcat 4.1 using mod_WebApp on Solaris 8 (JDK 1.3). I ran the attached servlet (which I didn't write) with the hope of testing that everything was working ok, especially the Oracle/JDBC bit. As far as I can tell, everything is configured properly... The general aim is for me to verify that everything works (using the attached servlet) before trying to deploy a second, more complex servlet that's currently running under JServ. Apologies if this is a frequent question but I've only been able to find vague references to it, and I'm only a novice Java programmer! Thanks, John Quote for the week: My fellow Americans, I am pleased to tell you I just signed legislation which outlaws Russia forever. The bombing begins in five minutes. Ronald Reagan, Radio microphone test, 11 Aug. 1984 (See attached file: error.txt)(See attached file: DatabaseCheck.java)-- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: NullPointerException: causes?
Looks like the DriverManager is returning null, so dbCcon is null. (line 217). So probably something is wrong in setting up the connection. Mvgr, Martin -Original Message- From: John Wadkin [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 18:41 To: Tomcat Users List (E-mail) Subject: NullPointerException: causes? Can anyone offer any suggestions about the cause of the attached NullPointerException trace? I've managed to setup and integrate Apache 1.3 and Tomcat 4.1 using mod_WebApp on Solaris 8 (JDK 1.3). I ran the attached servlet (which I didn't write) with the hope of testing that everything was working ok, especially the Oracle/JDBC bit. As far as I can tell, everything is configured properly... The general aim is for me to verify that everything works (using the attached servlet) before trying to deploy a second, more complex servlet that's currently running under JServ. Apologies if this is a frequent question but I've only been able to find vague references to it, and I'm only a novice Java programmer! Thanks, John Quote for the week: My fellow Americans, I am pleased to tell you I just signed legislation which outlaws Russia forever. The bombing begins in five minutes. Ronald Reagan, Radio microphone test, 11 Aug. 1984 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: NullPointerException: causes?
Martin, You said So probably something is wrong in setting up the connection. Any ideas what?? I've checked that the database is open and the listener is listening. The JDBC drivers are in the right place. The user has sufficient privileges. I'm out of ideas! I'm just a lowly student who's ended up working for his Uni for a year. No one here knows anything about TomCat or Java Servlets. The Oracle DBA left a week ago (seriously) and there's no one but me to do everything. I get help on the Unix/networking side of things. The person who writes the servlets (that I'm trying to deploy) knows next to nothing about running them. Great situation, eh? Thanks, John -Original Message- From: Martin van den Bemt [mailto:[EMAIL PROTECTED]] Sent: 31 January 2002 17:46 To: Tomcat Users List Subject: RE: NullPointerException: causes? Looks like the DriverManager is returning null, so dbCcon is null. (line 217). So probably something is wrong in setting up the connection. Mvgr, Martin -Original Message- From: John Wadkin [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 18:41 To: Tomcat Users List (E-mail) Subject: NullPointerException: causes? Can anyone offer any suggestions about the cause of the attached NullPointerException trace? I've managed to setup and integrate Apache 1.3 and Tomcat 4.1 using mod_WebApp on Solaris 8 (JDK 1.3). I ran the attached servlet (which I didn't write) with the hope of testing that everything was working ok, especially the Oracle/JDBC bit. As far as I can tell, everything is configured properly... The general aim is for me to verify that everything works (using the attached servlet) before trying to deploy a second, more complex servlet that's currently running under JServ. Apologies if this is a frequent question but I've only been able to find vague references to it, and I'm only a novice Java programmer! -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: NullPointerException: causes?
Hmm. Happens a lot I guess. The only thing I can think off, is that the classesX.zip (which includes the oracle jdbc driver), was not renamed to classesX.jar. Tomcat only adds files with a jar extension to the classloaders classpath. If that is the case, this message should appear on the screen : Get method = Class not found error which is generated by the following lines (the exception should come from the Class.forName() line. catch(ClassNotFoundException cnfe) { out.println(blockquoteULFONT COLOR=#00C000Get method - Class not found error: /FONT/UL /blockquote + cnfe) If nothing appears on screen : add an out.close() to the finally, so the stream to the browser is actually closed. Mvgr, Martin -Original Message- From: John Wadkin [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 19:35 To: 'Tomcat Users List' Subject: RE: NullPointerException: causes? Martin, You said So probably something is wrong in setting up the connection. Any ideas what?? I've checked that the database is open and the listener is listening. The JDBC drivers are in the right place. The user has sufficient privileges. I'm out of ideas! I'm just a lowly student who's ended up working for his Uni for a year. No one here knows anything about TomCat or Java Servlets. The Oracle DBA left a week ago (seriously) and there's no one but me to do everything. I get help on the Unix/networking side of things. The person who writes the servlets (that I'm trying to deploy) knows next to nothing about running them. Great situation, eh? Thanks, John -Original Message- From: Martin van den Bemt [mailto:[EMAIL PROTECTED]] Sent: 31 January 2002 17:46 To: Tomcat Users List Subject: RE: NullPointerException: causes? Looks like the DriverManager is returning null, so dbCcon is null. (line 217). So probably something is wrong in setting up the connection. Mvgr, Martin -Original Message- From: John Wadkin [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 18:41 To: Tomcat Users List (E-mail) Subject: NullPointerException: causes? Can anyone offer any suggestions about the cause of the attached NullPointerException trace? I've managed to setup and integrate Apache 1.3 and Tomcat 4.1 using mod_WebApp on Solaris 8 (JDK 1.3). I ran the attached servlet (which I didn't write) with the hope of testing that everything was working ok, especially the Oracle/JDBC bit. As far as I can tell, everything is configured properly... The general aim is for me to verify that everything works (using the attached servlet) before trying to deploy a second, more complex servlet that's currently running under JServ. Apologies if this is a frequent question but I've only been able to find vague references to it, and I'm only a novice Java programmer! -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: NullPointerException: causes?
John, you might try this to see if the database is accessible telnet ipaddress 1521 if the port is accessible you should get something similar to Trying... Connected to ipaddress Escape character is '^]'. if you cannot access the port you should either get a connection refused error or it will just do nothing Jeff -Original Message- From: John Wadkin [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 10:41 AM To: Tomcat Users List (E-mail) Subject: NullPointerException: causes? Can anyone offer any suggestions about the cause of the attached NullPointerException trace? I've managed to setup and integrate Apache 1.3 and Tomcat 4.1 using mod_WebApp on Solaris 8 (JDK 1.3). I ran the attached servlet (which I didn't write) with the hope of testing that everything was working ok, especially the Oracle/JDBC bit. As far as I can tell, everything is configured properly... The general aim is for me to verify that everything works (using the attached servlet) before trying to deploy a second, more complex servlet that's currently running under JServ. Apologies if this is a frequent question but I've only been able to find vague references to it, and I'm only a novice Java programmer! Thanks, John Quote for the week: My fellow Americans, I am pleased to tell you I just signed legislation which outlaws Russia forever. The bombing begins in five minutes. Ronald Reagan, Radio microphone test, 11 Aug. 1984 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: NullPointerException: causes?
Your driver probably wasn't loaded properly. DriverManager.getConnection() would have thrown a SQLException if it couldn't connect on this line: dbCon = DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD); That would have been caught by this: catch(SQLException sqle) { out.println(blockquoteULFONT COLOR=#00C000Get Method - SQL Exception error:/FONT/UL/blockquote + sqle); } But in the finally block, you are trying to call the close() method on Object dbCon, which never got instantiated in the first place (because of the exception). Try changing this line: dbCon.close(); To: if (dbCon != null) dbCon.close(); Are you getting any other output at all besides the NullPointerException? Usually Tomcat also shows the 'Root cause' exception on the error page that can help you track it down. -August --- PELOQUIN,JEFFREY (Non-HP-Boise,ex1) [EMAIL PROTECTED] wrote: John, you might try this to see if the database is accessible telnet ipaddress 1521 if the port is accessible you should get something similar to Trying... Connected to ipaddress Escape character is '^]'. if you cannot access the port you should either get a connection refused error or it will just do nothing Jeff -Original Message- From: John Wadkin [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 10:41 AM To: Tomcat Users List (E-mail) Subject: NullPointerException: causes? Can anyone offer any suggestions about the cause of the attached NullPointerException trace? I've managed to setup and integrate Apache 1.3 and Tomcat 4.1 using mod_WebApp on Solaris 8 (JDK 1.3). I ran the attached servlet (which I didn't write) with the hope of testing that everything was working ok, especially the Oracle/JDBC bit. As far as I can tell, everything is configured properly... The general aim is for me to verify that everything works (using the attached servlet) before trying to deploy a second, more complex servlet that's currently running under JServ. Apologies if this is a frequent question but I've only been able to find vague references to it, and I'm only a novice Java programmer! Thanks, John Quote for the week: My fellow Americans, I am pleased to tell you I just signed legislation which outlaws Russia forever. The bombing begins in five minutes. Ronald Reagan, Radio microphone test, 11 Aug. 1984 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: NullPointerException: causes?
I think DB_URL string making should be jdbc:oracle:thin: @111.22.333.44:1521:SID looks like yor are missing '@' symbol. -Chinni. John Wadkin j.wadkin@hudTo: Tomcat Users List (E-mail) .ac.uk [EMAIL PROTECTED] cc: 01/31/02 Subject: NullPointerException: causes? 11:40 AM Please respond to Tomcat Users List Can anyone offer any suggestions about the cause of the attached NullPointerException trace? I've managed to setup and integrate Apache 1.3 and Tomcat 4.1 using mod_WebApp on Solaris 8 (JDK 1.3). I ran the attached servlet (which I didn't write) with the hope of testing that everything was working ok, especially the Oracle/JDBC bit. As far as I can tell, everything is configured properly... The general aim is for me to verify that everything works (using the attached servlet) before trying to deploy a second, more complex servlet that's currently running under JServ. Apologies if this is a frequent question but I've only been able to find vague references to it, and I'm only a novice Java programmer! Thanks, John Quote for the week: My fellow Americans, I am pleased to tell you I just signed legislation which outlaws Russia forever. The bombing begins in five minutes. Ronald Reagan, Radio microphone test, 11 Aug. 1984 (See attached file: error.txt)(See attached file: DatabaseCheck.java)-- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] error.txt Description: Binary data DatabaseCheck.java Description: Binary data -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]