Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

Serialization and applets : can't unserialize objects?

Thread view: 
PawnsMaster - 28 Jun 2005 13:17 GMT
Hi everyone,

I have a problem with serialization and applets : I have the following part
of code :
ObjectInputStream in = new ObjectInputStream(new
URL(Utilities.getCodeBase(), demoFile + ".sav").openStream());

          componentsCount = in.read();  // no problem

          System.out.println(componentsCount);
          for(int i = 0; i < componentsCount; i++) {
             Piece p = (Piece)in.readObject(); // !! problem
             add(p);
          }
          in.close();

Which throws me this exception :

java.security.AccessControlException: access denied
(java.lang.RuntimePermission accessClassInPackage.sun.swing)

By signing the class I made the unserialization work. But I still have a
problem : when I'm accessing my applet from my computer, no problem, but
when I try to access it from another computer of the network, IE crashes !!!

Please help me I don't know what else to do .
Andrew Thompson - 28 Jun 2005 13:43 GMT
> Please help me I don't know what else to do .

Are you swallowing exceptions?

This situation of IE crashing is most unfortunate,
do you acrually mean that IE terminates?

(Assuming no) Have you looked at the Java console in IE?
MSVM: Alt V(iew) | J(ava Console)
Sun VM: Alt T(ools) | Sun Java Console

What is an URL for an example fo the applet
(working or otherwise).

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

PawnsMaster - 28 Jun 2005 13:53 GMT
No, IE doesn't terminate, but it takes 100% of the processor !
And that's really curious, because when I call the applet from the server
where it is situated, it works fine, but if I call it from another computer
of the network it gets IE to do that crappy thing ...

Thanks for helping

> > Please help me I don't know what else to do .
>
[quoted text clipped - 9 lines]
> What is an URL for an example fo the applet
> (working or otherwise).
Andrew Thompson - 28 Jun 2005 14:06 GMT
Please refrain from top-posting)

> No, IE doesn't terminate,

Good, so we can probably get more details easily.

>..but it takes 100% of the processor !
> And that's really curious, because when I call the applet from the server
> where it is situated, it works fine, but if I call it from another computer
> of the network it gets IE to do that crappy thing ...

Turn curiosity to information..
System.out.println( "method name/params return value" )
at the start and end of every method, chack that yoiu
are not swallowing *any* exceptions then look closely
at the console.

If that fails, resort to..
>> ..an example fo the applet
>> (working or otherwise).

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

PawnsMaster - 28 Jun 2005 14:37 GMT
I was wondering .. is it possible that the fact that I'm using JApplet could
be the problem ?
I put some debug lines to every functions, but it's crashing randomly,
sometimes It unserializes all of my elements but crash after, sometimes it
stops to the first element .... I can't understand where it does come from

> Please refrain from top-posting)
>
[quoted text clipped - 16 lines]
> >> ..an example fo the applet
> >> (working or otherwise).
Andrew Thompson - 28 Jun 2005 15:29 GMT
> I was wondering .. is it possible that the fact that I'm using JApplet could
> be the problem ?

Not very likely(*), but you can test that theory by
stripping the processes from behind the GUI and
seeing if that crashes.

* The only cause of this that I can think of is
'buggy Swing implementation in particular JRE',
but I have not heard of any Swing bugs that seem
related to the problem as described.

> I put some debug lines to every functions, but it's crashing randomly,
> sometimes It unserializes all of my elements but crash after, sometimes it
> stops to the first element .... I can't understand where it does come from

You need to proceed to an URL and code example to
have a good chance of progressing this further.

And again - *Please refrain from top-posting*
If you do not understand what that is,
please Google 'top-posting'.

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Roedy Green - 28 Jun 2005 16:28 GMT
>I was wondering .. is it possible that the fact that I'm using JApplet could
>be the problem ?
>I put some debug lines to every functions, but it's crashing randomly,
>sometimes It unserializes all of my elements but crash after, sometimes it
>stops to the first element .... I can't understand where it does come from

see http://mindprod.com/jgloss/applet.html

for how to turn your Applet into an hybrid that can also run as an
application. Then it is much easier to debug.

Signature

Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes

Roedy Green - 28 Jun 2005 16:27 GMT
>(Assuming no) Have you looked at the Java console in IE?
>MSVM: Alt V(iew) | J(ava Console)
>Sun VM: Alt T(ools) | Sun Java Console

for hints on various browsers to see the console see
http://mindprod.com/jgloss/console.html

Signature

Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes

Roedy Green - 28 Jun 2005 16:26 GMT
>By signing the class I made the unserialization work. But I still have a
>problem : when I'm accessing my applet from my computer, no problem, but
>when I try to access it from another computer of the network, IE crashes !!!

unsigned Applets have many restrictions.  See
http://mindprod.com/jgloss/applet.html
http://mindprod.com/jgloss/signedapplets.html

Signature

Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.