• 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

Struts2 Newbie needs a hint or two

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there!

I am new to struts2, jsp, servlets and all this java web technology. I was hoping to find some help here. I deployed a simple struts2 application. I get this exception:

I'm pretty sure my web.xml and struts.xml are correctly set up as the error began after creating an object. I use the execute()-method of an action to let a static method construct an object and want to print out a string from that object, and in an offline application this works fine, therefore the error has to lie in struts or servlets somehow (and I just don't get it). The code from the action looks like this:


Shown error on website:

Eclipse-Console:

Does anybody see my noob mistake? Something about servlets perhaps, that I might have not seen? If you need additional info please let me know.

Greetings, Akku

--

Update: I got a working HelloWorld-Struts2-System, so I don't search for a Struts-Setup-Walkthrough.
[ July 23, 2008: Message edited by: Tom Dallas ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try deploying and running the struts-blank-2.0.11.war file that comes with the download. If that works, then use struts-blank as the basis for a new project and plug in your action class and configuration entries and see if that fixes it.
 
Tom Dallas
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I did that, moved the code diectly into the struts2-blank-app-helloworld.java and tried to set a string to the message. Struts2 is up and running, but I don't get the object instantiated. The only (not very positive) change is that I don't get the error messages now anymore and that the console doesn't print system.out.prints anymore.

I just don't get it. Can anybody try to help? :-)

---

Update: Do I need an import somewhere here?

---

Update: Now I come closer to the problem: "org.apache.catalina.core.StandardWrapperValve invoke" throws the Exception.

In the documentation of this class it says it does the folowing: "Invoke the servlet we are managing, respecting the rules regarding servlet lifecycle and SingleThreadModel support."

Okay guys, for which attributes of my class do I need setter and getter? Only for those that I define here (did that) or also for every field that I get from my superclass (this would be a lot)? Isn't the lifecycle-management implemented by ActionSupport?
[ July 25, 2008: Message edited by: Tom Dallas ]
 
Tom Dallas
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Owwwww!

Finally the error became clear and it had nothing to do with Struts2, but with missing jars for imported classes. Sorry to have bothered you ... please someone delete this thread .

I swear I'll be looking for my own mistakes more closely before making such a request again! :-(
 
Your mind is under my control .... your will is now mine .... read this tiny ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic