Problem in using org.jdom.Parent in my EJB
852806Aug 5 2011 — edited Aug 5 2011Hi All,
I am using a code below to read a EBM and replace some of the node values in it. For that , initiallly, i want to check whether the XPATH class is working ..
While i run this code in my SOAP-UI i get teh No class definition found exception for the class org.jdom.Parent. But i hav imported that jar inside my project. and i am able to use the line import org.jdom.parent. in my class file.
package EBMhandling;
import java.io.StringReader;
import javax.jws.WebService;
import java.io.StringReader;
import javax.jws.WebService;
import org.jdom.Document;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;
import org.jdom.xpath.XPath;
import org.xml.sax.InputSource;
import org.jdom.Parent;
@WebService
public class UsingJDOMclass {
public String ReplaceEBM(String input,String nodeXpath) {
String modifiedEBM=null;
try
{
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build( new InputSource(new StringReader(input)) );
modifiedEBM=(new XMLOutputter()).outputString(doc);
// String innerXml = (new XMLOutputter()).outputString(XPath.selectSingleNode(doc,nodexpath));
try
{
XPath myxpath=XPath.newInstance(nodeXpath);
modifiedEBM=myxpath.toString();
}
catch(Exception e) {
modifiedEBM="ERROR: inside :" + e.toString();
}
}
catch(Exception e) {
modifiedEBM="ERROR :" + e.toString();
}
return modifiedEBM;
}
}
This is the error i get:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:ReplaceEBMResponse xmlns:ns2="http://EBMhandling/">
<return>ERROR: inside :org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Parent: org/jdom/Parent</return>
</ns2:ReplaceEBMResponse>
</S:Body>
</S:Envelope>
Kindly help me in this regard.
Thanks,
Sabarisri. N