on 10-23-2008 8:44 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.