f



java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException:

I have an application that came to a grinding halt yesterday for no
apparent reason.  After looking into it I discovered that the file
system had reached its capacity.  My java guru is on holidays and wont
be back for a week so I have been left to try and resolve this in his
absence.

In the tomcat logs directory the file "localhost_log-YYY-MM-DD.txt" is
growing to 45MB in size every day.  When looking into the file it
contains the same error message over and over again:

java.io.WriteAbortedException: writing aborted;
java.io.NotSerializableException:

I have checked the Catalina.log file as well and it was at 1.5GB in
size again with the exact same message repeating throughout the file:

java.io.WriteAbortedException: writing aborted;
java.io.NotSerializableException:
com.reynolds.partsalesSharedUtilities.RemoteSite.RemoteSiteRecord
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
        at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1369)
        at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:864)
        at org.apache.catalina.session.FileStore.load(FileStore.java:337)
        at org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:308)
        at org.apache.catalina.session.StoreBase.run(StoreBase.java:376)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.NotSerializableException:
com.reynolds.partsalesSharedUtilities.RemoteSite.RemoteSiteRecord

I do not understand what this is telling me. The RemoteSiteRecord.java
file contains the following:

package com.reynolds.partsalesSharedUtilities.RemoteSite;

import java.sql.*;
import java.util.*;
import com.reynolds.partsalesSharedUtilities.*;
import com.reynolds.partsalesSharedUtilities.Connections.*;
import com.reynolds.exceptions.*;
import com.reynolds.tools.*;
import com.reynolds.pick.*;
import com.reynolds.sockets.*;


import ContextServlet;


public class RemoteSiteRecord {
	public String message ="";
	private String siteName = "";
	private String storeNum = ""; 
	private String portRange = ""; 
	private String pricingPortRange = "";
	private String dlrName = "";
	private String dlrAddress = "";
	private String dlrSuburb = "";
	private String dlrState = "";
	private String dlrPostcode = "";
	private String dlrPhone = "";
	private String dlrFax = "";
	private String dlrEmail = ""; 
	private String dlrMakeID = ""; 
	private String createDate = ""; 
	private String dlrComments = ""; 
	private String nonEra = "";
	private String nonEraSub = "";
	private String siteID = "";
	private String countryID = "";
	private String splitSize = ""; 
	private String dlrStatus = ""; 
	private String isDistributor = "";
	private String eraVersion = "";
	private String showLookup = ""; 
	private String searchType = "";
	private String lastUpload = "";
	private boolean selectTransCode = false;
	private boolean viewSource = false;
	private String emailOrder = "";
	private String dlrCode = "";
	private String dlrPartsManager = "";
	private String updateStmt = "";
	private String batchusername = "";
	private String batchpassword = "";
	private String batchhome = "";
	private String batchhome2 = "";
	private String batchflag = "";
	private String batchemail = "";
	private boolean factoryInq = false; // 04ckw

	private String crashbook = ""; // alvin changes 9-04-03
	private String altcrashbook = ""; // alvin changes 9-04-03

//05ckw start
	private boolean viewPack = false;
	private boolean viewTaxCode = false;
	private boolean viewDetail = false;
	private boolean viewClass = false;
	private boolean viewRemarks = false;
	private boolean viewMdlAppl = false;
	private boolean viewSalesHist = false;
	private boolean viewBranchInq = false;
//05ckw end

	private java.sql.Date ScreateDate; //SQL Date object
	private java.util.Date JcreateDate; //java Date object
	private java.sql.Date SuploadDate; //SQL Date object
	private java.util.Date JuploadDate; //java Date object

	private boolean dealerPopulated = false;
						
	// null constructor	
	public RemoteSiteRecord(){	
	}
	
	// constructor for insert method
	public RemoteSiteRecord(int countryID){	
		this.countryID = (new Integer(countryID)).toString();
	}			

	public RemoteSiteRecord(String nodeID) throws Exception {
		retrieveSiteRecord(nodeID);
		dealerPopulated = true;		
	}	

	// constructor
	public RemoteSiteRecord(String siteID, int countryID) throws
Exception {
		retrieveSiteRecord(siteID, countryID);
		this.countryID = (new Integer(countryID)).toString();
		dealerPopulated = true;		
	}	
	
 	public RemoteSiteRecord(String siteName, String storeNum, String
dlrMakeID, int countryID) throws Exception{
    	retrieveSiteRecord(siteName,storeNum,dlrMakeID, countryID);
		this.countryID = (new Integer(countryID)).toString();
		dealerPopulated = true;	
   	}
	
	// getter/setter methods
	public String getBatchEmail(){
		return batchemail; 
	}

	public void setBatchEmail(String x){
		batchemail = x;
	}

	public String getBatchFlag(){
		return batchflag; 
	}

	public void setBatchFlag(String x){
		batchflag = x;
	}

	public String getBatchUserName(){
		return batchusername; 
	}

	public void setBatchUserName(String x){
		batchusername = x;
	}

	public String getBatchPassword(){
		return batchpassword; 
	}

	public void setBatchPassword(String x){
		batchpassword = x;
	}

	public String getBatchHome(){
		return batchhome; 
	}

	public void setBatchHome(String x){
		batchhome = x;
	}

	public String getBatchHome2(){
		return batchhome2; 
	}

	public void setBatchHome2(String x){
		batchhome2 = x;
	}
	
	public String getSiteID(){
		return siteID; 
	}
	
	public void setSiteID(String x){
		siteID = x;
	}
	
	public String getCountryID(){
		return countryID;
	}
	
	public void setCountryID(String x){
		countryID = x;
	}
	
	public String getSplitSize(){
		return splitSize;
	}
	
	public void setSplitSize(String x){
		splitSize = x;
	}	
	
	public String getDlrStatus(){
		return dlrStatus;
	}
	
	public void setDlrStatus(String x){
		dlrStatus = x;
	}	
	
	public String getSiteName(){
		return siteName;
	}
	
	public void setSiteName(String x){
		siteName = x;
	}	
	
	public String getStoreNum(){
		return storeNum;
	}
	
	public void setStoreNum(String x){
		storeNum = x;
	}	
	
	public String getPortRange(){
		return portRange;
	}
	
	public void setPortRange(String x){
		portRange = x;
	}	
	
	public String getNonEra(){
		return nonEra;
	}
	
	public void setNonEra(String x){
		nonEra = x;
	}	
	
	public String getNonEraSub(){
		return nonEraSub;
	}
	
	public void setNonEraSub(String x){
		nonEraSub = x;
	}	
	
	public String getDlrName(){
		return dlrName;
	}

//alvinoh ins start
public void setCrashBook(String x){
		crashbook = x;
	}	

public String getCrashBook(){
		return crashbook;
	}

public void setAltCrashBook(String x){
		altcrashbook = x;
	}	

public String getAltCrashBook(){
		return altcrashbook;
	}
//alvinoh ins end



//05ckw ins start
	public boolean getViewPack(){
		return viewPack;
	}
	public boolean getViewBranchInq(){
		return viewBranchInq;
	}
	public boolean getViewTaxCode(){
		return viewTaxCode;
	}
	public boolean getViewDetail(){
		return viewDetail;
	}
	public boolean getViewRemarks(){
		return viewRemarks;
	}
	public boolean getViewClass(){
		return viewClass;
	}
	public boolean getViewMdlAppl(){
		return viewMdlAppl;
	}
	public boolean getViewSalesHist(){
		return viewSalesHist;
	}
	public boolean viewMasterInq(){
		if(viewPack || viewTaxCode || viewDetail || viewRemarks || viewClass
|| viewMdlAppl || viewSalesHist || viewBranchInq) return true;
		return false;
	}
	public void setViewPack(boolean x){
		this.viewPack = x;
	}
	public void setViewBranchInq(boolean x){
		this.viewBranchInq = x;
	}
	public void setViewTaxCode(boolean x){
		this.viewTaxCode = x;
	}
	public void setViewDetail(boolean x){
		this.viewDetail = x;
	}
	public void setViewRemarks(boolean x){
		this.viewRemarks = x;
	}
	public void setViewClass(boolean x){
		this.viewClass = x;
	}
	public void setViewMdlAppl(boolean x){
		this.viewMdlAppl = x;
	}
	public void setViewSalesHist(boolean x){
		this.viewSalesHist = x;
	}
//05ckw ins end
	
	public void setDlrName(String x){
		dlrName = x;
	}	
	
	public String getDlrAddress(){
		return dlrAddress;
	}
	
	public void setDlrAddress(String x){
		dlrAddress = x;
	}	
	
	public String getDlrSuburb(){
		return dlrSuburb;
	}
	
	public void setDlrSuburb(String x){
		dlrSuburb = x;
	}	
	
	public String getDlrState(){
		return dlrState;
	}
	
	public void setDlrState(String x){
		dlrState = x;
	}	
	
	public String getDlrPostcode(){
		return dlrPostcode;
	}
	
	public void setDlrPostcode(String x){
		dlrPostcode = x;
	}	
	
	public String getDlrPhone(){
		return dlrPhone;
	}
	
	public void setDlrPhone(String x){
		dlrPhone = x;
	}	
	
	public String getDlrFax(){
		return dlrFax;
	}
	
	public void setDlrFax(String x){
		dlrFax = x;
	}	
	
	public String getDlrEmail(){
		return dlrEmail;
	}
	
	public void setDlrEmail(String x){
		dlrEmail = x;
	}	
	
	public String getDlrMakeID(){
		return dlrMakeID;
	}
	
	public void setDlrMakeID(String x){
		dlrMakeID = x;
	}	
	
	public String getCreateDate(){
		return createDate;
	}
	
	public void setCreateDate(String x){
		createDate = x;
	}	
	
	public String getDlrComments(){
		return dlrComments;
	}
	
	public void setDlrComments(String x){
		dlrComments = x;
	}	
	
	public String getPricingPortRange(){
		return pricingPortRange;
	}
	
	public void setPricingPortRange(String x){
		pricingPortRange = x;
	}	
        
  public int getStartPort(){
   	StringTokenizer st = new StringTokenizer(portRange,"^");
      int startPort = Integer.parseInt(st.nextToken());
      return startPort;
  	}
	
	public int getDefaultPort(){
   		StringTokenizer st = new StringTokenizer(portRange,"^");
      	String temp = st.nextToken();
      	temp = st.nextToken();
      	int defaultPort = Integer.parseInt(st.nextToken());
      	return defaultPort;
 	}	
        
   public int getEndPort(){
   	StringTokenizer st = new StringTokenizer(portRange,"^");
      String temp = st.nextToken();
      int endPort = Integer.parseInt(st.nextToken());
      return endPort;
 	}	
	
	public int getPricingStartPort(){
   	  StringTokenizer st = new StringTokenizer(pricingPortRange,"^");
      int startPort = Integer.parseInt(st.nextToken());
      return startPort;
  	}	
	
  public int getPricingDefaultPort(){
   	  	StringTokenizer st = new StringTokenizer(pricingPortRange,"^");
      	String temp = st.nextToken();
      	temp = st.nextToken();
      	int defaultPort = Integer.parseInt(st.nextToken());
      	return defaultPort;
 	}	
        
  public int getPricingEndPort(){
   	  	StringTokenizer st = new StringTokenizer(pricingPortRange,"^");
      	String temp = st.nextToken();
      	int endPort = Integer.parseInt(st.nextToken());
      	return endPort;
 	}
		
	public String getIsDistributor(){
	 	return isDistributor;
	}
	
	public void setIsDistributor(String x){
		isDistributor = x;
	}

	public String getEraVersion(){
	 	return eraVersion;
	}
	
	public void setEraVersion(String x){
		eraVersion = x;
	}

	public String getSearchType(){
	 	return searchType;
	}
	
	public void setSearchType(String x){
		searchType = x;
	}

	public java.sql.Date getSUploadDate(){
		return SuploadDate;
	}
	
	public void setSUploadDate( java.sql.Date x ){
		SuploadDate = x;
	}
	
	public java.util.Date getJUploadDate(){
		return JuploadDate;
	}
	
	public void setJUploadDate( java.util.Date x ){
		JuploadDate = x;
	}

	public String getShowLookup(){
	 	return showLookup;
	}
	
	public void setShowLookup(String x){
		showLookup = x;
	}

	public java.sql.Date getSCreateDate(){
		return ScreateDate;
	}
	
	public void setSCreateDate( java.sql.Date x ){
		ScreateDate = x;
	}
	
	public java.util.Date getJCreateDate(){
		return JcreateDate;
	}
	
	public void setJCreateDate( java.util.Date x ){
		JcreateDate = x;
	}

	public void setSelectTransCode(boolean selectTransCode){
		this.selectTransCode = selectTransCode;
	}

	public boolean getSelectTransCode(){
		return selectTransCode;
	}

	public void setViewSource(boolean viewSource){
		this.viewSource = viewSource;
	}

	public boolean getViewSource(){
		return viewSource;
	}

	public String getEmailOrder(){
		return emailOrder;
	}

	public void setEmailOrder(String x){
		emailOrder = x;
	}

	public String getDlrCode(){
		return dlrCode;
	}

	public void setDlrCode(String x){
		dlrCode = x;
	}

//04ckw start
	public boolean getFactoryInq(){
		return factoryInq;
	}

	public void setFactoryInq(boolean factoryInq){
		this.factoryInq =  factoryInq;
	}

//04ckw end

	public void setDlrPartsManager(String x){
		dlrPartsManager = x;
	}

	public String getDlrPartsManager(){
		return dlrPartsManager;
	}

	public Vector getAttachedUsers() throws SQLException {		
		return retrieveAttachedUsers(siteID, Integer.parseInt(countryID));
	}
	
	// this function returns true if the site is a dealer.partsales
parent site
	public boolean isParent() throws SQLException {
		DealerGroupRecord dgr = new DealerGroupRecord();
		return dgr.isParent(siteID, Integer.parseInt(countryID));
	}		
/** 06ckw ins start
This method has to be fixed, at the moment only used for toyota tsusho
*/	
	public boolean viewCasePartSearch(){		
		if(siteID.equals("1065") || siteID.equals("1064")){
			return true;
		}
		return false;
	}
	
	//function to return a string representation of a user record
	public String toString () {
		String recordString = "";
		recordString = siteID + " " + siteName + " " + storeNum + " " +
splitSize + " " + portRange + " " + nonEra + " "
			+ dlrStatus + " " + dlrName + " " + dlrAddress + " "	+ dlrSuburb +
" " + dlrState + " " + dlrPostcode + " "
			+ dlrPhone + " " + dlrFax + " " + dlrEmail + " " + dlrMakeID + " "
+ createDate + " " + dlrComments + " " + countryID + " " +
pricingPortRange + " " + isDistributor + " " + nonEraSub + " " +
eraVersion + " " + showLookup + " " + searchType + " " + lastUpload +
" " + viewSource + " " + selectTransCode + " " + emailOrder + " " +
dlrCode + " " + dlrPartsManager + " " + factoryInq + " " + batchflag +
" " + batchusername + " " +
			batchpassword + " " + batchhome + " " + batchemail + " " +
batchhome2;

		return recordString;
	}	
	
