Xerces - validator won't catch wrong input in xml file

Hi there,
I am using xerces 2.9.1 and Java 5
here is my code
package xmltesting;
import java.io.IOException;
import org.apache.xerces.parsers.DOMParser;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
public class DomParserExample {
     Document dom;
     public DomParserExample() {
     public void runExample() {
          //parse the xml file and get the dom object
          parseXmlFile();
     private void parseXmlFile(){
          //get the factory
          DOMParser parser = new DOMParser();
          try {
               parser.setFeature("http://apache.org/xml/features/validation/schema",true);
          } catch (SAXNotRecognizedException e) {
               e.printStackTrace();
          } catch (SAXNotSupportedException e) {
               e.printStackTrace();
          try {
               ErrorChecker errors = new ErrorChecker();
               parser.setErrorHandler(errors);
               //parse using builder to get DOM representation of the XML file
               parser.parse("xmltesting/shiporder.xml");
               dom = parser.getDocument();
          } catch(IOException ioe) {
               ioe.printStackTrace();
          } catch (SAXException saxe) {
               saxe.printStackTrace();
          System.out.println("Everything parsed without any problem");
     public static void main(String[] args){
          //create an instance
          DomParserExample dpe = new DomParserExample();
          //call run example
          dpe.runExample();
}My xml is following
<?xml version="1.0" encoding="ISO-8859-1"?>
<shiporder orderid="889923"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="shiporder.xsd">
<orderperson>John Smith</orderperson>
<shipto>
  <name>Ola Nordmann</name>
  <address>Langgt 23</address>
  <city>4000 Stavanger</city>
  <country>Norway</country>
</shipto>
<item>
  <title>Empire Burlesque</title>
  <note>Special Edition</note>
  <quantity>1</quantity>
  <price>10.90</price>
</item>
<item>
  <title>Hide your heart</title>
  <quantity>1</quantity>
  <price>9.90</price>
</item>
</shiporder>
</xs:schema>and schema xsd is
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="shiporder">
<xs:complexType>
  <xs:sequence>
   <xs:element name="orderperson" type="xs:string"/>
   <xs:element name="shipto">
    <xs:complexType>
     <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="address" type="xs:string"/>
      <xs:element name="city" type="xs:string"/>
      <xs:element name="country" type="xs:string"/>
     </xs:sequence>
    </xs:complexType>
   </xs:element>
   <xs:element name="item" maxOccurs="unbounded">
    <xs:complexType>
     <xs:sequence>
      <xs:element name="title" type="xs:string"/>
      <xs:element name="note" type="xs:string" minOccurs="0"/>
      <xs:element name="quantity" type="xs:positiveInteger"/>
      <xs:element name="price" type="xs:decimal"/>
     </xs:sequence>
    </xs:complexType>
   </xs:element>
  </xs:sequence>
  <xs:attribute name="orderid" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>Now I wanted to try and create problems in the xml file so the validator can catch those errors so i changed the quantity and price values to 'abc' string (they should be integer and decimal values respectively) everywhere in the xml file BUT the validation did not throw any errors and that is where i am confused.
do i need to do something else in the Java code?
thanks
Edited by: Shazmiester on Aug 11, 2008 10:20 AM
Edited by: Shazmiester on Aug 11, 2008 10:25 AM

here is my ErrorChecker code
package xmltesting;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.SAXParseException;
public class ErrorChecker extends DefaultHandler
     public ErrorChecker() {
     public void error (SAXParseException e) {
          System.out.println("Parsing Error: " + e.getMessage());
     public void warning (SAXParseException e) {
          System.out.println("Parsing warning: " + e.getMessage());
     public void fatalError(SAXParseException e) {
          System.out.println("Fatal Parsing Error.: " + e.getMessage());
          System.out.println("Exiting...");
          System.exit(1);
}Looks ok to me, the warnings don't show up at all.

Similar Messages

  • Wrong input and output files path?

    When i tried to run my code i got wrong path of input and output files, why it was and where is the mistake? I did not meant the path \tmp\xorout.txt and C:\jar\org\joone\samples\engine\xor\xor.txt in the source code - where are they from? :
    * XOR.java
    * Sample class to demostrate the use of the Joone's core engine
    * see the Developer Guide for more details
    * JOONE - Java Object Oriented Neural Engine
    * http://joone.sourceforge.net
    package org.joone.samples.engine.xor;
    import java.io.File;
    import org.joone.engine.*;
    import org.joone.engine.learning.*;
    import org.joone.io.*;
    import org.joone.net.NeuralNet;
    public class XOR implements NeuralNetListener {
    /** Creates new XOR */
    public XOR() {
    * @param args the command line arguments
    public static void main() {
    XOR xor = new XOR();
    xor.Go();
    public void Go() {
    * Firts, creates the three Layers
    LinearLayer input = new LinearLayer();
    SigmoidLayer hidden = new SigmoidLayer();
    SigmoidLayer output = new SigmoidLayer();
    input.setLayerName("input");
    hidden.setLayerName("hidden");
    output.setLayerName("output");
    /* sets their dimensions */
    input.setRows(2);
    hidden.setRows(3);
    output.setRows(1);
    * Now create the two Synapses
    FullSynapse synapse_IH = new FullSynapse(); /* input -> hidden conn. */
    FullSynapse synapse_HO = new FullSynapse(); /* hidden -> output conn. */
    synapse_IH.setName("IH");
    synapse_HO.setName("HO");
    * Connect the input layer whit the hidden layer
    input.addOutputSynapse(synapse_IH);
    hidden.addInputSynapse(synapse_IH);
    * Connect the hidden layer whit the output layer
    hidden.addOutputSynapse(synapse_HO);
    output.addInputSynapse(synapse_HO);
    FileInputSynapse inputStream = new FileInputSynapse();
    /* The first two columns contain the input values */
    inputStream.setAdvancedColumnSelector("1,2");
    /* This is the file that contains the input data */
    inputStream.setInputFile(new File("c:\\xor.txt"));
    input.addInputSynapse(inputStream);
    TeachingSynapse trainer = new TeachingSynapse();
    /* Setting of the file containing the desired responses,
    provided by a FileInputSynapse */
    FileInputSynapse samples = new FileInputSynapse();
    samples.setInputFile(new File("c:\\xor.txt"));
    /* The output values are on the third column of the file */
    samples.setAdvancedColumnSelector("3");
    trainer.setDesired(samples);
    /* Creates the error output file */
    FileOutputSynapse error = new FileOutputSynapse();
    error.setFileName("c:\\xorout.txt");
    //error.setBuffered(false);
    trainer.addResultSynapse(error);
    /* Connects the Teacher to the last layer of the net */
    output.addOutputSynapse(trainer);
    NeuralNet nnet = new NeuralNet();
    nnet.addLayer(input, NeuralNet.INPUT_LAYER);
    nnet.addLayer(hidden, NeuralNet.HIDDEN_LAYER);
    nnet.addLayer(output, NeuralNet.OUTPUT_LAYER);
    nnet.setTeacher(trainer);
              FileOutputSynapse results = new FileOutputSynapse();
    results.setFileName("c:\\results.txt");
    output.addOutputSynapse(results);
    // Gets the Monitor object and set the learning parameters
    Monitor monitor = nnet.getMonitor();
    monitor.setLearningRate(0.8);
    monitor.setMomentum(0.3);
    /* The application registers itself as monitor's listener
    * so it can receive the notifications of termination from
    * the net.
    monitor.addNeuralNetListener(this);
    monitor.setTrainingPatterns(4); /* # of rows (patterns) contained in the input file */
    monitor.setTotCicles(2000); /* How many times the net must be trained on the input patterns */
    monitor.setLearning(true); /* The net must be trained */
    nnet.go(); /* The net starts the training job */
    public void netStopped(NeuralNetEvent e) {
    System.out.println("Training finished");
    public void cicleTerminated(NeuralNetEvent e) {
    public void netStarted(NeuralNetEvent e) {
    System.out.println("Training...");
    public void errorChanged(NeuralNetEvent e) {
    Monitor mon = (Monitor)e.getSource();
    /* We want print the results every 200 cycles */
    if (mon.getCurrentCicle() % 200 == 0)
    System.out.println(mon.getCurrentCicle() + " epochs remaining - RMSE = " + mon.getGlobalError());
    public void netStoppedError(NeuralNetEvent e,String error) {
    ERROR:
    C:\jar>java -cp joone-engine.jar org.joone.samples.engine.xor.XOR C:\\xor.txt C:
    \\xorout.txt
    [main] [ERROR] - org.joone.io.FileOutputSynapse - IOException in Synapse 6. Mess
    age is : \tmp\xorout.txt (The system cannot find the path specified)
    Training...
    [Thread-0] [WARN] - org.joone.io.FileInputSynapse - IOException in Synapse 3. Me
    ssage is : C:\jar\org\joone\samples\engine\xor\xor.txt (The system cannot find t
    he path specified)
    [Thread-0] [WARN] - org.joone.io.FileInputSynapse - IOException in Synapse 3. Me
    ssage is : C:\jar\org\joone\samples\engine\xor\xor.txt (The system cannot find t
    he path specified)
    java.lang.NullPointerException
    at org.joone.io.StreamInputSynapse.getStream(StreamInputSynapse.java:176
    at org.joone.io.StreamInputSynapse.readAll(StreamInputSynapse.java:288)
    at org.joone.io.StreamInputSynapse.fwdGet(StreamInputSynapse.java:106)
    at org.joone.engine.Layer.fireFwdGet(Layer.java:212)
    at org.joone.engine.Layer.fwdRun(Layer.java:1225)
    at org.joone.net.NeuralNet.stepForward(NeuralNet.java:1015)
    at org.joone.net.NeuralNet.fastRun(NeuralNet.java:970)
    at org.joone.net.NeuralNet.fastRun(NeuralNet.java:937)
    at org.joone.net.NeuralNet$1.run(NeuralNet.java:890)
    at java.lang.Thread.run(Thread.java:534)

    c:xor.txt
    c:/xor.txt
    i think c:xor stands for somthing else like a virtual drive but ima not sure

  • What's wrong with the XML file????

    Hello!
    I am tryig to implement a "Filter" on my Apache tomcat server. The problem occures when I try to modify the XML-file on the server. This is the XML file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
                        <!-- The Filter -->
    <filter>       
         <filter-name>LoginChecker</filter-name>
         <filter-class>filters.LoginFilter</filter-class> 
    </filter>
                        <!-- The Filter Mapping -->
    <filter-mapping>       
         <filter-name>LoginChecker</filter-name> 
         <url-pattern>/secret/*</url-pattern> 
    </filter-mapping>
                        <!-- The Servlets -->
    <servlet>
            <servlet-name>SLoginHandler</servlet-name>
            <servlet-class>LoginHandler</servlet-class>
    </servlet>
    <servlet>
             <servlet-name>SProtectedResource</servlet-name>
             <servlet-class>ProtectedResource</servlet-class>
    </servlet>
    <servlet>
            <servlet-name>SRegister</servlet-name>
             <servlet-class>Register</servlet-class>
    </servlet>
    <servlet>
            <servlet-name>SVerify</servlet-name>
             <servlet-class>Verify</servlet-class>
    </servlet>
                        <!-- ....The Servlets Mapping -->
    <servlet-mapping>
            <servlet-name>SLoginHandler</servlet-name>
             <url-pattern>/LoginHandler</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
             <servlet-name>SProtectedResource</servlet-name>
             <url-pattern>/ProtectedResource</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
             <servlet-name>SRegister</servlet-name>
             <url-pattern>/Register</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
            <servlet-name>SVerify</servlet-name>
            <url-pattern>/Verify</url-pattern>
    </servlet-mapping>
    </web-app>When I try to run another sevlet on the server side, e.g, "Verify", I'll get an error message. BUT if I changethe XML file to (remove the "filter" spec):
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
                        <!-- The Servlets -->
    <servlet>
            <servlet-name>SLoginHandler</servlet-name>
            <servlet-class>LoginHandler</servlet-class>
    </servlet>
    <servlet>
             <servlet-name>SProtectedResource</servlet-name>
             <servlet-class>ProtectedResource</servlet-class>
    </servlet>
    <servlet>
            <servlet-name>SRegister</servlet-name>
             <servlet-class>Register</servlet-class>
    </servlet>
    <servlet>
            <servlet-name>SVerify</servlet-name>
             <servlet-class>Verify</servlet-class>
    </servlet>
                        <!-- ....The Servlets Mapping -->
    <servlet-mapping>
            <servlet-name>SLoginHandler</servlet-name>
             <url-pattern>/LoginHandler</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
             <servlet-name>SProtectedResource</servlet-name>
             <url-pattern>/ProtectedResource</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
             <servlet-name>SRegister</servlet-name>
             <url-pattern>/Register</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
            <servlet-name>SVerify</servlet-name>
            <url-pattern>/Verify</url-pattern>
    </servlet-mapping>
    </web-app>The servlet "Verify", or some other servlet, will work!!!
    What is wrong with my filter spec in the XML file?????

    hepp, no one asked for it...so no one will get it!
    BUT if "stevejluke" want another duke so let me know!

  • After migrating to new Mac Pro Dreamweaver won't launch, says missing menus.xml file. How do I resolve this?

    After migration to a new Mac Pro Dreamweaver CS6 won't launch. It says it is missing menus.xml file. How do I resolve this?

    Hi rustyg12,
    Go to Applications/Adobe Dreamweaver CS6/Configuration/Menus/menus.bak
    You'll see a menus.xml there - it is a backup copy of the actual menus.xml file that DW uses.
    Copy it from that folder, paste it 1 level above (in Menus folder).
    Fire up DW. See if it works.

  • IWeb won't open-cannot find "index.xml" file

    I've been having kernel panics lately and ran off my hard drive to another Mac (iMac) -not using migration assistant-and upon returning back to my main computer (MacBook Pro) and after diligently saving my Domain file, iWeb won't open because it cannot find the "index.xml". I have the site up on my idisk and when I open up the package in Domain, there's plenty in there. How do I get back to where I was-an iWeb site that I can manipulate.
    Any way I can get what I do still have to work? Or do I have to make my site from scratch again even though I have loads of files all over the place and only this one missing?
    I think Apple needs to tell us "how" and "what" to save when we need to vacate a computer because of kernel panics and the like-wouldn't you say? I ALWAYS suffer from something missing when I have to put the OS back on the computer from scratch-not to mention hours of wasted time downloading updates again and having to find keycodes and various application discs!
    MacBook Pro 2.16mhz Core 2 Duo 120gb hd 3gb ram   Mac OS X (10.4.9)   </span

    Welcome to the discussions, RPashman.
    I got this message before when I was editing multiple Domain.sites. I believe it happened when I tried to Publish when the Domain was not in the iWeb folder. During the Publish, it places a Domain file in the iWeb folder (maybe because it has to publish from there even though the actual file is elsewhere??) and if anything goes wrong, iWeb when it next opens will default to that improperly created Domain.sites file.
    Check in the iWeb directory (Library/Application Support/iWeb/Domain.sites
    ) and see how large the Domain.sites file is. If it's something under a meg, then maybe this is what happened to you. Move it out of that directory (I held mine just in case) then relaunch iWeb. Since there's not a Domain.sites file there anymore, it should ask if you want to create one or open an existing one.
    Not sure if this happened to you, but it's possible. It happened to this user as well.
    http://discussions.apple.com/thread.jspa?messageID=4178327&#4178327

  • K1 tab won't apply update.zip/update.xml files.

    I recently purchased a US K1 tab.  It came pre-loaded with k1-a301-02-03-110810-us.  I was experiencing a few minor issues so I came to this forum and found the officially released OTA images at http://download.lenovo.com/slates/k1/OTA  and the instructions for how to apply them.
    I began applying the updates in order of release.  OTA patches 110829 and 111017 flashed as expected.  However now when I try to apply the next update, 111025, upon pressing the power and volume+ buttons the system starts with 111017 and removes the files from the \download folder.  I have tried applying this three times.  Has the procedure changed beginning with the 111017 release?  What am I doing wrong?
    The tab works fine with 111017 and has resolved many of my issues, so it's not a huge problem... I would just prefer to be running the latest officially released software.
    Thanks in advance for any help.

    Why not just grab the latest through OTA? Its automatic.
    Thanks,
    Ricochet
    The K1_Was Just A Broken Promise Lenovo

  • Iweb 1.1.2 won't open, error message, index.xml file is missing

    i am using version 1.1.2
    i opened iweb and made a very very minor correction.
    i went into 'inspector' and saw that 'make all links inactive'
    was checked so i unchecked. i published and when i opened it again
    it was checked. so i made an extremely minor change on one of my pages....
    changed the angle of a drop shadow 1 degree....then published again.
    now iweb will not open. i get an error message that says
    'index.xml file is missing. none of my copies of the domain file will
    open. none. including old copies that i copied to a disc. all domain files
    whether on the hd or exterior drives get the same error message.
    i'm guessing that some how that file got corrupted.
    how do i install iweb again and if so how do i retrieve all my work?

    I't not iWeb that got damaged but the domain file. The index.xml file is inside the domain.sites file that's located in your Users/Home/Library/Application Support/iWeb folder. Do you have a backup of that file you can revert to?  If so then do it.  Otherwise a long shot but try the following:
    close iWeb.
    delete the iWeb preference file, com.apple.iWeb.plist, that resides in your Home/Library/Preferences folder.
    go to your Home/Library/Caches/com.apple.iWeb folder and delete its contents.
    launch iWeb and try again.
    If that doesn't help continue with:
    move the domain file from your Home/Library/Application Support/iWeb folder to the Desktop.
    launch iWeb, create a new test site, save the new domain file and close iWeb.
    go to the your Home/Library/Application Support/iWeb folder and delete the new domain file.
    move your original domain file from the Desktop to the iWeb folder.
    launch iWeb and try again.
    OT

  • Why can't I create a document in my Facebook group on my iPad? It won't let me input any text into the text box field after I create a new document. Thanks.

    Why can't I create a document in my Facebook group on my iPad. It won't let me input any text into the text box field after I create a new document. Thanks.

    Just thought I'd add my solution, I decided to go with WebDAV and I think it actually works better than the iTunes way, the steps are pretty much the same but avoiding the iTunes interface just makes things easier and faster.
    I followed this guide but it does have a small mistake in the httpd-dav.conf file, on line 2, where it's WebServer/WebDAV">, it should be <Directory "/Library/WebServer/WebDAV">.
    The tricky part is setting permissions which if wrong will give you errors when connecting with the iPad, I opted to set all to Read&Write since my home network has a hardware firewall. Another convenience was to add an alias to the webdav share on the Desktop.
    I'm still expecting the call from Apple but even if they fix the iTunes I'm sticking with WebDAV, atleast until I see what's new with iOS5 and iCloud this fall which should bring true sync for documents (I'm hoping that they will offer encryption with my own keys, if not, then I'll probably keep using WebDAV).

  • How to Disable client side validation for the message text input

    Hi,
    I have scenario where i need to by pass the client side validation for a message text input
    Scenario is
    I have a message text input field(say XYZ), i set the max length for the item as 20
    Now when im trying to enter the greek characters into it, it is allowing me to enter till 20 characters
    But when i try to submit the form ..my client side validation is firing..
    The Error says the XYZ is too long
    The problem is, in greek each character takes two bytes.(In english it is only 1).While entering the content it allowing 20 characters and when validating it is checking for bytes(if we enter in greek the length will be 40 bytes not 20)
    I cannot increase the max length .coz i have restrict the character length to 20 only.(english or Greek).
    Please help me in this regard.
    Regards
    Sandeep.

    Thanks for the information.But we dont have any option either declaratively or programatically to disable the client side validation for the message text input..I referred java docs ..i dint find any method which does..
    Correct me if im wrong

  • Firefox (v. 25.0.1) suddenly won't let me input in Japanese. How do I fix this?

    For some reason, Firefox suddenly won't let me input in Japanese. (I am using version 25.0.1.) Why has this happened and what can I do to fix it?

    I think this problem relates to an issue that I have raised here:
    https://support.mozilla.org/en-US/questions/978034
    If so, it is to do with the limiting of input sources to your default device in Firefox 25.0.1. Are you using OSX, and do you have multiple keyboard layouts in your language toolbar drop down?

  • HT1918 I'm trying to update my credit card, but it won't let me input the security code.  Does anyone know how to solve this problem?

    I'm trying to update my credit card in ITunes, but it won't let me input the security code.  Does anyone know how to solve this problem?

    Could you give me more details on how it would let you put in the CVV?

  • Wrong input, new 3d card

    Hi. I was going to install ati radeon 9200se on my computer. But when I plug it in det screen turns black after windows loading, it says: wrong input or something. How can I get it to work?

    I don't know what your old card was but put it back in. Uninstall the drivers belonging to it from within the OS. Shut down. Install your new card. Should work. If not, see if you can get into safe mode (F8) and install new drivers there.

  • C088 activity price wrong input

    Hello all.
    cost centre to activity rate was wrongly inputed 100 instead of 10 , the product cost collector debit all the cost with the planned activity rate as 100 and regular cost of consumption.
    while settling the PCC to material and variance to profitablity segment,
    accounting entry is posted as
    CR change in FG 1000-
    DR price diff         1000
    Is there a option to settle the difference without huge price difference.
    Regards,
    Swamy

    Hi all,
    No reply, Closing the issue.
    Thanks,
    Swamy H P

  • Wrongly input void payment date

    Hi! When I void a payment for an invoice with GL date 20-JUL, i wrongly inputted the date to 30-AUG.
    What I see now in "Payment Overview" window is:
    amount: 2000
    status: voided
    voide date: 30-AUG
    Invoices:
    Amount Paid GL Date
    2000 20-JUL
    (2000) 30-AUG
    Can anyone suggest what should I do now?

    leave the status of this voided payment as (NO)
    at the bottom of the payment form u will find ( Accounted -> NO) , so leave it at this status and make new payment @ right date then fire action button then check create account.
    -------------other solution------------------
    create account for this ( wrongly input void payment date) and transfer it to GL
    and from GL Reverse it but in the date/period you voided.

  • Using cal.setlenient(false) - won't catch my exception

    I've read through a lot of the posts, but nothing seems to work. Basically I'm writing a JUnit test for one of my classes and I'm trying to test one of my constructors' exceptions, but it won't catch the exception! Please take a look:
    This is part of my original class.
    public YearMonthDay(int year, int month, int day)
    // Instantiate a calendar to let it validate our date.
    try
    Calendar cal = Calendar.getInstance();
    cal.setLenient(false);
    cal.clear();
    // Set Calendar values to passed in parameters
    cal.set(Calendar.YEAR, year);
    cal.set(Calendar.MONTH, month - 1);
    cal.set(Calendar.DAY_OF_MONTH, day);
    //System.out.println("cal: " + cal.getTimeInMillis());
    catch (Exception e)
    //This is only here for testing current testing purposes
    System.out.println("Exception: " + e + " : " + month);
    throw new IllegalArgumentException("Invalid date parameters: " + year
    + ", " + month + ", " + day);
    this.year = year;
    this.month = month;
    this.day = day;
    This is part of my JUnit test where I'm sending "INVALID" dates to see if the exception will be caught.
    public void testExceptionValidCalendarDate()
    boolean caught = false;
    try
    YearMonthDay testInvalidDate = new YearMonthDay(2007, 15, 40);
    //System.out.println("testFalse :" + testFalse.toString());
    catch (IllegalArgumentException e)
    caught = true;
    assertTrue("testExceptionValidCalendarDate, did not get IllegalArgumentException", caught);
    I did read somewhere that the set() command only sets the fields, it doesn't do much checking, its not till you call something like "get()" that throws an exception. For instance, notice the commented portion "System.out....,,cal.getTimeInMillies()." if you allow that to be run, it throws an error, but I need for this constructor to set fields based on passed in parameters AND throw an exception if Year, Month or Day is invalid! Please help.

    Crossposted:
    http://forum.java.sun.com/thread.jspa?threadID=5231209
    Don't reply here. Instead see the crosspost.

Maybe you are looking for

  • Questions on Report Builder and Graphics Builder

    Hi there: I'm currently using Report/Graphics builder V 6.0.8.11.3 NT version to create RDF and OGD files. I was wondering with the following confusions: 1) Is the RDF/OGD file that I create under NT plat form portable to Sun Unix?? (ie. would Report

  • Solution of Inspection Lot creation

    Hi expert, I am newbie in QM module.  I have some question for solution in QM inspetion. sample Production Order created order for 100,000 pcs and goods receipt batch split(2,000 per batch), 50 batch per production order. Then in QM generate 50 inspe

  • Upgrade from Final Cut Express to Pro 5.0

    I think I made a stupid mistake. I purchased Final Cut Pro 5.0 upgrade thinking I could upgrade from Final Cut Express. But when I am asked to enter the previous versions serial number, it does not accept it. Is there any way to do this or am I going

  • OracleXE Newbie: How do I view user tables as SYS/SYSTEM?

    I'm brand new to Oracle and downloade OracleXE to learn a bit about it. When I login as SYS or SYSTEM how do I view user tables? Don't I have full admin rights? I can't figure it out. I've unlocked the sample application with the user HR and created

  • Gmail problems after upgrading to Mountain lion

    After recently upgrading to new moutain lion I am having probems with Gmail.  I am told to download the latest version of safari.  I have checked and am indeed running the latest version of safari.  Can anyone advise me on what to do please.