Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception creating bean of class

 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a simple Struts application; I am getting following exception when I invoke a struts servlet.

javax.servlet.ServletException: Exception creating bean of class java.mybank.appl.CustomerForm: {1}
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl


Following are details of my code

struts-config.xml




class is apprpritately defined and in correct package. Can anyone help what can be posible cause?

thanks
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which Struts version you are using ?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See question 9 of our FAQ.
 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts - 1.3.8
 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Merrill Higginson:
See question 9 of our FAQ.


Merril,

I in fact followed and verified all the four things, the name, spelling, class file existance, and public constructor. Every thing seems to be fine. There must be some very stupid mistake I may be making.. still sturggling.

Thanks
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem may be because of you are using old dtd , see here for old version


Try to make it 1.2 or 1.3 ,

and remove this line , and see .



See whether this works or not !
 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sagar,

That was a good catch I appreciate. But still problem persists. Following is my new struts-config.xml file



ALso here is my web.xml in ncase there is any issue here. (which I doubt)



Thanks for help..
 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just looked in the catalina_logs file in tomcat/logs folder and here is exception trace I found. IF this can be of any help.

 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like I finally resolved the issue. Let me update here soon once I fully resolve the new issue I am facing. I will put in the reason here.

Thanks for all the help
 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is resolved. The whole Issue was that I was using "Java" in my package name. I think this is restricted!!! I didnt know this till now though I am working in java for some long time now.

Merill you also have mentioned this in one of other threads at a place
http://www.coderanch.com/t/58159/Struts/Missing-message-key-welcome-title

Thanks for all your help and time Sagar / Merill.
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 'java' word in package was my doubt when I first saw your question , but I didn't dare to point, coz its looks fine, Why cant we create a sub package like java.util.myutil package, If This package is in my classpath, then whts the big issue ?
 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this is restricted by "Java" people. May be because if in future they need to have some package with exactly same name then the application will break.
As they keep on releasing new versions so people should not create any package in their own projects which may contradict with any probable future package of java.

Thats my understanding.
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Himanshu Kapil:
I think this is restricted by "Java" people. May be because if in future they need to have some package with exactly same name then the application will break.
As they keep on releasing new versions so people should not create any package in their own projects which may contradict with any probable future package of java.

Thats my understanding.


Ok thats sounds reasonable !

Any other non-guessed answer ?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just so you all know, I've added the java package name problem to the FAQ as one other thing to look for if you get the "Cannot create bean" message.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic