XML Import error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

XML Import error

James Troup-4
Hi guys,

I am in the process of testing data importing into ofbiz and I am
running into an error.

I have created a simple entity definition file XML file and it parses
the CSV file I have no problems;  the resultant file looks like this

<?xml version="1.0" encoding="UTF-8"?>
<entity-engine-xml>
<Product productId="HT120032C2SS" description="2 ARM LEAF CURL SS"
productTypeId="FINISHED_GOOD" />
<Product productId="HT7016FB2" description="3 ARM LEAF CURL FB"
productTypeId="FINISHED_GOOD" />
<Product productId="HW209" description="Washer 209 brs"
productTypeId="FINISHED_GOOD" />
<Product productId="1ALCOIL3012" description="ALUM. COIL 54mmWx0.95mmTH"
productTypeId="FINISHED_GOOD" />
</entity-engine-xml>

When I try to use the XML Import to DataSoure(s) Web Tool I get the
following error:

    * ERROR: Error parsing entity xml file:
      org.xml.sax.SAXParseException: '=' expected

I have also tried to import from the command line using

java -jar ofbiz.jar -install -file=./product.xml

but to no avail!

Where do I start looking from here?

Thanks,
James

Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

Ashish Vijaywargiya-2
Hey James,

It's working fine for me in below two cases(in
Webtools "XML Import to DataSource(s)").

I tried "Absolute Filename or URL:"
&
"Complete XML document (root tag: entity-engine-xml):"

Which version of Ofbiz are you using ???
Are you uploading the file on your local machine or on
remote machine ???

Regards
Ashish Vijaywargiya

--- James Troup <[hidden email]> wrote:

> Hi guys,
>
> I am in the process of testing data importing into
> ofbiz and I am
> running into an error.
>
> I have created a simple entity definition file XML
> file and it parses
> the CSV file I have no problems;  the resultant file
> looks like this
>
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <Product productId="HT120032C2SS" description="2 ARM
> LEAF CURL SS"
> productTypeId="FINISHED_GOOD" />
> <Product productId="HT7016FB2" description="3 ARM
> LEAF CURL FB"
> productTypeId="FINISHED_GOOD" />
> <Product productId="HW209" description="Washer 209
> brs"
> productTypeId="FINISHED_GOOD" />
> <Product productId="1ALCOIL3012" description="ALUM.
> COIL 54mmWx0.95mmTH"
> productTypeId="FINISHED_GOOD" />
> </entity-engine-xml>
>
> When I try to use the XML Import to DataSoure(s) Web
> Tool I get the
> following error:
>
>     * ERROR: Error parsing entity xml file:
>       org.xml.sax.SAXParseException: '=' expected
>
> I have also tried to import from the command line
> using
>
> java -jar ofbiz.jar -install -file=./product.xml
>
> but to no avail!
>
> Where do I start looking from here?
>
> Thanks,
> James
>
>




 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail.
http://new.mail.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

James Troup-4
Hi,

I am using opentaps 0.9.2

I since downloaded the daily build of opentaps; same error.

I am attempting to checkout  
http://svn.apache.org/repos/asf/incubator/ofbiz/trunk ofbiz

But it appears to be broken at the moment.

James

Ashish Vijaywargiya wrote:

>Hey James,
>
>It's working fine for me in below two cases(in
>Webtools "XML Import to DataSource(s)").
>
>I tried "Absolute Filename or URL:"
>&
>"Complete XML document (root tag: entity-engine-xml):"
>
>Which version of Ofbiz are you using ???
>Are you uploading the file on your local machine or on
>remote machine ???
>
>Regards
>Ashish Vijaywargiya
>
>--- James Troup <[hidden email]> wrote:
>
>  
>
>>Hi guys,
>>
>>I am in the process of testing data importing into
>>ofbiz and I am
>>running into an error.
>>
>>I have created a simple entity definition file XML
>>file and it parses
>>the CSV file I have no problems;  the resultant file
>>looks like this
>>
>><?xml version="1.0" encoding="UTF-8"?>
>><entity-engine-xml>
>><Product productId="HT120032C2SS" description="2 ARM
>>LEAF CURL SS"
>>productTypeId="FINISHED_GOOD" />
>><Product productId="HT7016FB2" description="3 ARM
>>LEAF CURL FB"
>>productTypeId="FINISHED_GOOD" />
>><Product productId="HW209" description="Washer 209
>>brs"
>>productTypeId="FINISHED_GOOD" />
>><Product productId="1ALCOIL3012" description="ALUM.
>>COIL 54mmWx0.95mmTH"
>>productTypeId="FINISHED_GOOD" />
>></entity-engine-xml>
>>
>>When I try to use the XML Import to DataSoure(s) Web
>>Tool I get the
>>following error:
>>
>>    * ERROR: Error parsing entity xml file:
>>      org.xml.sax.SAXParseException: '=' expected
>>
>>I have also tried to import from the command line
>>using
>>
>>java -jar ofbiz.jar -install -file=./product.xml
>>
>>but to no avail!
>>
>>Where do I start looking from here?
>>
>>Thanks,
>>James
>>
>>
>>    
>>
>
>
>
>
>
>____________________________________________________________________________________
>Do you Yahoo!?
>Everyone is raving about the all-new Yahoo! Mail.
>http://new.mail.yahoo.com
>  
>
Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

Ashish Vijaywargiya-2
Hey James,

I have tried the content of your XML data with the
online demo of opentaps at :

Paste the XML content in the webtools import screen :
Complete XML document (root tag: entity-engine-xml):

I also have the opentaps 0.9.2 version.
Let me test on that.
I will let you know about that.

Till then can you please send me the full details of
log message and which database are you using for this
??

Regards
Ashish Vijaywargiya


--- James Troup <[hidden email]> wrote:

> Hi,
>
> I am using opentaps 0.9.2
>
> I since downloaded the daily build of opentaps; same
> error.
>
> I am attempting to checkout  
>
http://svn.apache.org/repos/asf/incubator/ofbiz/trunk

> ofbiz
>
> But it appears to be broken at the moment.
>
> James
>
> Ashish Vijaywargiya wrote:
>
> >Hey James,
> >
> >It's working fine for me in below two cases(in
> >Webtools "XML Import to DataSource(s)").
> >
> >I tried "Absolute Filename or URL:"
> >&
> >"Complete XML document (root tag:
> entity-engine-xml):"
> >
> >Which version of Ofbiz are you using ???
> >Are you uploading the file on your local machine or
> on
> >remote machine ???
> >
> >Regards
> >Ashish Vijaywargiya
> >
> >--- James Troup <[hidden email]> wrote:
> >
> >  
> >
> >>Hi guys,
> >>
> >>I am in the process of testing data importing into
> >>ofbiz and I am
> >>running into an error.
> >>
> >>I have created a simple entity definition file XML
> >>file and it parses
> >>the CSV file I have no problems;  the resultant
> file
> >>looks like this
> >>
> >><?xml version="1.0" encoding="UTF-8"?>
> >><entity-engine-xml>
> >><Product productId="HT120032C2SS" description="2
> ARM
> >>LEAF CURL SS"
> >>productTypeId="FINISHED_GOOD" />
> >><Product productId="HT7016FB2" description="3 ARM
> >>LEAF CURL FB"
> >>productTypeId="FINISHED_GOOD" />
> >><Product productId="HW209" description="Washer 209
> >>brs"
> >>productTypeId="FINISHED_GOOD" />
> >><Product productId="1ALCOIL3012"
> description="ALUM.
> >>COIL 54mmWx0.95mmTH"
> >>productTypeId="FINISHED_GOOD" />
> >></entity-engine-xml>
> >>
> >>When I try to use the XML Import to DataSoure(s)
> Web
> >>Tool I get the
> >>following error:
> >>
> >>    * ERROR: Error parsing entity xml file:
> >>      org.xml.sax.SAXParseException: '=' expected
> >>
> >>I have also tried to import from the command line
> >>using
> >>
> >>java -jar ofbiz.jar -install -file=./product.xml
> >>
> >>but to no avail!
> >>
> >>Where do I start looking from here?
> >>
> >>Thanks,
> >>James
> >>
> >>
> >>    
> >>
> >
> >
> >
> >
> >
>
>____________________________________________________________________________________
> >Do you Yahoo!?
> >Everyone is raving about the all-new Yahoo! Mail.
> >http://new.mail.yahoo.com
> >  
> >
>




 
____________________________________________________________________________________
Sponsored Link

Mortgage rates near 39yr lows. $420k for $1,399/mo.
Calculate new payment!
http://www.LowerMyBills.com/lre
Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

James Troup-4
Ashish,
I have some more info.

There is something wrong in the way the date was parsed into an xml file
or there are some wrong characters.

I split my file with 6397 lines up into 50 line files put them into a
directory and imported.

60% of the files succeded.

So now I just have to figure out what is wrong with the other files and
correct them.

Thanks for your help.

James

Ashish Vijaywargiya wrote:

>Hey James,
>
>I have tried the content of your XML data with the
>online demo of opentaps at :
>
>Paste the XML content in the webtools import screen :
>Complete XML document (root tag: entity-engine-xml):
>
>I also have the opentaps 0.9.2 version.
>Let me test on that.
>I will let you know about that.
>
>Till then can you please send me the full details of
>log message and which database are you using for this
>??
>
>Regards
>Ashish Vijaywargiya
>
>
>--- James Troup <[hidden email]> wrote:
>
>  
>
>>Hi,
>>
>>I am using opentaps 0.9.2
>>
>>I since downloaded the daily build of opentaps; same
>>error.
>>
>>I am attempting to checkout  
>>
>>    
>>
>http://svn.apache.org/repos/asf/incubator/ofbiz/trunk
>  
>
>>ofbiz
>>
>>But it appears to be broken at the moment.
>>
>>James
>>
>>Ashish Vijaywargiya wrote:
>>
>>    
>>
>>>Hey James,
>>>
>>>It's working fine for me in below two cases(in
>>>Webtools "XML Import to DataSource(s)").
>>>
>>>I tried "Absolute Filename or URL:"
>>>&
>>>"Complete XML document (root tag:
>>>      
>>>
>>entity-engine-xml):"
>>    
>>
>>>Which version of Ofbiz are you using ???
>>>Are you uploading the file on your local machine or
>>>      
>>>
>>on
>>    
>>
>>>remote machine ???
>>>
>>>Regards
>>>Ashish Vijaywargiya
>>>
>>>--- James Troup <[hidden email]> wrote:
>>>
>>>
>>>
>>>      
>>>
>>>>Hi guys,
>>>>
>>>>I am in the process of testing data importing into
>>>>ofbiz and I am
>>>>running into an error.
>>>>
>>>>I have created a simple entity definition file XML
>>>>file and it parses
>>>>the CSV file I have no problems;  the resultant
>>>>        
>>>>
>>file
>>    
>>
>>>>looks like this
>>>>
>>>><?xml version="1.0" encoding="UTF-8"?>
>>>><entity-engine-xml>
>>>><Product productId="HT120032C2SS" description="2
>>>>        
>>>>
>>ARM
>>    
>>
>>>>LEAF CURL SS"
>>>>productTypeId="FINISHED_GOOD" />
>>>><Product productId="HT7016FB2" description="3 ARM
>>>>LEAF CURL FB"
>>>>productTypeId="FINISHED_GOOD" />
>>>><Product productId="HW209" description="Washer 209
>>>>brs"
>>>>productTypeId="FINISHED_GOOD" />
>>>><Product productId="1ALCOIL3012"
>>>>        
>>>>
>>description="ALUM.
>>    
>>
>>>>COIL 54mmWx0.95mmTH"
>>>>productTypeId="FINISHED_GOOD" />
>>>></entity-engine-xml>
>>>>
>>>>When I try to use the XML Import to DataSoure(s)
>>>>        
>>>>
>>Web
>>    
>>
>>>>Tool I get the
>>>>following error:
>>>>
>>>>   * ERROR: Error parsing entity xml file:
>>>>     org.xml.sax.SAXParseException: '=' expected
>>>>
>>>>I have also tried to import from the command line
>>>>using
>>>>
>>>>java -jar ofbiz.jar -install -file=./product.xml
>>>>
>>>>but to no avail!
>>>>
>>>>Where do I start looking from here?
>>>>
>>>>Thanks,
>>>>James
>>>>
>>>>
>>>>  
>>>>
>>>>        
>>>>
>>>
>>>
>>>
>>>      
>>>
>>____________________________________________________________________________________
>>    
>>
>>>Do you Yahoo!?
>>>Everyone is raving about the all-new Yahoo! Mail.
>>>http://new.mail.yahoo.com
>>>
>>>
>>>      
>>>
>
>
>
>
>
>____________________________________________________________________________________
>Sponsored Link
>
>Mortgage rates near 39yr lows. $420k for $1,399/mo.
>Calculate new payment!
>http://www.LowerMyBills.com/lre
>  
>
Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

Ashish Vijaywargiya-2
Hey James,

That's great that you got the solution.
I only tried the data that you sent on mailing list
and that worked fine for me.

Anyway good luck for the rest work.
Regards
Ashish Vijaywargiya

--- James Troup <[hidden email]> wrote:

> Ashish,
> I have some more info.
>
> There is something wrong in the way the date was
> parsed into an xml file
> or there are some wrong characters.
>
> I split my file with 6397 lines up into 50 line
> files put them into a
> directory and imported.
>
> 60% of the files succeded.
>
> So now I just have to figure out what is wrong with
> the other files and
> correct them.
>
> Thanks for your help.
>
> James
>
> Ashish Vijaywargiya wrote:
>
> >Hey James,
> >
> >I have tried the content of your XML data with the
> >online demo of opentaps at :
> >
> >Paste the XML content in the webtools import screen
> :
> >Complete XML document (root tag:
> entity-engine-xml):
> >
> >I also have the opentaps 0.9.2 version.
> >Let me test on that.
> >I will let you know about that.
> >
> >Till then can you please send me the full details
> of
> >log message and which database are you using for
> this
> >??
> >
> >Regards
> >Ashish Vijaywargiya
> >
> >
> >--- James Troup <[hidden email]> wrote:
> >
> >  
> >
> >>Hi,
> >>
> >>I am using opentaps 0.9.2
> >>
> >>I since downloaded the daily build of opentaps;
> same
> >>error.
> >>
> >>I am attempting to checkout  
> >>
> >>    
> >>
>
>http://svn.apache.org/repos/asf/incubator/ofbiz/trunk
> >  
> >
> >>ofbiz
> >>
> >>But it appears to be broken at the moment.
> >>
> >>James
> >>
> >>Ashish Vijaywargiya wrote:
> >>
> >>    
> >>
> >>>Hey James,
> >>>
> >>>It's working fine for me in below two cases(in
> >>>Webtools "XML Import to DataSource(s)").
> >>>
> >>>I tried "Absolute Filename or URL:"
> >>>&
> >>>"Complete XML document (root tag:
> >>>      
> >>>
> >>entity-engine-xml):"
> >>    
> >>
> >>>Which version of Ofbiz are you using ???
> >>>Are you uploading the file on your local machine
> or
> >>>      
> >>>
> >>on
> >>    
> >>
> >>>remote machine ???
> >>>
> >>>Regards
> >>>Ashish Vijaywargiya
> >>>
> >>>--- James Troup <[hidden email]> wrote:
> >>>
> >>>
> >>>
> >>>      
> >>>
> >>>>Hi guys,
> >>>>
> >>>>I am in the process of testing data importing
> into
> >>>>ofbiz and I am
> >>>>running into an error.
> >>>>
> >>>>I have created a simple entity definition file
> XML
> >>>>file and it parses
> >>>>the CSV file I have no problems;  the resultant
> >>>>        
> >>>>
> >>file
> >>    
> >>
> >>>>looks like this
> >>>>
> >>>><?xml version="1.0" encoding="UTF-8"?>
> >>>><entity-engine-xml>
> >>>><Product productId="HT120032C2SS" description="2
> >>>>        
> >>>>
> >>ARM
> >>    
> >>
> >>>>LEAF CURL SS"
> >>>>productTypeId="FINISHED_GOOD" />
> >>>><Product productId="HT7016FB2" description="3
> ARM
> >>>>LEAF CURL FB"
> >>>>productTypeId="FINISHED_GOOD" />
> >>>><Product productId="HW209" description="Washer
> 209
> >>>>brs"
> >>>>productTypeId="FINISHED_GOOD" />
> >>>><Product productId="1ALCOIL3012"
> >>>>        
> >>>>
> >>description="ALUM.
> >>    
> >>
> >>>>COIL 54mmWx0.95mmTH"
> >>>>productTypeId="FINISHED_GOOD" />
> >>>></entity-engine-xml>
> >>>>
> >>>>When I try to use the XML Import to DataSoure(s)
> >>>>        
> >>>>
> >>Web
> >>    
> >>
> >>>>Tool I get the
> >>>>following error:
> >>>>
> >>>>   * ERROR: Error parsing entity xml file:
> >>>>     org.xml.sax.SAXParseException: '=' expected
> >>>>
> >>>>I have also tried to import from the command
> line
> >>>>using
> >>>>
> >>>>java -jar ofbiz.jar -install -file=./product.xml
> >>>>
> >>>>but to no avail!
> >>>>
> >>>>Where do I start looking from here?
> >>>>
> >>>>Thanks,
> >>>>James
> >>>>
> >>>>
> >>>>  
> >>>>
> >>>>        
> >>>>
> >>>
> >>>
> >>>
> >>>      
> >>>
>
>>____________________________________________________________________________________
> >>    
> >>
> >>>Do you Yahoo!?
> >>>Everyone is raving about the all-new Yahoo! Mail.
> >>>http://new.mail.yahoo.com
> >>>
> >>>
> >>>      
> >>>
> >
> >
>
=== message truncated ===




 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail.
http://new.mail.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

Fabian Gorsler
In reply to this post by James Troup-4
Hi all,

after I read your mails, I start to remeber. I had a problem which was
quite equal...

James Troup wrote:
> There is something wrong in the way the date was parsed into an xml file
> or there are some wrong characters.

During my OFBiz project I expierenced some problems with XML im-/export,
too. When exporting files, German umlauts were not represented in their
correct XML entities (&#NNN;) and when importing them, the sax parser
returned with an error because of malformed UTF-8 chars. This error
occured if the content of the XML file was pasted into the Webtools form
and if the file was accessed by OFBiz itself via Webtools.

I could imagine the characters are not written using a XML printer, they
are written to the XML file as they are in the database. I didn't
investigate more on this topic, because there was no time for doing it.
We just wanted to know, whether we could use the OFBiz-way of dumping
the database or if we should backup the "traditional" way.

Can anybody acknowledge this for current versions? If not, I'll check it
on the weekend.

If anyone wants to paste umlauts and test it: ä ö ü Ä Ö Ü
(I hope no terminal will be broken after this mail. :))

HTH

Best regards,
Fabian.
Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

Guido Amarilla
I had a similar problem too with latin á ú é í ó characters.
Make sure the encoding of the xml file is UTF-8 and be careful if you
convert it from ASCII.

I think that you have a quote char ( " ) somewhere inside a value in
your XML file, for example:

<Product productId="1ALCOIL3012" description="ALUM. COIL 54mmWx0.95"mmTH"
productTypeId="FINISHED_GOOD" />

so the parser may think that  mmTH is a field and you`re missing =
before the next "

Guido Amarilla


2006/11/7, Fabian Gorsler <[hidden email]>:

> Hi all,
>
> after I read your mails, I start to remeber. I had a problem which was
> quite equal...
>
> James Troup wrote:
> > There is something wrong in the way the date was parsed into an xml file
> > or there are some wrong characters.
>
> During my OFBiz project I expierenced some problems with XML im-/export,
> too. When exporting files, German umlauts were not represented in their
> correct XML entities (&#NNN;) and when importing them, the sax parser
> returned with an error because of malformed UTF-8 chars. This error
> occured if the content of the XML file was pasted into the Webtools form
> and if the file was accessed by OFBiz itself via Webtools.
>
> I could imagine the characters are not written using a XML printer, they
> are written to the XML file as they are in the database. I didn't
> investigate more on this topic, because there was no time for doing it.
> We just wanted to know, whether we could use the OFBiz-way of dumping
> the database or if we should backup the "traditional" way.
>
> Can anybody acknowledge this for current versions? If not, I'll check it
> on the weekend.
>
> If anyone wants to paste umlauts and test it: ä ö ü Ä Ö Ü
> (I hope no terminal will be broken after this mail. :))
>
> HTH
>
> Best regards,
> Fabian.
>


--
Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

James Troup-4
In reply to this post by Fabian Gorsler
Hi all,

Here is a very simple way to debug the xml import files.

Just open them in a web browser.

Firefox spits out the error particularly nicely.

It actually shows you what is wrong and where.

XML Parsing Error: not well-formed
Location: file://///Bizserv/james/xag.xml
Line Number 49, Column 56:

<Product productId="HL10016FPBS" description="A/PRO L&N 100X75X1.6 FP
BS" productTypeId="FINISHED_GOOD" />
-------------------------------------------------------------------------------------------------------^


As we see in this case it is the "&"

I hope this little snippet of info might assist someone else.

James

Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

James Troup-4
In reply to this post by Fabian Gorsler
Hi all,

Here is a very simple way to debug the xml import files.

Just open them in a web browser.

Firefox spits out the error particularly nicely.

It actually shows you what is wrong and where.


> XML Parsing Error: not well-formed
> Location: file://///Bizserv/james/xag.xml
> Line Number 49, Column 56:<Product productId="HL10016FPBS" description="A/PRO L&N 100X75X1.6 FP BS" productTypeId="FINISHED_GOOD" />
> -------------------------------------------------------^

As we see in this case it is the "&"

I hope this little snippet of info might assist someone else.

James


Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

Fabian Gorsler
In reply to this post by Guido Amarilla
Hi Guido,

Guido Amarilla wrote:
> I had a similar problem too with latin á ú é í ó characters.
> Make sure the encoding of the xml file is UTF-8 and be careful if you
> convert it from ASCII.

that could be the point. I didn't check, whether the file was correctly
encoded. The encoding="UTF-8" header was set, but the content could be
wrong (I'll check this on the weekend with a hex editor, too.). It was the
original export from Webtools which couldn't be imported properly with a
blank database scheme.

But, nevertheless, would it not be a good idea to encode all chars except
of ASCII chars as XML entities? I think when using XML this is the best
practice for real interoperability and it is the only way that guarantees
that all of the chars/objects of a XML document can be viewed on any
system. Perhaps I could open a issue in Jira, but before I'll check it
twice. ;)

Best regards,
Fabian.

Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

Fabian Gorsler
Hi,

I've looked up the export and added a conversion for characters out of
the ASCII range to XML entities. The exported values can now be imported
w/o any problems. :)

Tomorrow I'll submit the patch to JIRA and I hope it will be accepted.

Best regards,
Fabian.

Reply | Threaded
Open this post in threaded view
|

Re: XML Import error

Fabian Gorsler
Hi,

me again. ;)

The issue and the patch can be found here:
https://issues.apache.org/jira/browse/OFBIZ-453

I hope this will fix the problems - at least the problem with special
language specific chars like German umlauts is fixed with this patch.

Best regards,
Fabian.