• Post Reply Bookmark Topic Watch Topic
  • New Topic

AbstractMethod Error

 
Ketan Mohite
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Code:This is not the actual code, but the root of the problem is this part.To make it easy to understand, I have changed the code.
Program compiles with no error but issue is there At run time only.

import javax.xml.parsers.SAXParser;
import org.apache.axis.utils.XMLUtils;
/**
* @author Administrator
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class Test {

public static void main(String[] args) {

SAXParser s = XMLUtils.getSAXParser();
System.out.println(s.toString());
}
}

This works fine when run on Eclipse and gives the following output

org.apache.crimson.jaxp.SAXParserImpl@1ac1fe4

But when run from command line, following error is thrown at run time only.

Exception in thread "main" java.lang.AbstractMethodError: javax.xml.parsers.SAXP
arser.getXMLReader()Lorg/xml/sax/XMLReader;
at org.apache.axis.utils.XMLUtils.getSAXParser (XMLUtils.java:270)
at test.Test.main(Test.java:24)

I am using JDK 1.4 and Axis 1.4



Thanks & Regards,
Ketan.
[ July 06, 2006: Message edited by: Ketan Mohite ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am guessing that your Java environment finds different libraries when run from the command line. Take a look at the Javadocs for java.lang.AbstractMethodError - it suggests a possible cause.
Bill
 
Ketan Mohite
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.....
I managed to solve the issue.
There was ns.jar from websphere home/lib directory;
Being it in a classpath,it was causing this error.
When I remove it from the classpath, code runs fine,with no errors.
I could not find why this jar was conflicting the result.
Now new question arises in front of me is that,about the significance of this ns.jar in Websphere..
For a moment I have removed the jar from the classpath, but will it affect the functionality of Websphere?
If anyone knows about this, please share your views.
Anyways, I am going to put this topic in Websphere forum.

Thanks & Regards,
Ketan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!