cancel
Showing results for 
Search instead for 
Did you mean: 

Exception raised from invocation of public java.util.Hash

former_member192766
Participant
0 Kudos

Hi All,

I have created a Web service from an EJB 3.0 project using Hashtable and receive the following error when testing the Web Service in WS Navigator or other SOAP tool:

<faultcode>SOAP-ENV:Server</faultcode>

<faultstring>javax.ejb.EJBException: Exception raised from invocation of public java.util.Hashtable services.ReadTableBean.getCoreCategories() method on bean instance services.ReadTableBean@14da54a9 for bean demo.sap.com/ia~ear*annotation|demo.sap.com~ia~ejb.jar*annotation|ReadTableBean; nested exception is: java.lang.NullPointerException</faultstring>

<detail>

<yq1:com.sap.engine.interfaces.webservices.runtime.RuntimeProcessException xmlns:yq1="http://sap-j2ee-engine/client-runtime-error">

<!-- javax.ejb.EJBException: Exception raised from invocation of public java.util.Hashtable services.ReadTableBean.getCoreCategories() method on bean instance services.ReadTableBean@14da54a9 for bean demo.sap.com/iaear*annotation|demo.sap.comia~ejb.jar*annotation|ReadTableBean; nested exception is: java.lang.NullPointerException -->

</yq1:com.sap.engine.interfaces.webservices.runtime.RuntimeProcessException>

Any idea's?

Regards,

Ridouan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

looks like your are using <null> as key or value for a hashtable entry which is not allowed for Hashtable entries (see [javadoc|http://java.sun.com/j2se/1.5.0/docs/api/java/util/Hashtable.html]

If you need <null> as key or value use HashMap instead

regards franz

...close thread if message is answered

former_member192766
Participant
0 Kudos

Hi Franz,

Thanks for your prompt response.

I changed the hashtable to hashMap but the problem still exist.

I am trying to read data from SAP using JCo and the FM RFC_READ_TABLE.

Here is a piece of code:

if (valueSet.getNumRows() > 0) {

valueSet.firstRow();

// Loop through the result set

while (valueSet.nextRow())

{

String waValueString = valueSet.getString("WA");

//Object waValueObject = valueSet.getString("WA");

String waValue = (String) valueSet.getValue("WA");

//resultHashTable.put(waValueString, waValue);

hashMap = new HashMap();

hashMap.put(waValue, waValueString);

// Sort the hash map using a tree map

treeMap = new TreeMap(hashMap);

}

What I am doing wrong here?

Thanks,

Ridouan

former_member192766
Participant
0 Kudos

Hi,

It was not the hashtable but the EJB could not find a property file with the connection string.

Thanks!.

Ridouan

Answers (0)