vishy_85 0 Newbie Poster

hello all , im having a problem throwing corba system exception
the following is my code

#include <createPlan.h>
#include <writeLog.h>

bool createPlanFunc(const schedule_Mgmt::planData & newPlanData1) ACE_THROW_SPEC ((
    CORBA::SystemException
    , schedule_Mgmt::alreadyExists
    , schedule_Mgmt::unknownErr
  ))
{  
  try
  {    
     ofstream outfile("/cc/smc3/ss_pool4/elem_level_mgmt/tools/Schedule_Mgmt/Schedule_Mgmt/src/scheduleLog.txt",ios::app);
     bool repeatdelay_bool;
     bool notonweekend_bool;
     bool validity_bool;
  
     const char* prepeatdelay;
     const char* pnotonweekend;
     const char* pvalidity;
  
     repeatdelay_bool = (CORBA::Boolean) newPlanData1.repeatDelay;
     notonweekend_bool = (CORBA::Boolean) newPlanData1.notOnWeekend;
     validity_bool = (CORBA::Boolean) newPlanData1.validity;
  
     if (repeatdelay_bool == 1)
     {
        prepeatdelay = "1";
     }
     else 
     {
        prepeatdelay = "0";
     } 
  
     if (notonweekend_bool == 1)
     {
        pnotonweekend = "1";
     }
     else 
     {
        pnotonweekend = "0";
     } 
  
     if (validity_bool == 1)
     {
        pvalidity = "1";
     }
     else 
     {
        pvalidity = "0";
     } 
  
     const char* pname = newPlanData1.planName;
     const char* pdesc = newPlanData1.planDescription;
     const char* pexec = newPlanData1.scriptExec;
     const char* pstartdate = newPlanData1.startDate;
     const char* pstartime = newPlanData1.startTime;
     const char* pstopdate = newPlanData1.stopDate;
     const char* pstoptime = newPlanData1.stopTime;
     // const char* pdelayint = newPlanData1.delayInt;
     const char* ptemptime = newPlanData1.startTime;
     const char* ptempdate = newPlanData1.startDate;
     const string domainnames = "PLANNAME,PLANDESCRIPTION,SCRIPTEXEC,STARTDATE,STARTTIME,STOPDATE,STOPTIME,DELAYINTERVAL,REPEATDELAY,NOTONWEEKEND,ACTIVATE,TEMPTIME,TEMPDATE";
     char plan[250] = {'\0'};
     strcat(plan,"'");
     strcat(plan,pname);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,pdesc);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,pexec);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,pstartdate);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,pstartime);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,pstopdate);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,pstoptime);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,"00:02:01");
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,prepeatdelay);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,pnotonweekend);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,pvalidity);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,pstartime);
     strcat(plan,"'");
     strcat(plan,",");
     strcat(plan,"'");
     strcat(plan,ptempdate);
     strcat(plan,"'");
     const string splan = (const string) plan;
     outfile << splan << endl;
     outfile.close();
  
     //cout<<"CREATE PLAN CALLED";
     
     //LogItf::setProcessName("Schedule_Mgmt");
     
     // Initialise Session using Session Pool
     Session::initSessionPool("BOSS", "E_SESSION_EIR", 2,  false, true);

     // Acquire session while initializing the Session.
     Session * schedSession1 ;
     schedSession1 = new  Session();

     DbSchedule * objschedule ;
       
     
     objschedule = new DbSchedule(schedSession1, "Schedule_mgmt");
    
     objschedule->StartTransaction(10);
     
     objschedule->GetTableDescription();

     //Insert the plan data to the Database.
     
     // const string splan = "'plan55','desc54','/home/users/venketas/C++/SCHMGMTClient/output/images/application.JPG','15/04/2009','17:15','15/04/2009','17:15','00:02:01','1','1','1','17:15','15/04/2009'";
     string test;
     test = objschedule->InsertTuple(domainnames,splan);
     
     //Commit Session.
     schedSession1->commitSession();
     
     //char info[50] = "PLAN CREATED";
    // writeLog(NULL,info); 

    
     // Deletes Session using Session Pool
     SessionPool::deletePool();
     
    //ofstream outfile("/cc/smc3/ss_pool4/elem_level_mgmt/tools/Schedule_Mgmt/Schedule_Mgmt/src/scheduleLog.txt",ios::app);
    //outfile << "vishytest" << endl;
    //outfile << test << endl;
    //outfile.close(); 
    
    if (test == "success")
    {
     return true;
    }
    else
    {
     return false;
    }  
    throw (CORBA::SystemException);
    throw (schedule_Mgmt::alreadyExists);

  }
  catch(...)
  {
    char error[50] = "ERROR : UNKNOWN ERROR";
    writeLog(NULL,error);
  }
}

i get the following error message :


schedule_Mgmt is the name of the module in the idl
alreadyExists is the name of the exception
Error 24: "createPlan.cpp", '<identifier>' expected instead of
'SystemException'.
throw (CORBA::SystemException);
^^^^^^^^^^^^^^^
Error 24: "createPlan.cpp", '<identifier>' expected instead of
'alreadyExists'.
throw (schedule_Mgmt::alreadyExists);
^^^^^^^^^^^^^

im not sure where im wrong , any suggestions ?
thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.