• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem while running applicaiton through jar commands........

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I created client.jar and server.jar files. In client.jar I inlcuded the stub files also with directory structure. In the server.jar also I includes stub & skel files. I even gave the correct manifest files in both jars..and the executing the server.jar like below..
start rmiregistry 9999
java -Djava.security.policy=mysecurity.policy -jar server.jar db.db 9999
I am getting following exception:::
Exception: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: suncertify.server.DataServerInterfaceImpl_Stub
where DataServerInterfaceImpl is the main class in starting the server.
where as the above command executes fine, if I extract the server.jar first before starting the server by using the following command..
jar -xf server.jar
I am feeling that it's not the correct way of running the jar files..where as, client .jar working fine with out extracting that. Why it is happening for server.jar only that too I am providing all files necessary for it's executing with directoy structure..
Please help me out from here..
Thanks a lot..
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like you have an RMISecurityManager class in your server and that is what is stopping your jar from running.
Mark
 
jyothi sunke
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,
Yeah, previously my source code had that RMISecurityManager..but now I removed that code and executed again..
but even then it's not working...What might be the reason for that??
Thanks in advance..
[ November 15, 2002: Message edited by: jyothi sunke ]
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now run the server jar like
java -jar server.jar <<any arguments here>>
no need for a policy file now.
Mark
 
jyothi sunke
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,
I executed with out policy file, now above exception is not coming but I am experiencing some other problem...
It is giving following exception..
Exception: access denied (java.io.FilePermission db.db read)
I checked the properties of file and it is not read only file..I didn't understand the problem...
Today I am experiencing lot of wierd problems while executing the application..
Thanks in advance..
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jyothi,
check whether you have installed a security manager, either programmatically or as a command line argument. Remove the security manager, and try again.
Hope this helps.
 
jyothi sunke
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mag & Mark,
What do u mean by installing the security manager?? I have following code on server side before binding the object in Naming service..
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
previously I set SecurityManager before lookup on client side also.. Now I removed on client side..
Except that I nowhere installed the SecurityManager...
IS this correct???
Thanks in advance...
 
Mag Hoehme
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jyothi,
exactly this piece of code - just remove it and try again.
 
jyothi sunke
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mag,

I tried that also..This time I am getting the following exception again..
Exception: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: suncertify.server.DataServerInterfaceImpl_Stub..
If I keep this code, on server side I am not getting this exception and at that situation I am getting db.db read only exception..What Should I do Mag???
Thanks a lot for ur help..
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I tried that also..This time I am getting the following exception again..


Now package your stubs in your client jar, and everything will work.
Eugene.
 
jyothi sunke
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, server is not starting..How can I execute client with out starting the server..I didn't understand...
Thanks...
 
jyothi sunke
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I understand that problem is in Manifest file
and in setting the class path.
Manifest-Version: 1.0
Main-Class: suncertify.server.DataServerInterfaceImpl
Created-By: 1.2.2 (Sun Microsystems Inc.)
In this, I am trying to give Class-Path also..but I didn't find any difference in the result.
So, how to set Class-Path in Manifest file..
Thanks in advance..
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where are you running your jar files from.
If you have c:\devexam\suncertify\server your jar should reside in the c:\devexam directory. Actually in the jar file the class files have the paths included, in the paths it should not have c:\devexam, it should have suncertify\server in it's path, which means you create your jars from the c:\devexam directory.
Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic