cancel
Showing results for 
Search instead for 
Did you mean: 

Importing java bean model

Former Member
0 Kudos

Hi,

I am trying to import an java bean model in web dynpro application .While selecting bean archive file , am getting this error can anybody help me.

Error : invlaid Class - JavaBean not available for import

Thanks in advance.

regards,

Krish.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

try to read this.

They consist steps related to import.

Importing a JavaBean Model

http://help.sap.com/saphelp_nw70/helpdata/EN/d7/3e07419a60ef6fe10000000a1550b0/frameset.htm

JavaBean Model in a Development Component Project

http://help.sap.com/saphelp_nw70/helpdata/EN/c3/321b410210ef6fe10000000a1550b0/frameset.htm

Hope this may help you.

Regards,

Deepak

Former Member
0 Kudos

hai deepak thanks a lot ,

I studied thoose articles and i follow the step but still am not clear....

Am getting the same error

can help me ....

regards,

krish

Former Member
0 Kudos

Hi.

Cud u please giv a brief idea abt steps which u hav follwd..?

i mean which projcts u hav creatd n in wch sequence..n whre is ur business logic??

Regards,

Khushboo

Former Member
0 Kudos

hai khushboo,

Thanks a lot , My application name SampleWD .

Steps are as follows

i) copied the java bean jar ( Addbean.jar ) to the wdproject lib folder

ii) set the classpath to TSSAP -Javax home (extends ejb20.jar file)

SampleWD -> Model

Model -> createmodel

Model name : Samplemodel

Model package : com.sample

local jar file : C:\sap\workspace\SampleWD\lib\Addbean.jar am error int this step as Invalid class - java bean not available for import

regards,

krish

Former Member
0 Kudos

Hi Krish,

try one thing first delete ur old jar file then again create fresh ones by build archive option for both java n ejb project..

u have 2 copy 2 .jar files into lib folder of ur web dynproject..

1) .jar file of ur java project.

2).jar file of ur ejb project.

after doin this Add both jar files to the class path of ur webdynpro project by Web Dynpro project->properties->java build path->libraries.

now Add ejb20.jar to the classpath via classpath variable

TSSAP_JAVAX_HOME...for this u just edit path of variable. chk if anything is givin warning or not..if no warning is coming then u have added jars successfully...

Creae new hava bean model ..

Hope it work for u..

Regards,

Khushboo

Edited by: Khushboo Singhal on Aug 18, 2008 2:31 PM

Edited by: Khushboo Singhal on Aug 18, 2008 2:35 PM

Former Member
0 Kudos

hai Khushboo,

I did all the things and then only i tried to import the jar file .. But it is not working

regards,

Krish

Former Member
0 Kudos

hai khushboo,

i changed the TSSAP_JAVAX_HOME path but its show lots of error

The default path for TSSAP_JAVAX_HOME :C:/Program Files/SAP/JDT/eclipse/plugins/com.tssap.ext.libs.j2ee_1.3/

i changed path as C:/Program Files/SAP/JDT/eclipse/plugins/com.tssap.ext.libs.j2ee_1.3/lib/ejb20.jar by clicking edit button

is this the correct path for that variables ?

But i tried this step and am not getting any error

in libraries tab - choosing TSSAP_JAVAX_HOME variable, select extend a popup window will appear in that select ejb20.jar.

is this step is correct ?

Former Member
0 Kudos

Hi Krish,

Delete this entry for ejb20.jar..

now try this for adding ejb20.jar

go to libraries then Add Variable now select TSSAP_JAVAX_HOME.

after doin this select this varable frm libraries which will b displayed to you aftr add variable step..

now go to edit then u'll get edit class path entry..

n paste this TSSAP_JAVAX_HOME/lib/ejb20.jar

nw apply n okay..chk it..it will wrk dfntly...ur error during build classpath will b removed..

Regards,

Khushboo

Former Member
0 Kudos

Hi,

Please go through this

Regards

Ayyapparaj

Former Member
0 Kudos

hai khushboo,

error got cleared that has been generated by classpath variable but still i cant import the java bean jar file ..... Same error

Invalid classes - java bean not available for import

Former Member
0 Kudos

hai Ayyapparaj,

Thanks a lot for ur kind reply..

I studied those articles and then only i started doing project .. But still am not clear ...

regards,

Krish

Former Member
0 Kudos

Hi Krish,

Then problem is wid ur wrapper class ..i.e ur command bean of java project..

chk ur code for command bean..hav u genrated gttr n settr methods properly for all fields??

Regards,

Khushboo

Former Member
0 Kudos

hai khushboo,

Thanks a lot kind reply its very helpful ,

I got cleared those error... I followed as

SampleWd - > Model

Model - > createmodel

i had given model name, package and jar file by selecting local jar file .. so far no error after clicking next ..

a support class appear means commandBean class

while selecting this class and by clicking Add-> button am facing a new error

Invalid class - CommmandBean as model class already exisits

can help me to slove this issue

regards

Krish

Former Member
0 Kudos

Hi Krish,

Then u need to delete ur old model..n all files related to tht model..

smetimes u cnt create a new model if old exists..

Delete ur old model n all related file wid that n create new one..

if still it gives error then create new web dynpro project n copy whole layout to new one's layout..so tht u can save ur efforts..bt than u'll hav to add again all jar files n class path...

it will take sme efforts but ur problem related to invalid model will b resolved..

And follow evrythng step by step while u r creating new web dynpro project.

aftr creation add jars to lib then add class path to those 2 jars.

while u r adding class path for ejb n commnd bean jar add from path from lib folder from ur web dynpro project.

latr on add ejb20.jar as i told u..

..n atlast create new model for command bean..

hope ur problm solves..

Regards,

Khushboo

Edited by: Khushboo Singhal on Aug 20, 2008 12:08 PM

Edited by: Khushboo Singhal on Aug 20, 2008 12:46 PM

Answers (3)

Answers (3)

siddharth_jain
Active Contributor
0 Kudos

Hi Krish,

try deleting the existing java bean jar file from the lib folder.

again generate the jar file from the Java bean project.

Copy the new generated jar file into the lib folder of WD project.

Also copy the the EJB jar along with the Java Bean jar file to the Webdynpro lib folder.

reload and rebuild the WD Project.

try import the model again.

Regards,

Siddharth

Former Member
0 Kudos

hai siddharth and khushboo,

Thanks a lot for your kind reply...

I did as you poeple suggested ... I deleted all related projects even i created a new web dynpro project but , am facing the error as

Invalid class - SampleBeanClass as model class already exists

Former Member
0 Kudos

Hi Krish,

for create model when u reaches to Add jar step..pick up jar from java project...then click on next-> next...and at last step for finsihing it if it asks to overwrite any file select yes only do not select yes to all option..bt if u hav creatd any model already it will giv u a mssage that class already exist..it will wrk wn u r creating model first time for WD project..

second option is to reimportmodel:

you simply select model and right click choose reimport the model.

when u click as like that then what are the changes are in model those are reflected in existed model..

hope it will solve ur problm...

Regards,

Khushboo

Edited by: Khushboo Singhal on Aug 22, 2008 2:50 PM

Former Member
0 Kudos

hai khushboo,

I tried your suggestions .. still am not clear ... am wishing to send some screen shots of my sample webdynpro project with the steps i did and with the error that am facing now if you accept... how can i send those to you ..?

Former Member
0 Kudos

Hi Krish Krish

I had this issue today, the unique diference is that I tried to import just java beans ( not entity beans ), but the error message was the same.

To resolve this problem I deleted all of my bean classes and I have created those again, I think the problem was that the DTS have not worked well before.

Because after I deleted the classes and restarted the NWDS I created the bean classes again and the DTS asked if I wanted to put those files in one activity, and after that the import worked very well.

Former Member
0 Kudos

.. and make sure that your wrapper classes are located in a package at least. if your wrapper is located on the default (no package) -- then you will get this error: CommmandBean as model class already exisits

this should resolve the mentioned issue. goodluck.

Former Member
0 Kudos

Hi Krish,

Add ejb20.jar as External jar ( jar file will be there in the server installation folders) in the Java Build Path of webdynpro project.

This will solve your issue.

Thanks

Madhu

Former Member
0 Kudos

hai Madhu ,

Thank a lot i had added that ejd20.jar to the project using TSSAP_JAVAX_HOME variable ... that is what i mentioned in the previous reply as

ii) set the classpath

regards,

Krish

Former Member
0 Kudos

Hi,

After u generate the jar file of the command bean u need to copy the jar file in lib folder of the project by switching over to navigational tab.then try importing the bean model.

regaurds,

Nikhil Tapkir.

Former Member
0 Kudos

hai Nikhil,

Thanks a lot

I did as u said but still .. am not able to import

regards,

Krish