[jdom-interest] Re:[jdom-interest]Build error in Linux, not Windows

Brian Wolf brianw at knowledgextensions.com
Wed Nov 21 09:53:51 PST 2001


Here is the exception, the program, the xml file and the environmental
settings:


org.jdom.JDOMException: Error in building: home



import org.jdom.Element;
import org.jdom.Document;
import org.jdom.output.XMLOutputter;
import org.jdom.input.SAXBuilder;

public class HelloWorld {
  public static void main(String[] args) {

    try {

    SAXBuilder builder = new SAXBuilder();

    Document doc = builder.build("/home/brian/test.xml");

      // Output the new document (doc) to System.out
      XMLOutputter outputter = new XMLOutputter();
      outputter.output(doc, System.out);
    } catch (Exception e) {
      System.err.println(e);
    }
  }
}


-----------------------------------------test.xml---------------------------
------------------

<?xml version="1.0"?>
<camelids>
  <species name="Camelus dromedarius">
    <common-name>Dromedary, or Arabian Camel</common-name>
    <physical-characteristics>
      <mass>300 to 690 kg.</mass>
      <appearance>
        The dromedary camel is characterized by a long-curved
        neck, deep-narrow chest, and a single hump.
        ...
      </appearance>
    </physical-characteristics>
    <natural-history>
       <food-habits>
         The dromedary camel is an herbivore.
         ...
       </food-habits>
       <reproduction>
         The dromedary camel has a lifespan of about 40-50 years
         ...
       </reproduction>
       <behavior>
         With the exception of rutting males, dromedaries show
         very little aggressive behavior.
         ...
       </behavior>
       <habitat>
         The camels prefer desert conditions characterized by a
         long dry season and a short rainy season.
         ...
       </habitat>
    </natural-history>
    <conservation status="no special status">
      <detail>
        Since the dromedary camel is domesticated, the camel has
        no special status in conservation.
      </detail>
    </conservation>
  </species>
  ...
</camelids>


---------------------------
environment ------------------------------------------

PWD=/home/brian
WINDOWID=29360392
HOSTNAME=localhost.localdomain
QTDIR=/usr/lib/qt-2.3.0
LESSOPEN=|/usr/bin/lesspipe.sh %s
KDEDIR=/usr
USER=root
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;
33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=0
1;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:
*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;
31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.
gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
MACHTYPE=i386-redhat-linux-gnu
MAIL=/var/spool/mail/root
INPUTRC=/etc/inputrc
OLDPWD=/root
BASH_ENV=/root/.bashrc
XMODIFIERS=@im=none
LANG=en_US
JAVA_HOME=/usr/java
COLORTERM=gnome-terminal
DISPLAY=:0
LOGNAME=root
SHLVL=4
SESSION_MANAGER=local/localhost.localdomain:/tmp/.ICE-unix/734
SHELL=/bin/bash
USERNAME=root
HOSTTYPE=i386
OSTYPE=linux-gnu
HISTSIZE=1000
LAMHELPFILE=/etc/lam/lam-helpfile
HOME=/root
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
TERM=xterm
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/b
in:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
_=/usr/bin/env







----- Original Message -----
From: Bilton, Sasha <Sasha.Bilton at bskyb.com>
To: 'Brian Wolf' <brianw at knowledgextensions.com>
Sent: Tuesday, November 20, 2001 9:53 AM
Subject: RE: [jdom-interest] Build error in Linux , not Windows


> Hmmm. Maybe your JAVA_HOME environment setting is set properly?
>
> Other than that, post the entire Exception and the xml file test. Check
that
> test.xml is in your working directory
>
> -----Original Message-----
> From: Brian Wolf [mailto:brianw at knowledgextensions.com]
> Sent: 20 November 2001 13:52
> To: jdom-interest at jdom.org
> Subject: [jdom-interest] Build error in Linux , not Windows
>
>
> Hi,
>
> The following code works fine under Windows, but not under Linux,
> where I get a JDOM exception: "error in build: HOME"
> --------------------------------------------------------------
> import org.jdom.Element;
> import org.jdom.Document;
> import org.jdom.output.XMLOutputter;
> import org.jdom.input.SAXBuilder;
> public class HelloWorld {
> public static void main(String[] args) {
> // Create a root Element for the Document
> Element root = new Element("GREETING");
> root.setText("Hello World!");
> // Create a new document using the root element just created
>
> file://Document doc = new Document(root);
> try {
> SAXBuilder builder = new SAXBuilder();
> Document doc = builder.build("test.xml");
> // Output the new document (doc) to System.out
> XMLOutputter outputter = new XMLOutputter();
> outputter.output(doc, System.out);
> } catch (Exception e) {
> System.err.println(e);
> }
> }
> }
>
>
> **********************************************************************
> Information in this email is confidential and may be privileged.
> It is intended for the addressee only. If you have received it in error,
> please notify the sender immediately and delete it from your system.
> You should not otherwise copy it, retransmit it or use or disclose its
> contents to anyone.
> Thank you for your co-operation.
> **********************************************************************
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20011121/7c9a77fd/attachment.htm


More information about the jdom-interest mailing list