	private void retrieveSiteRecord(String siteID, int countryID) throws
SQLException, Exception {
		String sqlString = "";
		Connection con = null;
		Statement stmt = null;
		ResultSet rs = null;
			
		try {
			con = PartsalesOracleConnection.getConnection(countryID);		
			stmt = con.createStatement();
			sqlString = "SELECT * FROM REMOTE_SITES WHERE SITE_ID = " + siteID
								+ " ORDER BY DLR_NAME";
			message = sqlString;
			rs = stmt.executeQuery(sqlString);
			if ( rs.next() ){ 
        this.siteID = siteID;
				siteName = rs.getString("SITE_NAME");
				storeNum = rs.getString("STORE_NUM");			
				splitSize = rs.getString("SPLIT_SIZE");
				portRange = rs.getString("PORT_RANGE");
				pricingPortRange = rs.getString("PRICING_PORT_RANGE");
				nonEra = rs.getString("NON_ERA");
				nonEraSub = rs.getString("NON_ERA_SUB") == null ? "" :
rs.getString("NON_ERA_SUB");
				dlrStatus = rs.getString("DLR_STATUS");
				dlrName = rs.getString("DLR_NAME");
				dlrAddress = rs.getString("DLR_ADDR");
				dlrSuburb = rs.getString("DLR_SUBURB");			
				dlrState = rs.getString("DLR_STATE");			 
				dlrPostcode = rs.getString("DLR_POSTCODE");
				dlrPhone = rs.getString("DLR_PHONE");			
				dlrFax = rs.getString("DLR_FAX");
				dlrEmail = rs.getString("DLR_EMAIL");			
				dlrMakeID = rs.getString("DLR_MAKE_ID");			 
				createDate = rs.getString("CREATE_DATE");
				ScreateDate = rs.getDate("CREATE_DATE");
				JcreateDate = ScreateDate.valueOf(ScreateDate.toString()); //not
sure if this is the best way to do this
				dlrComments = rs.getString("DLR_COMMENTS") == null ? "" :
rs.getString("DLR_COMMENTS");
				isDistributor = rs.getString("IS_DISTRIBUTOR");	
				eraVersion = rs.getString("ERA_VERSION");
				showLookup = rs.getString("VIEW_LOOKUP");
				searchType = rs.getString("SEARCH_TYPE");
				lastUpload = rs.getString("LAST_UPLOAD") ;
				SuploadDate = rs.getDate("LAST_UPLOAD") ;
				batchflag = rs.getString("BATCH_FLAG"); 
				batchusername = rs.getString("BATCH_USERNAME");
				batchpassword = rs.getString("BATCH_PASSWORD");
				batchhome = rs.getString("BATCH_HOME");
				batchhome2 = rs.getString("HOME_DIRECTORY");
				batchemail = rs.getString("BATCH_EMAIL");
				JuploadDate = SuploadDate!=null?SuploadDate.valueOf(SuploadDate.toString()):null;
//not sure if this is the best way to do this
				viewSource = (new
Boolean(rs.getString("VIEW_SRC"))).booleanValue();
				selectTransCode = (new
Boolean(rs.getString("SEL_TC"))).booleanValue();
				emailOrder = rs.getString("EMAIL_ORDER_ID");
				dlrCode = rs.getString("DLR_CODE");
				dlrPartsManager = rs.getString("PARTS_MANAGER");
				this.countryID = rs.getString("COUNTRY_ID");
				factoryInq = (new
Boolean(rs.getString("FACT_INQ"))).booleanValue();//04ckw add
//05ckw start
				viewPack = (new Boolean(rs.getString("VIEW_PACK"))).booleanValue();
				viewTaxCode = (new
Boolean(rs.getString("VIEW_TAX_CODE"))).booleanValue();
				viewDetail = (new
Boolean(rs.getString("VIEW_DETAIL"))).booleanValue();
				viewClass = (new
Boolean(rs.getString("VIEW_CLASS"))).booleanValue();
				viewRemarks = (new
Boolean(rs.getString("VIEW_REMARKS"))).booleanValue();
				viewMdlAppl = (new
Boolean(rs.getString("VIEW_MDL_APPL"))).booleanValue();
				viewSalesHist = (new
Boolean(rs.getString("VIEW_SALES_HIST"))).booleanValue();
				viewBranchInq = (new
Boolean(rs.getString("VIEW_BRANCH_INQ"))).booleanValue();
//05ckw end
				
//alvinchanges start
				crashbook = rs.getString("VIEW_CRASHBOOK");
				altcrashbook = rs.getString("VIEW_ALT_CRASHBOOK");
//alvinchanges end

			} else {					
				throw new Exception ("site does not exist\n<br>--> In
com.reynolds.partsalesSharedUtilities.RemoteSite.RemoteSiteRecord:
while retrieving remote site details");
			}	
		} finally {
			try {
				rs.close();
			} catch (Exception e){}
			try {
				stmt.close();
			} catch (Exception e){}
			try {
				con.close();
			} catch (Exception e){}
		}	         
	}	
        
 	private void retrieveSiteRecord(String siteName,String
storeNum,String dlrMakeID, int countryID) throws Exception,
SQLException {
		String sqlString = "";
		
		Connection con = null;
		Statement stmt = null;
		ResultSet rs = null;
		
		try {
			con = PartsalesOracleConnection.getConnection(countryID);		
			stmt = con.createStatement();
			
			sqlString = "SELECT * FROM REMOTE_SITES WHERE SITE_NAME = \'" +
siteName
                + "\' AND STORE_NUM = \'"  + storeNum + "\' AND
DLR_MAKE_ID = \'" + dlrMakeID + "\'"
								+ " ORDER BY DLR_NAME ";
            
			rs = stmt.executeQuery(sqlString);            
	
			if ( rs.next() ){
        this.siteID = rs.getString("SITE_ID");
				this.siteName = rs.getString("SITE_
AME");
				this.storeNum = rs.getString("STORE_NUM");			
				splitSize = rs.getString("SPLIT_SIZE");
				portRange = rs.getString("PORT_RANGE");
				pricingPortRange = rs.getString("PRICING_PORT_RANGE");
				nonEra = rs.getString("NON_ERA");
				nonEraSub = rs.getString("NON_ERA_SUB");				
				dlrStatus = rs.getString("DLR_STATUS");
				dlrName = rs.getString("DLR_NAME");
				dlrAddress = rs.getString("DLR_ADDR");
				dlrSuburb = rs.getString("DLR_SUBURB");			
				dlrState = rs.getString("DLR_STATE");			 
				dlrPostcode = rs.getString("DLR_POSTCODE");
				dlrPhone = rs.getString("DLR_PHONE");			
				dlrFax = rs.getString("DLR_FAX");
				dlrEmail = rs.getString("DLR_EMAIL");			
				this.dlrMakeID = rs.getString("DLR_MAKE_ID");			 
				createDate = rs.getString("CREATE_DATE");
				dlrComments = rs.getString("DLR_COMMENTS");
				isDistributor = rs.getString("IS_DISTRIBUTOR");		
				eraVersion = rs.getString("ERA_VERSION");
				showLookup = rs.getString("VIEW_LOOKUP");	
				searchType = rs.getString("SEARCH_TYPE");
				lastUpload = rs.getString("LAST_UPLOAD");
				viewSource = (new
Boolean(rs.getString("VIEW_SRC"))).booleanValue();
				selectTransCode = (new
Boolean(rs.getString("SEL_TC"))).booleanValue();
				emailOrder = rs.getString("EMAIL_ORDER_ID");
				dlrCode = rs.getString("DLR_CODE");
				dlrPartsManager = rs.getString("PARTS_MANAGER");
				this.countryID = rs.getString("COUNTRY_ID");
				factoryInq = (new
Boolean(rs.getString("FACT_INQ"))).booleanValue();//04ckw add
				batchflag = rs.getString("BATCH_FLAG"); 
				batchusername = rs.getString("BATCH_USERNAME");
				batchpassword = rs.getString("BATCH_PASSWORD");
				batchhome = rs.getString("BATCH_HOME");
				batchhome2 = rs.getString("HOME_DIRECTORY");
				batchemail = rs.getString("BATCH_EMAIL");
//05ckw start
				viewPack = (new Boolean(rs.getString("VIEW_PACK"))).booleanValue();
				viewTaxCode = (new
Boolean(rs.getString("VIEW_TAX_CODE"))).booleanValue();
				viewDetail = (new
Boolean(rs.getString("VIEW_DETAIL"))).booleanValue();
				viewClass = (new
Boolean(rs.getString("VIEW_CLASS"))).booleanValue();
				viewRemarks = (new
Boolean(rs.getString("VIEW_REMARKS"))).booleanValue();
				viewMdlAppl = (new
Boolean(rs.getString("VIEW_MDL_APPL"))).booleanValue();
				viewSalesHist = (new
Boolean(rs.getString("VIEW_SALES_HIST"))).booleanValue();
				viewBranchInq = (new
Boolean(rs.getString("VIEW_BRANCH_INQ"))).booleanValue();
//05ckw end

//alvinchanges start
				crashbook = rs.getString("VIEW_CRASHBOOK");
				altcrashbook = rs.getString("VIEW_ALT_CRASHBOOK");
//alvinchanges end

			} else {				
				throw new Exception ("site does not exist" + "\n<br>--> In
partsalesSharedUtilities/RemoteSite/RemoteSiteRecord.java: while
retrieving remote site details");
			}		
		} finally {
			try {
				rs.close();
			} catch (Exception e){}
			try {
				stmt.close();
			} catch (Exception e){}
			try {
				con.close();
			} catch (Exception e){}
		}							         
	}
//this retrieves the first record with passed nodeID	
		private void retrieveSiteRecord(String nodeID) throws SQLException,
Exception {
		String sqlString = "";
		Connection con = null;
		Statement stmt = null;
		ResultSet rs = null;
		this.countryID = ContextServlet.getApplParameter("countryID");
		try {
			con = PartsalesOracleConnection.getConnection(Integer.parseInt(countryID));
			stmt = con.createStatement();
			sqlString = "SELECT * FROM REMOTE_SITES WHERE SITE_NAME = \'" +
nodeID + "\'";
			message = sqlString;
			rs = stmt.executeQuery(sqlString);
		
			if ( rs.next() ){
           		this.siteID = rs.getString("SITE_ID");
				siteName = rs.getString("SITE_NAME");
				storeNum = rs.getString("STORE_NUM");			
				splitSize = rs.getString("SPLIT_SIZE");
				portRange = rs.getString("PORT_RANGE");
				pricingPortRange = rs.getString("PRICING_PORT_RANGE");
				nonEra = rs.getString("NON_ERA");
				nonEraSub = rs.getString("NON_ERA_SUB") == null ? "" :
rs.getString("NON_ERA_SUB");
				dlrStatus = rs.getString("DLR_STATUS");
				dlrName = rs.getString("DLR_NAME");
				dlrAddress = rs.getString("DLR_ADDR");
				dlrSuburb = rs.getString("DLR_SUBURB");			
				dlrState = rs.getString("DLR_STATE");			 
				dlrPostcode = rs.getString("DLR_POSTCODE");
				dlrPhone = rs.getString("DLR_PHONE");			
				dlrFax = rs.getString("DLR_FAX");
				dlrEmail = rs.getString("DLR_EMAIL");			
				dlrMakeID = rs.getString("DLR_MAKE_ID");			 
				createDate = rs.getString("CREATE_DATE");
				ScreateDate = rs.getDate("CREATE_DATE");
				JcreateDate = ScreateDate.valueOf(ScreateDate.toString()); //not
sure if this is the best way to do this
				dlrComments = rs.getString("DLR_COMMENTS") == null ? "" :
rs.getString("DLR_COMMENTS");
				isDistributor = rs.getString("IS_DISTRIBUTOR");	
				eraVersion = rs.getString("ERA_VERSION");
				showLookup = rs.getString("VIEW_LOOKUP");
				lastUpload = rs.getString("LAST_UPLOAD") ;
				SuploadDate = rs.getDate("LAST_UPLOAD") ;
				if(SuploadDate != null){
					JuploadDate = SuploadDate.valueOf(SuploadDate.toString()); //not
sure if this is the best way to do this
				}else{
					JuploadDate = null;
				}				viewSource = (new
Boolean(rs.getString("VIEW_SRC"))).booleanValue();
				selectTransCode = (new
Boolean(rs.getString("SEL_TC"))).booleanValue();
				emailOrder = rs.getString("EMAIL_ORDER_ID");
				dlrCode = rs.getString("DLR_CODE");
				dlrPartsManager = rs.getString("PARTS_MANAGER");
				this.countryID = rs.getString("COUNTRY_ID");
				factoryInq = (new
Boolean(rs.getString("FACT_INQ"))).booleanValue();//04ckw add
				batchflag = rs.getString("BATCH_FLAG"); 
				batchusername = rs.getString("BATCH_USERNAME");
				batchpassword = rs.getString("BATCH_PASSWORD");
				batchhome = rs.getString("BATCH_HOME");
				batchhome2 = rs.getString("HOME_DIRECTORY");
				batchemail = rs.getString("BATCH_EMAIL");
//05ckw start
				viewPack = (new Boolean(rs.getString("VIEW_PACK"))).booleanValue();
				viewTaxCode = (new
Boolean(rs.getString("VIEW_TAX_CODE"))).booleanValue();
				viewDetail = (new
Boolean(rs.getString("VIEW_DETAIL"))).booleanValue();
				viewClass = (new
Boolean(rs.getString("VIEW_CLASS"))).booleanValue();
				viewRemarks = (new
Boolean(rs.getString("VIEW_REMARKS"))).booleanValue();
				viewMdlAppl = (new
Boolean(rs.getString("VIEW_MDL_APPL"))).booleanValue();
				viewSalesHist = (new
Boolean(rs.getString("VIEW_SALES_HIST"))).booleanValue();
				viewBranchInq = (new
Boolean(rs.getString("VIEW_BRANCH_INQ"))).booleanValue();
//05ckw end

//alvinchanges start
				crashbook = rs.getString("VIEW_CRASHBOOK");
				altcrashbook = rs.getString("VIEW_ALT_CRASHBOOK");
//alvinchanges end						

			} else {					
				throw new Exception ("site does not exist" + "\n<br>--> In
partsalesSharedUtilities/RemoteSite/RemoteSiteRecord.java: while
retrieving remote site details");
			}	
		} finally {
			try {
				rs.close();
			} catch (Exception e){}
			try {
				stmt.close();
			} catch (Exception e){}
			try {
				con.close();
			} catch (Exception e){}
		}	         
	}	

	private Vector retrieveAttachedUsers(String siteID, int countryID)
throws SQLException {
		Vector attachedUsers = new Vector();
		
		String sqlString = "";
		
		Connection con = null;
		Statement stmt = null;
		ResultSet rs = null;
		
		try {
			con = PartsalesOracleConnection.getConnection(countryID);		
			stmt = con.createStatement();
			
			sqlString = "SELECT USER_ID FROM USER_DEALERS WHERE SITE_ID = " +
siteID ;
            
			rs = stmt.executeQuery(sqlString);            
	
			while ( rs.next() ){
        		attachedUsers.addElement(rs.getString("USER_ID"));
			} 
		} finally {
			try {
				rs.close();
			} catch (Exception e){}
			try {
				stmt.close();
			} catch (Exception e){}
			try {
				con.close();
			} catch (Exception e){}
		}
		
		return attachedUsers;							         
	}
	
	// validates user entered data
	private void testVariables () throws IncompleteFormDataException,
IncompleteDataException {
		// user/programmer errors
		if (storeNum.equals("")){ throw new
IncompleteFormDataException("Store Number is a required field"); }
		if (portRange.equals("")) { throw new
IncompleteFormDataException("Port Range is a required field"); }
		if (dlrName.equals("")) { throw new
IncompleteFormDataException("Dealer Name is a required field"); }
		if (dlrState.equals("")) { throw new
IncompleteFormDataException("Dealer State is a required field"); }
		if (dlrEmail.equals("")) { throw new
IncompleteFormDataException("Dealer Email is a required field"); }
		if (dlrMakeID.equals("")) { throw new
IncompleteFormDataException("Dealer Make ID is a required field"); }
		if (nonEra.equals("")) { throw new IncompleteFormDataException("Non
Era is a required field"); }
		if (splitSize.equals("")) { throw new
IncompleteFormDataException("Split size is a required field"); }
		if (dlrStatus.equals("")) { throw new
IncompleteFormDataException("Dealer status is a required field"); }
	}
	
	
	
	public void dealerInsert(int countryID) throws SQLException, 
			IncompleteFormDataException, IncompleteDataException,
DealerAlreadyExistsException
		{
		
		Connection con = null;
		Statement stmt = null;
		String stmtString = "";
		SQLFormatter sf = new SQLFormatter();
		
		this.countryID = new Integer(countryID).toString();
		
		testVariables();
		
		retrieveSiteID(countryID);
		
		try{
			con = PartsalesOracleConnection.getConnection(countryID);
			con.setAutoCommit(false);		
			stmt = con.createStatement();
		
			stmtString = "INSERT INTO REMOTE_SITES "
									+ "(SITE_ID, "
									+ " SITE_NAME, "
									+ " STORE_NUM, "
									+ " SPLIT_SIZE, "
									+ " PORT_RANGE, "
									+ " NON_ERA,"
									+ " DLR_STATUS, "
									+ " DLR_NAME, "
									+ " DLR_ADDR, "
									+ " DLR_SUBURB, "
									+ " DLR_STATE, "
									+ " DLR_POSTCODE,"
									+ " DLR_PHONE, "
									+ " DLR_FAX, "
									+ " DLR_EMAIL, "
									+ " DLR_MAKE_ID, "
									+ " CREATE_DATE, "
									+ " DLR_COMMENTS,"
									+ " COUNTRY_ID, "
									+ " PRICING_PORT_RANGE, "
									+ " IS_DISTRIBUTOR, "
									+ " NON_ERA_SUB, "
									+ " ERA_VERSION, "
									+ " VIEW_LOOKUP, "
									+ " SEARCH_TYPE, "
									+ " VIEW_SRC, "
									+ " SEL_TC, "
									+ " EMAIL_ORDER_ID, "
									+ " DLR_CODE, "
									+ " FACT_INQ, " // 04CKW ADD
									+ " BATCH_FLAG, " 
									+ " BATCH_USERNAME, " 
									+ " BATCH_PASSWORD, " 
									+ " BATCH_EMAIL, " 
									+ " BATCH_HOME, "
									+ " HOME_DIRECTORY, "
//05CKW INS START
									+ " VIEW_PACK, "
									+ " VIEW_SALES_HIST, "
									+ " VIEW_REMARKS, "
									+ " VIEW_DETAIL, "
									+ " VIEW_CLASS, "
									+ " VIEW_TAX_CODE, "
									+ " VIEW_MDL_APPL, "
									+ " VIEW_BRANCH_INQ, "
	
//05CKW INS END

//alvinoh INS START
									+ " VIEW_CRASHBOOK, "
									+ " VIEW_ALT_CRASHBOOK, "
//alvinoh INS END

									+ " PARTS_MANAGER)"
									+ " VALUES ("
									+  siteID + ","
									+ "'" + siteName + "',"
									+ "'" + storeNum + "',"
									+  splitSize + ","
									+ "'" + portRange + "',"
									+ "'" + nonEra + "',"
									+ dlrStatus + ","
									+ "'" + sf.format(dlrName) + "',"
									+ "'" + sf.format(dlrAddress) + "',"
									+ "'" + sf.format(dlrSuburb) + "',"
									+ "'" + dlrState + "',"
									+ "'" + dlrPostcode + "',"
									+ "'" + dlrPhone + "',"
									+ "'" + dlrFax + "',"
									+ "'" + dlrEmail + "',"
									+ "'" + dlrMakeID + "',"
									+ "CURRENT TIMESTAMP,"
									+ "'" + sf.format(dlrComments) + "',"
									+ countryID + ","
									+ "'" + pricingPortRange + "',"
									+ "'" + isDistributor + "',"
									+ "'" + nonEraSub + "',"
									+ "'" + eraVersion +"',"
									+ "'" + showLookup +"',"
									+ searchType + ","
									+ "'" + (new Boolean(viewSource)).toString() + "',"
									+ "'" + (new Boolean(selectTransCode)).toString() + "',"
									+ "'" + emailOrder + "',"
									+ "'" + dlrCode + "',"
									+ "'" + (new Boolean(factoryInq)).toString() + ","
									+ "'" + batchflag + "',"
									+ "'" + batchusername + "',"
									+ "'" + batchpassword + "',"
									+ "'" + batchemail + "',"
									+ "'" + batchhome + "',"
									+ "'" + batchhome2 + "',"
//05CKW INS START
									+ "'" + viewPack + "',"
									+ "'" + viewSalesHist + "',"
									+ "'" + viewRemarks + "',"
									+ "'" + viewDetail + "',"
									+ "'" + viewClass + "',"
									+ "'" + viewTaxCode + "',"
									+ "'" + viewMdlAppl + "',"
									+ "'" + viewBranchInq + "',"
//05CKW INS END

//alvinoh INS START
									+ "'" + crashbook + "',"
									+ "'" + altcrashbook + "',"
//alvinoh INS END
								
									+ "'" + dlrPartsManager + "')";
			
			stmt.executeUpdate(stmtString);
      		
							
			// update log_sites
			stmtString = "INSERT INTO LOG_SITES (SITE_ID, SITE_STATUS,
DATE_MOD)"
									+ " VALUES (" + siteID + "," + dlrStatus + ",CURRENT
TIMESTAMP)";
								
			stmt.executeUpdate(stmtString);				
						
			//commit changes to database
			con.commit();	
			con.setAutoCommit(true);
										
		} catch (SQLException e) {
			try {
				con.rollback();
				con.setAutoCommit(true);
			} catch (Exception ex){}			
			if (e.getErrorCode() == 1){
				throw new DealerAlreadyExistsException ("This dealer already
exists");
			}						
			throw new SQLException (e.toString() + "<br>--> " + stmtString);
		} finally {			
			try { stmt.close(); } 
			catch (Exception e){}
			try { con.close(); } 
			catch (Exception e){}
		}
	}
	
	
	public void delete() throws SQLException, IncompleteFormDataException
{
		Connection con = null;
		Statement stmt = null;
		String stmtString = "";
		
		if (!dealerPopulated){
			throw new IncompleteFormDataException("getUserDetails() method not
called");
		}
		
		try {
			con = PartsalesOracleConnection.getConnection(Integer.parseInt(countryID));
			con.setAutoCommit(false);
			stmt = con.createStatement();
			
			stmt.executeUpdate("DELETE FROM REMOTE_SITES WHERE SITE_ID = " +
siteID );
			stmt.executeUpdate("DELETE FROM USER_DEALERS WHERE SITE_ID = " +
siteID);
 			stmt.executeUpdate("DELETE FROM DEALER_GROUPS WHERE SITE_ID = " +
siteID);
			con.commit();
			con.setAutoCommit(true);
								
		} catch (SQLException e) {			
			con.rollback();
			con.setAutoCommit(true);			
			throw e;
		} finally {			
			try { stmt.close(); } 
			catch (Exception e){}
			try { con.close(); } 
			catch (Exception e){}
		}				
	}
		
	private void retrieveSiteID(int countryID) throws SQLException {
		Connection con = null;
		Statement stmt = null;
		ResultSet rs = null;
		
		try{
			con = PartsalesOracleConnection.getConnection(countryID);
			stmt = con.createStatement();
			String stmtString = "SELECT NEXTVAL FOR SITE_ID_SEQ FROM
RNRDB2.DUAL";
			rs = stmt.executeQuery(stmtString);
			rs.next();
			siteID = rs.getString("1");
			 
			rs.close();
			stmt.close();
			con.close();			
		
		} finally {
			try { rs.close(); } 
			catch (Exception e) {}
			try { stmt.close(); } 
			catch (Exception e) {}
			try { con.close(); } 
			catch (Exception e) {}	
		}
	}
	
	
	
	public void dealerUpdate() throws IncompleteFormDataException,
IncompleteDataException , SQLException {
		
		Connection con = null;
		Statement stmt = null;
		String stmtString = "";
		SQLFormatter sf = new SQLFormatter();
		
		// A call to getUserDetails() must be made before updating user
		if (!dealerPopulated){
			throw new IncompleteFormDataException("retrieveSiteRecord() method
not called");
		}	
		
		testVariables();
		
		// fix any variables that might possible have apostrophes in them
						
		try {			
			con = PartsalesOracleConnection.getConnection(Integer.parseInt(countryID));
			con.setAutoCommit(false);		
			stmt = con.createStatement();
					
			updateStmt = "UPDATE REMOTE_SITES SET";

			addSQL("SITE_NAME", "'" + siteName + "'");
			addSQL("STORE_NUM", "'" + storeNum + "'");
			addSQL("SPLIT_SIZE", splitSize);
			addSQL("PORT_RANGE", "'" + portRange + "'");
			addSQL("NON_ERA", "'" + nonEra + "'");
			addSQL("DLR_STATUS", dlrStatus);
			addSQL("DLR_NAME", "'" + sf.format(dlrName)+ "'");
			addSQL("DLR_ADDR", "'" + sf.format(dlrAddress)+ "'" );
			addSQL("DLR_SUBURB", "'" + sf.format(dlrSuburb)+ "'");
			addSQL("DLR_STATE", "'" + dlrState + "'");
			addSQL("DLR_POSTCODE", "'" + dlrPostcode + "'");
			addSQL("DLR_PHONE", "'" + dlrPhone + "'");
			addSQL("DLR_FAX", "'" + dlrFax + "'");
			addSQL("DLR_EMAIL", "'" + dlrEmail + "'");
			addSQL("DLR_MAKE_ID", "'" + dlrMakeID + "'");
			addSQL("DLR_COMMENTS", "'" + sf.format(dlrComments) + "'");
			addSQL("COUNTRY_ID", countryID);
			addSQL("PRICING_PORT_RANGE", "'" + pricingPortRange + "'");
			addSQL("IS_DISTRIBUTOR", "'" + isDistributor + "'");
			addSQL("NON_ERA_SUB", "'" + nonEraSub + "'");
			addSQL("ERA_VERSION","'" + eraVersion + "'");
			addSQL("VIEW_LOOKUP","'" + showLookup + "'");
			addSQL("SEARCH_TYPE", searchType);
			addSQL("VIEW_SRC", "'" + (new Boolean(viewSource)).toString() +
"'");
			addSQL("SEL_TC","'" + (new Boolean(selectTransCode)).toString() +
"'");
			addSQL("EMAIL_ORDER_ID", "'" + emailOrder + "'");
			addSQL("DLR_CODE", "'" + dlrCode + "'");
			addSQL("PARTS_MANAGER", "'" + dlrPartsManager + "'");
			addSQL("FACT_INQ", "'" + (new Boolean(factoryInq)).toString() +
"'");
			addSQL("BATCH_FLAG","'" + batchflag + "'");
			addSQL("BATCH_USERNAME","'" + batchusername + "'");
			addSQL("BATCH_PASSWORD","'" + batchpassword + "'");
			addSQL("BATCH_EMAIL","'" + batchemail + "'");
			addSQL("BATCH_HOME","'" + batchhome + "'");
			addSQL("HOME_DIRECTORY","'" + batchhome2 + "'");

//05CKW INS START
			addSQL("VIEW_PACK","'" + viewPack + "'");
			addSQL("VIEW_DETAIL","'" + viewDetail + "'");
			addSQL("VIEW_REMARKS","'" + viewRemarks + "'");
			addSQL("VIEW_CLASS","'" + viewClass + "'");
			addSQL("VIEW_SALES_HIST","'" + viewSalesHist + "'");
			addSQL("VIEW_TAX_CODE","'" + viewTaxCode + "'");
			addSQL("VIEW_MDL_APPL","'" + viewMdlAppl + "'");
			addSQL("VIEW_BRANCH_INQ","'" + viewMdlAppl + "'");
//05CKW INS END

//alvinoh INS START
			addSQL("VIEW_CRASHBOOK","'" + crashbook + "'");
			addSQL("VIEW_ALT_CRASHBOOK","'" + altcrashbook + "'");
//alvinoh INS END

			updateStmt += " WHERE SITE_ID = " + siteID;
			
			stmt.executeUpdate(updateStmt);
			
			con.commit();
			con.setAutoCommit(true);					
						
		} catch (SQLException e) {			
			try {
				con.rollback();
				con.setAutoCommit(true);
			} catch (Exception ex) {}			
			throw new SQLException (e.toString() + "<br>\n---> Copy And Paste
following statement and send to shannonw@reynolds.com.au<br>\n" +
updateStmt);
		} finally {			
			try { stmt.close(); } 
			catch (Exception e){}
			try { con.close(); } 
			catch (Exception e){}
		}							
	}

	public void addSQL(String column, String value) {
		// If value does not equal null then add to updateStmt
		if (value!=null) { 
			if (updateStmt.equals("UPDATE REMOTE_SITES SET")) { updateStmt += "
" + column + " = " + value ; }
			else { updateStmt += " ," + column + " = " + value ; }
		}
	}

	public boolean backupRunning(int countryID) throws
ConnectionException,SQLException,InvalidGroupException{
		boolean backupRunning = false;
//		this.countryID = ContextServlet.getApplParameter("countryID");
//	07ckw del	if (!(new
DealerGroupRecord(siteID,countryID)).getParent().equals("7") &&  !(new
DealerGroupRecord(siteID,countryID)).getParent().equals("113"))
//07ckw ins start
if ((new DealerGroupRecord(siteID,countryID)).getParent().equals("1065"))		{
//07ckw ins end
			try
			{
				PartsalesConnection dealerConnection = new
PartsalesConnection(this,"dealerlink");
				PickRecord pr = PickRecord.read("0","ERABACKUP","CONTROL.BACKUP",
"1", "R",dealerConnection,this.getStoreNum());
				if (pr.getPickRecord().equalsIgnoreCase("Y")){
					backupRunning = true;
				}
			}catch(ConnectionException ce){};
			
		}

		return backupRunning;

	}
		
}

Is anyone able to decipher this for me?????
0
1/8/2004 10:19:27 PM
comp.lang.java.programmer 52714 articles. 1 followers. Post Follow

3 Replies
1075 Views

Similar Articles

[PageSpeed] 35

public class RemoteSiteRecord implements Serializable {...} should work

--

____________

http://reader.imagero.com the best java image reader.


0
spam381 (211)
1/8/2004 10:44:06 PM
Shannon wrote:

> java.io.WriteAbortedException: writing aborted;
> java.io.NotSerializableException:
> com.reynolds.partsalesSharedUtilities.RemoteSite.RemoteSiteRecord
....
> public class RemoteSiteRecord {
....
> Is anyone able to decipher this for me?????

	Yes.  The RemoteSiteRecord class isn't implementing Serializable, which 
is necessary for Java to serialize an object.  Change the class 
statement for RemoteSiteRecord to:

	public class RemoteSiteRecord implements java.io.Serializable {

	Recompile and try again, and it should work.  HTH!

Brad BARCLAY

-- 
=-=-=-=-=-=-=-=-=
 From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project:  http://www.jsyncmanager.org

0
bbarclay (167)
1/9/2004 1:42:11 AM
I guess my next question is why is it trying to write this away to the
file system.  We are using cookies in the programming to handle
session management so are not concerned with letting Tomcat handle
this.  Unfortunately the java guru who set it up is on leave and cam
to us to assist in operations and ran this new machine up obviously
with this turned on.  How do I turn it off?

We are using Tomcat 4.1.24.

Regards
Shannon
0
1/9/2004 5:18:31 AM
Reply:

Similar Artilces:

cast java.io.PushbackReader to java.io.Reader?
Hi all, I have a function in Matlab that makes a database call and returns a java.io.Reader instance. Matlab seems to automatically convert this to a PushbackReader. Is there a way to force it to remain as just a Reader, or cast it to a Reader after the fact? Here's what it looks like: try xmlReader = myDBClient.read(java.lang.String(myXMLDocumentIdentifierString)) ... catch display([lasterr]); end result: xmlReader 1x1 java.io.PushbackReader where DBClient.read() signature is: public Reader read(String xmlDocumentIdentifier) {} The XML document identifier i...

java.io.FileReader and java.io.FileWriter encoding
Hi, I recently changed the hosting for my website (from Linux to Linux) and now I'm experiencing some trouble with java.io.FileReader and java.io.FileWriter: their getEncoding() method returns ASCII (returned ISO8859_1 on the previuos host). I've set -Dfile.encoding=ISO-8859-1 but nothing has changed, except that javax.mail.internet.MimeUtility.getDefaultJavaCharset() effectively returns ISO-8859-1. Does anyone know how the default encoding is selected? I report some system properties: file.encoding.pkg: sun.io user.country: US java.runtime.version: 1.4.2_04-b05 os.version: 2...

java.io.File to java.lang.String
What's the best way to get the contents of a file represented by ajava.io.File object into a String? Benjamin wrote:> What's the best way to get the contents of a file represented by a> java.io.File object into a String?> You don't specify what you consider best so how about simple as best? Now for my curiosity, why would you want to do this?import java.io.*;public class test { public static void main(String[] args) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); File f = new File(args[0]); FileInputStream fis = new ...

Java in Java
Is it possible to download a Java app (applet etc?) and run it inside a desktop Java app? -- Dirk http://www.transcendence.me.uk/ - Transcendence UK http://www.theconsensus.org/ - A UK political party http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff Dirk Bruere at NeoPax wrote: > Is it possible to download a Java app (applet etc?) and run it inside a > desktop Java app? > Quite likely, but you won't necessarily get the same security model, unless you were careful about it. -- Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/&g...

Java Java
Have my first Open Source Linux Java Project. Working on a second right now. Coming out with a distro called OPEN*WINDOWS. It will be at www.black-and-company.com tab wrote: > Have my first Open Source Linux Java Project. > Working on a second right now. > > Coming out with a distro called OPEN*WINDOWS. > > It will be at www.black-and-company.com > Wasn't that the whole point of Lindows? Oh, right, we didn't care for that either. tab wrote: > Have my first Open Source Linux Java Project. > Working on a second right now. > > Coming out with a ...

How do I fix: "Incompatible type for constructor. Can't convert java.io.InputStream to java.io.Reader."
Hi, First, let me state "I am not a Java programmer.", but I need to write a Java stored procedure for use in an Oracle database instance. The code fragment I am having issues with is: Process p = Runtime.getRuntime().exec(cmd); BufferedReader r = new BufferedReader(p.getInputStream()); I have tried to understand the class hierarchy on java.sun.com, but I am lost. Can someone lend a hand, or point me to a source which will explain this to me? Thanks so much for your time. rr Ron Reidy wrote: > Hi, > > First, let me state "I am not a Java programmer.", but I need to write > a Java stored procedure for use in an Oracle database instance. The > code fragment I am having issues with is: > > Process p = Runtime.getRuntime().exec(cmd); > BufferedReader r = new BufferedReader(p.getInputStream()); > > I have tried to understand the class hierarchy on java.sun.com, but I > am lost. Can someone lend a hand, or point me to a source which will > explain this to me? > > Thanks so much for your time. > > rr A BufferedReader only wraps round a Reader (not an InputStream). So you need to wrap your InputStream in an InputStreamReader, and then wrap that with a BufferedReader. Like this: BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); Steve ...

Charset names in java.io and java.nio
Hi guys, Why is character set Cp1047 known in java.io but not in java.nio.charset.Charset? Enclosed nio and io examples illustrate what I mean. Cheers, Vince NIO EXAMPLE public class NioTest { public static void main( String[] args) throws Exception { java.nio.charset.Charset.forName("Cp1047"); } } COMMENTS An exception is thrown: Exception in thread "main" java.nio.charset.UnsupportedCharsetException: Cp1047 at java.nio.charset.Charset.forName(Charset.java:486) at NioTest.main(NioTest.java:3) IO EXAMPLE import java.io.InputStreamReade...

java error message java.io not found in import
Hi i'm trying to run a code like but i'm getting all the time the same error Class java.io not found in import import Java.io i guess the problem is that i dont have the header in the include folder,doenst anyone have solution for me? thread wrote: > Hi i'm trying to run a code like but i'm getting all the time the same > error > Class java.io not found in import > import Java.io 1. Capitalization matters. The package name is `java.io', not `Java.io' 2. The first-person subjective pronoun is `I', not `i'. 3. There is no class `java.io'; there is a package `java.io' which contains such useful classes as Reader or Writer... Perhaps you wanted to import all of java.io, in which case the syntax is `import java.io.*' -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth On May 15, 9:55=A0pm, thread <yaniv...@gmail.com> wrote: > ...i'm trying to run a code like but i'm getting all the time the same > error > Class java.io not found in import > import Java.io > > i guess the problem is that i dont have the header in the include > folder,doenst anyone have solution for me? Try starting here(1) and here(2) (1) <http://pscode.org/javafaq.html#exact> (2) <http://pscode.org/sscce.html> For example, this is an SSCCE.. <SSCCE> import java.io; class TestCompile { } </SSCCE> ...and here is the *exact* error message &l...

java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method) at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245) at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) Thanks in advance, Ganesh Majji ganesh.m@gmail.com wrote: > I am new to DB2. I am getting this error while loading the DB2Driver. I > don't have any idea about where i might have gone wrong. please help > me. Unfortunately my crystal bowl stays dark because you didn't mentioned your operating system and which DB2 version you're using. For Windows, *nix and OS/2 please ensure that your application is using the db2java.zip from SQLLIB\java. Check if there are multiple db2jdbc.dll on your system, remove any extra db2jdbc.dll files on the system. Ensure that you can connect to DB2 with the DB2 workstation tools from your machine. sorry for not mentioning the system details. Operation System is SunOS (Solaris) and DB2 SDK 8.2.2 Thank you very much for the kind response, Ganesh Bernd Hohmann wrote: > ganesh.m@gmail...

Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
Hi, Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please put YES or NO as the first word in your reply. Add comments after it if you wish. I'll make a YES/NO count after some time. Kind regards, Paka Paka Small wrote: > Poll: Is a Java Method an Instance of the Java Class > java.lang.reflect.Method? It's not subject to vote. It's defined by the language. You might as well ask, "Is 'int' a primitive or a reference type?". Your vote will not change reality. > Please put YES or NO as the first word in your reply. Add comments > after it if you wish. > > I'll make a YES/NO count after some time. And what exactly do you hope to accomplish by this exercise? Distinguish who knows Java from those who don't? A method is not a class, and a class is not a method. That's reality in Java. The law of gravity is not subject to repeal by opinion, and neither is this. Instead of wasting your time and trying to waste ours conducting meaningless polls, why don't you read the material linked upthread and learn the truth for yourself? Learn the truth and it will set you free, or at least keep you from making errors like claiming that methods and classes are the same in Java. -- Lew On 5 feb, 20:38, Lew <lewbl...@gmail.com> wrote: > Paka Small wrote: > > Poll: Is a Java Method an Instance of the Java Class > > java.lang.reflect.Method? > > It's not sub...

java.security.AccessControlException: access denied (java.io.FilePermission background.jpg read)
I am extremely new to java and this is the first I've worked with applets, so any help will be appreciated but I stress that I am new but very capable. I have looked on many message boards but I don't understand most of what they are talking of. I have written a simple Breakout game and would like to put it on a web page. However, when I load the web page I get an error that the applet failed to load and here is the message: java.security.AccessControlException: access denied (java.io.FilePermission background.jpg read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkRead(Unknown Source) at sun.awt.SunToolkit.getImageFromHash(Unknown Source) at sun.awt.SunToolkit.getImage(Unknown Source) at javax.swing.ImageIcon.<init>(Unknown Source) at javax.swing.ImageIcon.<init>(Unknown Source) at GraphicsPanel.loadImageFromFile(GraphicsPanel.java:34) at GraphicsPanel.<init>(GraphicsPanel.java:23) at Breakout.<init>(Breakout.java:111) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang....

Compiling Java from Java
I wish to write a Java program which can compile and run java source code. Can this be done without resorting to OS-specific calls to javac? I've seen suggestions that Ant might allow me to do this, but I've looking through the Ant manual, I can't see anything about it. Any hints? Malcolm Malcolm Ryan wrote: > I wish to write a Java program which can compile and run java source > code. Can this be done without resorting to OS-specific calls to javac? > I've seen suggestions that Ant might allow me to do this, but I've > looking through the Ant manual, I can&#...

Substituting Java API classes for enhanced functionality (e.g. java.io.File)
Hi, I have written a substitute for some java.io.* classes. My classes treat ZIP or JAR files exactly like directories, so that you can e.g. list ZIP files and arbitrarily read or write or delete their entries. My substitutes have the same name as in the java.io package, but live in their own package (e.g. de.schlichtherle.io.File instead of java.io.File). This provides 98% source code compatibility - most of the time a simple import statement at the top of a using class is enough to use the new functionality. To achieve 100% compatibility I would like to provide a modified classloader...

Help java.io.NotSerializableException
This is a multi-part message in MIME format. ------=_NextPart_000_0042_01C9E496.6C3B4220 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I'm creating a project (a game) for the university ... but I am in = trouble with the management of files (for now, the save). I still have this exception "java.io.NotSerializableException". I tried to put anything as a parameter ... but nothing. To give you an example: the class crossfire.Orco contains various = attributes and methods inside ... I would not want this to be the =...

java.lang.Set with elements of type java.lang.Set
Roughly I do something along the lines of: Set set = new HashSet(); Set elem = new HashSet(); set.add(elem); // now we change the elem and add it again to the set elem.add(some object here); set.add(elem); I found out the hard way that 'set' may now contain 'elem' either once or twice, the reason being that 'elem.add()' changes the hashCode of elem such that it is not noticed that it is in 'set' already on the 2nd 'set.add()'. Question: What I would actually want is an IdentityHashSet() set = new IdentityHashSet() but this does not...

java.lang vs java.util
Surprising to see something defined in java.lang <http://developer.android.com/reference/java/lang/Iterable.html> depend on something defined in java.util <http://developer.android.com/reference/java/util/Iterator.html>. Surely the hierarchy should go the other way? On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: > Surprising to see something defined in java.lang > <http://developer.android.com/reference/java/lang/Iterable.html> depend on > something defined in java.util > <http://developer.android.com/reference/java/util/Iterator.html>. > > Surely the hierarchy should go the other way? I think Iterable may make it into java.lang because of its significance in the foreach statement. Patricia On 04/02/2011 12:23 AM, Patricia Shanahan wrote: > On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: >> Surprising to see something defined in java.lang >> <http://developer.android.com/reference/java/lang/Iterable.html> depend on >> something defined in java.util >> <http://developer.android.com/reference/java/util/Iterator.html>. >> >> Surely the hierarchy should go the other way? Not if it wants to be consistent with http://download.oracle.com/javase/6/docs/api/ don't'cha think? And the so-called "hierarchy" of java.util and java.lang is that they are equal. The language reserves for itself the entire panoply of java.* and javax.* packages. > I think It...

java.security.AccessControlException: access denied (java.io.FilePermission background.jpg read) #2
I am extremely new to java and this is the first I've worked with applets, so any help will be appreciated but I stress that I am new but very capable. I have looked on many message boards but I don't understand most of what they are talking of. I have written a simple Breakout game and would like to put it on a web page. However, when I load the web page I get an error that the applet failed to load and here is the message: java.security.AccessControlException: access denied (java.io.FilePermission background.jpg read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkRead(Unknown Source) at sun.awt.SunToolkit.getImageFromHash(Unknown Source) at sun.awt.SunToolkit.getImage(Unknown Source) at javax.swing.ImageIcon.<init>(Unknown Source) at javax.swing.ImageIcon.<init>(Unknown Source) at GraphicsPanel.loadImageFromFile(GraphicsPanel.java:34) at GraphicsPanel.<init>(GraphicsPanel.java:23) at Breakout.<init>(Breakout.java:111) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang....

to use import java.lang.* or import java.lang.Math or none at all?
Hi guys, i knew that by default all java.lang classes will be imported by the compiler during compilation. but, to make it easier for the computer, should i specify which class i really will be using? does this action will boost the performance during compilation and runtime or not a matter at all? the answer to this post will definitely affect my programming style in the future when i'm considering "to import or not to import"... hmm,,, thanks in advance. JPractitioner wrote: > i knew that by default all java.lang classes will be imported by the > compiler during compilation. but, to make it easier for the computer, > should i specify which class i really will be using? does this action > will boost the performance during compilation and runtime or not a > matter at all? Whether and how you import classes has exactly zero effect at runtime. Imports (with or without wildcards) are only a kind of abbreviation provided by the compiler to save us the effort of typing in fully-qualified type names every time. In theory explicit importing should make compilation faster -- by a very tiny amount. I've never heard anyone claim that they've even managed to measure a difference let alone found a case where it made a practical difference. So the question comes down to how to write your code for maximum clarity. One school of thought asserts that you should always import each class explicitly (rather than by a wildcard). There's a fai...

Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Good day to all, I have installed the j2se/netbeans binary bundle on red hat 9. I can run everything perfectly as root but when I try to compile with any other user I get: Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object When I saw this it seemed like a permissions problem but I checked the permissions and everything seemed fine. All users have execute permissions of javac and java. I have read other threads dealing with the same or similar problem but have not reached any solution yet. I would appreciate if anyone that has run into this type of problem and has solved it if he/she could give me a hand or if anyone could just point out what I should be looking for in this type of problem. Thanks in advance... gek ...

java.lang.IllegalStateException: No Java compiler available
tearing my hair out on this one.Thuis started as an upgrade issue till i realised that my un-usedtomcat5 installation didn't work either with my test jsp.I have, in desparation, un-installed all java / tomcat libs and re-installed only those required to get thetomcat6-6.0.14-1jpp.noarch.rpm (and the band-waggon) loadedfirst I installed java_app_platform_sdk-5_02-linux.binthis shows (after I set alternatives to point to the /opt/SDK/jdkdirecrtory)[root@squirrel ~]# javac -versionjavac 1.6.0java shows the same.I have set the following in profileCLASSPATH=$JDKHOME:$JDKHOME/lib/tools.jarJAVA_H...

Certified Java Programmer (Sun Java 2)
I'm very interested in Java, and I would very much like to work with Java as a professional programmer. I have a degree as an electronics engineer (from 1996), but unfortunately, I can't get a job as a programmer with this diploma, because it is to old, and courses in modern OOP are missing. What should I do to get a Certificate as a Java (2) programmer? -I've heard that Sun Microsystems have examination as "Sun Certified Java 2 Programmer" and "Sun Certified Java 2 Developer". I think, that I could study Java 2 at home with my own computer (With Suns Java 2 S...

CheckBox in Column of JTable: Exception: java.lang.String cannot be cast to java.lang.Boolean
Hello, I have discovered a hidden error. My project was working for awhile, but then I started to get the below error. My error comes from the fact that I'm using a checkbox in a jtable, and I'm using the below "getColumnClass". Thank you, compile: run: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at javax.swing.JTable$BooleanRenderer.getTableCellRendererComponent(JTable.java:5412) at javax.swing.JTable.prepareRenderer(JTable.java:5735) at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2114) at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:2016) at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1812) at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161) at javax.swing.JComponent.paintComponent(JComponent.java:778) at javax.swing.JComponent.paint(JComponent.java:1054) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5221) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1482) at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1413) at javax.swing.RepaintManager.paint(RepaintManager.java:1206) at javax.swing.JComponent._paintImmediately(JComponent.java:5169) at javax.swing.JComponent.paintImmediately(JComponent.java:4980) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:770) at javax.swing.RepaintM...

java.lang.UnsatisfiedLinkError: no lsxbe in java.library.path
Hello i got following exception: java.lang.UnsatisfiedLinkError: no lsxbe in java.library.path My source code looks like the examples of the Notes homepage. import lotus.domino.*; public class Main extends NotesThread{ public static void main(String argv[]){ System.err.println(System.getProperty("java.library.path")); // System.load("C:/Programme/lotus/notes/lsxbe.dll"); Main t = new Main(); t.start(); } public void runNotes(){ try{ Session s = NotesFactory.createSession("localhost&qu...

java.lang.OutOfMemoryError: Java heap space #2
Does anyone have any ideas on why that happened: [java] Exception in thread "main" java.lang.OutOfMemoryError: Java heap space Explaining the situation. I have such code: for (int i=0; i<10000-1; i++) { for (int j=i+1; j<10000; j++) { compareElements(arr[i], arr[j]); } } Element of the array is a simple class that has two fields (one is string and another is BitVector) and getters and setters for those fields. Function compareElements compares the BitVectors of two elements. Now the problem: when I run the code, program runs only till then 1334 element in t...

Web resources about - java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: - comp.lang.java.programmer

Resources last updated: 3/13/2016 4:50:09 AM