Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

returning a hashmap

 
marten kay
Ranch Hand
Posts: 188
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A real beginners question.

I am populating a HashMap (DnaiInstrument) in a database utility as below



I then when I call the getInstrument() method in the code below I get a
java.lang.NoClassDefFoundError: DNAI/data/DnaiDB DNAI.struts.TestAction.execute(TestAction.java:41)



Something is wrong at the DnaiInstrument = DnaiDB.getInstrument();

where I am returning a HashMap into a HashMap variable. The program compiles, and intuitively I understand that this may be wrong, but I can't figure out how.

Hope someone can help, thanks
[ September 05, 2008: Message edited by: marten kay ]
 
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
Nothing wrong with the code if it compiles; this is just a deployment problem. Either you're not putting all the class files into your jar(s), or some of your jar files aren't being put in the right place in your web server. I'm going to move this over to the Struts forum, because perhaps Struts has some special requirements for how classes have to be installed. But again, there's nothing at all wrong with the code -- it has nothing to do with "returning a hashmap."
 
marten kay
Ranch Hand
Posts: 188
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ernest

I now think it was something in my netbeans, I rewrote the class with a different name but same code and it now works. This case closed.

thanks again and cheers

Marten
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic