aspose file tools*
The moose likes Struts and the fly likes returning a hashmap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "returning a hashmap" Watch "returning a hashmap" New topic
Author

returning a hashmap

marten kay
Ranch Hand

Joined: Feb 03, 2007
Posts: 176

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 ]

when in doubt put it in parenthesis and stick a dollar sign in front of it, only good can come from this.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

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."


[Jess in Action][AskingGoodQuestions]
marten kay
Ranch Hand

Joined: Feb 03, 2007
Posts: 176

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: returning a hashmap
 
Similar Threads
Need some exam links for Generics and help related to a question in Generics
Instantiating abstract class - Spring in Action 2nd Edition
What am I doing wrong?
Doubt in generic method
Getting different output in a Spring project