cancel
Showing results for 
Search instead for 
Did you mean: 

NullPointerException Importing Java Bean Model

Former Member
0 Kudos

Hi Experts,

I'm facing the following Probelm when I try to import an Jar-File as a java bean Model:

<i>Plugin name: Web Dynpro Model Editor Services

Plugin ID:com.sap.ide.webdynpro.service.modeleditorcom.sap.ide.webdynpro.modeleditor.wizards.model.creation.ModelWizard

Method: doImportJavaBeanModel()

Message: Failed to create model com.sap.testmodel.TestModel Details:

Exception: java.lang.NullPointerException: null</i>

My TestModel is the following:

public class TestClass {
	
	private String name;
	
	public TestClass(){};
	/**
	 * @return
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param string
	 */
	public void setName(String string) {
		name = string;
	}

}

The NWDS Plugin Error Log shows the following:

<i>java.lang.NullPointerException

at com.sap.ide.metamodel.importers.javabean.JavaBeanModelImporter.checkForDuplicates(JavaBeanModelImporter.java:769)

at com.sap.ide.metamodel.importers.javabean.JavaBeanModelImporter.getImportStatus(JavaBeanModelImporter.java:625)

at com.sap.ide.webdynpro.modeleditor.wizards.model.creation.ModelWizard$5.run(ModelWizard.java:856)

at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)</i>

Whats wrong with my Application

Thanks in Advance!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Valery Silaev and Nidhi Rajshree,

thanks for your quick answers. But as you can see in my code its a very simple model. It's just a normal java class and I don't use any non-standard classes in it. This class was developed in a common java project and exported to a jar file. Then I copied the jar into my wd-project and added it to build path. I tried to reimport it several times in different ways->same result.

Now I tend to use a normal java class directly in my wd-project (no jar and not extern) and import it from project folder. That works till now.

I am using NWDS Version 7.0.11

Thanks!

Former Member
0 Kudos

Hi Manuel,

Check whether u added

wdContext.node<modelNode>().bind(new TestClass());

before u executes the model

Check the model mappings also

Regards

Fahad Hamsa

Former Member
0 Kudos

Hi Manuel,

Could you let me know which IDE release and SP you are using?

Moreover try doing the following steps in the order that if the first doesn't work try the next:

1.Reload the WebDynpro project and try importing the Java Bean Model again.

2.Create a new WebDynpro project and import the Java Bean Model.

3.Could you send me the jar file you are using on the following email id:

nidhi.rajshree@gmail.com

Best Regards,

Nidhi

Message was edited by:

Nidhi Rajshree

Former Member
0 Kudos

Manuel,

One of the possible reasons is that your JavaBeans are referring classes not available for your main project (very typical for model import from external jar).

Please check this.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net