• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

APPLET ClassLoader & Connecting to Server

 
Saroj Samal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have applet for loading class from network url. The same url is locating to jar file.Loading of class and starting executing the same is successful.

During loaded class execution it connects to my server with same codebase. It is giving error. System not allowing to connect any site not allowing to own server from where it is loaded. it is not allowing to read the System Property.
Please help me......

I have signed the applet.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

What error message are you getting? TellTheDetails
 
Saroj Samal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Error Details follows ............................


Error during executionjava.lang.reflect.InvocationTargetException

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at Simple.start(Simple.java:34)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.io.FileNotFoundException: Startup.txt

at webl.lang.Machine.<init>(Machine.java:33)

... 7 more




 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The constructor of some class (the class for which you're calling Constructor.newInstance() at line 34 in Simple.java) is throwing an exception; if you caught the exception above and printed the trace from calling getCause() on it, you'd see the actual root cause exception as thrown by the constructor.

The class loading is over and done with at the point where this exception happens.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So where is the file Startup.txt? Should it be somewhere else?
[ January 24, 2007: Message edited by: Ulf Dittmer ]
 
Saroj Samal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ernest Friedman-Hill,

You are right. The cause is java.io.FileNotFoundException: Startup.txt.

Inside constructor it is connecting to my Server to read Startup.txt from zip file. Due to security exception for loaded class could not able to read file Startup.txt file.

The error is occuring for Security Exception in Applet. My Applet can do same job without any error. But it is throwing error during excution from Loaded Class.

Eny Solutin is there for this to handle.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inside constructor it is connecting to my Server to read Startup.txt from zip file.

I doubt that it is connecting to the server, because in that case it wouldn't be using the java.io package, it would be using the Class/ClassLoader resource mechanism. Are you certain that it isn't looking for that file on the local disk?

My Applet can do same job without any error.

I'm not sure what you're saying here - has the applet worked before without throwing an exception?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic