This discussion is archived
0 Replies Latest reply: Feb 17, 2012 6:24 AM by 918284 RSS

Could not instantiate bean

918284 Newbie
Currently Being Moderated
Hi Guys,

I am not much familiar with Java. I have developed my java program using jdk1.6 and am trying to register java bean using jdk.1.3.1.08 sun.beans.ole.packager utility and when i reach step 5 and click register i am getting below error message. Can someone help me understand what i am doing wrong. The class file is located in excel\test\Getfileinfo.class and it does have constructor definition in it. Thanks.

c:\jdk1.3.1_08\jre>.\bin\java -cp .\lib\rt.jar;.\lib\jaws.jar sun.beans.ole.Packager
The definition for excel.test.GetFileInfo in the JAR file
has a format error.

WARNING: Could not instantiate bean "excel.test.GetFileInfo" from JAR "C:\excel.jar"
But were unable to load the class "excel.test.GetFileInfo" because of
java.lang.ClassNotFoundException: excel.test.GetFileInfo
Common reasons for this failure include:
(1) The class is not defined in the correct package
it should be in the package "excel.test"
(2) The class has not been given the correct name
it should be called "GetFileInfo"
(3) The class file contains the wrong class or no class at all

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points