The application have Struts 2 and Smart Client 8.1 both plug-in(s).
Please note application deployed on Weblogic 10.3 server.
Case 1: When the Struts filter has enabled the file file uploader component does not upload the file and return null on DMI Layer.
Case 2: When we disable Struts 2 filer then file uploader workes but, it not upload complete file. Where as the total file size is just 10-15 KB.
We got "org.xml.sax.SAXParseException: Premature end of file." Exception.
{Stake trace}
org.xml.sax.SAXParseException: Premature end of file.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1044)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:133)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:172)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToStream(JasperCompileManager.java:169)
at com.ias.dm.dmi.impl.ReportsDMIImpl.compileFile(ReportsDMIImpl.java:254)
at com.ias.dm.dmi.impl.ReportsDMIImpl.saveReport(ReportsDMIImpl.java:128)
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 com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:949)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:610)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1711)
at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.ias.dm.login.DM2AppicationFilter.doFilter(DM2AppicationFilter.java:86)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: Premature end of file.
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:243)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToStream(JasperCompileManager.java:169)
at com.ias.dm.dmi.impl.ReportsDMIImpl.compileFile(ReportsDMIImpl.java:254)
at com.ias.dm.dmi.impl.ReportsDMIImpl.saveReport(ReportsDMIImpl.java:128)
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 com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:949)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:610)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1711)
at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.ias.dm.login.DM2AppicationFilter.doFilter(DM2AppicationFilter.java:86)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
{Stake trace}
below are the code snippets.
1. In DS file we have declare a field type as binary :- report.DS.xml
<field>
<name>reportdata</name>
<title>JRXML File</title>
<type>binary</type>
<showFileInline>true</showFileInline>
<required>true</required>
</field>
2. DMI Class code:- ReportDMIImpl.java
Map valueMap = dsRequest.getValues();
Long reportID = (Long) dsRequest.getParameter("reportid");
ISCFileItem fileItem = dsRequest.getUploadedFile("reportdata");
if(fileItem== null && reportID!= null && reportID> 0){
return DM2Utils.getFailureResponse(dsResponse, new ReportDTO());
}
Please let me know if more information is required.
Thanks!
Please note application deployed on Weblogic 10.3 server.
Case 1: When the Struts filter has enabled the file file uploader component does not upload the file and return null on DMI Layer.
Case 2: When we disable Struts 2 filer then file uploader workes but, it not upload complete file. Where as the total file size is just 10-15 KB.
We got "org.xml.sax.SAXParseException: Premature end of file." Exception.
{Stake trace}
org.xml.sax.SAXParseException: Premature end of file.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1044)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:133)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:172)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToStream(JasperCompileManager.java:169)
at com.ias.dm.dmi.impl.ReportsDMIImpl.compileFile(ReportsDMIImpl.java:254)
at com.ias.dm.dmi.impl.ReportsDMIImpl.saveReport(ReportsDMIImpl.java:128)
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 com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:949)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:610)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1711)
at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.ias.dm.login.DM2AppicationFilter.doFilter(DM2AppicationFilter.java:86)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: Premature end of file.
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:243)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToStream(JasperCompileManager.java:169)
at com.ias.dm.dmi.impl.ReportsDMIImpl.compileFile(ReportsDMIImpl.java:254)
at com.ias.dm.dmi.impl.ReportsDMIImpl.saveReport(ReportsDMIImpl.java:128)
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 com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:949)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:610)
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1711)
at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.ias.dm.login.DM2AppicationFilter.doFilter(DM2AppicationFilter.java:86)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
{Stake trace}
below are the code snippets.
1. In DS file we have declare a field type as binary :- report.DS.xml
<field>
<name>reportdata</name>
<title>JRXML File</title>
<type>binary</type>
<showFileInline>true</showFileInline>
<required>true</required>
</field>
2. DMI Class code:- ReportDMIImpl.java
Map valueMap = dsRequest.getValues();
Long reportID = (Long) dsRequest.getParameter("reportid");
ISCFileItem fileItem = dsRequest.getUploadedFile("reportdata");
if(fileItem== null && reportID!= null && reportID> 0){
return DM2Utils.getFailureResponse(dsResponse, new ReportDTO());
}
Please let me know if more information is required.
Thanks!
Comment