Apache POI Upgrade issue
Hi,
I am working for an ADF application and here we have used POI 2.5 JAR file for the excel reading.
Now we are upgrading to poi-3.8-beta3 VERSION to handle both xls and xlsx versions. But we are getting the following error when trying to execute the below code snippet.
POIFSFileSystem fileSystem = new POIFSFileSystem(inputStream);
HSSFWorkbook workBook = new HSSFWorkbook(fileSystem);
Error Message:
org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)
Is there way to fix this issue without making any code change so that it should support both the excel versions. Please suggest.
Thanks,
Manasa
Manasa,
Well, being that the error message says "you need to use a different part of the API," it appears that you need to make a code change.
This is also not the POI forum/mailing list, so it would be appropriate for you to ask there, not on the JDeveloper/ADF forum.
Also, if you'd have searched this forum, you'd have found out that other people have made the same mistake of asking on the wrong forum and gotten an answer.
Finally, if you Google for "org.apache.poi.poifs.filesystem.OfficeXmlFileException" you'd find even more information
John
Similar Messages
-
Help needed to loadjava apache poi jars into oracle database.
Help needed to loadjava apache poi jars into oracle database. Many classes left unresolved. (Poi 3.7, database 11.1.0.7). Please share your experience!
Hi,
The first 3 steps are just perfect.
But with
loadjava.bat -user=user/pw@connstr -force -resolve geronimo-stax-api_1.0_spec-1.0.jar
the results are rather unexpected. Here is a part of the log file:
arguments: '-user' 'ccc/***@bisera7-db.dev.srv' '-fileout' 'c:\temp\load4.log' '-force' '-resolve' '-jarsasdbobjects' '-v' 'geronimo-stax-api_1.0_spec-1.0.jar'
The following operations failed
resource META-INF/MANIFEST.MF: creation (createFailed)
class javax/xml/stream/EventFilter: resolution
class javax/xml/stream/events/Attribute: resolution
class javax/xml/stream/events/Characters: resolution
class javax/xml/stream/events/Comment: resolution
class javax/xml/stream/events/DTD: resolution
class javax/xml/stream/events/EndDocument: resolution
class javax/xml/stream/events/EndElement: resolution
class javax/xml/stream/events/EntityDeclaration: resolution
class javax/xml/stream/events/EntityReference: resolution
class javax/xml/stream/events/Namespace: resolution
class javax/xml/stream/events/NotationDeclaration: resolution
class javax/xml/stream/events/ProcessingInstruction: resolution
class javax/xml/stream/events/StartDocument: resolution
class javax/xml/stream/events/StartElement: resolution
class javax/xml/stream/events/XMLEvent: resolution
class javax/xml/stream/StreamFilter: resolution
class javax/xml/stream/util/EventReaderDelegate: resolution
class javax/xml/stream/util/StreamReaderDelegate: resolution
class javax/xml/stream/util/XMLEventAllocator: resolution
class javax/xml/stream/util/XMLEventConsumer: resolution
class javax/xml/stream/XMLEventFactory: resolution
class javax/xml/stream/XMLEventReader: resolution
class javax/xml/stream/XMLEventWriter: resolution
class javax/xml/stream/XMLInputFactory: resolution
class javax/xml/stream/XMLOutputFactory: resolution
class javax/xml/stream/XMLStreamReader: resolution
resource META-INF/LICENSE.txt: creation (createFailed)
resource META-INF/NOTICE.txt: creation (createFailed)
It seems to me that the root of the problem is the error:
ORA-29521: referenced name javax/xml/namespace/QName could not be found
This class exists in the SYS schema though and is valid. If SYS should be included as a resolver? How to solve this problem? -
Upgrade issues OBIEE 10g to 11g along with OBIA upgrade
Hi,
I have to upgrade OBIEE 10.1.3.4.1 to OBIEE 11.1.1.5 along with OBIA 7.9.6.1 to 7.9.6.5(Informatica 8.6.1 to 9.0.1) at my client location and I have very little knowledge on it. and want to know/have help documents for upgrade.
And if anyone in the forums involved in upgrade please list the errors/issues occured during upgrade and after upgrade.
1. OBIEE 10g to 11g upgrade issues??
2. OBIA OBIA 7.9.6.1 to 7.9.6.5 upgrade issues along with 10g to 11g??
3. Informatica 8.6.1 to 9.0.1 upgrade issues??
4. DAC upgrade issues??
any response for my questions is appreciated.
Thanks
Jay.
Edited by: Jay on Apr 11, 2012 9:11 AMHI Jay,
We cannot explained thread list here, If you get any errors plz post me,will try to help out.
This is oracle document link - This document has given step by step with screen shots upgration for 10g to 11g ,Please refer the below link.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11115/upgrade/upgrade_to_11g.htm
http://obieemanu.blogspot.in/2011/05/rpd-upgration-from-10g-to-11g.html
http://docs.oracle.com/cd/E21764_01/upgrade.1111/e10125/ua_command_line.htm#ASMAS149
Award points it is useful.
Thanks,
satya -
Report generation toolkit upgrade issues
I have created multiple vi's in that utilize the previous report generation toolkits specifically using the Generate Report Get Data to Modify.vi and the Generate Report Set Modified Data.vi. Obviously the report reference has now changed in 8.6's version of the report generation toolkit and these vi's do not exist in the 8.6 library anymore. What vi's do I need to replace these functions with to make this code work. Can anyone tell me what the work around is to solving this problem. This is a picture of the code.
BJD1613
Lead Test Tools Development Engineer
Philips Respironics
Certified LV Architect / Instructor
Attachments:
code.JPG 92 KBHi BJD1613,
The Report Generation VIs on the LabVIEW Palettes mutate properly. However, you may run into upgrade issues if VIs distributed with LabVIEW, but not available in the Palettes are used in the code. Hence, I would caution against using them for the same reason.
In this case, the specific references do exist in the report generation classes; however, since they are private, they cannot be accessed by VIs outside the respective classes. A temporary workaround for now is mentioned in the following KB 4OOCSJ4M Getting References in Report Generation Toolkit 1.1.3 with LabVIEW 8.6.
This was reported to R&D (CAR# 123064) for further investigation -
Apache POI small example request & if it's possible to do...
I'm fairly new to Java, and am interested in creating a dynamic program in swing:
I have a word 2007 document with a number of lines of text and commands from a user manual I have created. I would like to use the Apache POI package to open the document read in each line one by one, and based on what style the line is in (Heading 1 format vs Normal vs Command vs Directory...etc) the program would go through a specific subroutine. For instance if were to have a document down below:
h1. Copy Files Procedure: (heading 1 style)
h2. 1.) Log into the Kermit unix server and change directory to:(heading 2 style)
h4. a.) "$HOME/whatever/" (openSSHwindow style)
h2. 2.) Perform a secure copy to Muppet server. (heading 2 style)
h4. a.) "scp user@server files whatever the command is" (command style)
I would want the program to read in this word doc line by line and spit out in my log file:
"Copy Files Procedure:" is in heading 1 style.
"Log into the Kermit unix server and change directory to:" is in heading 2 style.
"$HOME/whatever/" is in openSSHwindow style.
"Perform a secure copy to Muppet server." is in heading 2 style.
"scp user@server files whatever the command is" is in command style.
...etc
I did some research into Apache POI, but i wanted to know if anyone else here knew a way to do this. All I can find is that there is way to pull out the heading indent level! The problem with is that I'm using custom formats, not just Headings 1-9!
if someone would write a tiny example in java swing showing how to read the line in from a word doc and pull the line content as well as it's line style with a swing method that it invokes if it is a certain that would be SUPER helpful!!!!
The usefulness of this example could allow anyone to use this program to dynamically create an operating console GUI with any properly formatted word doc version of the operators manual!802532 wrote:
All I mean with that is one that will create itself based on a word doc and it's styling...So, your program will read a word doc, and then generate Java source code, compile it, and execute it?
I think you're abusing the word "dynamic." It sounds like you mean "a program that takes input and produces output based on that input." This is pretty much what all programs beyond "Hello World" do. -
EHP Upgrade Issue - Java Stack
Hi,
Our Source System at NW 7.0 SP13 and we are upgrading the system to EHP1 SP03.
Upgrade failed at Downtime > DEPLOY_ONLINE_DEPL phase.
Error log:
Sep 9, 2009 10:11:51 PM [Error]: com.sap.sdt.ucp.phases.AbstractPhaseType.doExecute(AbstractPhaseType.java:863) [Thread[main,5,main]]: Exception has occurred during the execution of the phase.
Sep 9, 2009 10:11:51 PM [Error]: com.sap.sdt.jspm.unattended.RequestController.addContextInfo(RequestController.java:178) [Thread[main,5,main]]: Deployment of queue sapjup-queue completed with error
JSPM version is 7.01.3.0.15. Current JSPM log directory is /usr/sap/XPD/JC00/j2ee/JSPM/log/log_2009_09_09_16_09_42.
Sep 9, 2009 10:11:51 PM [Error]: com.sap.sdt.sapjup.tools.sapjupjspm.SAPJupJSPMRapiAdapter.createAndLogRapiException(SAPJupJSPMRapiAdapter.java:698) [Thread[main,5,main]]: The deployment of the queue failed.
Sep 9, 2009 10:11:51 PM [Error]: com.sap.sdt.sapjup.tools.sapjupjspm.deploy.SAPJupJSPMDeployer.deployList(SAPJupJSPMDeployer.java:68) [Thread[main,5,main]]: Could not execute deployment of stack file /usr/sap/trans/EPS/in/XPD.xml.
Sep 9, 2009 10:11:51 PM [Error]: com.sap.sdt.j2ee.phases.PhaseTypeDeploymentManager.execute(PhaseTypeDeploymentManager.java:519) [Thread[main,5,main]]: Error while executing DeploymentManager phase with action deploySlot. Check the log files for the specified action.
Sep 9, 2009 10:11:51 PM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:906) [Thread[main,5,main]]: Phase UPGRADE/DEPLOYMENT_BASED_UPGRADE/DEPLOY_ONLINE_DEPL has been completed.
Sep 9, 2009 10:11:51 PM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:907) [Thread[main,5,main]]: Start time: 2009/09/09 22:09:42.
Sep 9, 2009 10:11:51 PM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:909) [Thread[main,5,main]]: End time: 2009/09/09 22:11:51.
Sep 9, 2009 10:11:51 PM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:910) [Thread[main,5,main]]: Duration: 0:02:08.248.
Sep 9, 2009 10:11:51 PM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:911) [Thread[main,5,main]]: Phase status is error.
I went through the following link , proceeded with option 2, But still getting same error.
Portal Upgrade Issue
Please advise the resolution for the issue I have.
Thanks in advance
Regards
Srinivas
Edited by: Srinivas Dasari on Sep 10, 2009 5:48 AM
Edited by: Srinivas Dasari on Sep 10, 2009 5:48 AMIssue resolved
-
Hi,
We're currently on 4.6b and going to upgrade to ECC6 with unicode I'm trying to compile a list point taken care converting to unicode from ABAP technical point of view. Does anyone have such a list?
Some points i shortlisted are :
1) Use GUI_UPLOAD and GUI_DOWNLOAD rather than WS_UPLOAD and WS_DOWNLOAD.
2) Structures or table headers that contain non-character data need to be identical when moving, comparing, selecting into, updating from, etc.
3) OPEN DATASET filename IN TEXT MODE FOR INPUT ENCODING DEFAULT.
I know there are others. Any help would be appreciated.
aRsCheck the below links
http://www.sapfans.com/forums/viewtopic.php?t=268386&highlight=upgrade+issues
http://www.sapfans.com/forums/viewtopic.php?t=263434&highlight=upgrade+issues
http://www.sapfans.com/forums/viewtopic.php?t=261051&highlight=upgrade+issues
http://www.sapfans.com/forums/viewtopic.php?t=253316&highlight=upgrade+issues -
How to Edit Word Document in Oracle ADF Application - Apache POI
Hi All
I was wondering if there is a way to edit and save word documents in Oracle ADF without loosing the Formatting.
I was able to edit and save the word document however the Formatting was lost.
Please let me know if there are any pointers or open source Java APIs that we can use to achieve this.Refer the Text Formatting section
Apache POI - HWPF - Java API to Handle Microsoft Word Files
HWPF Reads in a Word document with minimum formatting (no lists, tables, footnotes, endnotes, headers, footers)
Apache POI - HWPF - Java API to Handle Microsoft Word Files
The _cbt field in class HWPFDocumentCore contains formatting information.
HWPFDocumentCore (POI API Documentation)
For more advanced text extraction needs, including Rich Text extraction (such as formatting and styling), along with XML and HTML output, Apache POI works closely with Apache Tika to deliver POI-powered Tika Parsers for all the project supported file formats.
Apache POI - Text Extraction
Use Apache Tikka for formatting.
Apache Tika - Supported Document Formats -
Using Apache POI 3.2 to create hyperlinks in Excel
Hello,
I am new to Java.
I have written a program that accesses Excel with the Apache POI version 3.2.
All seems to work until I tried to insert a Hyperlink to a file on the local drive.
I followed the quick start guide from Apache POI.
It provides the following code but Java does not appear to find the "createHelper".
//link to a file in the current directory
cell = sheet.createRow(1).createCell((short)0);
cell.setCellValue("File Link");
link = createHelper.createHyperlink(Hyperlink.LINK_FILE);
link.setAddress("link1.xls");
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
Any ideas on how to insert a Hyperlink into Excel would be appreciated.
Thanks
ChrisThis seems to be a class in 3.5 beta jar file. Try downloading and using the 3.5 beta
-
Hello,
I want to read in excel files to a JTable. I was able to read in .xls files, but have problems reading .xlsx files. Maybe there is something i need to add to the following code:
FileInputStream iStream = new FileInputStream(newFile);
POIFSFileSystem fs = new POIFSFileSystem(iStream);
Workbook wb1 = WorkbookFactory.create(fs);
Sheet sheet = wb1.getSheetAt(0); // get the first sheet data
// Iterate over each row in the sheet
Iterator rows = sheet.rowIterator();
while(rows.hasNext()) {
Row row = (Row) rows.next();
.............The compiler is complaining about the 3rd line: Workbook wb1 = WorkbookFactory.create(fs);
Thanks.@ejp:
I quite agree with you. It's a runtime exception -
org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)I've tried searching before coming here to ask. HSSF processes .xls files only, XSSF processes .xlsx files only while SS is supposed to read both .xls and .xlsx files. Maybe there's anyone that has used it before who can help out.
Thanks -
Errors in Forte 3.5 -Upgrade issue
hello ,
We are having a frequent disruption in the communication SO which has an
externalConnection Class. Did anything change in 3.5? We did not have
these errors in 3L!
After these erros, we have a mutex locking problem which leaves our
application hanging.
Any help will be greatly appreciated!
thanks
suma
Here is an Excerpt of the log file
Task 9: extConn4030a808.Write: 194 bytes written to 10
INFORMATION: Network partner closed connection. This usually means the
process at the other end of the wire failed. Please go look there and
find
out why.
Class: qqsp_DistAccessException
Error #: [501, 152]
Detected at: qqcm_HoseFSM::ReceivedClose at 2
Error Time: Thu May 24 09:16:29
Exception occurred (locally) on partition "MerlinWindows_cl41_Part8",
(partitionId = F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105, taskId =
[F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105.7]) in application
"MerlinWindows_cl41", pid 23406 on node laxrc2 in environment laxrc2.
INFORMATION: Error parameters for Set:0 Msg:0:
Class: qqsp_DistAccessException
Detected at: qqcm_HoseFSM::ReceivedClose at 1
Error Time: Thu May 24 09:16:29
Exception occurred (locally) on partition "MerlinWindows_cl41_Part8",
(partitionId = F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105, taskId =
[F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105.7]) in application
24-May-2001 09:16:47: VH.G.G..GUIT/GUI0/PLAXRC172.23.4.401/../..;PGYX;
Task 9: extConn4030a808.Write: 233 bytes written to 10
INFORMATION: Network partner closed connection. This usually means the
process at the other end of the wire failed. Please go look there and
find
out why.
Class: qqsp_DistAccessException
Error #: [501, 152]
Detected at: qqcm_HoseFSM::ReceivedClose at 2
Error Time: Thu May 24 09:16:47
Exception occurred (locally) on partition "MerlinWindows_cl41_Part8",
(partitionId = F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105, taskId =
[F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105.7]) in application
"MerlinWindows_cl41", pid 23406 on node laxrc2 in environment laxrc2.
INFORMATION: Error parameters for Set:0 Msg:0:
Class: qqsp_DistAccessException
Detected at: qqcm_HoseFSM::ReceivedClose at 1
Error Time: Thu May 24 09:16:47
regards,
Suma Venkatesh-----Original Message-----
From: Venkatesh, Suma
Sent: Thursday, May 24, 2001 2:39 PM
To: '[email protected]'
Subject: Errors in Forte 3.5 -Upgrade issue
hello ,
We are having a frequent disruption in the communication SO which has an
externalConnection Class. Did anything change in 3.5? We did not have
these errors in 3L!
After these erros, we have a mutex locking problem which leaves our
application hanging.
Any help will be greatly appreciated!
thanks
suma
Here is an Excerpt of the log file
Task 9: extConn4030a808.Write: 194 bytes written to 10
INFORMATION: Network partner closed connection. This usually means the
process at the other end of the wire failed. Please go look there and
find
out why.
Class: qqsp_DistAccessException
Error #: [501, 152]
Detected at: qqcm_HoseFSM::ReceivedClose at 2
Error Time: Thu May 24 09:16:29
Exception occurred (locally) on partition "MerlinWindows_cl41_Part8",
(partitionId = F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105, taskId =
[F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105.7]) in application
"MerlinWindows_cl41", pid 23406 on node laxrc2 in environment
laxrc2.
INFORMATION: Error parameters for Set:0 Msg:0:
Class: qqsp_DistAccessException
Detected at: qqcm_HoseFSM::ReceivedClose at 1
Error Time: Thu May 24 09:16:29
Exception occurred (locally) on partition "MerlinWindows_cl41_Part8",
(partitionId = F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105, taskId =
[F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105.7]) in application
24-May-2001 09:16:47: VH.G.G..GUIT/GUI0/PLAXRC172.23.4.401/../..;PGYX;
Task 9: extConn4030a808.Write: 233 bytes written to 10
INFORMATION: Network partner closed connection. This usually means the
process at the other end of the wire failed. Please go look there and
find
out why.
Class: qqsp_DistAccessException
Error #: [501, 152]
Detected at: qqcm_HoseFSM::ReceivedClose at 2
Error Time: Thu May 24 09:16:47
Exception occurred (locally) on partition "MerlinWindows_cl41_Part8",
(partitionId = F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105, taskId =
[F2E11800-5003-11D5-BF99-AE145F2AAA77:0x105.7]) in application
"MerlinWindows_cl41", pid 23406 on node laxrc2 in environment
laxrc2.
INFORMATION: Error parameters for Set:0 Msg:0:
Class: qqsp_DistAccessException
Detected at: qqcm_HoseFSM::ReceivedClose at 1
Error Time: Thu May 24 09:16:47
regards,
Suma Venkatesh -
Apache and Jserv issues - AppsLogin and AppsLocalLogin not working
Hi,
I am trying to understand the Apache and Jserv issues
Home page - http://11i-tst-02.cisco.com:38901 - working fine
This confirms that Apache core module is working fine. Does this confirm about the pls module also ?
Apps local login - http://11i-tst-02.cisco.com:38901/OA_HTML/AppsLocalLogin.jsp - throwing Java Exception
Request URI:/OA_HTML/AppsLocalLogin.jsp
Exception:
java.lang.NoClassDefFoundError
at oracle.apps.fnd.sso.SSOManager.getAppsServletAgent(SSOManager.java:1727)
at oracle.apps.fnd.sso.SSOManager.getLoginUrl(SSOManager.java:316)
at oa_html._AppsLocalLogin._jspService(_AppsLocalLogin.java:410)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
at oracle.jsp.JspServlet.service(JspServlet.java:148)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
at org.apache.jserv.JServConnection.run(JServConnection.java:294)
at java.lang.Thread.run(Thread.java:479)
Is it related to SSO ? Because error mentions about SSOManager
But why does AppsLocalLogin need to go thru SSO ?
Doesn it mean Jserv issues ? I am able to see same message logged in jvm logs ?
Restarting Apache doesnt help
Servlet login - http://11i-tst-02.cisco.com:38901/oa_servlets/AppsLogin - throws Internal Server Erorr
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
Apache log doesnt show any error
Servlet test works - http://11i-tst-02.cisco.com:38901/servlets/Hello
Example Apache JServ Servlet
Congratulations, ApacheJServ 1.1 is working!
OAM works - http://11i-tst-02.cisco.com:38901/servlets/weboam/oam/oamLogin - Navigating to SSO page for authentication
AOL test works - http://11i-tst-02.cisco.com:38901/OA_HTML/jsp/fnd/aoljtest.jsp
FND_WEB.PING works - http://11i-tst-02.cisco.com:38901/pls/QTCSTG/FND_WEB.PING
Connection test works - http://11i-tst-02.cisco.com:38901/servlets/oracle.apps.icx.common.ConnectionTest
So, my question is why AppsLogin and AppsLocalLogin are not working - if servlets / AOL / FND / OAM links are working
Is there issue with Jserv ?
Can someone please explain the significance of the above tests
And which tests need to pass for AppsLogin and AppsLocalLogin to work
ThanksSince all the tests work fine as you stated above, I suggest you do the following:
- Rerun Autoconfig on all tiers
- rm -rf $OA_HTML/_pages
- Bounce Apache -
R12 upgrade issue:Not able to login using forms:Please help****urgent
We have recently upgraded our instance from 11.5.9 to 12.0.4 in Windows 2003 server.
We are unable to login to forms after upgrade, however we are able access self service responsibilities without any issues.
We are getting APP-FND-01496 when we access any forms responsibility. We have tried all possible metalink notes with no luck.
Any help to resolve this issue will be appreciated.Duplicate thread ...
R12 upgrade issue:Not able to login to forms**please help
Re: R12 upgrade issue:Not able to login to forms**please help -
Excel File Management Apache POI HSSF vs. jxl jar
I've been reviewing Java technologies for managing Excel files, and I'm a little confused about the differences between Apache's POI HSSF implementation and JExcelApi, and utimately what technology it makes sense to use.
They are both open source, although POI is backed by Apache, where JExcelApi seems to be open source developed by Andy Khan. It seem Apache has a little more weight, therefore may be a better option.
Can someone who has exposure to these technologies please provide me with some insight.
Thanks.Hi
Thanks for your reply,
Now I hav used an alternate approach of using Apache POI.
But.......
I have created simple table in jsp and set content type to
<%@ page contentType="application/vnd.ms-excel" %>
when i navigate to this jsp it is getting displayed in excel format.
I wish if user clicks on to navigate for this jsp, he must get an option to either open, save or cancel the jsp.
Then on selecting save a dialogue gets appeared where he can select path and file name.
Please comment.
Thanks. -
Exception when using Apache POI in ADF
Goodmorning;
i'm using jdev 11g, i m trying to use Apache POI to import the content of Microsoft XL file into my database.
i already do that succesfully on netbeans. but not on jdev.
first i download the POI package from the apache web site, and i create a librarie and add the jar files to the jdev by using Tools --> Manage Libraries, this is the list of the jar file : poi-3.6-20091214.jar, poi-contrib-3.6-20091214.jar, poi-ooxml-3.6-3-20091214.jar and poi-scratchpad-3.6-20091214.jar.
next, create a jsf page with a boutton, then i enable the binding of this page by using Design --> Page Properties --> component binding --> check Auto Bind
in the action method of the buton i put the following code :
public String cb1_action() throws FileNotFoundException, IOException {
Connection conn = null;
String url = "jdbc:mysql://localhost:3306/";
String dbName = "test";
String driver = "com.mysql.jdbc.Driver";
String username = "root";
String userPassword = "";
try {
InputStream fs = new FileInputStream("/home/Rachid/test1.xls");
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
HSSFRow row = null;
for (Iterator rowIt = sheet.rowIterator(); rowIt.hasNext();) {
row = (HSSFRow) rowIt.next();
HSSFCell code = row.getCell(0);
HSSFCell nom = row.getCell(1);
HSSFCell dt = row.getCell(2);
java.util.Date date = dt.getDateCellValue();
System.out.println("code "+code+" % nom "+nom +" % date " +date);
try {
Class.forName(driver).newInstance();
} catch (ClassNotFoundException e) {
} catch (InstantiationException e) {
} catch (IllegalAccessException e) {
try {
conn = DriverManager.getConnection(url+dbName,username,userPassword);
} catch (SQLException e) {
Statement stmt = null;
try {
stmt = conn.createStatement();
} catch (SQLException e) {
String strQuery = "insert into importxl values ("+code+",'"+nom+"','"+date.getDay()+"/"+date.getMonth()+"/"+date.getYear()+"')";
System.out.println(strQuery);
try {
stmt.close();
} catch (SQLException e) {
try {
conn.close();
} catch (SQLException e) {
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
return null;
and when i run my page and click on the button, this exception page appear :
Error 500--Internal Server Error
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
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:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
... 35 more
Caused by: java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook
at Mybean.bean1.wrc(bean1.java:23)
at Mybean.MybeanImport.cb1_action(MybeanImport.java:53)
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.sun.el.parser.AstValue.invoke(AstValue.java:157)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
... 43 more
Caused by: java.lang.ClassNotFoundException: org.apache.poi.hssf.usermodel.HSSFWorkbook
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:280)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:253)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:177)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:37)
... 52 moreHi John,
Ya ur right i too agree we can go for shared Libraries for reusable or massive apps but we still dont know whether OP is gng on the way and also i never said dont go for shared Libraries+
May be he will be running the application locally for any testing purpose..... if it so i have suggested him not to keep the jar files in the folders outside the project....
Why becoz incase the jar file kept in outside folder,
if the folder gets deleted or some times if it kept in any shared folder and user loses the permission error will be thrown it cant be traced why the error gets throwned....
if the jar is gng to be referred from local best way is to keep it in the project folder itself.............
Regards,
Suganth.G
Maybe you are looking for
-
I CAN'T GET RID OF QUICK TIME 6.5 ON A WINDOWS XP/HOME COMPUTER
I have a Mac at work with a T-4 trunk line so I sometimes use QT. But, since my genealogy program only works with Windows, I have a Win XP/Home at home using dial-up. As soon as I bought this computer, I downloaded QT 6.5 not realizing that I couldn'
-
I downloaded Adobe immigration software for Aperture, opened Lightroom, but the Aperture library was grayed out so it couldn't be selected to import. How do I get it to work? I only have a few days left on the test version of Lightroom to see how it
-
Is incredible , i can repair my mac book pro for the graphic schedule
I can't believe , is impossible to repair my mac book pro sn W87100M2W0L, BECOUSE IS VINTAGE AFTER 5 yers, hope the Apple give me a solution, i'm worry, and if isn't possible to repair i close with Appke and all the products who i have, sorry for my
-
Hi: I want to use XmlParser in my J2ME application, but at the time of defining XmlParser object i a getting error is:"XmlParser cannot be resolved to a type". I am using eclipse for developing application. I have already added KXml.zip in my src fol
-
Problem converesion from jpeg to pdf
Problem conversion from jpeg to pdf. I have scanned some images. So, the file is in jpeg I should make some changes in Paint or Photoshop program and I keep as jpeg. Then, when I converted and collected them into one pdf from Acrobat 8 and 9 too. Som