• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UnMarshalException,ClassNotFoundException

 
aleks nikolic
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any comments on the following ?
C:\starting>java -Djava.rmi.server.codebase=file:/suncertify/client/ -Djava.secu
rity.policy=fbn.policy suncertify.client.FBNGui DataServer Remote
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: access denied to class loader
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: access denied to class loader
java.lang.ClassNotFoundException: java.security.AccessControlException: access d
enied (java.io.FilePermission \suncertify\client\- read)
<<no stack trace available>>
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd take a look at the security exception that is being thrown. This seems to be the cause of the classloading issue which, in turn, throws the UnmarshalExeception. According the the Sun Doc's these cases will throw an UnmarchalException
1) if an exception occurs while unmarshalling the call header
2) if the protocol for the return value is invalid
3 )if a java.io.IOException occurs unmarshalling parameters (on the server side) or the return value (on the client side).
4) if a java.lang.ClassNotFoundException occurs during unmarshalling parameters or return values
4) if no skeleton can be loaded on the server-side; note that skeletons are required in the 1.1 stub protocol, but not in the 1.2 stub protocol.
5) if the method hash is invalid (i.e., missing method).
6) if there is a failure to create a remote reference object for a remote object's stub when it is unmarshalled
Hope this helps
Sean
 
aleks nikolic
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately I get "no stack trace available" .
But everything works fine when I use a web server and http URLS. When I switch over to file URLs I get this crazy error at the point where I modify a record . i.e. DataInfo object is being sent to the server . Why it is having trouble UnMarshalling or why there is AccessControlException is beyond me . I'm starting to think it has something to do with a glitch of some kind .
I'm just not sure whether or not I should hand in my assignment as is . Maybe the markers are using a web server anyway ?
 
tsmets
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Have you checked against the : http://java.sun.com/products/jdk/1.2/docs/guide/rmi/codebase.html#section6
The second thing is clearly the need for a authorisation to use the file:// class loader. Apparently the policytool does not include the possibililty to authorize class loaders but for the java.io.FilePermission...
I'm also very much awaiting for someone who could help on that one !

Originally posted by aleks nikolic:
Any comments on the following ?
C:\starting>java -Djava.rmi.server.codebase=file:/suncertify/client/ -Djava.secu
rity.policy=fbn.policy suncertify.client.FBNGui DataServer Remote
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: access denied to class loader
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: access denied to class loader
java.lang.ClassNotFoundException: java.security.AccessControlException: access d
enied (java.io.FilePermission \suncertify\client\- read)
<<no stack trace available>>


------------------
 
aleks nikolic
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This happened a long time ago but as I recall the correct syntax is
java -Djava.rmi.server.codebase=file:suncertify/server/
-Djava.security.policy=fbn.policy
suncertify.server.DataServerImp
DataServer suncertify/db/db.db
i.e. you will notice that it is file: , not file:/ . It was a relative directory not absolute . That made the difference . Also the codebase wasn't required on the client side .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic