• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Problem Running Struts Example

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure if this is a Tomcat Problem or a problem with my configuration of STRUTS & Tomcat so if this needs to be moved, please do so.
I was attempting to run the example that Thomas Paul had on the newsletter about STRUTS from March 2002. I believe that I did everything correct and I am getting this error message.

If this mess makes any sense with anyone, could you please help me.
Thank you
 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Seems like you don't have the resource file in the proper place. Either that or you are missing an entry in the web.xml file,
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I have the MessageResources.properties file in the struts\WEB-INF\classes\test\struts folder. And the Web.XML file I just copied and pasted from the <Listing 1> and it is in the struts\WEB-INF folder. So I think everything is there.
 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try the ApplicationResource.properties file...
also look at this thread: Why use Struts?
I keep fighting it, so now I at least find some of these..
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ha, I am inclined to agree with Ken on this topic. I think I would rather program my own logic and try and debug it than try and debug logic that someone else planned out for me.
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gregg Bolinger:
Ha, I am inclined to agree with Ken on this topic. I think I would rather program my own logic and try and debug it than try and debug logic that someone else planned out for me.


I see. So you don't code in Java since you wouldn't want to have to debug a JVM.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok ok. Good point. I am still getting that error from above though if anyone can suggest anything else.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, the documents say to put the war files in the webapps folder of my container. Why do we need to do this, and more importantly, why DON'T we need to do this for the example that Thomas Paul provided. Or am I needing to do that and Thomas was just assuming we read STRUT'S install instructions.
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like title.login is missing from the MessageResources.properties file!
add this line:
title.login=Login Screen
[ September 17, 2002: Message edited by: Thomas Paul ]
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gregg Bolinger:
Also, the documents say to put the war files in the webapps folder of my container.

The war files are for the Struts examples. You don't need them to run my example.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Thomas. Fixed that problem. Now it says:
Cannot retrieve definition for form bean null.
Looks like I have some research to do. Oh well, what is better than a fun night of reading and debugging.
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mkae sure you have these lines in your struts-config.xml file.
<!-- ========== Form Bean Definitions ============ -->
<form-beans>
<form-bean name="login" type="test.struts.LoginForm" />
</form-beans>
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I received the same null error. The struts-config.xml does contain the proper form beans definition.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gregg Bolinger:
Ha, I am inclined to agree with Ken on this topic. I think I would rather program my own logic and try and debug it than try and debug logic that someone else planned out for me.


Again, my point is missed.
My point is that the J2EE API is itself a framework. You have not yet reached the point where you can implement your application specific logic becuase you are still installing/learning/understanding the 'framework' you have chosen.
I feel that if one fully understands the JSDK functionality provided directly from SUN (and implemented by all vendords) and one fully understands STRUTS, they will see very, very little is added for the cost required.
Take a few minutes and layout how you would do a few pages in STRUTS. Then take a few minutes and layout how you would do the same pages using the JSDK. You will see that regardless of what you use, the same exact application specific logic will make up the vast majority of your work (I put the number at 95%+, however I'm sure that will be debated here).
[ September 19, 2002: Message edited by: Ken Robinson ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Ken, we get it by now. You feel you gain nothing by using STRUTS. If you are not convinced by now that STRUTS is a useful tool, I don't think you ever will be. I didn't miss your point. You have a lot of points. You have a lot of valid points for your opinion. As do Thomas and everyone else for theirs. I think the horse is dead now.
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ken, I have written hundreds (if not thousands) of servlets and JSPs. I have written applications without Struts. I have written applications with Struts. I like Struts. I think Struts allows you to easily write well distributed applications in an Model 2 architecture. You disagree. Fine. I think we have now officially beaten this to death.
 
Ken Robinson
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Geesh, getting brutal here.
Something I said was not used in the context I had intended. When that happens I like to clarify what I meant.
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the cause of the form bean null error. Later in the tutorial there is an updated struts-config.xml and an ActionForm class. Adding these takes care of that error. There is now a new error. There is now a null pointer exception in the LoginBean. It appears that the userId variable is not being set.
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found a couple of mistakes in the example and they have been corrected. If you start from the top and get the current listings it should work.
If you have trouble with Tomcat not seeing your properties files, remove the struts.jar from the jre/lib/ext file and put it somewhere else in your classpath.
 
This is awkward. I've grown a second evil head. I'm going to need a machete and a tiny ad ...
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic