Why not parsing using JDOM?

Please see the xml file & my java code. The code seems ok..but not parsing right! Please advise, where the problem is?? Also, how do I extract the Supplier tag in this example file??? Any help is really appreciated!!!
<POOutbound_schema PurchaseOrder="P415704423" OrderDate="2003-06-05"><DocRouting/><Supplier Account="152625001" CompanyName="REP " Address1="ATTENTION SALES " Address2="XXXXXXXXXX " City="XXXXX " Address4=" " Address5=" " Address6=" " State="KA" CountryCode=" " ZipCode="67223 " Phone="833-555-5555" Fax="333-670-3324" OrderStatus="CLOSED AND PRINTED" Comments="DO NOT SHIP TEST PO " TransmissionDate="2003-06-05" TransmissionTime="17:14:54"/><Buyer CompanyName="XXXXXXXXX" Phone="222-577-3708" Fax=" " BuyerNumber="101000" BuyerName="1IM " Email="[email protected]"/><DeliveryAddress CompanyName=" ENSEN COMPANY " Address1="C/O SHIPPING " Address2="221900 SHI BLVD " City="SCHG " Address4=" " Address5=" " Address6="SCHAUMBURG " State="IL" ZipCode="65693 " Phone="800-444-4448" ShipDeptContactName="HHHHN "/><PaymentTerms DueDays="30" DiscountDays="10" DiscountPercent="0"/><DeliveryTerms PrePaid="Prepaid" Transport="TO BE DETERMINED " Fob="ORIGIN "/><OrderLine TransmissionID="-2147482947" ItemNo="506280 " BranchNumber="00423" Description="3-3/4 RD X 20' R/L " QuantityUnitOfMeasure="Pound" PriceUnitOfMeasure="Pound" UnitPrice1="1.0000" UnitPrice2="71.0000" ForeignCurrencyCode="USD" BaseCurrencyCode="USD" DueDate="2003-06-05" POLineNumber="1" Qty="1.0000" SizeDescription="140/41 HR ANN ASTM A322 " LineStatus="Open"><LineNotes OrderLineNote="440/414 HR BAR - LP ANLED - LATT REV ASTM A32, A304 "/><LineNotes OrderLineNote="- AIM .025 MAP AN S - CERT/R RD - 410/412H HABILITY "/><LineNotes OrderLineNote="REQD - STAMP HEAT NUMBER ONE END ON SIZES 2-1/2" AND OVER - "/><LineNotes OrderLineNote="GRAIN SIZE 5 OR FINER - REPORT NI,CU,V AND HARDNESS "/></OrderLine><OrderLine TransmissionID="-2147482946" ItemNo="502327 " BranchNumber="00423" Description="3/4 SQ X 12' R/L " QuantityUnitOfMeasure="Pound" PriceUnitOfMeasure="Pound" UnitPrice1="1.0000" UnitPrice2="1.0000" ForeignCurrencyCode="USD" BaseCurrencyCode="USD" DueDate="2003-06-05" POLineNumber="2" Qty="1.0000" SizeDescription="1018 CF ASTM A108 " LineStatus="Open"><LineNotes OrderLineNote="1018 CF BAR - LATEST REV: ASTM A108 - CERT T/R REQD "/><LineNotes OrderLineNote=" "/></OrderLine><OrderLine TransmissionID="-2147482945" ItemNo="507027 " BranchNumber="00423" Description="5-3/4 RD X 20' R/L " QuantityUnitOfMeasure="Pound" PriceUnitOfMeasure="Pound" UnitPrice1="1.0000" UnitPrice2="1.0000" ForeignCurrencyCode="USD" BaseCurrencyCode="USD" DueDate="2003-06-05" POLineNumber="3" Qty="1.0000" SizeDescription="86/80H HR ASTM A322 ASTM A304 " LineStatus="Open"><LineNotes OrderLineNote="8/86H HOT RO BA - LAST REVASTM A32AND ATM A304 - AIM "/><LineNotes OrderLineNote=".025 MAX P AND S - STAMUMBER ON ONE END SIZES 2-1/2" AND OVER "/><LineNotes OrderLineNote="GRA SIZE OR FINER - HARDEILITY TO BE REPORTED - CET /R REQD "/></OrderLine></POOutbound_schema>
import java.io.File;
import java.io.FilenameFilter;
import java.io.*;
import java.lang.*;
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;
import java.util.*;
public class EmjPO
public static void main (String args[]) {
String[] outarray=new String[1000];
String pono=null;
int j=0;
try {
/* Build the document with SAX and Xerces, no validation */
SAXBuilder builder = new SAXBuilder();
/* Create the document */
Document doc = builder.build(new File("c:/emjdata/PO.xml"));
/* To get the DocType from in xml file. Reads the Doctype. */
DocType docType = doc.getDocType();
/* Get the root element. */
Element root = doc.getRootElement();
/* Get Children */     
List rtiloadoutbound = root.getChildren("POOutbound_schema");
Iterator i = rtiloadoutbound.iterator();
while (i.hasNext()) {
Element rti_load_outbound = (Element) i.next();
/* Parses each tag to output string */
String PurchaseOrder = rti_load_outbound.getAttributeValue("PurchaseOrder");
String OrderDate = rti_load_outbound.getAttributeValue("OrderDate");     
System.out.println(" Purchase Order : " + PurchaseOrder + " " + OrderDate);
} /* while ends here */
} /* try ends here */
catch (Exception ex) {
ex.printStackTrace();     
System.out.println("Exception Occured " + ex);

The stack trace should tell you the line number and the filename where the exception happened.
This is just a guess:
List rtiloadoutbound = root.getChildren("POOutbound_schema"); //this returns null because root iself the element 'POOutbound_schema'
Iterator i = rtiloadoutbound.iterator(); //calling .iterator() on a null gives the NullPointerExceptionso try
String PurchaseOrder = root.getAttributeValue("PurchaseOrder");
String OrderDate = root.getAttributeValue("OrderDate");

Similar Messages

  • Why not to use static methods - with example

    Hi Everyone,
    I'd like to continue the below thread about "why not to use static methods"
    Why not to use static methods
    with a concrete example.
    In my small application I need to be able to send keystrokes. (java.awt.Robot class is used for this)
    I created the following class for these "operations" with static methods:
    public class KeyboardInput {
         private static Robot r;
         static {
              try {
                   r = new Robot();
              } catch (AWTException e) {
                   throw new RuntimeException(e + "Robot couldn't be initialized.");
         public static void wait(int millis){
              r.delay(millis);
         public static void copy() {
              r.keyPress(KeyEvent.VK_CONTROL);
              r.keyPress(KeyEvent.VK_C);
              r.keyRelease(KeyEvent.VK_C);
              r.keyRelease(KeyEvent.VK_CONTROL);
         public static void altTab() {
              r.keyPress(KeyEvent.VK_ALT);
              r.keyPress(KeyEvent.VK_TAB);
              r.keyRelease(KeyEvent.VK_TAB);
              r.keyRelease(KeyEvent.VK_ALT);
                   // more methods like  paste(), tab(), shiftTab(), rightArrow()
    }Do you thinks it is a good solution? How could it be improved? I've seen something about Singleton vs. static methods somewhere. Would it be better to use Singleton?
    Thanks for any comments in advance,
    lemonboston

    maheshguruswamy wrote:
    lemonboston wrote:
    maheshguruswamy wrote:
    I think a singleton might be a better approach for you. Just kill the public constructor and provide a getInstance method to provide lazy initialization.Thanks maheshguruswamy for advising on the steps to create a singleton from this class.
    Could you maybe advise also about why do you say that it would be better to use singleton? What's behind it? Thanks!In short, it seems to me that a single instance of your class will be able to coordinate actions across your entire application. So a singleton should be enough.But that doesn't answer why he should prefer a singleton instead over a bunch of static methods. Functionally the two are almost identical. In both cases there's only one "thing" on which to call methods--either a single instance of the class, or the class itself.
    To answer the question, the main reason to use a Singleton over a classful of static methods is the same reason the drives a lot of non-static vs. static decisions: Polymorphism.
    If you use a Singleton (and and interface), you can do something like this:
    KeyboardInput kbi = get_some_instance_of_some_class_that_implements_KeyboardInput_somehow_maybe_from_a_factory();And then whatever is calling KBI's public methods only has to know that it has an implementor of that interface, without caring which concrete class it is, and you can substitute whatever implementation is appropriate in a given context. If you don't need to do that, then the static method approach is probably sufficient.
    There are other reasons that may suggest a Singleton--serialization, persistence, use as a JavaBean pop to mind--but they're less common and less compelling in my experience.
    And finally, if this thing maintains any state between method calls, although you can handle that with static member variables, it's more in keeping with the OO paradigm to make them non-static fields of an instance of that class.

  • Why not always use H-REAP

    Hello All,
    I apologize if this has appeared in another thread, but it has been something I've been mulling over now for a couple weeks.  With the improvements in the 7.2.103, is there any reason to not automatically make every deployment an H-REAP (now FlexConnect) deployment?  Just the mere fact of WLAN survivability during controller outage, without a redundant controller of course, is a strong incentive.  With all the progress Cisco has made, I'm trying to come up with reasons to not just configure every deployment to be H-REAP/Flexconnect.  Off the top of my head the only reasons I can think of are:
    -extra config on the access switch
    -limited to 25 AP's per H-REAP group.  (Even this reason is really not that big of one when designed properly)
    I'm highly curious what the community thinks.
    Thanks in advance,
    Matt

    Matt,
    At this time I don't think the question should be why or why not use FlexConnect of every single deployment. Local mode and FlexConnect both have their own benefits and each should be carefully considered for the deployment in question. A few items to keep in mind are:
    Where will the APs be located in relation to the WLC?
    Who is going to be managing this system? (FlexConnect is more difficult to manage than local due to the additional configuration.)
    Does it make sense for data traffic? (In one case I had a customer that did not have their controller located at a central point of their network... Not my choice or reccomendation.)
    Do I need AAA override?
    FlexConnect isn't terrible but it's still got a ways to go regarding development. It was designed around the idea of remote branch deployment, not necessairly large depolyments at one site where a customer could have multiple redundant controllers.
    So far some limitations I've personally faced are bugs.
    Don't let that stop you from utilizing FlexConnect as it does indeed have its uses.
    For some good information check out the follwoing link:
    http://revolutionwifi.blogspot.com/2010/06/h-reap-deployment-guidelines-and.html
    Some of it may be a little out of date as it was written in 2010.
    Regards,
    Aaron

  • Why not just use UDP?

    I have UDP code written in Java that listens to an IP address and port number containing data being sent to that IP and port number. Why wouldn't I just continue to use the traditional UDP paradigm instead of JMS? My ReceiveSocket class creates a new java.net.MulticastSocket instance, creates a new DatagramPacket for reading the bytes, and then takes the datagram packet as input:
    private MulticastSocket m_socket = new MulticastSocket( m_receivePort );
    private DatagramPacket m_packet = new DatagramPacket( buf, buf.length );
    m_socket.receive( m_packet );
    I'm able to receive the data being sent and process it. Can someone explain the benefits of the JMS approach?
    Thanks!

    I would add to Steve's points that the difference in technical specification between UDP and TCP is that TCP guarantees delivery, in order, for messages that are too large to fit in one packet. UDP does not guarantee delivery, or the order of the packets, but it is much faster than TCP.
    It is easy to imagine an application that may want guarantees for some data, and does not care for other data. To address this situation, some implementations of JMS go beyond the specification and provide features to allow non-guaranteed data transfer. For instance, I have been using Sun Java System Message Queue which allows NO_ACKNOWLEDGE which increases performance at the cost of reliability.

  • Why not to use Commit

    Hi,
    Can Any one tell the reason why using Commit after Insert will reduce the performace of a proc.
    Thanks

    Are you talking about commit in a loop ? Then see the below links.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4951966319022
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7661190956484

  • Why not to use static methods in interfaces?

    why?

    Because static methods are always attached to a particular class -- not an object. So object polymorphism (which is what interfaces are good for) won't help. Now, what you can do is say that subclasses must implement a method that looks an awful lot like a static method, in that it doesn't depend on object state.
    This bugged me, and it still bugs me a little bit in that I have to instantiate an object of a type in order to call these pseudo-static methods. When the pseudo-static methods tell the user how to initialize the object, you get a bit of a chicken-and-egg problem.

  • Why not always use -server option?

    Hello!
    I've tried running some my applications with -server option - and discovered that for non-GUI apps -server renders drastic increase in execution speed.
    For example code below takes only 2 seconds to execute with java -server while it takes more then 120 seconds with java -client option.
    Now I'm considering writing all apps with
    Runtime.exec("java -server MyApplication");Can someone tell me in what cases -server is a bad choice, and when it's OK?
    And, in my code - does java runtime really create 1000 threads - or is there some optimization?
            public void run()
                    int q=0;
                    for (int i=0; i<10000000; i++)
                            q++;
            public static void main (String args[])
                long l_start = System.currentTimeMillis();
                    for (int h=0; h<1000; h++)
                            new Hell().start();
                    System.out.println("Operation took "+(System.currentTimeMillis()- l_start)/1000+" seconds");

    JVM tutorial states that there are the cases when server performs slower. If you going to execute a small utility (<20 sec), use client.

  • NEED TO UNDERSTAND WHY/WHY NOT TO USE/BUY SERVER

    Hey there -
    I have a small business (3 employees total.)
    My issue thus far has beens scheduling meetings through iCal, etc., and sharing files. Basically, I want my assistant and my partner (and my wife at times as well) to be able to send me invites (vice/versa) for meetings AND also have the ability to make changes to those meetings. Meaning, if my assistant sends me an invite, then only SHE can make changes to that meeting. But say I want to move the time myself or add something to the event, then I need to have her do it and resend the updated invite.
    Will server fix this?

    Hi mcforman-
    No, OSX Server in and of itself will not solve your problem. Your money may be better spent on a scheduling program that can suit your needs.
    Have you tried posting your question in the iCal forum? There are knowledgeable folks there that may be able to help: Category : iCal
    Luck-
    -DaddyPaycheck

  • When not to use SAP PI

    Hi all,
    Do you agree?
    [http://architectsap.com/blog/sap-netweaver-pi-7-1-usage-scenarios-when-not-to-use-sap-pi|http://architectsap.com/blog/sap-netweaver-pi-7-1-usage-scenarios-when-not-to-use-sap-pi]
    Best Regards,
    Pedro M. D. Pereira

    Hi all,
    Synchronous integration
    I disagree either! SYNC comms are cool
    User Interface Integration scenario
    I don't agree totally, i think it depends from what people want to do, per eg: In a B2B scenario, where Portal needs to acess an application, which is outside the company, i think communication should't be direct.
    Web Service interface of backend application
    I don't disagree totally, if in a company exists only one or two servers... :P. Normally when i hear something like that, it comes from people, who still have some resistance about PI and midlewares in general...If there is only one scenario or two, well, who cares about a middleware, why spending money on it. However, if you have complex architectures, several applications, multiple scenarios, obviously a middleware adds a lot of value, and if a company already has it and pays for it, why not to use it?  
    Any more opinions?
    Naresh, why do you say PI is not unicode compatible? Can you open a thread with an example?
    Best Regards,
    Pedro M. D. Pereira
    Edited by: Pedro Pereira on Jun 22, 2010 1:12 PM
    Edited by: Pedro Pereira on Jun 22, 2010 1:12 PM

  • Why not buy? 2.16GHz CoreDuo MacBook Pro

    I currently use a 17-inch G4 1.33GHz PowerBook and am ready for an upgrade. I'm considering to a new Core Duo machine. My uses are modest page layout (Quark Xpress) light photo editing (Photoshop) and presentations (PowerPoint). The ability to run Windows applications directly (With Parallels) is very important; moderate travel use and desktop replacement are the other criteria. There is currently what appears to be a screaming good deal from several of the mail-order houses ($1700 after rebates) on the original 17-inch 2.16GHz MacBook Pro. This is the version that came before todays Core 2 Duo machines and will obviously be slower and less capable. But saving a grand is attractive. Is there any compelling reason NOT to go for the Core Duo machine? Will it be unable to run applications that are foeseeable? Will it be an unloved technical orphan? Why might I regret the purchase?
    Thanks for all advice.
    PowerBook 17"   Mac OS X (10.3.9)  

    Tony is right, BUT to be more specific the 15in Core2Dues include both Firewire 800 and 400, where as the 15in CoreDuo had just firewire 400. As for the 17in CoreDuo (the one Aces is looking at) that did have firewire 800 adn 400...
    I want to also add that the programs you listed you work with are questionable to me. I mean this in regards to their native processor language, those programs are written for PowerPC chips. I am not sure if you are familiar so please let me briefly explain (I, as well as others can go into more detail if needed). Anyways, as you know, the new Apple computers such as the MBP have intel processors. Meaning the entire chip architechture is different then that of the G3, G4, G5 (all were PowerPC chips). So although Apple rewrote the Operating system to work for the new intel chips, many software vendors, such as the programs you listed (Photoshop, Powerpoint, etc...) have yet to be rewritten. Therefore it theory they would not work at all! But of course Apple needed to do something about this compatability issue or else consumers would not buy the new intel processors.
    So Apple created something called Rosetta. Rosetta is an emulator that runs in the background and is always ready to translate PowerPC programs to work on the new intel platform. So, if you had your new MBP and launched photoshop, it would launch like normal. But underneath, Rosetta is enabling this PowerPC program to work on the intel. The problem with this is: a signifigant performance hit. If you ever ran Virtual PC on your powerbook to use windows, you know how slow it can be.
    My point in telling you this is that software vendors, such as Adobe, are working to create intel versions of their software so that no Rosetta (thus performance hits) will occur. And since Photoshop and others are still off in the distance, like this coming spring/summer Q2-Q3, I would say why not keep using your Powerbook and wait to upgrade until every program you want to use properly works with intel. By then, you can also probably get the current Core2Due MBP for a steal.

  • Could not parse well-formed HTML 4.01/XHTML 1.0 document using JDOM

    Hi All,
    I am having difficulty reading two well-formed HTML document using JDOM when running offline (not on the Internet). The first few lines of these documents are listed below:
      1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
      2 <!-- saved from url=(0044)http://www.mongabay.com/igapo/zipcodes/CA.htm -->
      3 <HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Cities and Towns in California starting with A - Zip codes United States of America</TITLE>
      4 <META http-equiv=Content-Type content="text/html; charset=UTF-8">
      5 <META
      6 content="california, cities, towns, villages, list, zipcodes, postal codes, us, ca"
      7 name=keywords>
      8 <META
      1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      2 <html xmlns="http://www.w3.org/1999/xhtml">
      3 <head>
      4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      5 <meta name="keywords" content="8024, california, postcode, map, america, postal code, alabama Hills, Adelaide, Aberdeen, la, la, california" />
      6 <meta name="description" content="93545 zip code for Alabama Hills, Adelaide and Aberdeen (LA), California (CA) with map and local information." />
    The Java snippets that references these documents (local files) is as follows:
    1      public static void main(String[] argv) 
    2       {
    3            File zipcodefile = new File("C:\\TEMP\\Zipcodes Listing for California.txt");  // former
    4            //                                                     or
    5            File zipcodefile = new File("C:\\TEMP\\Zipcodes Listing for California  - 93545 - Los Angeles, CA.txt");  // later
    6            try
    7            {
    8                SAXBuilder saxBuilder=new SAXBuilder("org.apache.xerces.parsers.SAXParser");
    9                // saxBuilder.setValidation(false);
    10              org.jdom.Document  doc = saxBuilder.build(zipcodefile);
    11              System.out.println(doc.getContent());
    12              System.out.println(doc.getDocType());
    13              ....( i ) This program would does not work even while it was running on-line (has Internet access). The execution process would exit on line 10 but not sure whether it completes it or not. Don't understand why though?
    ( ii ) What is the difference between the two files as far as the format goes? I thought HTML 4.01 is equivalent to XHTML 1.0? In other word, they are already well-formatted and so they can be parse directly by an XML parser such as Xerces. In other word, it is not necessary to use tool such as Tidy to convert to clean up missing tags?
    ( iii ) why are the tags in the former file in capital? Do parsers in general distinguish tags in capital compared to lower case?
    I am very new to XML parsing and would appreciate some guidances.
    Thanks a lot,
    Jack

    Hi,
    I am following a possible solution (http://devdiary.motime.com/post/471628/Why+implement+your+own+EntityResolver?) on how to redirect references to entities within an XML document to a local file but do not understand why it is not picking up the parsing file (former). Below is a complete change of ZipcodeTidy2JDomParser to include my own EntityResolver:
    1  public class ZipcodeTidy2JDomParser {
    2     public static void main(String[] argv) {
    3         try {
    4             File zipcodefile = new File("C:\\TEMP\\File zipcodefile = new File("C:\\TEMP\\Zipcodes Listing for California.txt"); // former
    5             SAXBuilder saxBuilder = new SAXBuilder(false);
    6             saxBuilder.setEntityResolver(new EntityResolver() {
    7             public InputSource resolveEntity(String publicId, String systemId) {
    8                 try {
    9                     if (systemId != null && systemId.endsWith(".dtd")) {
    10                         return new InputSource(getClass().getResource("E:\\Temp\\Software Development\\Download\\Forum\\html-loose.dtd").openStream());
    11                     }
    12                 }
    13                 catch (IOException e) {
    14                     e.printStackTrace();
    15                 }
    16                 return null;
    17               }
    18             });
    19             InputStream is = new FileInputStream(zipcodefile.getName());
    20      //     InputStream is = new FileInputStream(zipcodefile);
    21             Document document = null;
    22             try {
    23                 document = saxBuilder.build(is);
    24     //          document = saxBuilder.build(zipcodefile);
    25             }
    26             catch (JDOMException e) {
    27                 e.printStackTrace();
    28             } catch (IOException e) {
    29                 e.printStackTrace();
    30             }
    31             finally {
    32                 if (document == null) return;
    33             }
    34             System.out.println(document.getContent());
    35             System.out.println(document.getDocType());
    The output from running ZipcodeTidy2JDomParser is:
    java.io.FileNotFoundException: Zipcodes Listing for California.txt. (The system cannot find the file specified)
            at java.io.FileInputStream.open(Native Method)
            at java.io.FileInputStream.<init>(FileInputStream.java:106)
            at java.io.FileInputStream.<init>(FileInputStream.java:66)
            at JDOMXPath.ZipcodeTidy2JDomParser.main(ZipcodeTidy2JDomParser.java:19){code}
    Could any see where this issue is coming from?
    The author of the same thread suggest that line 5 should add an extra parameter (SAXBuilder saxBuilder = new SAXBuilder(false, "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"). However, the SAXBuilder constructor does not accept the second paramter. Any ideas?
    Many thanks,
    Jack                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can I use JDOM to parse if I just put the class into a servlet folder witho

    Dear ALL,
    I am using JDOM to do some parsing of my XML.
    I can compile it on my own machine since I installed JDOM.
    But I have to put all my files in a servelt folder at my college which hasn't got J-DOM installed.
    I placed the jar file into it, and the class which I compiled on my machine but It doesn't work.
    Can someome pls telll me how I can get it to work on the machine at college?
    Is downloading JDOM-beta7 the only way?
    Many Thanks

    Typically the servlets directory will be in the webserver's classpath. This being the case, any class in that directory will be in the classpath. When classes that are in packages (such as org.jdom.*) and they are not in a jar file, they will be contained in a directory structure reflecting the structure of the package. For example, the class org.jdom.Attribute would have a path like /servlets/org/jdom/Attribute.class (if it were in the servlets directory on a Unix machine).
    SO, to get to the point, if you unjar the jdom jar file, and put the resulting directory structure in the servlets directory, then your servlets should be able to get to those classes. That is how I would do/try it if I were in your situation.
    Winzip can unjar jar files... and there are utilities provided with the JDK. Let me know if you need more help!

  • SQL not parsed correctly Why is meant by SQL Statements Larger than 32KB?

    I execute the following code
         begin
              dbms_output.put_line('b4 Constructing query 2');
              v_retail_rate_query_a:='select *
              from Rate R
              where rate_id=:v_RateID
              and service_id=:p_ServiceID
    AND SUBSTR(R.Area_Code, 1, LEAST(LENGTH(:v_Orig_Number), LENGTH(R.Area_Code))) = SUBSTR(:v_Orig_Number, 1, LEAST(LENGTH(:v_Orig_Number), LENGTH(R.Area_Code)))
    AND LENGTH(R.Area_Code) <= LENGTH(:v_Orig_Number)
              v_query_a_length:=length(v_retail_rate_query_a);
              dbms_output.put_line('v_retail_rate_query_a ' || v_retail_rate_query_a || ' |');
              dbms_output.put_line('v_query_a_length ' || v_query_a_length || ' |');
         exception
              when others then
              :v_ErrNumber:=-1800;
         end;
    But the statement is not parsed correctly why is this so? with reference to http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg09dyn.htm#26624
    32k /8 would have give me at most 4000 characters. the query certainly does not have 4000 characters.
    Anybody could enlighten me with the reason why oracle could not parse my query? Is there a way to insert '\n' in Pl/SQL?
    thanks!

    You do in your select statement length(r.area_code) <= length(:v_orig_number), so least(length(:v_orig_number),length(area_code)) will always return
    length(r.area_code).
    substr(r.area_code,1,least(length(:v_orig_number),length(r.area_code))) will return area_code because substr(r.area_code,1,length(r.area_code)) will return r.area_code.
    SUBSTR(:v_Orig_Number, 1, LEAST(LENGTH(:v_Orig_Number), LENGTH(R.Area_Code))) will return
    SUBSTR(:v_Orig_Number, 1,length(r.area_code)).
    I believe you can use select statement
    select *
    from rate
    where rate_id = cp_rate_id
    and service_id = cp_service_id
    and cp_orig_number like area_code||'%';
    Use this PL/SQL code.
    set serveroutput on
    declare
    cursor c_rats( cp_rate_id     in rate.rate_id%type
                 , cp_service_id  in rate.service_id%type
                 , cp_orig_number in varchar2)
           is
           select *
           from   rate
           where  rate_id           = cp_rate_id
           and    service_id        = cp_service_id
           and    cp_orig_number like area_code||'%';
    begin
      for r_rats in c_rats(1,2,'ABCDEFG') loop
        dbms_output.put_line(r_rats.rate_id);
      end loop;   
    end;
    /Here I used rate_id = 1, service_id = 2 and orig_number = 'ABCDEF'.

  • I created an Apple ID using my ISP Email when I registered at the Store/Apple Support Communities/iTunes/Face Time and it does not work in iChat. Why Not ?

    Question:-
    I created an Apple ID using my ISP Email when I registered at the Store/Apple Support Communities/iTunes/Face Time or other portal and it does not work in iChat. Why Not ?
    Answer:-
    For a Name to work in iChat it has to be an Valid AIM screen Name.
    Only Apple IDs from the @mac.com ending names registered here  and the Mobileme (@Me.com ending) names are Valid with the AIM service as well as being Apple IDs
    (I am still working on info about registering with iCloud at the moment but if this does give you an @Me.com email it may well be a valid AIM name as well)
    NOTES:-
    The @mac.com page works by linking an external (Non Apple) email with a @mac.com name.
    This External Email cannot be one linked to an Existing Apple ID (you have to use a second email or register at AIM )
    The options at AIM are to use your existing email or create new name and link the existing only for Password recovery
    MobileMe (@me.com ending names) were valid Emails addresses, Apple IDs AND a Valid AIM Screen Name
    @mac.com names look like emails but are only Apple IDs and iChat/AIM Valid Screen Names.
    The AIM registration page seems to be pushing you to register [email protected] This is relatively new and I have not followed through the pages to find out if it a valid AIM email (Previously you could register a name without an @whatever.com suffix)
    8:16 PM      Friday; June 10, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

    Question:-
    So I have my current [email protected] email in iChat as I thought as I had linked that to an Apple ID it was a Valid iChat Name.  It keeps coming up with a UserName or Password Invalid message.  What do I do next ?
    Answer:-
    Open iChat
    Go to the Menu under the iChat name in the Menu Bar and then Preferences and then Accounts in the new window.
    Commonly written as iChat > Preferences > Accounts as directions/actions to take.
    If it displays with a Yellow running name in the list you have a choice.
    Either register it at AIM (I would use a different password to the ISP Login) and then change the password only in iChat  (It may take you to confirm any Confirmation email from AIM first) in iChat > Preferences > Accounts
    Or you register a new Name at AIM (Or at @mac.com) and enter that (details below)
    If you have a Blue Globe name  (@mac.com) that will not Login the chances are that it the password that is the issue.
    Apple lets you create longer passwords than can be used with the AIM Servers.
    Change the Password at iForgot to no more than 16 characters.
    Then change the password in iChat as details above.
    Adding a new Account/Screen Name in iChat (that is valid with the AIM servers)
    Open iChat if not launched.
    Go to iChat Menu > Preferences > Accounts
    Click the Add ( + )  Button at the bottom of the list.
    Choose in the top item drop down either @Mac.com or AIM depending on what you registered
    Add the name (with @mac.com the software will add the @mac.com bit)
    Add in the password.  (If you don't add it now iChat will ask you each time you open it)
    Click Done.
    The Buddy List should open (New Window)
    The Accounts part of the Preferences should now have the new name and you should be looking at the details.
    You can add something in the Description line which will then title the Buddy List (Useful when you have two or more names) and make it show up as that in the iChat Menu > Accounts and the Window Menu of iChat when logged in.
    You can then highlight any other Account/Screen Name you don't want to use and use the Minus ( - ) Button to delete it.
    8:39 PM      Friday; June 10, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • This is a new notification coming up with iTunes, why and how do I fix it? The song "Penny Lane" could not be used because the original file could not be found. Would you like to locate it?

    This is a new notification coming up with iTunes, why and how do I fix it?
    The song “Penny Lane” could not be used because the original file could not be found. Would you like to locate it?
    Max

    Hey xxCreepyFiaxx,
    First, I would try the following suggested steps for when you don't see content in iTunes after updating:
    Quit iTunes.
    Download and install the latest version of iTunes.
    Use the Finder (Mac) or Windows Explorer (Windows) to go to the iTunes folder that contains the iTunes library files:
    Mac OS X
    /Users/username/Music/iTunes/
    Microsoft Windows Windows XP and Windows 2000
    \Documents and Settings\username\My Documents\My Music\iTunes\
    Microsoft Windows Windows Vista and Windows 7
    \Users\username\Music\iTunes\
    Drag the iTunes Library file from the above location to the Desktop.
    Open the Previous iTunes Libraries folder in the iTunes folder.
    Locate the file named iTunes Library YYYY-MM-DD where YYYY-MM-DD is the date you upgraded iTunes (Year-Month-Day).
    Drag this file to the iTunes folder (the enclosing folder).
    Rename this file to iTunes Library.
    Open iTunes.
    You should now see your missing content in iTunes.
    via: No content shows up in iTunes after updating
    http://support.apple.com/kb/TS1967
    If that doesn't resolve the issue, then I'd go through the steps in here:
    iTunes: Finding lost media and downloads
    http://support.apple.com/kb/TS1408
    Have a good one,
    Delgadoh

Maybe you are looking for

  • Storage is full but I can't remove anything from my iphone 5s

    Hi there. I just upgraded to an iPhone 5s (16GB) from an iPhone 4 (16GB). While still using the iPhone 4 I enabled iCoud and iTunes Match and synced them across all my other devices (iPad and PCs). Now when using my iPhone 5s I constantly receive a m

  • Adobe Photoshop CS4 says license expired on first day of usage.

    Downloaded Adobe Photoshop CS4 trial version yesterday(5/22) and install it today 5/23 on a new PC. When I tried to open it, it says license expired...anyone know why?  I have uninstalled and re-installed and it says the same thing.

  • In order to install some programs my imac Java SE 6 Runtime is being required

    to install some programs my Mac OS X 10.8 it is requesting me to have Java SE 6 Runtime and it gives me the option "to install one now" but when i click on "install" it says the software is currecntly unavailable, this is fustrating, any ideas? I alr

  • How to fix ORA-01658 error message

    Am trying to get a old bit of database code working and am getting the following errors with the following REM ********************************************************************** CREATE TABLE gam_service ( /*gam_ser*/ service_group_id NUMBER(10) N

  • Query to find the maximum and second maximum

    i have a table temptab of 3 columns col1 col2 col3 1 a 08-JAN-08 1 a 09-JAN-08 1 a 10-JAN-08 1 b 10-JAN-08 1 c 11-mar-08 1 c 10-mar-08 i want to select 1st maxm and 2nd maxm of col3 group by (col1,col2) o/p will be like 1 a 10-jan-08 08-jan-08 1 b 10