Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Fatal Error The element type "br" must be terminated while download image from flickr

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Fatal Error The element type "br" must be terminated while download image from flickr

    Hi ,
    I am downloading images from Flickr webserver using Flickr API.While parsing the url using document object

    I got the fatel error:
    [Fatal Error] ?method=flickr.photos.getRecent&api_key=myapikey&t ags=&per_page=10&page=1:16:155: The element type "br" must be terminated by the matching end-tag "</br>".

    The requested url to download the image is :-
    "http://www.flickr.com/services/rest/?method=flickr.photos.getRecent&api_key=myapikey&t ags=&per_page=10&page=1"

    Below is the method that parses the content.

    protected Document getFlickrData(String method, Map<String, String> params)
    throws MalformedURLException, SAXException, IOException, FlickrException {
     
    URL flickrRequestUrl = null; 
    flickrRequestUrl = constructFlickrRequestUrl(method, params);
     
    System.out.println("FlckrRequestUrl:" " " flickrRequestUrl);
     
    System.setProperty("http.proxyHost", "myproxy.com"); 
    System.setProperty("http.proxyPort", "8080"); 
     
    Authenticator.setDefault( new HttpAuthenticator() ); 
     
    System.setProperty("http.proxyUser", "kj0044135"); 
    System.setProperty("http.proxyPassword", "password"); 
     
    System.out.println("Document before parsing flickrRequestUrl:");
     
    [B]Document document = xmlParser.parse(flickrRequestUrl.toString()); [/B]// Here I am getting exception
    System.out.println("Document after parsing flickrRequestUrl:" " " document);
     
    NodeList errors = document.getDocumentElement().getElementsByTagName("err");
     
    if (errors != null && errors.getLength() > 0) {
    System.out.println("Error occur");
    throw new FlickrException((Element) errors.item(0));
    }
     
    return document; 
     
    }

    what is the problem in this.Please help my out here.

    Thanks in advance.

    Thanks and Regards,
    Kalpesh


  2. #2
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: Fatal Error The element type "br" must be terminated while download image

    The web page you are trying to download from has poor formatting and writing. basically within the HTML file you are downloading there is a br tag that doesn't have a closing br tag.

    Regards,
    Chris

  3. #3
    Junior Member
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Fatal Error The element type "br" must be terminated while download image from fl

    Hi,
    Thanks for reply.

    Actually when paste the url in bowser then contain display in browser is given below:-

    <?xml version="1.0" encoding="utf-8" ?>
    - <rsp stat="ok">
    - <photos page="1" pages="100" perpage="10" total="1000">
    <photo id="3637930746" owner="80714421@N00" secret="dcffaf4ceb" server="3410" farm="4" title="IMG_9002e" ispublic="1" isfriend="0" isfamily="0" />
    <photo id="3637930724" owner="32405530@N00" secret="cdab38ff2d" server="3628" farm="4" title="P6132622" ispublic="1" isfriend="0" isfamily="0" />
    <photo id="3637930706" owner="56529377@N00" secret="80fab8f394" server="3657" farm="4" title="DSCN0127" ispublic="1" isfriend="0" isfamily="0" />
    <photo id="3637117815" owner="15586202@N00" secret="efc096d2e6" server="3637" farm="4" title="IMG_0329" ispublic="1" isfriend="0" isfamily="0" />
    <photo id="3637117783" owner="42809587@N00" secret="086c2f05a7" server="3376" farm="4" title="N628CC" ispublic="1" isfriend="0" isfamily="0" />
    <photo id="3637117761" owner="28756676@N02" secret="5583b7a2b8" server="2468" farm="3" title="18062009609-001" ispublic="1" isfriend="0" isfamily="0" />
    <photo id="3637117659" owner="31242357@N07" secret="edcf46b7ea" server="2427" farm="3" title="_DSC0033_edited-1_filtered" ispublic="1" isfriend="0" isfamily="0" />
    <photo id="3637930808" owner="99361158@N00" secret="895cf707b3" server="3618" farm="4" title="_DSC7786" ispublic="1" isfriend="0" isfamily="0" />
    <photo id="3637930800" owner="91431624@N00" secret="d157f95156" server="3602" farm="4" title="DSCF5530" ispublic="1" isfriend="0" isfamily="0" />
    <photo id="3637930790" owner="31507225@N00" secret="8b7fa39d3d" server="3595" farm="4" title="Library - 3094" ispublic="1" isfriend="0" isfamily="0" />
    </photos>
    </rsp>

    There is no <br> tag. I am actuallu access this web serve through firewall.Is this causes any problem.

    Thanks and Regards,
    Kalpesh Jain

  4. #4
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Fatal Error The element type "br" must be terminated while download image from fl

    I do not think this has anything to do with you being behind a firewall. Which API are you using? flickrj or jickr?

    The error is due to how your attempting to parse the downloaded XML.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  5. #5
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Fatal Error The element type "br" must be terminated while download image from fl

    Can you please post all of your code for me to look at..
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Similar Threads

  1. Replies: 16
    Last Post: August 27th, 2010, 03:30 PM
  2. Replies: 2
    Last Post: March 23rd, 2010, 01:38 AM
  3. [SOLVED] "GridLayout" problem in Java program
    By antitru5t in forum AWT / Java Swing
    Replies: 3
    Last Post: April 16th, 2009, 10:26 AM

Tags for this Thread