Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problem Running Application (Java + Excel Doc)

Reply
Thread Tools

Problem Running Application (Java + Excel Doc)

 
 
TheNewf@gmail.com
Guest
Posts: n/a
 
      05-07-2005
I have to be honest. This is my first attempt at writing an application
and I have run in to a large road block. I am trying to read an MS
Excel 2000 Document with Java (Using the Java Excel API @
http://www.andykhan.com/jexcelapi/). I have been writing this program
in the NetBeans IDE 4.0 which had been working well for me, i get some
warnings but nothing too bad. When I compile and run the progran with
NetBean it works, but when i try to run it in dos using java -jar it
give me:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
jxl/read/biff/BiffException
at workapp2.Main.actionPerformed(Main.java:124)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown
Source)
at javax.swing.AbstractButton$Handler.actionPerformed (Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown
Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unk nown
Source)
at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mou seReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown
Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown
Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at
java.awt.EventDispatchThread.pumpOneEventForHierar chy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

My first thought is their is something with the Java Excel API i am
using but... i can't seem to see a problem. I have tried to look at the
documentation for the Java Excel API, but I have finally run in to a
block. Any help would be appreachated.

Thanks,

The Newf

 
Reply With Quote
 
 
 
 
Betty
Guest
Posts: n/a
 
      05-08-2005

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> I have to be honest. This is my first attempt at writing an application
> and I have run in to a large road block. I am trying to read an MS
> Excel 2000 Document with Java (Using the Java Excel API @
> http://www.andykhan.com/jexcelapi/). I have been writing this program
> in the NetBeans IDE 4.0 which had been working well for me, i get some
> warnings but nothing too bad. When I compile and run the progran with
> NetBean it works, but when i try to run it in dos using java -jar it
> give me:
>
> Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
> jxl/read/biff/BiffException
> at workapp2.Main.actionPerformed(Main.java:124)
> at javax.swing.AbstractButton.fireActionPerformed(Unk nown
> Source)

<snip>

I had this same problem, I put the jar file in my classpath and it worked.

> My first thought is their is something with the Java Excel API i am
> using but... i can't seem to see a problem. I have tried to look at the
> documentation for the Java Excel API, but I have finally run in to a
> block. Any help would be appreachated.
>
> Thanks,
>
> The Newf
>



 
Reply With Quote
 
 
 
 
TheNewf@gmail.com
Guest
Posts: n/a
 
      05-08-2005
I have tried to add it to the manifest file. but it still doesn't seem
to work. One thing I did notice is that in the NetBeans IDE i had to
modify the source compiling options to associate to the file.

What I tried was in the manifest file:

Main-Class: workapp2.Main
Class-Path: jxl.jar

i placed a copy of the jxl.jar in the same directory as the files for
the jar. I am still getting the errors above when i try just to run the
jar from dos using: java -jar WorkApp2.jar. the program runs fine until
it gets to the point were it needs to read the excel document, where it
craps out?

The Newf

 
Reply With Quote
 
Betty
Guest
Posts: n/a
 
      05-09-2005

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> I have tried to add it to the manifest file. but it still doesn't seem
> to work. One thing I did notice is that in the NetBeans IDE i had to
> modify the source compiling options to associate to the file.
>
> What I tried was in the manifest file:
>
> Main-Class: workapp2.Main
> Class-Path: jxl.jar
>
> i placed a copy of the jxl.jar in the same directory as the files for
> the jar. I am still getting the errors above when i try just to run the
> jar from dos using: java -jar WorkApp2.jar. the program runs fine until
> it gets to the point were it needs to read the excel document, where it
> craps out?


I don't remember all the steps I went through to figure this out
by trial and error, but I quit as soon as it worked.
My classpath (Windows XP Pro). I took out the things that
were specific to my environment like c:\bin;
echo %classpath%
> .;
> ..;
> ..\..;
> c:\Shareware\jExcelAPI\jexcelapi\jxl.jar;


I have a copy of jxl.jar in my highest level source directory.

C:\Eclipse3.1M2\workspace\NewDraw\src\jxl.jar


>
> The Newf
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Excel reports ::::Excel 2003 Migration To Excel 2007 =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= ASP .Net 15 10-24-2007 01:34 PM
Need help for COM running from Web application, but not form .EXE application JeffQ888@gmail.com ASP .Net 1 05-23-2006 03:20 PM
PostedFile.ContentType returns "application/octet-stream" instead of "application/vnd.ms-excel" CVerma ASP .Net 2 09-27-2004 11:01 PM
How to get the name of a running asp.net application from the application itself??? Bob Rock ASP .Net 2 06-14-2004 06:44 PM
Can a web application call methods on a webservice running in the same application Ron Vecchi ASP .Net Web Services 0 08-04-2003 09:08 PM



Advertisments