• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI stress...

 
Arno Reper
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Im searching and breaking my brain but...i don't understand where the problem is.
When I launch the app in stand-alone mode...no problem
When I launch the server...no problem
When I launch one client connected on the previous server...no problem
But...
When I launch a second client on the same server i got a NullPointerException. Do you know what the problem is? or could be?

Here is the full stack trace...
Thank you for your help
Arno


 
Eamonn O'Connell
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That could really be anything. Have a look at your persistContractorRecord() method. See what is causing NPE and take it from there. It could be that your design is not suitable for concurrent threads...
 
Arno Reper
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tested it, it look thread-safe...so i don't think its coming from datafileaccess, i think its the rmi stuff that has a problem somewhere...
Maybe my fa´┐Żade...it makes me crazy

ps : line 265 is synchronized(database)

the worst thing is that the file is modified...its just insane lool
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arno,

I think that your problem is on :
at suncertify.db.DataFileAccess.persistContractorRecord(DataFileAccess.java:265)

"line 265 is synchronized(database)" - the synchronized does not care about the null references.

Regards,
M
 
Arno Reper
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Im almost sure its not there...i think its a RMI problem
because of this
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

I follow my searches
Arno
Thanks for your help
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the value of the reference variable database just before you enter the synchronized block? If it is null go up the call stack checking its value as you go.
 
Arno Reper
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not null because the database is the RandomAccessFile and after i get this exception the file is modified...thats the "funny" thing.

The NPE only happens when i try to write (update)to the file and that i have two clients connected to the server ( only one is sending a request... ). The search function is working well...
Arfgh...

Arno

[ May 01, 2007: Message edited by: Arno Reper ]
 
Arno Reper
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is :
when i connect to the server with one client it works normally...but when a second client connect, the first one and the second one have a NPE when I have to update the file...maybe is there something wrong with the server...
AAAAaaaah I am so noob with networking and RMI...(I m still a programmer student)

Arno
 
Arno Reper
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Illumination...
Could it be that its because I don't use 'rmic' on my RemoteObject?
I thought I didn't need it with 5.0...So would it change something?

ps: I would do it later for Sun...

==>[EDIT] Noooop...its not the problem [ May 01, 2007: Message edited by: Arno Reper ]

==>[RE-EDIT] POOOWWWWAAAA I got that little damn well hidden bug !!!
YEEEEEEEEEEEEEEEEEEEEEEAAAAH...I'll finally sleep nice today...loool
Make me happy...

Arno

[ May 01, 2007: Message edited by: Arno Reper ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic