• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2055
  • Last Modified:

500 Servlet Exception java.lang.NullPointerException

The following error is received when trying to go to ANY page on my website that requires access to the database.  Can anyone help me with this?  I just moved the site from one hosting company to another and cannot get my site back up and running!  HELP!

The site is www.roundrockonline.biz.....


500 Servlet Exception

java.lang.NullPointerException
      at _java._roundrockonline._listing__jsp._jspService(/java/roundrockonline/listing.jsp:19)
      at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
      at com.caucho.jsp.Page.subservice(Page.java:506)
      at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
      at com.caucho.server.http.Invocation.service(Invocation.java:315)
      at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
      at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
      at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
      at java.lang.Thread.run(Thread.java:536)
0
junkyforjc
Asked:
junkyforjc
  • 15
  • 13
  • 12
  • +2
2 Solutions
 
objectsCommented:
your trying to reference a variable that is null.
perhaps it is failing to get a db connection.

can you post your code
0
 
mmuruganandamCommented:
check  your servlet filter settings and list the listing.jsp and the servlet that dispatches the listing.jsp
0
 
junkyforjcAuthor Commented:
I am fairly certain that it is failing the connection.  However, I do not know how to test this.  It is all on the servers and I am not knowledgable enough to tell what is wrong.  I know that the "path" for all the files is probably not the same as it was previously but as I said, I do not know how to tell where the db is located.  I don't know where to find the servlet filter settings....


Here is the code to listing.jsp


<%@ page language="Java" contentType="text/html" %>
<%@ page import="java.util.*,java.sql.*" %>

<%roundrockonline.connect.ConnectionPool pool = roundrockonline.connect.ConnectionPool.getInstance();
Connection conn;
Statement stmt;
ResultSet rs;
Statement stmt1;

Statement stmt2,stmt3;
ResultSet rs2=null;
ResultSet rs3=null;
String sub_cat_index="1";
String msg="Please enter Business details here.";
if(request.getParameter("msg")!=null){
    msg=request.getParameter("msg");
}

conn=pool.getConnection();
//conn=DriverManager.getConnection("jdbc:mysql://www.roundrockonline.biz/roundrockonline","roundrockonline","password is here");
stmt=conn.createStatement();
stmt1=conn.createStatement();
stmt2=conn.createStatement();
stmt3=conn.createStatement();
rs=stmt.executeQuery("SELECT * from category WHERE parent_category_code=0 order by description");
//rs1=stmt1.executeQuery("SELECT description from category WHERE parent_category_code!=0");

if(rs.next()){
      sub_cat_index=rs.getString("category_code");
      rs2=stmt2.executeQuery("SELECT * from category WHERE parent_category_code="+sub_cat_index+" order by description");

}
rs.absolute(-1);
int category_count=rs.getRow();
rs.beforeFirst();

String referredBy = "";
String temp=request.getHeader("referer");
/*

if(temp.indexOf("RoundRock")>-1)
      referredBy="RoundRock";

if(temp.indexOf("Dallas")>-1)
      referredBy="Dallas";

if(temp.indexOf("Austin")>-1)
      referredBy="Austin";

if(temp.indexOf("Houston")>-1)
      referredBy="Houston";

if(temp.indexOf("Lubbock")>-1)
      referredBy="Lubbock";


*/
String register_city =referredBy;
%>

<html>
<head>
<title>Round Rock online</title>
<meta name="rating" content="General">
<meta name="resource-type" content="text/html">
<meta name="CreatedBy" content="Synapse Communications (P) Limited - 2002">
<meta name="copyright" content="RoundRockOnline.biz">
<meta name="robots" content="index, follow">
<meta name="robots" content="ALL">
<meta name="Distribution" Content="Global">
<meta name="revisit" Content="14 days">
<meta name="Language" Content="English">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" Content="text/html;Charset=iso-8859-1">
<link rel="stylesheet" href="template/index_style.css" type="text/css">
</head>

<script language="javascript">
<!--
var uploaded=false;
//var groups=document.form1.category.options.length;
var group=new Array(<%=category_count%>);
for (i=0; i<<%=category_count%>; i++)
group[i]=new Array();
var j=0;
<% rs.next();
for (int i=0; i<category_count; i++){
int j=0;
rs3=stmt3.executeQuery("SELECT * from category WHERE parent_category_code="+sub_cat_index+" order by description");
while(rs3.next()){
    if(j==0){%>
       group[<%=i%>][<%=j%>]=new Option("--Select Sub-Category--","none");

    <%rs3.beforeFirst();
    }
    else{%>
group[<%=i%>][<%=j%>]=new Option("<%=rs3.getString(2)%>","<%=rs3.getString(1)%>");
<%  }
j=j+1;
 }
if(rs.next()) sub_cat_index=rs.getString("category_code");
}%>


function redirect(x){
if(x>0)x=x-1;
else
x=0;
for (m=document.form1.sub_category.options.length-1;m>0;m--)
document.form1.sub_category.options[m]=null
for (i=0;i<group[x].length;i++){
document.form1.sub_category.options[i]=new Option(group[x][i].text,group[x][i].value)
}
document.form1.sub_category.options[0].selected=true
}


function checkAll()
{
     if ((document.form1.category.options.selectedIndex == 0)&& (document.form1.search_for.value=="")){
            alert("Please specify either a business category or a business name to search. ");
            document.form1.category.focus();
      }

      else {

         document.form1.submit();
      }
}

//-->
</script>


<body bgcolor="003366" text="#000000" vlink="0" alink="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="redirect(document.form1.category.options.selectedIndex)">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>

    <td>&nbsp;</td>
        </tr>
        <tr>

    <td background="images/top-bg.gif" valign="top">
      <table width="770" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr>
                <td valign="top">

            <div align="center"><a href="index.jsp"><img src="/images/title.jpg" width="520" height="87" alt="RoundRockOnline.biz" border="0"></a></div>
                </td>
              </tr>
            </table>

    </td>
        </tr>
        <tr>

    <td height="20">
      <div align="center" class="linksmain"><a href="corpinfo.html" class="linksmain">Corporate Info</a> | <a href="contactus.html" class="linksmain">Contact Us</a></div>
    </td>
        </tr>
        <tr>

    <td bgcolor="#FFFFFF" valign="top">
      <table width="700" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td height="15">&nbsp;</td>
        </tr>
        <tr>
          <td><img src="/images/search_top.jpg" width="700" height="46" alt="Search Area"></td>
        </tr>
        <tr>
          <td height="15">
            <div align="right" ><a href="business_register.jsp" class="white_link">&laquo;
              Click here to list your business &raquo;</a></div>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr>
                <td class="text_head" height="30">Looking for a product or business
                  near you?</td>
              </tr>
              <tr>
                <td class="text_main" valign="top" height="20"><b>Please enter
                  details here.<br>
                  </b> </td>
              </tr>
              <tr>
                <td valign="top">
                  <form name="form1" method="post" action="search.jsp">
                    <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
                      <tr>
                        <td colspan="7" bgcolor="#003366" height="20">
                          <div align="center" class="linksmain">ROUNDROCK BUSINESS
                            DIRECTORY</div>
                        </td>
                      </tr>
                      <tr>
                        <td rowspan="8" valign="top" width="2"><img src="/images/search-side.gif" width="2" height="167"></td>
                        <td width="22" height="10">&nbsp;</td>
                        <td width="247">&nbsp;</td>
                        <td width="41">&nbsp;</td>
                        <td width="250">&nbsp;</td>
                        <td width="80">&nbsp;</td>
                        <td rowspan="8" valign="top" width="3">
                          <div align="right"><img src="/images/search-side.gif" width="2" height="167"></div>
                        </td>
                      </tr>
                      <tr>
                        <td width="22">&nbsp;</td>
                        <td class="white_link" width="247"><font size="2">1.</font>
                          Search by Category:</td>
                        <td width="41">&nbsp;</td>
                        <td class="white_link" width="250"><font size="2">2. </font>Search
                          by Sub-Category</td>
                        <td width="80">&nbsp;</td>
                      </tr>
                      <tr>
                        <td width="22">&nbsp;</td>
                        <td height="24" valign="bottom" width="247">
                          <select name="category" onChange="redirect(this.options.selectedIndex)" size="1" >
                          <option value="none">--Select category--</option>
                            <%rs.beforeFirst();
                              while(rs.next()){ %>
                            <option value="<%=rs.getString(1)%>"><%=rs.getString("description")%>
                            </option>
                            <% } %>
                          </select>
                        </td>
                        <td width="41">&nbsp;</td>
                        <td valign="bottom" width="250">
                          <select name="sub_category" size="1" >
                           <option value="none">--Select sub-category--</option>
                            <% while(rs2.next()){ %>
                            <option value="<%=rs2.getString(1)%>"><%=rs2.getString("description")%>
                            </option>
                            <% } %>
                          </select>
                        </td>
                        <td width="80">&nbsp;</td>
                      </tr>
                      <tr>
                        <td width="22" height="10">&nbsp;</td>
                        <td width="247">&nbsp; </td>
                        <td width="41">&nbsp;</td>
                        <td width="250">&nbsp;</td>
                        <td width="80">&nbsp;</td>
                      </tr>
                      <tr>
                        <td width="22">&nbsp;</td>
                        <td class="white_link" width="247"><font size="2">3.</font>Search
                          For(Name):</td>
                        <td width="41">&nbsp;</td>
                        <td class="white_link" width="250"><font size="2">4.</font>
                          Zip:</td>
                        <td width="80">&nbsp;</td>
                      </tr>
                      <tr>
                        <td width="22">&nbsp;</td>
                        <td height="24" valign="bottom" width="247">
                          <input type="text" name="search_for">
                        </td>
                        <td width="41">&nbsp;</td>
                        <td valign="bottom" width="250">
                          <input type="text" name="zip">
                        </td>
                        <td width="80">
                          <div align="center"><a href="javascript:checkAll()"><img src="/images/go.jpg" width="32" height="22" border="0"></a></div>
                        </td>
                      </tr>
                      <tr>
                        <td width="22">&nbsp;</td>
                        <td width="247" class="white_link" >
                          <input type="radio" name="match" value="exact" checked>
                          Exact Match
                          <input type="radio" name="match" value="like">
                          Similar to</td>
                        <td width="41">&nbsp;</td>
                        <td width="250" class="white_link">
                          <input type="radio" name="list" value="all" checked>
                          List All
                          <input type="radio" name="list" value="discount">
                          List Discount offers</td>
                        <td width="80">&nbsp;</td>
                      </tr>
                      <tr>
                        <td width="22" height="10">&nbsp;</td>
                        <td width="247" class="white_link" >&nbsp; </td>
                        <td width="41">&nbsp;</td>
                        <td width="250">&nbsp; </td>
                        <td width="80">&nbsp;</td>
                      </tr>
                      <tr>
                        <td colspan="7" valign="top"><img src="/images/search-bottom.gif" width="645" height="2"></td>
                      </tr>
                    </table>
                  </form>
                </td>                                                                                                        
              </tr>
              <tr><td height="10">&nbsp;</td></tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
      <td>&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="6699CC" height="20">
      <div align="center" class="linksmain"><a href="corpinfo.html" class="linksmain">Corporate Info</a> | <a href="contactus.html" class="linksmain">Contact Us</a> | <a href="help.html" class="linksmain">Help</a> | <a href="terms.html" class="linksmain">Terms of Use</a> | <a href="terms.html" class="linksmain">Privacy Notice</a></div>
    </td>
        </tr>
        <tr>

    <td height="20">
      <div align="center"><span class="non-link">All rights reserved &copy;2002
        roundrockonline.biz</span></div>
    </td>
        </tr>
</table>
</body>
<%
if(rs!=null)rs.close();
if(stmt!=null)stmt.close();

if(stmt1!=null)stmt1.close();
if(rs2!=null)rs2.close();
if(stmt2!=null)stmt2.close();
if(rs3!=null)rs3.close();
if(stmt3!=null)stmt3.close();
pool.returnConnection(conn);%>
</html>

0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
mmuruganandamCommented:
You don't need to create

stmt=conn.createStatement();
stmt1=conn.createStatement();
stmt2=conn.createStatement();
stmt3=conn.createStatement();


Four statements.  Do your work only with one statement.  I am suspecting, creating more than one statement with a single connection is causing the problem.

Use one statement and comment the other statements.  It should work.
0
 
objectsCommented:
easiest wAy to determine what the cause is would be to look at line 19 of the generated java file
0
 
objectsCommented:
if (pool==null) throw new SQLException("COuld not get pool");
conn=pool.getConnection();
if (conn==null) throw new SQLException("COuld not get connection");
0
 
junkyforjcAuthor Commented:
Objects,

I added the error statements and I get a Could not get pool error.

0
 
objectsCommented:
check your connection pool code to determine the reason getInstance() is returning null.
0
 
kiwi_alienCommented:
Its actually line 19 of the .jsp file - compilers have come somewhere in the last few years at least...

Looks like its just your pool that is null (if you've given us every line of that file...) when you first use it.

Feel free to throw 'objects' code in to show that but why it IS null is weird when it *looks* like you instantiate it...??
0
 
mmuruganandamCommented:
That is right!  Your pool is returning null.
0
 
junkyforjcAuthor Commented:
Well gentlemen,

I think that it is to do with the location of the db...???

Here is the code for the ConnectionPool.java
package roundrockonline.connect;

import java.sql.*;
import java.util.*;
import java.io.*;

public class ConnectionPool
{
      static ConnectionPool pool;
      private Hashtable connections;
      private static String dbURL, user, password,driverClassName;
      private static int initialConnections,increment,maxIdle,idle=0;

      public static ConnectionPool getInstance(){
      if(pool == null)
            try
            {
                  pool = new ConnectionPool();
                  //System.out.println(" New instance created ");
            }
            catch(Exception e)
            {
                  //System.out.println(" Cannot connect to " + dbURL +" ,Check your parameters");
            }
            return pool;
      }

      public ConnectionPool() throws SQLException, ClassNotFoundException
      {
            init();
            //this.initialConnections = initialConnection;
            //this.driverClassName = driverClassName ;
            Class.forName(this.driverClassName);
            //this.dbURL = dbURL;
            //this.user = user;
            //this.password = password;
            //this.increment= increment;
            connections= new Hashtable();
            for(int i = 0; i < initialConnections; i++)
            {
                  Connection c = DriverManager.getConnection(this.dbURL, this.user, this.password);
                  connections.put(c, Boolean.FALSE);
                  //System.out.println(" made connection no ." + i+" "+c);

            }
            //idle=initialConnections;
      }


      public Connection getConnection() throws SQLException
      {
            Connection con = null;
            Enumeration cons = connections.keys();
            synchronized (connections)
            {
            while(cons.hasMoreElements())
            {
                  con = (Connection)cons.nextElement();
                  Boolean b = (Boolean)connections.get(con);
                  if ( b.equals(Boolean.FALSE))
                  {
                        try
                        {
                              con.setAutoCommit(true);
                        }
                        catch(SQLException e)
                        {
                              con = DriverManager.getConnection(dbURL, user, password);
                              //System.out.println(" got connection in catch() "+con);
                        }
                        connections.put(con, Boolean.TRUE);
                        //idle--;
                        return con;
                  }
            }
            for(int i = 0; i < increment; i++)
            {
                  Connection c = DriverManager.getConnection(this.dbURL, this.user, this.password);
                  connections.put(c, Boolean.FALSE);
                  //System.out.println(" made connection no ." + i+" "+c);
                  //idle++;
            }
            //idle--;
            return getConnection();
            }
      }

      public synchronized void returnConnection(Connection returned)
      {
            try
            {
                  Connection con;
                  Enumeration cons = connections.keys();
                  while (cons.hasMoreElements())
                  {
                        con = (Connection)cons.nextElement();
                        if (con == returned)
                        {
                              idle++;
                              if(idle == connections.size()) idle=0;
                              if(idle > maxIdle){
                                    con.close();
                                    connections.remove(con);
                                    //System.out.println(" Removed from pool "+ con);
                                    idle--;

                              }
                              else {
                                    connections.put(con, Boolean.FALSE);
                                    //System.out.println(" Returned to pool "+ con);
                              }
                              break;
                        }
                  }
            }
            catch(Exception e)
            {
                  //System.out.println("error in return connection method .. "+e);
            }

      }
//

      private void init()
      {
//System.out.println("in init method .. ");
            Properties dbProps = loadPropertyFile("/home/round/public_html/WEB-INF/classes/roundrockonline/connect/roundrockonlinedb.properties");
//System.out.println("Properties .. "+ dbProps);
            loadDrivers(dbProps);
      }


   private Properties loadPropertyFile(String propertyFileName)
   {
     Properties dbProps = new Properties();
      //System.out.println("Properties loadPropertyFile().. "+dbProps);
     InputStream is=null;
     try {
       is = new FileInputStream(propertyFileName);
       dbProps.load(is);
     }catch (Exception e) {
        //System.err.println("FATAL Error: error in Connection Pool creation");
        //System.err.println("             can't read the property file " + propertyFileName);
     }finally {
        try {
          if (is != null)
            is.close();
        }catch (IOException e) {
        }
     }
      //System.out.println("Properties return loadPropertyFile().. "+dbProps);
     return dbProps;
   }

      private void loadDrivers(Properties props)
      {
            dbURL = props.getProperty("url");
            driverClassName = props.getProperty("drivers");
              user = props.getProperty("user");
              password = props.getProperty("password");
              initialConnections=Integer.parseInt(props.getProperty("initialConnections"));
              increment=Integer.parseInt(props.getProperty("increment"));
              maxIdle=Integer.parseInt(props.getProperty("maxIdle"));
            //System.out.println("dbURL .. "+ dbURL);
            //System.out.println("driverClassName .. "+ driverClassName);
            //System.out.println("user .. "+ user);
            //System.out.println("password .. "+ password);


      }
}
 
0
 
objectsCommented:
>                //System.out.println(" Cannot connect to " + dbURL +" ,Check your parameters");

that shouldn't be commented out
i'd suggest printing out that exception to give you some clues
0
 
objectsCommented:
perhaps your driver class is not available
0
 
mmuruganandamCommented:
Check this file

/home/round/public_html/WEB-INF/classes/roundrockonline/connect/roundrockonlinedb.properties

0
 
junkyforjcAuthor Commented:
I don't know how to check the driver class availability.

Here is the contents of the properties file:


#mySQL settings
drivers=org.gjt.mm.mysql.Driver
url=jdbc:mysql://www.roundrockonline.biz/roundrockonline
user=roundrockonline
password=Ay6Q62V1aeR
initialConnections=3
increment=2
maxIdle=1
0
 
objectsCommented:
printing out that exception that is ignored above will tell u the cause.
0
 
junkyforjcAuthor Commented:
I tried to uncomment that and I got nothing when I went to the page.  How do I make it include that in the output to the screen?
0
 
mmuruganandamCommented:
  public ConnectionPool() throws SQLException, ClassNotFoundException
     {
          init();
          //this.initialConnections = initialConnection;
          //this.driverClassName = driverClassName ;
          Class.forName(this.driverClassName);


>> Class.forName(this.driverClassName); your driver class is getting loaded in this part.  If it is not there, it could have thrown ClassNotFoundException.


         try
          {
               pool = new ConnectionPool();
               //System.out.println(" New instance created ");
          }
          catch(Exception e)
          {
               System.out.println(" Cannot connect to " + dbURL +" ,Check your parameters");
               e.printStackTrace();
          }

would help us guide you more.
0
 
objectsCommented:
    public static ConnectionPool getInstance() throws Exception {
     if(pool == null)
     {
          pool = new ConnectionPool();
      }
      return pool;
     }
0
 
junkyforjcAuthor Commented:
I have added the code and I get no additional error output.  Here is the page that I get:


500 Servlet Exception
java.sql.SQLException: COuld not get pool
      at _java._roundrockonline._listing__jsp._jspService(/java/roundrockonline/listing.jsp:18)
      at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
      at com.caucho.jsp.Page.subservice(Page.java:506)
      at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
      at com.caucho.server.http.Invocation.service(Invocation.java:315)
      at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
      at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
      at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
      at java.lang.Thread.run(Thread.java:536)

0
 
objectsCommented:
what code did u add?
if you are prionting out the exception then stdout goes to your logs so check there.
the change i posted above should cause the error to be displayed to the page.
0
 
junkyforjcAuthor Commented:
I have added both.  The error.log shows the following:

[2004/03/31 01:30:11] com.caucho.jsp.JspServlet: init
[2004/03/31 01:30:11] _java._roundrockonline._listing__jsp: init
[2004/03/31 01:30:12] COuld not get pool
java.sql.SQLException: COuld not get pool
      at _java._roundrockonline._listing__jsp._jspService(_listing__jsp.java:44)
      at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
      at com.caucho.jsp.Page.subservice(Page.java:506)
      at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
      at com.caucho.server.http.Invocation.service(Invocation.java:315)
      at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
      at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
      at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
      at java.lang.Thread.run(Thread.java:536)


The stderr.log shows the following:

Cannot connect to jdbc:mysql://www.roundrockonline.biz/roundrockonline ,Check your parameters


0
 
objectsCommented:
> Cannot connect to jdbc:mysql://www.roundrockonline.biz/roundrockonline ,Check your parameters

its failing, but you're still not printing out the exception. That'll tell you the cause of the failure.

0
 
junkyforjcAuthor Commented:
how do i get the exception?
0
 
junkyforjcAuthor Commented:
Sorry for the delay.  I never said I was great at this.  Here is the exception:


500 Servlet Exception
java.sql.SQLException: Invalid authorization specification: Access denied
for user: 'roundrockonline@sn2.cwihosting.com' (Using password: YES)
      at org.gjt.mm.mysql.MysqlIO.init(Unknown Source)
      at org.gjt.mm.mysql.Connection.connectionInit(Unknown Source)
      at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Unknown Source)
      at org.gjt.mm.mysql.Driver.connect(Unknown Source)
      at java.sql.DriverManager.getConnection(DriverManager.java:512)
      at java.sql.DriverManager.getConnection(DriverManager.java:171)
      at roundrockonline.connect.ConnectionPool.<init>(ConnectionPool.java:42)
      at roundrockonline.connect.ConnectionPool.getInstance(ConnectionPool.java:18)
      at _java._roundrockonline._listing__jsp._jspService(/java/roundrockonline/listing.jsp:4)
      at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
      at com.caucho.jsp.Page.subservice(Page.java:506)
      at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
      at com.caucho.server.http.Invocation.service(Invocation.java:315)
      at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
      at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
      at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
      at java.lang.Thread.run(Thread.java:536)

0
 
mmuruganandamCommented:
your password is wrong.
0
 
mmuruganandamCommented:
check your password in the properties file.

There are chances that your user might be also wrong.
0
 
mmuruganandamCommented:
Seems like your password is encrypted in your properties file.

Decrypt and use.
0
 
junkyforjcAuthor Commented:
The user is wrong because of the @sn2.cwihosting.com.......how do I change that portion???  I don't know how you tell that the db is correct?
0
 
junkyforjcAuthor Commented:
the password was the one that i used when the site was hosted on the other servers.???
0
 
mmuruganandamCommented:
   public ConnectionPool() throws SQLException, ClassNotFoundException
     {
          init();
          //this.initialConnections = initialConnection;
          //this.driverClassName = driverClassName ;
          Class.forName(this.driverClassName);
          //this.dbURL = dbURL;
          //this.user = user;
          //this.password = password;
          //this.increment= increment;
          connections= new Hashtable();
          for(int i = 0; i < initialConnections; i++)
          {
               System.out.println(this.user); // ADD THIS LINE HERE
               Connection c = DriverManager.getConnection(this.dbURL, this.user, this.password);



Check this out and let me know.

In the stack trace it use to give some other information on users.

I think, the user is going correct.
0
 
junkyforjcAuthor Commented:
i can get into the database from the hosting company tools, however, i have no way of knowing that it is where my program is trying to access...is there a way for me to check the path of the db??
0
 
mmuruganandamCommented:
i am suspecting on your password.

is that encrypted in the properties file.
0
 
mmuruganandamCommented:
the stack trace clearly says that "Invalid authorization specification"

In that case, it is able to talk to the DB.  But the credentials are wrong.
0
 
objectsCommented:
> is there a way for me to check the path of the db??

yes from the connection string:

jdbc:mysql://www.roundrockonline.biz/roundrockonline

0
 
junkyforjcAuthor Commented:
You are correct.  The user is correct...However, this still goes back to my having to create the db and not knowing how to check and make sure that I have the correct user and password in.  Is there any way to check..  I know that when I go to it in the tools, it does not ask for pw or anything.???
0
 
mmuruganandamCommented:
contact your system administrator for the verification of your password.
0
 
mmuruganandamCommented:
check your tool for authentication mechnism.  There are host authentication and password authentication.  If that option is there, select the password authentication and try
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> how to check and make sure that I have the correct user and password in.  Is there any way to check..  

Do you have a DBA?
0
 
junkyforjcAuthor Commented:
I will have to submit a ticket for them to check for me.  It will be at least tomorrow....??

I am so very thankful for you all.  I feel certain that it is the login or pw that is wrong.

Blessings on you all!
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>>  I feel certain that it is the login or pw that is wrong

It is, perhaps, the password.
0
 
objectsCommented:
0
 
junkyforjcAuthor Commented:
Gentlemen,

Again, I humbly thank you!  You are an amazing resource!

Junkyforjc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 15
  • 13
  • 12
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now