Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 8th, 2003, 05:44 PM
Registered User
 
Join Date: Jul 2003
Location: Sierra Vista, AZ, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Capi
Default Reading and Writing Objects

Hi,

We have been written a small application that saves our data using ObjectOutputStream. We saved our object with writeObject(palet). Palet is an array of data 'Palet[] palet = new Palet[25]'. We seem to beable to save the data but reading it back we get an Exception error.

Our code for reading it back looks like this:


    public void PaletInit() throws IOException, ClassNotFoundException
    {
        boolean blnTemp = true;
        try
        {
            File data = new File("palet.obj");
            ObjectInputStream in = new ObjectInputStream(new FileInputStream(data));

            while(blnTemp == true)
            {
                index = 0;
                palet[index] = (Palet) in.readObject();
            }
            in.close();
        }
        catch (Exception e)
        {
            System.out.println("Error during input");
        }
    }

We currently rewrote our program using binary stream and that works but would like to figure out why we couldn't get the object reading to work.



Reply With Quote
  #2 (permalink)  
Old July 10th, 2003, 08:59 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to jwenting Send a message via MSN to jwenting
Default

Read up on serialization.
The class you try to load probably has non-serializable data that isn't properly initialised when loaded.
Reply With Quote
  #3 (permalink)  
Old July 29th, 2003, 03:26 PM
Registered User
 
Join Date: Jul 2003
Location: Sierra Vista, AZ, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Capi
Default

Took a while but that did it.

Thanks.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading and writing .PST file shoakat ASP.NET 2.0 Basics 1 January 25th, 2011 08:31 AM
Reading and Writing to Serial Devices muralidharan.d C# 2005 0 May 10th, 2007 07:50 AM
Writing works then reading fails childoftv XSLT 3 April 22nd, 2006 04:09 AM
Reading from a xml file and writing to another billy_bob_the_3rd XML 5 April 29th, 2005 01:40 PM
Reading / Writing from Serial Port ashu_from_india General .NET 1 April 29th, 2005 03:50 AM



All times are GMT -4. The time now is 04:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.