Exception in thread "main" java.lang.NoClassDefFoundError: shoogle/services
Hi
i'm having a problem with this and am not sure why i'm getting this error,
here my code
/*
* XMLCache.java
*
* Created on 21 April 2006, 16:47
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package shoogle.services;
/**
*
* @author gerard
*/
import shoogle.Global;
import shoogle.CrossQuery;
import shoogle.DateTime;
import java.util.ArrayList;
import java.sql.*;
import java.io.*;
import java.net.*;
/**
*
* @author Gerard
*/
publicclass XMLCache{
/** Creates a new instance of XMLCache */
public XMLCache(){
}
publicvoid updateRSS()
{
Global global =new Global();
ArrayList RSSList =new ArrayList();
Connection dbconn;
ResultSet results;
PreparedStatement sql;
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
try
{
String sql_string;
dbconn = DriverManager.getConnection(global.ShoogleDBURL, global.ShoogleDBWriteUser, global.ShoogleDBWritePassword);
sql_string ="SELECT RSSURL FROM rss_store";
sql = dbconn.prepareStatement(sql_string);
results = sql.executeQuery();
while(results.next())
{
RSSList.add(results.getString("RSSURL"));
}
dbconn.close();
}
catch (SQLException s)
{
System.out.println("updateRSS: " + s);
}
}
catch (Exception ex)
{
System.out.println("updateRSS: " + ex);
}
for (int i=0; i < RSSList.size(); i++)
{
String RSSURL = (String) RSSList.get(i);
fetchRSS(RSSURL);
System.out.println(RSSURL);
}
}
publicboolean createRSSEntry(String RSSURL)
{
Global global =new Global();
boolean RSSCreated =false;
Connection dbconn;
PreparedStatement sql;
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
try
{
String sql_string;
dbconn = DriverManager.getConnection(global.ShoogleDBURL, global.ShoogleDBWriteUser, global.ShoogleDBWritePassword);
sql_string ="INSERT INTO rss_store (RSSURL) VALUES ('" + RSSURL +"')";
sql = dbconn.prepareStatement(sql_string);
sql.executeUpdate();
RSSCreated =true;
dbconn.close();
}
catch (SQLException s)
{
System.out.println("createRSSEntry: " + s);
}
}
catch (Exception ex)
{
System.out.println("createRSSEntry: " + ex);
}
System.out.println("RSSCreated");
return RSSCreated;
}
publicboolean fetchRSS(String RSSURL)
{
Global global =new Global();
CrossQuery crossquery =new CrossQuery();
DateTime datetime =new DateTime();
boolean RSSFetched =false;
String CurrentDateTime = datetime.returnCurrentYearMonthDayHoursMinutesSeconds();
int ItemCheck = crossquery.countItems("RSSURL","rss_store","RSSURL", RSSURL);
if (ItemCheck == 0)
{
createRSSEntry(RSSURL);
}
try
{
URL url =new URL(RSSURL);
URLConnection c = url.openConnection();
InputStream in = c.getInputStream();
ByteArrayOutputStream baous =new ByteArrayOutputStream();
byte[] buf =newbyte[1<<9];
for(int read; (read = in.read(buf)) != -1; baous.write(buf, 0, read));
buf =null;
byte[] data = baous.toByteArray();
Connection dbconn;
PreparedStatement sql;
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
try
{
String sql_string;
dbconn = DriverManager.getConnection(global.ShoogleDBURL, global.ShoogleDBWriteUser, global.ShoogleDBWritePassword);
sql_string ="UPDATE rss_store SET XMLBlob=?, LastUpdateDateTime='" + CurrentDateTime +"' WHERE RSSURL='" + RSSURL +"'";
sql = dbconn.prepareStatement(sql_string);
sql.setBytes(1,data);
sql.executeUpdate();
dbconn.close();
}
catch (SQLException s)
{
System.out.println("fetchRSS\\updateItem: " + s);
}
}
catch (Exception ex)
{
System.out.println("fetchRSS: " + ex);
}
}
catch (Exception e)
{
}
RSSFetched =true;
return RSSFetched;
}
}
then when i call it i'm using a little comand prompt i had created
d:
cd\
cd sites
cd shoogle.shinelimited.com
cd root
cd web-inf
cd classes
java -classpath .;D:\Sites\shoogle.shinelimited.com\ROOT\WEB-INF\lib\mysql-connector-java-3.1.11-bin.jar shoogle.services.XMLCache
but i keep getting
D:\Sites\shoogle.shinelimited.com\ROOT>java -classpath .;D:\Sites\shoogle.shinelimited.com\ROOT\WEB-INF\classes\shoogle\services.shoogle.services.XMLCache
Exception in thread "main" java.lang.NoClassDefFoundError:shoogle/services/XMLCache
i'm not sure what the error is and y? please help thanks

