cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Importing JavaBean Model in NetWeaver Developer Studio

Former Member
0 Kudos

Hello,

I'm having a problem importing a JavaBean Model in NetWeaver Development Studio. I am running 2.0.11 (SP11).

I have a DC with the with one JavaBean defined:

package com.test.bd;

import java.io.Serializable;

import javax.naming.InitialContext;

import javax.naming.NamingException;

import com.test.entity.ContactInformationLocal;

import com.test.entity.ContactInformationLocalHome;

public class ContactInformationBean implements Serializable {

private ContactInformationLocalHome home;

private String firstName;

private String lastName;

private String email;

public ContactInformationBean() {

try {

InitialContext ctx = new InitialContext();

home =

(ContactInformationLocalHome) ctx.lookup(

"java:comp/test.com/test-ear/ContactInformationBean");

} catch (NamingException e) {

e.printStackTrace();

}

}

/**

  • @return

*/

public String getEmail() {

return email;

}

/**

  • @return

*/

public String getFirstName() {

return firstName;

}

/**

  • @return

*/

public String getLastName() {

return lastName;

}

/**

  • @param string

*/

public void setEmail(String string) {

email = string;

}

/**

  • @param string

*/

public void setFirstName(String string) {

firstName = string;

}

/**

  • @param string

*/

public void setLastName(String string) {

lastName = string;

}

public void executeLoadByEmail(String email) {

try {

ContactInformationLocal bean = home.findByEmail(email);

setFirstName(bean.getFirstName());

setLastName(bean.getLastName());

setEmail(bean.getEmail());

} catch (Exception e) {

e.printStackTrace();

}

}

public void executeStore() {

try {

ContactInformationLocal bean = home.findByEmail(getEmail());

bean.setFirstName(getFirstName());

bean.setLastName(getLastName());

} catch (Exception e) {

e.printStackTrace();

}

}

}

Its used DC references are set to ejb20, and my entity bean DC.

Next, I have a Web Dynpro DC that i'm trying to import my JavaBean into as a model. I have added my JavaBean DC and the ejb20 DC (but not my entity bean DC) to its used DC references.

When I try and import the JavaBean as a model, the IDE freezes up after I click next in the first wizard screen. If I let my IDE wait for about 30 minutes (in the mean time it is completly locked up and will not respond to user input), it will finally come back and say invalid jar file, no JavaBeans available for import.

Can anyone tell me what I'm possibly doing wrong? Is there a problem with my JavaBean itself or the way that I'm referencing it?

Thanks for your help!

Chris

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Chris,

maybe you had the same problem like I had: the export function of the Development Studio renders a slightly different jar-file than the SDK jar-tool. I posted an example:

Jari

Former Member
0 Kudos

What is your source folder where you put JavaBean? It shuld be "src/packages". I have similar problem when I put java class in another source folder.

Former Member
0 Kudos

I solved the problem. I moved the ejb method calls out to a delegate object and Netweaver liked that. It seems that JavaBean models that call to EJBs don't work well--at least when using DC's.

Thanks!

Former Member
0 Kudos

Chris,

Could you run NW IDE in console mode (replace javaw to java in application shortcut)? Then post trace of console here.

Also one guess: try to change existing signature constructor to smth. like public ContactInformationBean(boolena ignore), and add no-op empty public ContactInformationBean(){}. Does import works in this case?

VS