• 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
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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" />
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic