Why my program on SAX doesn't work?

Hi,
I am learning SAX by myself.
I read the article on this page:
http://java.sun.com/xml/
jaxp-1.1/docs/tutorial/sax/2a_echo.html
And I pasted the program
Echo.java and slideSample.xml
And I downloaded the crimson.jar jaxp.jar and xalan.jar
when I run
javac -classpath .\jaxp.jar;.\crimson.jar;.\xalan.jar Echo.java
I get a single Error.
cannot resolve symbol
symbol: method parse (java.io.File,org.xml.sax.helpers.DefaultHandler)
location: class javax.xml.parsers.SAXParser
saxParser.parse(new File(argv[0]), handler);
1 error
The first time i saw this I thought it might because when I pasted the file down I made some mistake. So that I download another copy of
Echo01.java and slideSample01.xml
when I run javac Echo01.java
the same thing happened.
I believe that these sample of course have been tested.
What's wrong?

Hi,
first make sure you've got the lastest version of Xalan (2.2 D6) if done they may have a problem with jaxp try to compile without jaxp and if it's really needed put it at the end of the classpath for xalan libs to be used first.
I had a problem with a servlet wich used xalan, it didn't work because jaxp libs were used first so I remove it from the classpath and it is now working.
Hope this helps

Similar Messages

  • Why tethering with USB cable doesn't work after IOS6.0 update?

    why tethering with USB cable doesn't work after IOS 6.0 update?

    Try updating the carrier settings, if that doesn't do it try following along with this Apple doc -> iOS: Troubleshooting Personal Hotspot

  • Why some eMac DVD SuperDrive doesn't work?

    Why some eMac DVD SuperDrive doesn't work?
    They have a limited hours life, or some DVD or CD can damage them?
    Thank you

    Hopefully some day I will find the answer for this question.

  • Why an automatic sign in doesn´t work?

    Why an automatic sign-in doesn´t work? I have chosen to the choose: "Sign in me automatically when Skype starting".

    Hi Nadia,
    Although a slightly different issue, could you try solutions 1 and 2 from here: http://helpx.adobe.com/creative-cloud/kb/creative-cloud-application-recognizing-available. html
    Thanks,
    - Dave

  • Why custom logon error messages doesn't work in WAS 7.0, EP 7.0?

    I managed to get custom error messages in WAS 6.40 / EP 6.0.
    I'm using JAAS custom Login module for user authentication and from there different Login Exceptions are thrown.
    I have modified logon.par file to display different error messages like "Logon ID is empty", "Password is empty", "Your user ID or password could not be validated.  Please check and try again."
    When i copy the same code into my working environment i.e WAS 7.0 / EP 7.0, it doesn't work, message always was "User Authentication Failed". Do anyone knows the reason why i was like that?
    Can you please explain exactly when the custom login module gets executed after the user clicks on "Logon" Button.
    In logon.par file i have not seen any code to execute JAAS - custom logon module. PLease explain exact execution flow ..
    Thanks in advance ..
    MMK

    Your card reader might be finicky like mine. Figure out which device your card reader is at (from what I'm reading probably sdb), then attempt to mount /dev/sdb to any location. If your card reader is like mine, this mount will fail but you'll find you now magically have /dev/sdb1, /dev/sdb2, etc devices, which will successfully mount... oddness, but it "just works" so I'm happy
    Note that if you plug a card into a slot that is to the kernel, for example, /dev/sda2, then try to mount /dev/sda1, this will (obviously) fail, so be sure to try mounting all the devices that magically appear (if any do).
    -dav7

  • Program compiles but doesn't work

    The folowing program compiles, but it doesn't work, when I type GuessingGame.play(5); into the interactions pane, I get the message
    No 'play' method in 'GuessingGame'. All my brackets line up and I can't see where the problem is. I would definitely apreciate it if you could help!
    /** Allows a user to play a number-guessing game.
    The constructor takes the integer to be guessed. */
    public class GuessingGame {
    int theNumber; //The number to be guessed by the user.
    int guessNumber; //The users guess.
    public void play(int g){
    theNumber=g;
    guessNumber = Integer.parseInt(JOptionPane.showInputDialog("Guess an integer."));
    while(guessNumber!=theNumber){
    if(guessNumber > theNumber){
    JOptionPane.showMessageDialog(null, "Your guess was too high. Guess again.");
    else if(guessNumber < theNumber){
    JOptionPane.showMessageDialog(null, "Your guess was too low. Guess again.");
    JOptionPane.showMessageDialog(null, "You're right!");

    Sorry, it's just that no-one was answering, it took over 2 hours to get a response. I finally got some help now(with the topic as 'Fun to be had by all!'), so you can now just ignore all of them.

  • Sound doesn't work(only in firefox). why? sound doesn't work(only in firefox). why? (adobe flash player doesn't work even thought it's installed)

    sound doesn't work (only in firefox). adobe flash player doesn't work correctly, thought it's installed. can't solve the problem. i need Sound.
    == This happened ==
    Every time Firefox opened
    == don't know

    What does the Adobe test page say?
    http://www.adobe.com/software/flash/about/
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the ''Safe mode'' start window.
    You have to close and restart Firefox after each change via "File > Exit" (on Mac: "Firefox > Quit")
    See also [[No sound in Firefox]] and [[Video or audio does not play]]

  • After updating to iOS 8.0.2 in my iPhone 5S, why does automatic landscape orientation doesn't work?

    I recently updated to iOS 8.0.2 in my iPhone 5S. Since that update, landscape orientation doesn't work for any application. I have ensured that the Portrait Orientation lock is Off.

    I have a workaround, if you lock then unlock the orientation lock it seems to work again.

  • Why Position:Relative from CSS doesn't work at Safari 5.03?

    If you watch my web page: http://clubdeleonesst.tk
    I designed a ComboBox and have some problems with position relative. I used jQuery to create it, you could watch the original example here:
    http://www.marghoobsuleman.com/jquery-image-dropdown
    And I have been watching that the transparency from Flash doesn't work too. I hope you can solve these bugs.
    Message was edited by: FANMixco
    Message was edited by: FANMixco

    The "disappearing" affect you describe is not normal. You may need to reinstall Safari.
    First, try removing the Apple cookies from your Safari Preferences>Security>Cookies panel. Also, go to your Safari Menu and Empty cache. Then try to log-on to Apple Discussions.
    Also, regarding the "disappearing" effect, try Safari from another User Account.
    Here is guidance from Apple on how to set up the account. You can ignore step 7 in the article.
    Also, on the system preference>Accounts panel, click on "log-in" options. There, select "fast user switching". This allows you to go back and forth between user accounts via an icon in your Menu Bar at the top of the computer screen.
    Log-on to the new account and start Safari. If Safari is stable in the new account, then your problem is specific to your regular user account. Otherwise, similar response means a system-wide problem.
    Post back with results.

  • Why my weather widget suddenly doesn't works?

    My weather widget working fine before yesterday but suddenly doesn't works when i choose in these locations singapore, malaysia and taiwan... what's wrong with it?

    Close this. My IPod now works. Yes, if you must know, it was something stupid that I had overlooked. I still wonder what that "double horse shoe" symbol means, though. It wasn't pointing to my stupid mistake, that I do know

  • Why in spanish the keyboard doesn´t work Q or A letter

    That side doesn´t work sometimes in games, anybody that the same problem?

    I get erratic loss of input capability into my Touch. On some days in the browser ,the W key doesn't work but the adjacent Q or E keys work just fine when I slide my finger back and forth. A few hours later, it works just fine. Last night I was entering a new location in the weather, the keyboard worked fine but after a search, it would not let me click on the new location to set it up. I could get a blue background but it would not click to complete the entry. Again, I tried it 20 min later and it worked just fine. Same thing on iTunes, there are occasions when the screen is unresponsive to my input and other times when it works just fine. I have one of those plastic covers sold at the Apple store to protect the screen and maybe that's the problem. However, recent rollerblade fall proved the worth of the protector as the cover was deeply scored but the screen was fine (was erratic before fall, not caused by fall). Touch is not jailbroken. Don't want to give up the protection film but I'm not sure whether there is a problem with my iTouch or just with my touch.

  • BUG? using own EntityResolver with SAX doesn't work

    Hello,
    I was experimenting with the oracle.xml.parser.XMLParser using
    the SAX interface.
    I've written a test program that instantiates a driver and
    registers my own handlers (which just print to System.out).
    I also have my own org.xml.sax.EntityResolver, it looks like
    this:
    public class SAXEntityResolver implements EntityResolver {
    public InputSource resolveEntity(String publicId,
    String systemId) throws SAXException, IOException {
    System.out.println("<<Call to resolveEntity>>");
    try { //assume it's a URL of some sort
    URL url=new URL(systemId);
    return new InputSource(url.openStream());
    catch (MalformedURLException e1) {
    try { //it's not a URL, assume a file spec
    FileInputStream fin=new FileInputStream(systemId);
    return new InputSource(fin);
    catch (FileNotFoundException e2) {
    return null;
    //don't understand it, let the parser handle it.
    when I parse the following xml file:
    <?xml version="1.0"?>
    <!DOCTYPE dinner SYSTEM "dinner.dtd">
    <dinner>
    <location planet="Earth">Alma 3</location>
    <time>12:30</time>
    <date>Vandaag</date>
    </dinner>
    The parser generates an error to my org.xml.sax.ErrorHandler
    which prints it to the screen. The output looks like this:
    [C:\temp\xml]java -cp c:\TEMP\xml\oracle\lib\xmlparser.jar;.
    SAXParseXML oracle.xml.parser.XMLParser dinner.xml
    Locater accepted: oracle.xml.parser.SAXLocator@6ba51a96
    document parsing start
    [error: Couldn't find external DTD 'dinner.dtd']
    element dinner start: null:4:1
    (other output follows with no more errors)
    It seems as if the Oracle XMLParser doesn't use my EntityResolver
    to resolve it's external entities (the dinner.dtd file in this
    case, the file is indeed there, trust me!), otherwise it would
    have printed the message seen in the code above (<<Call to
    resolveEntity>>). If you're wondering how I configured the
    systemId in the SAX parser, here's how:
    File f=new File(args[1]);
    InputSource src=new InputSource(new FileInputStream(f));
    src.setSystemId(f.toURL().toString());
    p.parse(src);
    Can you tell me why this is? (I use NT4 with jdk 1.2)
    I've tested the same thing with the IBM, Microstar and Sun
    parsers, and they all seem to work fine with this example...
    Hope to hear from you! (cc in with mail please)
    Erwin.
    null

    Thanks for the post. You have identified a bug which will be
    fixed in a maintenance release. Until that time you can parse a
    String type rather than a InputSource type in SAXParseXML.java as
    a workaround.
    Oracle XML Team
    http://technet.oracle.com
    Erwin Vervaet (guest) wrote:
    : Oracle XML Team wrote:
    : : Which version of the parser are you using? If not 1.0.0.3
    (the
    : : latest) try that version. If the problem still exists it
    would
    : : help if you could provide your test program.
    : The readme.html in the xmlparser_v1_0_0_3.zip file (I download
    it
    : on monday 8/2/1999) says: 'Oracle XML Parser 1.0.0.3.0'.
    : So that's not the problem, below are all the files of the test
    : program. The command I use to start the program is the
    following
    : (note that there cannot be a classpath clash problem!, I use
    Sun
    : jdk1.2 on NT4 SP4):
    : [C:\temp\xml]dir
    : Volume in drive C is unlabeled Serial number is 2C90:8BDE
    : Directory of C:\temp\xml\*
    : 11/02/99 10:50 <DIR> .
    : 11/02/99 10:50 <DIR> ..
    : 9/02/99 16:34 <DIR> aelfred
    : 9/02/99 21:56 <DIR> oracle
    : 8/02/99 17:44 <DIR> xml-ea2
    : 8/02/99 14:10 <DIR> xml4j
    : 9/02/99 22:44 <DIR> xp
    : 9/02/99 16:42 215 dinner.dtd
    : 9/02/99 23:03 167 dinner.xml
    : 8/02/99 15:23 438 ParseXml.java
    : 11/02/99 10:50 2.402 SAXDocHandler.class
    : 9/02/99 21:14 1.585 SAXDocHandler.java
    : 11/02/99 10:50 1.129 SAXEntityResolver.class
    : 9/02/99 22:04 737 SAXEntityResolver.java
    : 11/02/99 10:50 976 SAXErrHandler.class
    : 9/02/99 15:39 495 SAXErrHandler.java
    : 11/02/99 10:50 1.261 SAXParseXML.class
    : 9/02/99 22:09 629 SAXParseXML.java
    : 10.034 bytes in 11 files and 7 dirs 12.800 bytes
    : allocated
    : 201.152.512 bytes free
    : [C:\temp\xml]java -cp c:\temp\xml\oracle\lib\xmlparser.jar;.
    : SAXParseXML oracle.xml.parser.XMLParser dinner.xml
    : Here are the files:
    : //file SAXErrHandler.java
    : import org.xml.sax.*;
    : public class SAXErrHandler implements ErrorHandler {
    : public void warning(SAXParseException exception) throws
    : SAXException {
    : System.err.println("[warning: " + exception +
    : public void error(SAXParseException exception) throws
    : SAXException {
    : System.err.println("[error: " + exception + "]");
    : public void fatalError(SAXParseException exception)
    : throws SAXException {
    : System.err.println("[fatal error: " + exception + "]");
    : //file SAXEntityResolver.java
    : import org.xml.sax.*;
    : import java.net.*;
    : import java.io.*;
    : public class SAXEntityResolver implements EntityResolver {
    : public InputSource resolveEntity(String publicId, String
    : systemId) throws SAXException, IOException {
    : System.out.println("<<Call to resolveEntity>> " + publicId + "
    : + systemId);
    : try { //assume it's a URL of some sort
    : URL url=new URL(systemId);
    : return new InputSource(url.openStream());
    : catch (MalformedURLException e1) {
    : try { //it's not a URL, assume a file
    : spec
    : FileInputStream fin=new
    : FileInputStream(systemId);
    : return new InputSource(fin);
    : catch (FileNotFoundException e2) {
    : return null; //don't understand
    : it, let the parser handle it.
    : //file SAXDocHandler.java
    : import org.xml.sax.*;
    : public class SAXDocHandler implements DocumentHandler {
    : private Locator locator=null;
    : public void startDocument() throws SAXException {
    : System.out.println("document parsing start");
    : public void setDocumentLocator(Locator locator) {
    : System.out.println("Locater accepted: " + locator);
    : this.locator=locator;
    : public void startElement(String name, AttributeList atts)
    : throws SAXException {
    : System.out.println("element " + name + " start: "
    : + locate());
    : for (int i = 0; i < atts.getLength(); i++)
    : System.out.println("attribute " +
    : atts.getName(i) + "=" + atts.getValue(i) + " (" +
    atts.getType(i)
    : + ")");
    : public void characters(char[] ch, int start, int length)
    : throws SAXException {
    : System.out.println("char data: " + new
    : String(ch,start,length));
    : public void ignorableWhitespace(char[] ch, int start, int
    : length) throws SAXException {
    : System.out.println("ignoring some whitespace: " +
    : new String(ch,start,length));
    : public void endElement(String name) throws SAXException {
    : System.out.println("element " + name + " end: " +
    locate());
    : public void processingInstruction(String target, String
    : data) throws SAXException {
    : System.out.println("PI: " + target + "=" + data);
    : public void endDocument() throws SAXException {
    : System.out.println("document parsing end");
    : private String locate() {
    : if (locator!=null) {
    : return locator.getSystemId() + ":" +
    : locator.getLineNumber() + ":" + locator.getColumnNumber();
    : return "";
    : //file SAXParseXML.java
    : import org.xml.sax.*;
    : import org.xml.sax.helpers.ParserFactory;
    : import java.io.*;
    : public class SAXParseXML {
    : public static void main(String[] args) {
    : if (args.length>1) {
    : try {
    : Parser
    : p=ParserFactory.makeParser(args[0]);
    : p.setDocumentHandler(new
    : SAXDocHandler());
    : p.setErrorHandler(new
    : SAXErrHandler());
    : p.setEntityResolver(new
    : SAXEntityResolver());
    : File f=new File(args[1]);
    : InputSource src=new
    : InputSource(new FileInputStream(f));
    : src.setSystemId(f.toURL().toString());
    : p.parse(src);
    : catch (Exception e) {
    : e.printStackTrace();
    : //file dinner.xml
    : <?xml version="1.0"?>
    : <!DOCTYPE dinner SYSTEM "dinner.dtd">
    : <dinner>
    : <location planet="Earth">Alma 3</location>
    : <time>12:30</time>
    : <date>Vandaag</date>
    : </dinner>
    : //file dinner.dtd
    : <?xml version="1.0" encoding="UTF-8"?>
    : <!ELEMENT dinner (location, time, date?)>
    : <!ELEMENT location (#PCDATA)>
    : <!ELEMENT time (#PCDATA)>
    : <!ELEMENT date (#PCDATA)>
    : <!ATTLIST location country CDATA "Belgium">
    Oracle Technology Network
    null

  • Why does this java code doesn't work on my pc?

    for example:
    package one;
    public class Alpha {
    //member variables
    private int privateVariable = 1;
    int packageVariable = 2; //default access
    protected int protectedVariable = 3;
    public int publicVariable = 4;
    //methods
    private void privateMethod() {
    System.out.format("privateMethod called%n");
    void packageMethod() { //default access
    System.out.format("packageMethod called%n");
    protected void protectedMethod() {
    System.out.format("protectedMethod called%n");
    public void publicMethod() {
    System.out.format("publicMethod called%n");
    public static void main(String[] args) {
    Alpha a = new Alpha();
    a.privateMethod(); //legal
    a.packageMethod(); //legal
    a.protectedMethod(); //legal
    a.publicMethod(); //legal
    System.out.format("privateVariable: %2d%n",
    a.privateVariable); //legal
    System.out.format("packageVariable: %2d%n",
    a.packageVariable); //legal
    System.out.format("protectedVariable: %2d%n",
    a.protectedVariable); //legal
    System.out.format("publicVariable: %2d%n",
    a.publicVariable); //legal
    As you can see, Alpha can refer to all its member variables and all its methods, as shown by the Class column in the preceding table. The output from this program is:
    privateMethod called
    packageMethod called
    protectedMethod called
    publicMethod called
    privateVariable: 1
    packageVariable: 2
    protectVariable: 3
    publicVariable: 4
    when above example runs on my pc:
    it works below description:
    D:\javacode>javac Alpha.java
    D:\javacode>java Alpha
    Exception in thread "main" java.lang.NoClassDefFoundError: Alpha (wrong name: on
    e/Alpha)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    why it runs wrongly and who can help me?
    thanks

    if i runs it below:
    D:\javacode>javac one\Alpha.java
    D:\javacode>java one.Alpha
    privateMethod called
    protectedMethod called
    protectedMethod called
    privateVariable: 1
    packageVariable: 2
    protectedVariable: 3
    publicVariable: 4
    it runs well!

  • Why page on the internet doesn't work????????

    Hi guys
    I have this domain http://www.regardit.eu forwarded to my .mac account. It is about photography from Luembourg.
    Anyway. I have problems to visit the site. It is forwarded corectly. ISP helped me, but still people can not visit this site. any idea why?
    Today I just updated the site and from my computer it works, but from other machines it doesn't
    Can you confirm if you can see the page?

    Hey! I know that really ***** with the website. People also complain that it is way slow.
    I guess the problem could be that your ISP doesn't allow Cname to look up DNS A type.
    You can try this.
    It works on my site for now, but I need some time and feedback from people.
    Solution:
    Go to your domain setup and click Change DNS.
    you should have there one or two entries.
    change it like this
    Let say my domain is regardit.eu
    1 name TTL -1800 type A Value 17.250.248.34 -> this is IP web.mac.com
    2 name TTL -1800 type CNAME Value regardit.eu
    I'm not a PRO, but for now it works. Apple even ISP did not know where the problem is.
    Let me know if it worked for you./
    MIKE

  • My i tunes is not working anymore. it says the application failed to start because MSVCR80.dll was not found. I have tried re-installing the program but it doesn't work.

    Hello,
    Yesterday I tried to get onto iTunes and was unable to. I keep getting this message:
    Itunes.exe - Unable to locate component.
    This application has failed to start because MSVCR80.dll was not found.
    Re-installing the application may fix this problem.
    I have tried to uninstall and re-install the program several times but cannot get it to work. Now I get this message:
    iTunes was not installed correctly. Please reinstall iTunes.
    Error 7 (Windows error 126)
    I have tried to do what I can but am not really iTunes savy and would like to get this issue resolved. Can anyone help me?
    THANK YOU!!
    Cyn

    Hello there, Cyn.
    The following Knowledge Base article provides some great information for troubleshooting your issue. Keep in mind uninstalling and reinstalling has to be done in a very specific fashion, therefore use the guidelines from this article to accomplish this:
    Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/ht1926
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

Maybe you are looking for

  • How to increase the logout time

    Hi Guys, My PIA logs out for every 20 minutes. i do not want that happen. I want to increase the time for logout to 1 hour. Can any suggest me how to do that? Please help me.

  • Nokia specialists have a very low qualification!

    It looks like Nokia specialists are not professional and they just are unable to fix this simple bug. This challenge is too difficult for Nokia :-( I mean that Nokia is unable to fix a bug, described at /discussions/board/message?board.id=smartphones

  • [SOLVED] Kernel 3.0 become 2.6.32.48-1-lts after update?

    Hi everybody, After I updated my laptop yesterday, I can not change the screen resolution. It is only 1024*768 while the maximum is 1336*768. Then I figure out the kernel was downgraded from 3.0 to arch 2.6.32.48-1-lts. In the /boot folder, I only fi

  • Faulty On/Off/Lock button iPhone 5

    My iPhone 5 on/off/lock button has started playing up. I sent it away to O2 for repairs but they claim it is due to physical damage (which I am pretty sure it is not) and are trying to charge me for this. I have since googled this fault and it appear

  • Reg: No enries in SID table of attribute of a  Master data info object

    Hello SAP Gurus!!! I Hope everyone is doing good. I found some issues , when i loaded master data into master data info object in sap bi. I have an object which is holding master data (master data info object)---ZEMPID(employee id) I have attributes