This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Cannot create bean of class

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can someone help me solve this:
I am using Web Sphere 4.0 and i get the following error when using a bean
Servlet Error: Cannot create bean of class [Classname]: javax.servlet.ServletException: Cannot create bean of class [Classsname]
Thanks,
janani
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A few things i did when i encountered the same problem.
1.Introduced a package for the bean program.(test)
2.Make sure the class file is placed inside
the package folder for example
web-inf/classes/test/yourclass.class, test being your package name.
3.Check if the package name test is the first line of your bean program.
4.While using useBean use the following syntax
<jsp:useBean id="cart" scope="session" class="test.ShoppingCart" />
test being the package name and ShoppingCart
your class(bean) name.
Note: The following syntax gave me a ServletException. Don't know what was wrong.
It seems valid code to me.
<%@ page import="test.*" %>
<jsp:useBean id="cart" scope="session" class="ShoppingCart" />
 
Look! I laid an egg! Why does it smell like that? Tiny ad, does this smell weird to you?
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic