At least it is gratifying to know that the casue of the problem can be
identified - well it's source anyway - and equally good to know that the
error is a constant; we know that we only have one problem to track down I
thinl.

With regard to the debgging, it is quite hard to say really Paul as the
technique I would adopt is far more agricultural. If it were possible to get
at the file, I would unzip it using a tool like PKUnzip or WinRar. That
would expand the archive out into the relevant files and folders which it
would then be possible to examine using a simple text editor because, as I
am certain you already know, xml is simply a flat text file marked up in a
particular way. I would open each file manually and search for the tags that
were causing the error - an opening <br> tag with no closing tag but with an
'enclosed'  tag; hopefully, it will be the case that only one of the files
contains them. As I said, agricultural but it should expose that part of the
document that is causing the error and may point the way to a solution.
Unfortunately, it is not possible to tell just which one of the xml files
contains the markup from the error message so it would be a case of opening
each to see where the problem lay.

Either way, I think that POI should handle the situation if Excel manages to
open these files successfully. If it is possible for you to isolate that
part of the markup that is casuing the error then it may be possible for the
developers to fix the API.

Yours

Mark B

PS. Have you tried opening one of these files using Excel and then simply
resaving it? If so, what happens to the error message? Often, doing this is
sufficient to clear an error message and it may be that this would offer you
a workaround should the error be blocking your project.


Paul Spencer-3 wrote:
> 
> Mark,
> 1) The files are from the same source and I suspect the where generated in
> the same way.  In addition the files may have been upgraded from earlier
> version of Excel during their lifespan.
> 
> 2) All of the files that fail have failed with the same error.
> 
> 3) Since the files contains confidential data, it will be hard to make one
> available for the developers.  If I can identify what in the file is
> causing the error, I can create a file for the developers.  Although you
> mentioned stripping content from the file, what are some other debugging
> tools, techniques, and logging that can be used to determine what in the
> file is causing the error. 
> 
> Paul Spencer
> 
> 
> On Mar 27, 2010, at 4:09 AM, MSB wrote:
> 
>> 
>> Morning Paul,
>> 
>> It sounds from that error message that the xml is malformed in some way;
>> a
>> way that POI will not tolerate but Excel and OO will and one which is not
>> common to that file type (xlsm). Can you tell me please, are all of the
>> files that generate this same error from the same source, produced by the
>> same piece of software or contain the same macros?
>> 
>> Also, and this is assuming that the files are large, is it possible for
>> you
>> to create a very simple, small file that produces this exception? If you
>> can, and if you can then upload the file, that will help the developers
>> to
>> identify which element in which file in the archive is producing the
>> errors.
>> The way most people go about this is to systematically strip content from
>> the file while still producing the error.
>> 
>> Yours
>> 
>> Mark B
>> 
>> 
>> Paul Spencer-3 wrote:
>>> 
>>> I am get the exception below thrown when reading in some .xlsm files
>>> into
>>> POI v3.6 WorkbookFactory.create(fileInputStream). The files open without
>>> error in Excel 2007 and OpenOffice 2.3.  I have other .xlsm files that
>>> work as expected in POI v3.6.
>>> 
>>> Any ideas on how to get more information on what is causing the " does
>>> not
>>> close tag <br>" error?
>>> 
>>> Paul Spencer
>>> 
>>> 
>>>> Caused by: org.apache.poi.POIXMLException:
>>>> java.lang.reflect.InvocationTargetException
>>>>    at
>>>> org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:61)
>>>>    at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:256)
>>>>    at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:261)
>>>>    at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:196)
>>>>    at
>>>> org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:172)
>>>>    at
>>>> org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:63)
>>>>    at
>>>> com.mikon.mes.mikon.server.importserver.bean.AbstractImportFileBean.fileUploaded(AbstractImportFileBean.java:110)
>>>>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>    at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>    at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>    at java.lang.reflect.Method.invoke(Method.java:597)
>>>>    at
>>>> org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
>>>>    ... 31 more
>>>> Caused by: java.lang.reflect.InvocationTargetException
>>>>    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>>> Method)
>>>>    at
>>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>>>    at
>>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>>>    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>>>    at
>>>> org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:59)
>>>>    ... 42 more
>>>> Caused by: org.apache.xmlbeans.XmlException: error:  does not close tag
>>>> <br>.
>>>>    at
>>>> org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3471)
>>>>    at
>>>> org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1270)
>>>>    at
>>>> org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1257)
>>>>    at
>>>> org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345)
>>>>    at org.apache.xmlbeans.XmlObject$Factory.parse(XmlObject.java:663)
>>>>    at
>>>> org.apache.poi.xssf.usermodel.XSSFVMLDrawing.read(XSSFVMLDrawing.java:101)
>>>>    at
>>>> org.apache.poi.xssf.usermodel.XSSFVMLDrawing.<init>(XSSFVMLDrawing.java:96)
>>>>    ... 47 more
>>>> Caused by: org.xml.sax.SAXParseException:  does not close tag <br>.
>>>>    at
>>>> org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1038)
>>>>    at
>>>> org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:723)
>>>>    at
>>>> org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3439)
>>>>    ... 53 more
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>> 
>>> 
>>> 
>> 
>> -- 
>> View this message in context:
>> http://old.nabble.com/%22org.xml.sax.SAXParseException%3A-%3C-b%3E-does-not-close-tag-%3Cbr%3E.%22-when-opening-some-.xlsm-files-tp28047195p28050810.html
>> Sent from the POI - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/%22org.xml.sax.SAXParseException%3A-%3C-b%3E-does-not-close-tag-%3Cbr%3E.%22-when-opening-some-.xlsm-files-tp28047195p28073587.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to