Results 1 to 4 of 4
- 08-20-2011, 08:49 PM #1
Member
- Join Date
- Aug 2011
- Posts
- 2
- Rep Power
- 0
java.lang.ArrayIndexOutOfBoundsException: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at com.ibm.crm.rtuu.adapter.refdata.RTUUOpportunityCa tegory.processOpportunityCategory(RTUUOpportunityC ategory.java:5300)
at com.ibm.crm.rtuu.adapter.refdata.RTUUStartOpportun ityCategory.startOpportunityCategory(RTUUStartOppo rtunityCategory.java:57)
at com.ibm.crm.rtuu.adapter.utilities.twoMain.callOpp tyCategory(twoMain.java:117)
at com.ibm.crm.rtuu.adapter.utilities.twoMain.main(tw oMain.java:65)
An unexpected error occurred.
plz provide me some solution..





- 08-20-2011, 09:00 PM #2
Member
- Join Date
- Aug 2011
- Posts
- 11
- Rep Power
- 0
plz provide me some code..






- 08-20-2011, 09:11 PM #3
Member
- Join Date
- Aug 2011
- Posts
- 2
- Rep Power
- 0
while (iniLine != null) {
// The refdata file uses the ~ as a delimiter
pArray = iniLine.split("~");
// Extract from the record only the fields required for the
// Opportunity Category
RECORD_TYPE = pArray[0];
ROW_ID = pArray[1];
LOV_VAL = pArray[4];
LOV_NAME = pArray[5];
PAR_VAL = pArray[12];
PAR_NAME = pArray[21];
LOV_OLD_VAL = pArray[22];
LOV_OLD_NAME = pArray[23];
GPAR_VAL = pArray[31];
GGPAR_VAL = pArray[34];
LOV_OLD_PAR_VAL = pArray[24];
System.out.println("****************************** ***************************");
System.out.println("Printing the Oppty Category records in the xsrrefdata.txt");
System.out.println("****************************** ***************************");
else if (pArray[0].equals("Inactivate")
&& !(pArray[4].equals(""))
&& !(pArray[5].equals("")))
{
System.out.println("PAR_NAME = (" + PAR_NAME + ")");
Connection rtuucon = null;
Properties pfile = new Properties();
RTUULoadProperties lpfile = new RTUULoadProperties();
StringBuffer sqlStringLOV = new StringBuffer(
500);
StringBuffer sqlStringGPP = new StringBuffer(
500);
StringBuffer sqlStringGPP1 = new StringBuffer(
500);
StringBuffer sqlStringGPP_Remap = new StringBuffer(
500);
try {
RTUUDBConnect rtudb = new RTUUDBConnect();
pfile = lpfile.loadPropertiesFile(msgLog);
rtuucon = rtudb
.connectToRTUU(pfile, msgLog);
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
String driverName = pfile
.getProperty("DBDriver");
String urlGPP = pfile
.getProperty("DBUrlPrefix")
+ pfile.getProperty("SiebelDBNameEM");
String user_GPP = pfile
.getProperty("SiebelDBUserIdEM");
String pwd_GPP = pfile
.getProperty("SiebelDBPasswordEM");
// Connect to GPP reporting
try {
Class.forName(driverName);
System.out.println("Driver Registered");
} catch (Exception e) {
System.out
.println("Could not register driver.");
System.exit(0);
}
System.out.println("RECORD_TYPE = ("
+ RECORD_TYPE + ")");
System.out.println("LOV_VAL = (" + LOV_VAL
+ ")");
System.out.println("LOV_NAME = (" + LOV_NAME
+ ")");
System.out.println("PAR_VAL = (" + PAR_VAL
+ ")");
System.out.println("PAR_NAME = (" + PAR_NAME
+ ")");
System.out.println("LOV_OLD_VAL = ("
+ LOV_OLD_VAL + ")");
System.out.println("LOV_OLD_NAME = ("
+ LOV_OLD_NAME + ")");
System.out.println("GPAR_VAL = (" + GPAR_VAL
+ ")");
System.out.println("GGPAR_VAL = (" + GGPAR_VAL
+ ")");
System.out.println("LOV_OLD_PAR_VAL = ("
+ LOV_OLD_PAR_VAL + ")");
String tempVardel = "";
String tempVardel1 = "";
tempVardel = LOV_OLD_NAME + ":" + LOV_OLD_VAL;
tempVardel1 = LOV_OLD_NAME + ":" + LOV_OLD_VAL;
tempVardel= tempVardel.replaceAll("'s","/'s");
tempVardel = tempVardel.replaceAll("&","/&");
tempVardel = tempVardel.replaceAll("_","/_");
tempVardel1= tempVardel1.replaceAll("'s","/'s");
tempVardel1 = tempVardel1.replaceAll("&","/&");
tempVardel1 = tempVardel1.replaceAll("_","/_");
try {
Connection conGPP = DriverManager
.getConnection(urlGPP, user_GPP,
pwd_GPP);
thisMsg = "Connected to GPP ";
logMsg.writeIt(thisMsg);
msgLog.logInformation("RTUU109E",
"RTUUOpportunitycategory",
"processOpportunityCategory",
thisMsg);
System.out.println(thisMsg);
System.out.println("Connected to GPP");
String queryStringremap_gpp = "select name from SIEBEL.S_CHRCTR where (NAME like '"
+ tempVardel + "') with ur";
System.out.println("parent query is = " + queryStringremap_gpp);
String queryStringremap_gpp1 = "select name from SIEBEL.S_CHRCTR_VAL where NAME like '"
+ tempVardel1 + "' with ur";
System.out.println("child query is = " + queryStringremap_gpp1);
// System.out.println("query is = " +
// selectNAME);
//Statement and Resultset created
String Tempname = "";
Statement st = conGPP.createStatement();
ResultSet rsGPP = st.executeQuery(queryStringremap_gpp);
Statement st1 = conGPP.createStatement();
ResultSet rsGPP1 = st1.executeQuery(queryStringremap_gpp1);
if (PAR_NAME.trim().length() == 0)
{
if(LOV_OLD_NAME.length()>8 || tempVardel.length()>50)
{
System.out.println(LOV_OLD_NAME + "\t" +" Exceeded the max length of 8"+"\t"+"or"+"\t"+ tempVardel+"\t"+"Exceeded the max length in S_CHRCTR table");
out.write(LOV_OLD_NAME + "\t" +"Exceeded the max length of 8"+"\t"+ "or"+"\t"+tempVardel+"\t"+"Exceeded the max length in S_CHRCTR table");
out.newLine();
}
else
{
if ((rsGPP != null) && rsGPP.next())
{
System.out.println("Resultset of GPP is not null so processing for parent ");
Tempname = rsGPP.getString(1);
System.out.println("parent name is rsGPP.getString(1) = " + Tempname);
//X_DELETE_FLG = rsGPP.getString(2);
/*System.out
.println("rsGPP.getString(2) = "
+ rsGPP.getString(2));*/
//System.out.println("X_DELETE_FLG = "
// + X_DELETE_FLG);
//if (X_DELETE_FLG.equals("N"))
//{
System.out.println(Tempname +"\t"+ "Delete Remap"+"\t"+"Sending for input file processing");
//out.write(Tempname + "Sending for input file processing ");
//out.newLine();
//processing
// get properties from AdapterProperties file
Connection rtuucon1 = null;
Properties pfile1 = new Properties();
RTUULoadProperties lpfile1 = new RTUULoadProperties();
try {
RTUUDBConnect rtudb = new RTUUDBConnect();
pfile1 = lpfile1.loadPropertiesFile(msgLog);
rtuucon1 = rtudb
.connectToRTUU(pfile1, msgLog);
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
String driverNamea = pfile1
.getProperty("DBDriver");
String urlGPPa = pfile1
.getProperty("DBUrlPrefix")
+ pfile1.getProperty("SiebelDBNameEM");
String user_GPPa = pfile1
.getProperty("SiebelDBUserIdEM");
String pwd_GPPa = pfile1
.getProperty("SiebelDBPasswordEM");
// Connect to GPP reporting
try {
Class.forName(driverNamea);
System.out.println("Driver Registered");
} catch (Exception e) {
System.out
.println("Could not register driver.");
System.exit(0);
}
System.out.println("RECORD_TYPE = ("
+ RECORD_TYPE + ")");
System.out.println("LOV_VAL = (" + LOV_VAL
+ ")");
System.out.println("LOV_NAME = (" + LOV_NAME
+ ")");
System.out.println("PAR_VAL = (" + PAR_VAL
+ ")");
System.out.println("PAR_NAME = (" + PAR_NAME
+ ")");
System.out.println("LOV_OLD_VAL = ("
+ LOV_OLD_VAL + ")");
System.out.println("LOV_OLD_NAME = ("
+ LOV_OLD_NAME + ")");
System.out.println("GPAR_VAL = (" + GPAR_VAL
+ ")");
System.out.println("GGPAR_VAL = (" + GGPAR_VAL
+ ")");
System.out.println("LOV_OLD_PAR_VAL = ("
+ LOV_OLD_PAR_VAL + ")");
try {
outputLine = LOV_OLD_NAME + ":" + LOV_OLD_VAL + delim;
String tempVar = LOV_OLD_NAME + ":" + LOV_OLD_VAL;
String delimiter = ";";
String[] temp;
String temp1;
temp = LOV_NAME.split(delimiter);
temp1 = "'" + temp[0] + ":" + "%" + "'";
String LOVVAL = "";
System.out.println("value of temp 1 is== "+temp1);
if(temp.length>1)
LOVVAL = temp[1]+ ":" + LOV_VAL;
else
LOVVAL = "";
Connection conGPPa = DriverManager
.getConnection(urlGPPa, user_GPPa,
pwd_GPPa);
thisMsg = "Connected to GPP ";
logMsg.writeIt(thisMsg);
msgLog.logInformation("RTUU109E",
"RTUUOpportunitycategory",
"processOpportunityCategory",
thisMsg);
System.out.println(thisMsg);
System.out.println("Connected to GPP");
int pass1 = 0;
String sqlStringLOVaremap = "select name from SIEBEL.S_CHRCTR where (NAME like "
+ temp1+ ") with ur";
System.out.println("sqlStringLOVaremap is = " + sqlStringLOVaremap);
Statement stremap = conGPPa.createStatement();
//resultset
ResultSet rsLOV = stremap.executeQuery(sqlStringLOVaremap);
if (rsLOV.next()) {
LOVNAME = rsLOV.getString(1);
System.out
.println("rsLOV.getString(1) = "
+ rsLOV.getString(1));
System.out.println("LOVNAME = "
+ LOVNAME);
}
rsLOV.close();
String sqlStringGPPa = "select X_DELETE_FLG from SIEBEL.S_CHRCTR where (NAME like '"
+ tempVar+ "') with ur";
System.out.println("sqlStringGPPa is = " + sqlStringGPPa);
Statement stremap1 = conGPPa.createStatement();
//resultset
ResultSet rsGPPa = stremap1.executeQuery(sqlStringGPPa);
if (rsGPPa.next()) {
X_DELETE_FLG = rsGPPa.getString(1);
System.out
.println("rsGPPa.getString(1) = "
+ rsGPPa.getString(1));
System.out.println("X_DELETE_FLG = "
+ X_DELETE_FLG);
}
rsGPPa.close();
X_DELETE_FLG = "Y";
outputLine = outputLine + ""
+ LOVNAME + delim
+ X_DELETE_FLG ;
rowCounter_remap++;
logout_remap.write(outputLine);
System.out
.println("Writing this record "
+ outputLine
+ " to File "
+ outputFileRemap);
logout_remap.newLine();
} catch (SQLException sqlException) {
sqlException.printStackTrace();
System.err
.println("Failed to prepare statement:\n\t");
System.err
.println("Processing cannot continue.");
System.exit(-1);
} catch (Exception e) {
e.printStackTrace();
System.err
.println("An unexpected error occurred.");
System.err
.println("Processing cannot continue.");
System.exit(-1);
}
//} //
/*else{
System.out.println("Record already exists in database");
out.write("Record already exists in database"+Tempname);
out.newLine();
}*/
}
else{
System.out.println(Tempname + "\t"+"GPP Delete Remap Record"+"\t"+"Record does not exists in S_CHRCTR table");
out.write(Tempname + "\t"+"GPP Delete Remap Record"+"\t"+"Record does not exists in S_CHRCTR table");
out.newLine();
}
}
}
else
{
if(PAR_NAME.length()>8||LOV_OLD_NAME.length()>8 || tempVar.length()>100|| tempVar1.length()>100)
{
System.out.println(LOV_OLD_NAME + "\t" +" Exceeded the max length of 8"+"\t"+"or"+"\t"+ "name"+"\t"+"Exceeded the max length in S_CHRCTR_VAL table");
out.write(LOV_OLD_NAME + "\t" +"Exceeded the max length of 8"+"\t"+ "or"+"\t"+"name"+"\t"+"Exceeded the max length in S_CHRCTR_VAL table");
out.newLine();
}
else
{
if ((rsGPP1 != null) && rsGPP1.next())
{
outputLine = PAR_NAME + ":" + LOV_OLD_PAR_VAL
+ delim + LOV_OLD_NAME + ":"
+ LOV_OLD_VAL + delim;
System.out.println( "IN child processing");
Tempname = rsGPP1.getString(1);
System.out.println("rsGPP1.getString(1) = " + rsGPP1.getString(1));
System.out.println("Tempname = " + Tempname);
//X_DELETE_FLG = rsGPP1.getString(2);
//System.out
//.println("rsGPP1.getString(2) = "
//+ rsGPP1.getString(2));
//System.out.println("X_DELETE_FLG = "
//+ X_DELETE_FLG);
//if (X_DELETE_FLG.equals("N"))
//{
System.out.println(Tempname + "Sending for input file processing");
out.write(Tempname + "Sending for input file processing ");
out.newLine();
//processing
//get properties from AdapterProperties file
Connection rtuucona = null;
Properties pfilea = new Properties();
RTUULoadProperties lpfilea = new RTUULoadProperties();
try {
RTUUDBConnect rtudb = new RTUUDBConnect();
pfilea = lpfilea.loadPropertiesFile(msgLog);
rtuucona = rtudb
.connectToRTUU(pfilea, msgLog);
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
String driverNamea = pfilea
.getProperty("DBDriver");
String urlGPPa = pfilea
.getProperty("DBUrlPrefix")
+ pfilea.getProperty("SiebelDBNameEM");
String user_GPPa = pfilea
.getProperty("SiebelDBUserIdEM");
String pwd_GPPa = pfilea
.getProperty("SiebelDBPasswordEM");
// Connect to GPP reporting
try {
Class.forName(driverNamea);
System.out.println("Driver Registered");
} catch (Exception e) {
System.out
.println("Could not register driver.");
System.exit(0);
}
System.out.println("RECORD_TYPE = ("
+ RECORD_TYPE + ")");
System.out.println("LOV_VAL = (" + LOV_VAL
+ ")");
System.out.println("LOV_NAME = (" + LOV_NAME
+ ")");
System.out.println("PAR_VAL = (" + PAR_VAL
+ ")");
System.out.println("PAR_NAME = (" + PAR_NAME
+ ")");
System.out.println("LOV_OLD_VAL = ("
+ LOV_OLD_VAL + ")");
System.out.println("LOV_OLD_NAME = ("
+ LOV_OLD_NAME + ")");
System.out.println("GPAR_VAL = (" + GPAR_VAL
+ ")");
System.out.println("GGPAR_VAL = (" + GGPAR_VAL
+ ")");
System.out.println("LOV_OLD_PAR_VAL = ("
+ LOV_OLD_PAR_VAL + ")");
if (PAR_NAME.trim().length() != 0)
{
tempVar = PAR_NAME + ":" + LOV_OLD_PAR_VAL;
tempVar1 = LOV_OLD_NAME + ":" + LOV_OLD_VAL;
}
tempVar= tempVar.replaceAll("'s","/'s");
tempVar = tempVar.replaceAll("&","/&");
tempVar = tempVar.replaceAll("_","/_");
tempVar1= tempVar1.replaceAll("'s","/'s");
tempVar1 = tempVar1.replaceAll("&","/&");
tempVar1 = tempVar1.replaceAll("_","/_");
System.out.println("tempVar value =" +tempVar);
System.out.println("tempVar1 value =" +tempVar1);
try {
String delimiter = ";";
String[] temp;
String temp1;
temp = LOV_NAME.split(delimiter);
temp1 = "'" + temp[0] + ":" + "%" + "'";
String LOVVAL = "";
if(temp.length>1)
LOVVAL = temp[1] + ":" + LOV_VAL;
else
LOVVAL = "";
System.out.println("temp[1] value =" +temp[1]);
System.out.println("LOV_VAL value =" +LOV_VAL);
System.out.println("LOVVAL value =" +LOVVAL);
Connection conGPPa = DriverManager
.getConnection(urlGPPa, user_GPPa,
pwd_GPPa);
thisMsg = "Connected to GPP ";
logMsg.writeIt(thisMsg);
msgLog.logInformation("RTUU109E",
"RTUUOpportunitycategory",
"processOpportunityCategory",
thisMsg);
System.out.println(thisMsg);
System.out.println("Connected to GPP");
int pass1 = 0;
String sqlStringLOVaremap = "select name from SIEBEL.S_CHRCTR where (NAME like "
+ temp1+ ") with ur";
System.out.println("sqlStringLOVaremap is = " + sqlStringLOVaremap);
Statement stremap = conGPPa.createStatement();
//resultset
ResultSet rsLOV = stremap.executeQuery(sqlStringLOVaremap);
if (rsLOV.next()) {
LOVNAME = rsLOV.getString(1);
System.out
.println("rsLOV.getString(1) = "
+ rsLOV.getString(1));
System.out.println("LOVNAME = "
+ LOVNAME);
}
rsLOV.close();
String sqlStringGPPa = "select X_DELETE_FLG from SIEBEL.S_CHRCTR where (NAME like '"
+ tempVar+ "') with ur";
System.out.println("sqlStringGPPa is = " + sqlStringGPPa);
Statement stremap1 = conGPPa.createStatement();
//resultset
ResultSet rsGPPa = stremap1.executeQuery(sqlStringGPPa);
if (rsGPPa.next()) {
X_DELETE_FLG = rsGPPa.getString(1);
System.out
.println("rsGPPa.getString(1) = "
+ rsGPPa.getString(1));
System.out.println("X_DELETE_FLG = "
+ X_DELETE_FLG);
pass1 = 1;
}
rsGPPa.close();
String sqlStringGPP_Remapa = "select X_DELETE_FLG from SIEBEL.S_CHRCTR_VAL where (NAME like '"
+ tempVar1+ "') with ur";
System.out.println("sqlStringGPP_Remapa is = " + sqlStringGPP_Remapa);
Statement stremap2 = conGPPa.createStatement();
//resultset
ResultSet rsGPP_Remap = stremap2.executeQuery(sqlStringGPP_Remapa);
if (pass1 == 1 && rsGPP_Remap.next()) {
X_DELETE_FLG1 = rsGPP_Remap
.getString(1);
System.out
.println("rsGPP_Remap.getString(1) = "
+ rsGPP_Remap
.getString(1));
System.out.println("X_DELETE_FLG1 = "
+ X_DELETE_FLG1);
if (X_DELETE_FLG.equals("N")) {
X_DELETE_FLG = "Y";
} else {
X_DELETE_FLG = "N";
}
if (X_DELETE_FLG1.equals("N")) {
X_DELETE_FLG1 = "Y";
} else {
X_DELETE_FLG1 = "Y";
}
outputLine = outputLine
+ LOVNAME + delim + LOVVAL + delim
+ X_DELETE_FLG + delim
+ X_DELETE_FLG1;
rowCounter_remap++;
logout_remap.write(outputLine);
System.out
.println("Writing this record "
+ outputLine
+ " to File "
+ outputFileRemap);
logout_remap.newLine();
}
else if (pass1 == 1 && tempVar1.equals(""))
{
if (X_DELETE_FLG.equals("N"))
{
X_DELETE_FLG = "Y";
}
else
{
X_DELETE_FLG = "N";
}
outputLine = outputLine + delim
+ LOVNAME + LOVVAL
+ X_DELETE_FLG + delim + "";
rowCounter_remap++;
logout_remap.write(outputLine);
System.out
.println("Writing this record "
+ outputLine
+ " to File "
+ outputFileRemap);
logout_remap.newLine();
}
rsGPP_Remap.close();
conGPP.close();
} catch (SQLException sqlException) {
sqlException.printStackTrace();
System.err
.println("Failed to prepare statement:\n\t");
System.err
.println("Processing cannot continue.");
System.exit(-1);
} catch (Exception e) {
e.printStackTrace();
System.err
.println("An unexpected error occurred.");
System.err
.println("Processing cannot continue.");
System.exit(-1);
}
//}
/*
}*/
}
else{
System.out.println(Tempname + "\t"+"GPP Delete Remap Record"+"\t"+"Record does not exists in S_CHRCTR_VAL table");
out.write(Tempname + "\t"+"GPP Delete Remap Record"+"\t"+"Record does not exists in S_CHRCTR_VAL table");
out.newLine();
}
}
}
}catch (Exception e) {
e.printStackTrace();
System.err
.println("An unexpected error occurred.");
System.err
.println("Processing cannot continue.");
System.exit(-1);
}
} // GPP
-
You are trying to use an empty array at line 5300 of the RTUUOpportunityCategory class which is being called by line 57 of the RTUUStartOpportunityCategory class. You then post a huge amount of unformatted and extremely difficult to read and interpret code without indicating what line the error is falling on. I'm not sure how we can help you with this given the information that you've presented so far. If you still need our help, you'll have to put in some effort to reformulate your question and your code so that it is possible that we can help you. I suggest that you read the links in my signature below on how to ask smart questions, how to use code tags, and how to create an SSCCE.
Similar Threads
-
Java.lang.ArrayIndexOutOfBoundsException:0>=0
By maitoti in forum Advanced JavaReplies: 3Last Post: 04-04-2011, 05:03 AM -
Java.lang.ArrayIndexOutOfBoundsException
By Ladyjest1 in forum New To JavaReplies: 1Last Post: 07-12-2010, 10:11 PM -
java.lang.ArrayIndexOutOfBoundsException
By niteshwar.bhardwaj in forum Java 2DReplies: 0Last Post: 02-13-2009, 07:29 AM -
java.lang.ArrayIndexOutOfBoundsException
By mew in forum New To JavaReplies: 2Last Post: 12-02-2007, 09:40 PM -
java.lang.ArrayIndexOutOfBoundsException
By Marcus in forum New To JavaReplies: 1Last Post: 07-05-2007, 05:15 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks