Invalid Handle Exception grr.

I get this every time i try to update my database. not when i read from it, that goes error free but writing to it, ug. Here's whats goin on:
the setup for the table is:
Verb Type
String Integer
Con is the Connection that is always successful when used to read data
the Method FindData returns "Yes" if the verb exists in the table and "No" if it doesn't and yes i have my reasons for making it return a string instead of a boolean
Command is a Statement: Statement Command = Con.createStatement();
Update is a String
i is an int
if (FindData(Con, Verb).compareTo("No") == 0)
     Update = "insert into [Sheet1$] (Verb, Type) values('"+Verb+"', "+Integer.parseInt(Data)+")";
     System.out.println("Update: "+Update);
     i = Command.executeUpdate(Update);
     if (i == 1) System.out.println("Success!!!"); else System.out.println("Failed");
     Command.close();
     Con.close();
     System.out.println("EXISTS:: "+FindData(Con, Verb));                    
here's what i get as output:
----jGRASP exec: java UpdateData
Update: insert into [Sheet1$] (Verb, Type) values('Mentir', 1)
Invalid handle
----jGRASP: operation complete.
Which means it throws an exception at the i = Command.executeUpdate(Update); line and doesn't go further than that.
Does anyone know what this function even means?
Does anyone know how to fix this?
if you need more information pleas let me know
Thanks, Lateralus

yep it's an excel driver that allows you to connect to excel databases. here's my getConnection function:
public static Connection getConnection(String FilePath, String FileName)
     String Driver = "";
     String Url = "";
     String Username = "";
     String Password = "";
     Connection Con = null;
     try
          Driver = "sun.jdbc.odbc.JdbcOdbcDriver";
          Url = "jdbc:odbc:Excel Files;DBQ=";
          Url += FilePath+"\\"+FileName;
          Username = "";
          Password = "";
          Class.forName(Driver); // load JDBC-ODBC driver
          return DriverManager.getConnection(Url, Username, Password);
     catch (Exception e) {System.out.println("getConnection:  "+e.getMessage());}
     return(Con);
}

Similar Messages

  • Invalid Handle Exception-What is the reason?

    I face with "Invalid Handle exception" (SQLException) while using the following code.
    Could anybody tell me the possible reasons/Situation the error rise?
    stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery(SQLStmt);
         if(rs!=null){
    ResultSetMetaData rsm = rs.getMetaData();
         int totalcols = rsm.getColumnCount();
         Vector temp;
         while (rs.next()) {
         Vector temp = new Vector();
         for (int i = 1; i <= totalcols; i++) {
              String value = rs.getString(i);
              if (value == null) {
              value = "";
         temp.addElement(value);
         }//for loop ends here
         valueVector.addElement(temp);
         rs.close();
         stmt.close();     
    Thank you all

    Vector temp;
    while (rs.next()) {
    Vector temp = new Vector();Are you sure that this is the code you are running? The reason I ask is that I'm pretty sure that it won't compile, at least under JDK1.4. You should get a compile error something like "temp is already defined".
    If thats not the problem you need to find out on which line the error actually occurs. You can get this from the exception by calling the printStackTrace() method.
    Col

  • Portlet Invalid handle exception -- URGENT PLEASE HELP

    I am deploying our Portal application and portlets in a clustered environment. We have three machines and following weblogic servers are started in each machine:
    Machine1 - Admin Server
    Machine2 - Portal1, Portlet1
    Machine3 - Portal2, Portlet2
    Portlets are deployed on portlet servers (portlet 1 and portlet 2). When I deployed the Portal application I intentionally registered portlet producer pointing to 127.0.0.1:8889, thinking that it will work for both portals since the portlet server is in same machine as well..
    So my assumption is :
    Portal1 will always load portlet from Portlet1 server and
    Portal2 will always load portlet from Portlet2 server
    but I am getting following error now... don;t have a clue what to do.. This is very urgent, I am working over the weekend over this.. any help would be highly appreciated..
    Line: -----
    <Apr 23, 2011 6:17:07 PM EDT> <Error> <oracle.portlet.client.connection.wsrp.HTTPClientTransport> <WCS-40152> <A request to the producer URL "http://127.0.0.1:8889/ApplicationAccess/portlets/WSRP_v2_Markup_Service" resulted in a status 500 response with fault string "Invalid handle "C:f5163bc7-4caa-4d4f-b031-cf475ecd099f".; nested exception is:
         oracle.portlet.producer.container.ContainerObjectNotFoundException: Object named "registration" could not be found in the persistent store.". The fault code given was "{urn:oasis:names:tc:wsrp:v2:types}InvalidRegistration". The producer generated a timestamp of 2011-04-23T18:17:06.217-04:00 and associated the following stack trace with the fault message: com.bea.wsrp.faults.InvalidRegistrationException: Invalid handle "C:f5163bc7-4caa-4d4f-b031-cf475ecd099f".; nested exception is:
         oracle.portlet.producer.container.ContainerObjectNotFoundException: Object named "registration" could not be found in the persistent store.
         at com.bea.wsrp.producer.handlers.management.ProducerDataStoreManager$ConfigurationContext.createWsrpFaultException(ProducerDataStoreManager.java:1481)
         at oracle.portlet.producer.container.persistence.WsrpFaultExceptionFactory.createWsrpFaultException(WsrpFaultExceptionFactory.java:43)
         at oracle.portlet.producer.container.persistence.PersistentProducerDataStore.getRegistrationDataContext(PersistentProducerDataStore.java:205)
         at oracle.portlet.producer.container.persistence.ProducerDataStoreImpl.getRegistrationDataContext(ProducerDataStoreImpl.java:225)
         at com.bea.wsrp.producer.handlers.management.ProducerDataStoreManager.initializeRequestContext(ProducerDataStoreManager.java:242)
         at com.bea.wsrp.producer.handlers.management.ProducerDataStoreManager.initializeRegistration(ProducerDataStoreManager.java:210)
         at com.bea.wsrp.producer.handlers.RegistrationHandleFilter.doFilter(RegistrationHandleFilter.java:56)
         at com.bea.wsrp.producer.handlers.AbstractServiceHandler.preprocess(AbstractServiceHandler.java:108)
         at com.bea.wsrp.producer.handlers.AbstractServiceHandler.service(AbstractServiceHandler.java:65)
         at com.bea.wsrp.producer.container.ProducerEndPoint.processNow(ProducerEndPoint.java:349)
         at com.bea.wsrp.producer.container.ProducerEndPoint.processNow(ProducerEndPoint.java:250)
         at com.bea.wsrp.producer.container.ProducerEndPoint.processNow(ProducerEndPoint.java:208)
         at oracle.portlet.server.adapter.web.WSRP_v2_Markup_PortTypeSoapToEndpoint.initCookie(WSRP_v2_Markup_PortTypeSoapToEndpoint.java:281)
         at oasis.names.tc.wsrp.v2.bind.runtime.WSRP_v2_Markup_Binding_SOAP_Tie.invoke_initCookie(WSRP_v2_Markup_Binding_SOAP_Tie.java:295)
         at oasis.names.tc.wsrp.v2.bind.runtime.WSRP_v2_Markup_Binding_SOAP_Tie.processingHook(WSRP_v2_Markup_Binding_SOAP_Tie.java:1448)
         at oracle.j2ee.ws.server.StreamingHandler.handle(StreamingHandler.java:299)
         at oracle.j2ee.ws.server.JAXRPCProcessor.doEndpointProcessing(JAXRPCProcessor.java:442)
    Line: -----
    Regards,
    sak007
    Edited by: user469829 on Apr 23, 2011 4:23 PM

    Sak007,
    Did u get the solution for this issue? I am also facing the similar kind of issue.
    I have a portal server, that consumes the remote portlet which is deployed on a cluster environment (Server1 and Server2). When i register my remote portlet, sometimes the registration handle holds info about server1 and sometimes it is server2. When the registration handle holds info about Server1, my application is working fine in the portal. Whereas when the registration handle holds the info about Server2. It throws the exception as:
    Invalid handle "C:10.10.0.42:-a3eb70c:130d71f8067:-7ff9".[[
    oracle.portlet.server.containerimpl.ContainerObjectNotFoundException: Object named "registration" could not be found in the persistent store.
    at oracle.portlet.server.containerimpl.persistence.SimplePersistentStorage.get(SimplePersistentStorage.java:47)
    Any pointers will be helpful.
    Note: I have visited the URl posted in above thread and it doesn't solve the issue.
    Thanks.

  • Invalid Handle Exception!

    Background: I have a SQL database created and maintained via MS Access 2003. I use JDBC to connect and interact with this database. So far my program has been able to do everything from querying a table to inserting new rows to deleting others, but has had no luck with updating rows either through the execute()/executeUpdate() methods or the ResulSet updateInt()/UpdateString() methods.
    So currently I'm recieving an Invalid Handle error during runtime for this program. I ran a stack trace and the line that gave the error was where I was creating a ResultSet from an executeQuery(). I'm unsure what Invalid Handle means, and am further baffled at this error since I have another method with the EXACT SAME line for the query and it receives no errors. To put it into better veiw I have my main class/main method, and from there I call a few different methods from this other class I have. I call this one method, works fine; I call this other method a little while afterwards and it has the exact same few lines at the beginning as the previously mentioned method. Suddenly I get this Invalid Handle error. Like I said, the error said it's happening when I'm doing ResultSet rs = stmnt.executeQuery("SELECT columns FROM table WHERE column LIKE 'string'");
    Please help! Thank you!

    i cant ever open adobe or other pdf files im not new to computers but i am far from profficient. when i ask adobe and others about invalid handles, broken ? whatever and dont have permission etc. all i get is silence or blank looks....i think adobe suks very hard and all the rest of this stuff is just terrible and i want to change to linux....i sure wish i knew more but when i ask a lot of people who claim to be knowledgable i find that all they can do is type well and open and parse documents where i know much more about most hardware and software......anyone out there able to help a dyslexic non typer???

  • Invalid Handle SQL Exception

    Everytime I call this method from my JSP page, I get the error Invalid Handle. I changed my query statement at the most bottom part to a hard-coded update statement (this one update wirtech.orders_temp set BOOKCODE ='12345678', QUANTITY = '150', SUPPLIER = 'rain', STAT = 'pending', FULFILLED = '0', CONSOLIDATED = '1', CONSOLIDATEID ='1' where POID = '10003) but i still get that error. I traced my program and found out the error comes out at After System.out.println("hereba2"+query);. That's the line before stmt.executeupdate(query); at the bottom part of the consolidatePOS method.
    Please help, we've been stuck here for one week already.
         public void consolidatePOS(Vector v, String code)
              try{
                   String poidfinal = "";
                   int y = 0;
                   int qty = 0;
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con = DriverManager.getConnection(url, username, password);
                stmt = con.createStatement();
                System.out.println("before big while."+v.size());
                   while(y<v.size())
                query = "select QUANTITY from wirtech.orders_temp where POID = '"+v.elementAt(y)+"'";
                System.out.println("first stmt.execute");
                rs=stmt.executeQuery(query);
                System.out.println("inside medium while.");
                while (rs.next())
                     System.out.println("inside small while.");
                     qty = qty + rs.getInt("QUANTITY");
                if(y == v.size()-1)
                     poidfinal = ""+v.elementAt(y);
                y++;
                rs.close();
                System.out.println("after big while.");
                int ea = getConsolidateID();
                System.out.println("ea"+ea);
                System.out.println("here ba/!?");
                query = "update wirtech.orders_temp set BOOKCODE ='12345678', QUANTITY = '150', SUPPLIER = 'rain', STAT = 'pending', FULFILLED = '0', CONSOLIDATED = '1', CONSOLIDATEID ='1' where POID = '10003'";
                System.out.println("here ba2"+query);
                stmt.executeUpdate(query);
                System.out.println("after big while. LASTT");
                stmt.close(); con.close();
                } catch(Exception ex) {
                     System.out.println("error in consolidatePOS()" + ex);     
              public int getConsolidateID()
              {int x =0;
                   try {
                Class.forName(driver);
                con = DriverManager.getConnection(url, username, password);
                stmt = con.createStatement();
                query = "SELECT COUNT(DISTINCT CONSOLIDATEID) AS count FROM wirtech.orders_temp";
                rs = stmt.executeQuery(query);
                while (rs.next()) {
                    x = rs.getInt("count");
                rs.close();
                stmt.close();
                con.close();
            } catch (Exception e) {
                System.out.println("getTransactionCount has an Exception: " + e);
            }

    This is a complete guess! ... perhaps the
    rs.close();also closes the Statement (or invalidates it) which you use later to execute the update. The API does not seem to indicate this though:
    void close()
               throws SQLException
        Releases this ResultSet object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.
        Note: A ResultSet object is automatically closed by the Statement object that generated it when that Statement object is closed, re-executed, or is used to retrieve the next result from a sequence of multiple results. A ResultSet object is also automatically closed when it is garbage collected. But perhaps it may still be worthwhile seeing if removing that close will fix the problem.

  • First Chance exception in build.exe(NTDLL.DLL);0xC0000008:Invalid Handle

    Hi Michael,
                               I am using WINDOWS XP with SP2 ; I am facing a problem after installing Sp6 for VC++
                 First Chance exception in build.exe(NTDLL.DLL);0xC0000008:Invalid Handle
         Please Help me out for this Michael.
    Thanks & Regards,
    Rakesh
    Rakesh

    Howdy Rakesh,
    I'm not sure who Michael is, but you might want to try the MSDN or the MSDN forum for general VC++ help.
    Warm regards,
    pBerg

  • Why do I get an invalid handle error when debugging, on a call to ncReset?

    I am working with the example program obj2obj.c
    I have a PCI-CAN/2 card installed.
    I must call ncReset for *both* ports (CAN0 and CAN1), prior to any other commands or I will get a driver error (NC_ERR_DRIVER, Bxxx0002).
    This happens even if the program terminates properly, closing all handles, and I then remove the ncReset commands.
    Fine, I can live with the ncResets.
    However, if I then try and debug the program using Microsoft Visual C++, it immediately chokes on the second call to ncReset( "CAN1", 0 ) and complains about an invalid handle.
    If I add a status check to both of the ncResets and run the program from the DOS command line, I don't get any errors printed out
    so the calls are working fine just running the program.
    The driver updates listed do not appear to address this problem (1.4.1 uses LabView which I do not have and 1.4.2 is for Windows 2000)
    Why are the ncResets required in the first place?
    And why can't I single step through the second call to ncReset?
    Thanks in advance for your help.
    System details:
    PC running Windows NT 4.00.1381
    PCI-CAN/2 w/driver 1.4
    Microsoft Visual C++ 6.0 Professional

    bsat, thank you for helping out!
    I had tried using only one ncReset previously and was experiencing driver errors. I removed the second ncReset as you suggested and now it seems to work with only one. I cannot get it to fail like it was doing.
    However, at least one ncReset must be used or I get the following error:
    ERROR ncConfig CAN1: Driver error (qual=000b000)
    Press any key to continue
    I get this error even when the program terminates normally. For example:
    1) Build obj2obj with the ncReset command.
    2) Execute and allow to terminate normally.
    3) Edit obj2obj and remove ncReset command.
    4) Execute and the error message is displayed.
    Amazingly, I was also able to single step through most of the program this morning. I got the first three messages (of 10 total) before ge
    tting the error:
    Microsoft Visual C++
    First-chance exception in cctool.exe (NTDLL.DLL): 0xC0000008: Invalid Handle
    It seems to be more random than first appeared and perhaps more related to MSVC than to the NI-CAN card. Any insight?
    Also, having to include an ncReset is undesireable since I'd like to develop a CAN driver that could be called from multiple threads. I'd be very interested in your opinion on why I'm having trouble getting it to work without one.
    Thanks again for your help, it is greatly appreciated!

  • Can we handle exceptions for the expressions in select query?

    Hi all,
    Can we handle exceptions for the expressions in select query.
    I created a view, there I am extracting a substring from a character data and expected that as a number.
    For example consider the following query.
    SQL> select to_number( substr('r01',2,2) ) from dual;
    TO_NUMBER(SUBSTR('R01',2,2))
    1
    Here we got the value as "1".
    Consider the following query.
    SQL> select to_number( substr('rr1',2,2) ) from dual;
    select to_number( substr('rr1',2,2) ) from dual
    ORA-01722: invalid number
    For this I got error. Because the substr returns "r1" which is expected to be as number. So it returns "Invalid number".
    So, without using procedures or functions can we handle these type of exceptions?
    I am using Oracle 10 G.
    Thanks in advance.
    Thank you,
    Regards,
    Gowtham Sen.

    SQL> select decode(ltrim(rtrim(translate(substr('r21', 2, 2), '0123456789', ' ' ), ' '), ' '), null, (substr('r21', 2, 2)), null) from dual;
    DE
    21
    SQL> ed a
    SQL> select decode(ltrim(rtrim(translate(substr('rr1', 2, 2), '0123456789', ' ' ), ' '), ' '), null, (substr('rr1', 2, 2)), null) from dual;
    D
    -

  • How to handle exceptions in a Service

    Hi,
    I'm trying to get the new Service (background thread) stuff working and am close but I have a problem with handling exceptions that are thrown in my Task. Below is my code, does anyone know if I am doing something wrong, or is this just a flaw in the system at the moment:
    Here is my service:
    public class TestService extends Service<String>
        protected Task<String> createTask()
            return new Task<String>()
                protected String call() throws Exception
                   System.out.println("About to throw exception from inside task");
                   throw new Exception("Test failure");
    }Here is my code using this service:
    public void doTest()
        final TestService test = new TestService();
        test.stateProperty().addListener(new ChangeListener<Worker.State>()
            public void changed(ObservableValue<? extends Worker.State> source, Worker.State oldValue, Worker.State newValue)
                System.out.println("State changed from " + oldValue + " to " + newValue);
        test.start();
    }When the task throws its exception I was hoping to get a state change to FAILED but the callback is never triggered. I've tried listening for invalidation of the state and also tried listening to all the other properties on Service (running, progress, exception, etc). There doesn't seem to be any feedback after the exception has been thrown.
    Am I using this wrong, or is it a bug?
    Cheers for you help,
    zonski

    Hi,
    This was working in the build #32. I updated the JavaFX to build #36 and it stopped working.
    I checked in the latest build #37 as well which was released last week and this doesn't work here as well.
    If the task is succeeding the state is getting changed to SUCCEEDED but in case of an exception there is no change in the state
    Edited by: user12995677 on Aug 3, 2011 2:07 AM

  • Problem with  Handling  Exception  in Jsp

    hi
    I am unable to handling exception in Jsp.
    In my Simple Form i taken a simple text field named salary.
    Details.jsp
    <%@ page language="java" isErrorPage="true" errorPage="Det.jsp"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <html:html>
    <html:form action="/det.do">
    Enter Salary<html:text property="sal"/><br>
    <br>
    <html:submit value="SEND" />
    </html:form>
    </html:html>and my Actionclass is:
    package com.gurukul.util;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public class DetUserAction extends Action {
         String s=null;
         int sal;
    public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
         try
         sal=Integer.parseInt(req.getParameter("sal"));
         if (sal>0)
              s="success";
         else
         throw new SalException(sal);}
         catch(SalException e)
              e.getMessage();
         return map.findForward(s);
    and my Formbean is
    package com.gurukul.util;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public class DetUserAction extends Action {
         String s=null;
         int sal;
    public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
         try
         sal=Integer.parseInt(req.getParameter("sal"));
         if (sal>0)
              s="success";
         else
         throw new SalException(sal);}
         catch(SalException e)
              e.getMessage();
         return map.findForward(s);
    }and my struts-config.xml is
                                  </form-bean>
                                  <form-bean name="DetUser"  
                           type="com.gurukul.util.DetUserForm">
                                  </form-bean>
    <action path="/det"
                          type="com.gurukul.util.DetUserAction"
                          name="DetUser"
                        input="/Details.jsp"
                           scope="request">
                           <exception key="errors.sal"
                           type="com.gurukul.util.SalException"
                           path="/jsp/Det.jsp"/>
                       <forward name="success" path="/jsp/DetailList.jsp"  />
                       <forward name="failure" path="/jsp/Details.jsp"/>
                         </action>and Det.jsp(i.e error jsp) is
    <%@ page language="java" isErrorPage="true"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <html:html>
    <center><b>
    Invalid Salary</b></center>
    <%= exception.getMessage() %>
    </html:html>but i didnt get exception on jsp.
    please help me
    Regards
    VAS

    hi
    can you please guide me how to handle exceptions in Jsp(struts)?

  • Handling exceptions for a event handler method.

    Hi Mates,
                    I have two custom container in which i am displaying an alv grid usind objects. when a double click event is performed in one of the alv the other alv should be displayed. I now have to handle exceptions of the class  CX_SY_DYN_CALL_ILLEGAL_TYPE. This is raised for an invalid parameter type when calling a method dynamically. I cannot use the keyword "RAISING" in the definition of the event handler method. i checked with the syntax of the method definition in abap dictionary, there were no addition "RAISING" for an event handler method. please provide me with the solution (a sample code would do.)

    Hello,
    May be you should read about the TRY ... CATCH block which is used for handling exceptions.
    Basic construct of your code should look like this:
    TRY.
    " Your Dynamic Method call
      CATCH CX_SY_DYN_CALL_ILLEGAL_TYPE.
    ENDTRY.
    If you want to get the error message text:
    DATA:
    lcx_excp TYPE REF TO CX_SY_DYN_CALL_ILLEGAL_TYPE,
    v_err_msg TYPE string.
    TRY.
    " Your Dynamic Method call
      CATCH CX_SY_DYN_CALL_ILLEGAL_TYPE INTO lcx_excp.
      v_err_msg = lcx_excp->get_text( ).
    ENDTRY.

  • INVALID HANDLE

    PLEASE HELP ME
    I GOT EXCEPTION INVALID HANDLE IN MS ACCESS & MS SQL SERVER
    I MADE THE METHOD STATIC WHICH LOADS DRIVER & GET CONNECTION SO NEXT TIME IT WILL REUSE PREVIOS REFERANCE
    CODE:
    import java.sql.*;
    public class getconnection
    static Connection connection;
    static Statement st123;
    public getconnection()
    public static Statement getConnection() throws Exception
                   if(connection==null)
                        System.out.println("...............N e w - C o n n............. ");
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    connection = DriverManager.getConnection("jdbc:odbc:gandhiasso","","");
                        st123 = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
                        System.out.println(st123);
                   System.out.println("...............O l d - C o n n............. ");
                   return st123;
         public void closeConnection()throws Exception
    ONLY ONCE QUERY EXECUTES NEXT TIME IT SHOWS INVALID HANDLE FOR ANY QUERY
    PLZ PLZ HELP ME OUT

    >
    CODE:
    import java.sql.*;
    public class getconnection
    static Connection connection;
    static Statement st123;
    public getconnection()
    public static Statement getConnection()
    throws Exception
                   if(connection==null)
    System.out.println("...............N e w - C o n
    o n n............. ");
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    connection =
    DriverManager.getConnection("jdbc:odbc:gandhiasso","",
    st123 =
    23 =
    connection.createStatement(ResultSet.TYPE_SCROLL_SENSI
    TIVE,ResultSet.CONCUR_UPDATABLE);
                        System.out.println(st123);
    System.out.println("...............O l d - C o n
    o n n............. ");
                   return st123;
         public void closeConnection()throws Exception
    ONLY ONCE QUERY EXECUTES NEXT TIME IT SHOWS INVALID
    HANDLE FOR ANY QUERY
    PLZ PLZ HELP ME OUTI think it was the way you create the class and its constructors.
    I don't think you can create "static" method with a contructor name.
    Try changing your class and contructor to DBConnection, and leave the rest unchanged. See what happen..
    Good luck
    :D
    PS. next time, please use formatting tips. I've some difficulties understanding what you explained.

  • Invalid handle if topic subscriber run from javaw

    Hi.
    I'm new to JMS but have just written a fairly straightforward pub/sub application which runs absolutely fine when the subscriber client is started using 'java'.
    You'll notice that, when you go through the process of setting up context, factory, and so on, the JMS implementation built into J2EE comes up with a 'welcome' message on standard output:
    Java(TM) MessageService 1.0.2 Reference Implementation (build b14)
    However, I'd like to run this subscriber client without a Java console. When I try to do this (using javaw), I get an i/o exception as the subscriber starts up with an 'invalid handle' as the exception message. I presume my app is getting upset because the JMS server doesn't have a console for its welcome message.
    Maybe the workaround is blindingly obvious, but I can't see it at the moment. Can anyone tell me how to re-direct the welcome message or get rid of it completely ?

    Problem solved - please ignore posting.

  • Invalid Number exception

    Hi experts,
    I have a very strange problem. I have a query to which I am binding a value. The datatype of the value is number. Whenever I am executing the VO for the second time it is throwing ORA-01722: invalid number exception. The value that is being bound is 100% number. The JDBC version I am using is 9.2.0.6.0
    It is reproducible in instance and JDeveloper.
    I have no clue why it is happening. Appreciate if someone can give some pointers.
    Error stack:
    [1814] SELECT mcixv.customer_number CustomerNumber,
    mcixv.customer_name CustomerName,
         aav.concatenated_address ShipToLocation
    FROM mtl_customer_item_xrefs_v mcixv,
    ic_item_mst iim ,
         mtl_system_items msi,
         ar_addresses_v aav,
         hz_site_uses_v hsv
    WHERE hsv.primary_flag = 'Y'
    AND hsv.bill_to_location IS NOT NULL
    AND hsv.site_use_code = 'SHIP_TO'
    AND aav.address_id = hsv.address_id
    AND mcixv.customer_id = aav.customer_id
    AND mcixv.inactive_flag= 'N'
    AND mcixv.concatenated_segments = iim.item_no
    AND mcixv.inventory_item_id = msi.inventory_item_id
    AND msi.organization_id = xxtmg_ul_common_utils.get_organization_id
    AND msi.segment1 = iim.item_no
    AND xxtmg_an_process_utils.get_price_list_uom(mcixv.customer_number,iim.item_id) = 'Y'
    AND iim.item_id = :1
    group by mcixv.customer_number, mcixv.customer_name,aav.concatenated_address[1815] Binding param 1: 4084[1816] ViewObject close single-use prepared statements[1817] QueryCollection.executeQuery failed...[1818] java.sql.SQLException: ORA-01722: invalid number
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)     at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)     at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)     at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)     at oracle.jdbc.ttc7.TTC7Protocol.executeFetch(TTC7Protocol.java:1005)     at oracle.jdbc.dbaccess.DBAccess.executeFetchNeedDefines(DBAccess.java:283)     at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2673)     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2933)     at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:650)     at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:578)     at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:627)     at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:515)     at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3347)     at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:828)     at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4495)     at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)     at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)     at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)     at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3311)     at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3298)     at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:444)     at tempel.oracle.apps.xxtmg.an.scaleaudit.server.checkCustomersPresentVOImpl.initQuery(checkCustomersPresentVOImpl.java:22)     at tempel.oracle.apps.xxtmg.an.scaleaudit.server.ScaleAuditAMImpl.validateNonFurnSublot(ScaleAuditAMImpl.java:762)     at tempel.oracle.apps.xxtmg.an.scaleaudit.server.webui.ScaleAuditCO.processFormRequest(ScaleAuditCO.java:1005)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:804)     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1157)     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)     at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)     at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2632)     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1658)     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:501)     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:422)     at OA.jspService(OA.jsp:40)     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)     at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)     at java.lang.Thread.run(Thread.java:534)[1819] checkCustomersPresentVO1>#q old SQLStmtBufLen: 933, actual=903, storing=933[1820] SELECT mcixv.customer_number CustomerNumber,
    mcixv.customer_name CustomerName,
         aav.concatenated_address ShipToLocation
    FROM mtl_customer_item_xrefs_v mcixv,
    ic_item_mst iim ,
         mtl_system_items msi,
         ar_addresses_v aav,
         hz_site_uses_v hsv
    WHERE hsv.primary_flag = 'Y'
    AND hsv.bill_to_location IS NOT NULL
    AND hsv.site_use_code = 'SHIP_TO'
    AND aav.address_id = hsv.address_id
    AND mcixv.customer_id = aav.customer_id
    AND mcixv.inactive_flag= 'N'
    AND mcixv.concatenated_segments = iim.item_no
    AND mcixv.inventory_item_id = msi.inventory_item_id
    AND msi.organization_id = xxtmg_ul_common_utils.get_organization_id
    AND msi.segment1 = iim.item_no
    AND xxtmg_an_process_utils.get_price_list_uom(mcixv.customer_number,iim.item_id) = 'Y'
    AND iim.item_id = :1
    group by mcixv.customer_number, mcixv.customer_name,aav.concatenated_addressJBO-27122: SQL error during statement preparation. Statement: SELECT mcixv.customer_number CustomerNumber,
    mcixv.customer_name CustomerName,
         aav.concatenated_address ShipToLocation
    FROM mtl_customer_item_xrefs_v mcixv,
    ic_item_mst iim ,
         mtl_system_items msi,
         ar_addresses_v aav,
         hz_site_uses_v hsv
    WHERE hsv.primary_flag = 'Y'
    AND hsv.bill_to_location IS NOT NULL
    AND hsv.site_use_code = 'SHIP_TO'
    AND aav.address_id = hsv.address_id
    AND mcixv.customer_id = aav.customer_id
    AND mcixv.inactive_flag= 'N'
    AND mcixv.concatenated_segments = iim.item_no
    AND mcixv.inventory_item_id = msi.inventory_item_id
    AND msi.organization_id = xxtmg_ul_common_utils.get_organization_id
    AND msi.segment1 = iim.item_no
    AND xxtmg_an_process_utils.get_price_list_uom(mcixv.customer_number,iim.item_id) = 'Y'
    AND iim.item_id = :1
    group by mcixv.customer_number, mcixv.customer_name,aav.concatenated_addressoracle.apps.fnd.framework.OAException: JBO-27122: SQL error during statement preparation. Statement: SELECT mcixv.customer_number CustomerNumber,
    mcixv.customer_name CustomerName,
         aav.concatenated_address ShipToLocation
    FROM mtl_customer_item_xrefs_v mcixv,
    ic_item_mst iim ,
         mtl_system_items msi,
         ar_addresses_v aav,
         hz_site_uses_v hsv
    WHERE hsv.primary_flag = 'Y'
    AND hsv.bill_to_location IS NOT NULL
    AND hsv.site_use_code = 'SHIP_TO'
    AND aav.address_id = hsv.address_id
    AND mcixv.customer_id = aav.customer_id
    AND mcixv.inactive_flag= 'N'
    AND mcixv.concatenated_segments = iim.item_no
    AND mcixv.inventory_item_id = msi.inventory_item_id
    AND msi.organization_id = xxtmg_ul_common_utils.get_organization_id
    AND msi.segment1 = iim.item_no
    AND xxtmg_an_process_utils.get_price_list_uom(mcixv.customer_number,iim.item_id) = 'Y'
    AND iim.item_id = :1
    group by mcixv.customer_number, mcixv.customer_name,aav.concatenated_address[1821] OAApplicationPoolImpl.setConnectionReleaseLevel was called with isReleased = true, isReserved = true[1822] setConnectionReleaseLevel - Set connection release level to 1JRAD_PERF : /tempel/oracle/apps/xxtmg/an/scaleaudit/webui/ScaleAuditPG - preparePage : 10045msJRAD_PERF : /tempel/oracle/apps/xxtmg/an/scaleaudit/webui/ScaleAuditPG - renderDocument : 70ms

    I'm just trying to rule out the possiblity of unsynchronized load balanced servers because the issue begaviour is not pointing to code as such otherwise it shouldn't have been happening in a random way. Have you put the trace and seen the value of parameter which is getting binded at the time the error is getting generated.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Invalid Class Exception problem

    Hi whenever i try to run this method from a different class to the one it is declared in it throws invalid class exception, (in its error it says the class this method is written in is the problem) yet when i run it from its own class in a temporary main it works fine, perhaps someone can see the problem in the method code. All its doing is reading from a few different txt files, deserializing the objects and putting them into arraylists for future access.
    public void readCourseData()
              CourseArrayLengths cal;
              try
                   FileInputStream fis = new FileInputStream("arraylengths.txt");
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   cal = ((CourseArrayLengths) ois.readObject());     
                   ois.close();
                   FileInputStream fis1 = new FileInputStream("units.txt");
                   ObjectInputStream ois1 = new ObjectInputStream(fis1);
                   for(int i=0;i<cal.getUnitArrayLength();i++)
                        units.add((Unit) ois1.readObject());
                   ois1.close();
                   FileInputStream fis2 = new FileInputStream("sections.txt");
                   ObjectInputStream ois2 = new ObjectInputStream(fis2);
                   for(int i=0;i<cal.getSectionArrayLength();i++)
                        sections.add((Section) ois2.readObject());
                   ois2.close();
                   FileInputStream fis3 = new FileInputStream("files.txt");
                   ObjectInputStream ois3 = new ObjectInputStream(fis3);
                   for(int i=0;i<cal.getFileArrayLength();i++)
                        files.add((Filetype) ois3.readObject());
                   ois3.close();
              catch(FileNotFoundException exception)
              System.out.println("The File was not found");
              catch(IOException exception)
              System.out.println(exception);
              catch(ClassNotFoundException exception)
              System.out.println(exception);
         }

    import java.util.ArrayList;
    import java.io.*;
    import javax.swing.*;
    public class Unit implements Serializable
    ArrayList units = new ArrayList();
    ArrayList sections = new ArrayList();
    ArrayList files = new ArrayList();
    String unitName;
    int sStart=0,sEnd=0,sIndex=0,fIndex=0,subIndex=0;
         public Unit(String unitNamec,int sStartc,int sEndc)
              unitName = unitNamec;
              sStart = sStartc;
              sEnd = sEndc;
         public Unit()
         public String getUnitName()
              return unitName;
         public Unit getUnit(int i)
              return (Unit)units.get(i);
         public Section getSection(int i)
              return (Section)sections.get(i);
         public ArrayList getUnitArray()
              return units;
         public int getSectionStart()
              return sStart;
         public int getSectionEnd()
              return sEnd;
         public void setSectionStart(int i)
              sStart = i;
         public void setSectionEnd(int i)
              sEnd = i;
         public void addUnit(String uName)
              units.add(new Unit(uName,sections.size(),sIndex));
              sIndex++;
         public void addSection(String sName,Unit u)
              //problem lies with files.size()
              sections.add(new Section(sName,files.size(),files.size()));
              u.setSectionEnd(u.getSectionEnd()+1);
              //fIndex++;
         public void addFile(String fName,File fPath,Section s)
              files.add(new Filetype(fName,fPath));
              s.setFileEnd(s.getFileEnd()+1);
         public void display(Unit u)
              System.out.println(u.getUnitName());
              for(int i=u.getSectionStart();i<u.getSectionEnd();i++)
                   System.out.println(((Section)sections.get(i)).getSectName());
                   for(int j=((Section)(sections.get(i))).getFileStart();j<((Section)(sections.get(i))).getFileEnd();j++)
                        System.out.println(((Filetype)files.get(j)).getFileName());
         public void writeCourseData()
         //writes 3 arrays to 3 different files
    try
    FileOutputStream fos = new FileOutputStream("units.txt");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
         for(int i=0;i<units.size();i++)
         oos.writeObject((Unit)units.get(i));
         oos.close();
    catch (Exception e)
    System.err.println ("Error writing to file");
    try
    FileOutputStream fos = new FileOutputStream("sections.txt");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
         for(int i=0;i<sections.size();i++)
         oos.writeObject((Section)sections.get(i));
         oos.close();
    catch (Exception e)
    System.err.println ("Error writing to file");
    try
    FileOutputStream fos = new FileOutputStream("files.txt");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
         for(int i=0;i<files.size();i++)
         oos.writeObject((Filetype)files.get(i));
         oos.close();
    catch (Exception e)
    System.err.println ("Error writing to file");
    try
    FileOutputStream fos = new FileOutputStream("arraylengths.txt");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
         oos.writeObject(new CourseArrayLengths(units.size(),sections.size(),files.size()));
         oos.close();
    catch (Exception e)
    System.err.println ("Error writing to file");
         public void readCourseData()
              CourseArrayLengths cal;
              try
                   FileInputStream fis = new FileInputStream("arraylengths.txt");
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   cal = ((CourseArrayLengths) ois.readObject());     
                   ois.close();
                   FileInputStream fis1 = new FileInputStream("units.txt");
                   ObjectInputStream ois1 = new ObjectInputStream(fis1);
                   for(int i=0;i<cal.getUnitArrayLength();i++)
                        units.add((Unit) ois1.readObject());
                   ois1.close();
                   FileInputStream fis2 = new FileInputStream("sections.txt");
                   ObjectInputStream ois2 = new ObjectInputStream(fis2);
                   for(int i=0;i<cal.getSectionArrayLength();i++)
                        sections.add((Section) ois2.readObject());
                   ois2.close();
                   FileInputStream fis3 = new FileInputStream("files.txt");
                   ObjectInputStream ois3 = new ObjectInputStream(fis3);
                   for(int i=0;i<cal.getFileArrayLength();i++)
                        files.add((Filetype) ois3.readObject());
                   ois3.close();
              catch(FileNotFoundException exception)
              System.out.println("The File was not found");
              catch(IOException exception)
              System.out.println(exception);
              catch(ClassNotFoundException exception)
              System.out.println(exception);
         /*public static void main(String args[])
              Unit u1 = new Unit();
              u1.addUnit("Cmps2a22");
              u1.addSection("Section1",u1.getUnit(0));
              //u1.addSubSection("Subsect1",u1.getSection(0));
              u1.addFile("File1",null,u1.getSection(0));
              u1.addFile("File2",null,u1.getSection(0));
              u1.addSection("Section2",u1.getUnit(0));
              u1.addFile("NF",null,u1.getSection(1));
              u1.addFile("NF2",null,u1.getSection(1));
              u1.addFile("NF3",null,u1.getSection(1));
              u1.addSection("Section3",u1.getUnit(0));
              u1.addFile("NF",null,u1.getSection(2));
              u1.addFile("NF2",null,u1.getSection(2));
              u1.addFile("NF4",null,u1.getSection(2));
              u1.display(u1.getUnit(0));
              u1.writeCourseData();
              u1.readCourseData();
              u1.display(u1.getUnit(0));
    import java.util.ArrayList;
    import java.io.*;
    public class Section implements Serializable
    private String sectName,subSectName;
    private int fpStart=0,fpEnd=0,subSectStart=0,subSectEnd=0;
    private Section s;
    private boolean sub;
         public Section(String sectNamec,int fpStartc,int fpEndc,int subSectStartc,int subSectEndc,Section sc,boolean subc)
              sectName = sectNamec;
              fpStart = fpStartc;
              fpEnd = fpEndc;
              subSectStart = subSectStartc;
              subSectEnd = subSectEndc;
              s = sc;
              sub = subc;
         public Section(String sectNamec,int fpStartc,int fpEndc)
              sectName = sectNamec;
              fpStart = fpStartc;
              fpEnd = fpEndc;
         public Section getParent()
              return s;
         public boolean isSub()
              return sub;
         public String getSubName()
              return subSectName;
         public int getSubStart()
              return subSectStart;
         public int getSubEnd()
              return subSectEnd;
         public void setSubStart(int i)
              subSectStart = i;
         public void setSubEnd(int i)
              subSectEnd = i;
         public int getFileStart()
              return fpStart;
         public int getFileEnd()
              return fpEnd;
         public String getSectName()
              return sectName;
         public void setFileStart(int i)
              fpStart = i;
         public void setFileEnd(int i)
              fpEnd = i;
         public void addSection(String sectName)
         /*public static void main(String args[])
    import java.io.*;
    public class Filetype implements Serializable
         private String name;
         private File filepath;
         public Filetype(String namec, File filepathc)
              name = namec;
              filepath = filepathc;
         public String getFileName()
              return name;
         public File getFilepath()
              return filepath;
    import java.io.*;
    public class CourseArrayLengths implements Serializable
    private int ul,sl,fl;
         public CourseArrayLengths(int ulc,int slc,int flc)
              ul = ulc;
              sl = slc;
              fl = flc;
         public int getUnitArrayLength()
              return ul;
         public int getSectionArrayLength()
              return sl;
         public int getFileArrayLength()
              return fl;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.ArrayList;
    import java.io.*;
    public class OrganiserGui implements ActionListener
    int width,height;
    JFrame frame;
         public OrganiserGui()
              width = 600;
              height = 500;
         public void runGui()
              //Frame sizes and location
              frame = new JFrame("StudentOrganiser V1.0");
    frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
              frame.setSize(width,height);
              frame.setLocation(60,60);
              JMenuBar menuBar = new JMenuBar();
              //File menu
              JMenu fileMenu = new JMenu("File");
              menuBar.add(fileMenu);
              fileMenu.addSeparator();
              JMenu addSubMenu = new JMenu("Add");
              fileMenu.add(addSubMenu);
              JMenuItem cwk = new JMenuItem("Coursework assignment");
              addSubMenu.add(cwk);
              JMenuItem lecture = new JMenuItem("Lecture");
              lecture.addActionListener(this);
              addSubMenu.add(lecture);
              JMenuItem seminar = new JMenuItem("Seminar sheet");
              addSubMenu.add(seminar);
              //Calendar menu
              JMenu calendarMenu = new JMenu("Calendar");
              menuBar.add(calendarMenu);
              calendarMenu.addSeparator();
              JMenu calendarSubMenu = new JMenu("Edit Calendar");
              calendarMenu.add(calendarSubMenu);
              JMenuItem eventa = new JMenuItem("Add/Remove Event");
              eventa.addActionListener(this);
              calendarSubMenu.add(eventa);
              JMenuItem calClear = new JMenuItem("Clear Calendar");
              calClear.addActionListener(this);
              calendarSubMenu.add(calClear);
              JMenu calendarSubMenuView = new JMenu("View");
              calendarMenu.add(calendarSubMenuView);
              JMenuItem year = new JMenuItem("By Year");
              year.addActionListener(this);
              calendarSubMenuView.add(year);
              JMenuItem month = new JMenuItem("By Month");
              month.addActionListener(this);          
              calendarSubMenuView.add(month);
              JMenuItem week = new JMenuItem("By Week");
              week.addActionListener(this);
              calendarSubMenuView.add(week);
              //Timetable menu
              JMenu timetableMenu = new JMenu("Timetable");
              menuBar.add(timetableMenu);
              timetableMenu.addSeparator();
              JMenu stimetableSubMenu = new JMenu("Social Timetable");
              timetableMenu.add(stimetableSubMenu);
              JMenu ltimetableSubMenu = new JMenu("Lecture Timetable");
              timetableMenu.add(ltimetableSubMenu);
              frame.setJMenuBar(menuBar);
    frame.setVisible(true);
         public void actionPerformed(ActionEvent e)
              JMenuItem source = (JMenuItem)(e.getSource());
              System.out.println(source.getText());     
              Calendar c = new Calendar();
              if(source.getText().equalsIgnoreCase("By Year"))
                   System.out.println("INSIDE");
                   c.buildArray();
                   c.calendarByYear(Calendar.calendarArray);     
              if(source.getText().equalsIgnoreCase("Add/Remove Event"))
                   c.eventInput();
              if(source.getText().equalsIgnoreCase("clear calendar"))
                   c.buildYear();
                   c.writeEvent(Calendar.calendarArray);
                   c.buildArray();
              if(source.getText().equalsIgnoreCase("lecture"))
                   System.out.println("Nearly working");
                   //JFileChooser jf = new JFileChooser();
                   //jf.showOpenDialog(frame);
                   FileManager fm = new FileManager();
                   //choose unit to add file to
                   JOptionPane unitOption = new JOptionPane();
                   Unit u = new Unit();
                   u.readCourseData();
                   //u.display(u.getUnit(0));
                   System.out.println((u.getUnit(0)).getUnitName());
                   String[] unitNames = new String[u.getUnitArray().size()];
                   for(int i=0;i<unitNames.length;i++)
                        //unitNames[i] = (((Unit)u.getUnitArray().get(i)).getUnitName());
                        //System.out.println(unitNames);
                        System.out.println((u.getUnit(i)).getUnitName());
                   //unitOption.showInputDialog("Select Unit to add lecture to",unitNames);
                   //needs to select where to store it
                   //fm.openFile(jf.getSelectedFile());
         public static void main(String args[])
              OrganiserGui gui = new OrganiserGui();
              gui.runGui();
    java.io.invalidclassexception: Unit; local class incompatible: stream classdesc serialversionUID = 3355176005651395533, local class serialversionUID = 307309993874795880

Maybe you are looking for