how to inherit external module jxl ? Problems working with excel sheets

151 views
Skip to first unread message

sly

unread,
Jul 15, 2009, 9:57:46 PM7/15/09
to Google Web Toolkit
I'm new to gwt and have been working on a project which works with
excel sheets. I need to read an excel sheet and use that data in my
application.
I have included the jar found in this url in the build path
http://jexcelapi.sourceforge.net/ . I'm developing on eclipse.
When I run the project as a gwt app I get the following error.

Line 20: No source code is available for type java.io.FileInputStream;
did you forget to inherit a required module?
Line 22: No source code is available for type java.io.File; did you
forget to inherit a required module?
Line 38: No source code is available for type jxl.Sheet; did you
forget to inherit a required module?
Line 45: No source code is available for type java.io.InputStream; did
you forget to inherit a required module?
Line 46: No source code is available for type jxl.WorkbookSettings;
did you forget to inherit a required module?
Line 47: No source code is available for type jxl.Workbook; did you
forget to inherit a required module?
Line 49: No source code is available for type jxl.Cell; did you forget
to inherit a required module?
Line 52: No source code is available for type jxl.DateCell; did you
forget to inherit a required module?
Line 57: No source code is available for type java.util.Locale; did
you forget to inherit a required module?
Line 104: No source code is available for type
jxl.read.biff.BiffException; did you forget to inherit a required
module?

After going through many of the threads here, I found out that the
reason for this is that I have not inherited this module into my
project. Where I am stuck right now is, HOW to INHERIT it ??? Below is
a copy of my .gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//
EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-
source/core/src/gwt-module.dtd">
<module rename-to='gwtsample'>

<inherits name='com.google.gwt.user.User'/>

<inherits name='com.google.gwt.user.theme.standard.Standard'/>

<entry-point class='com.sample.client.gwtsample'/>

<inherits name="com.google.gwt.maps.GoogleMaps" />

<script src="http://maps.google.com/maps?
gwt=1&amp;file=api&amp;v=2&amp;sensor=false;key=0UJTPX2XKYcABhyx5VXkq-
K2YctzpXUYhHEfWTQ" />
</module>

I do not how to inherit the jxl module.
Below is a copy of my import statements in one of my class file
import jxl.Cell;
import jxl.DateCell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.WorkbookSettings;
import jxl.read.biff.BiffException;

I tried <inherits name="jxl.Cell"/> and so on for all those classes .
And still its not working.
Can anyone please help me regarding this, I need to overcome this very
badly. I'm a student and my project has stagnated for a few days and I
cannot afford more of it.

Also if anyone can help me with a sample gwt application which reads/
writes an excel sheet, would really help me learn a lot.

Thanking in advance.

Isaac Truett

unread,
Jul 16, 2009, 4:06:58 PM7/16/09
to Google-We...@googlegroups.com
> After going through many of the threads here, I found out that the
> reason for this is that I have not inherited this module into my
> project. Where I am stuck right now is, HOW to INHERIT it ???

You can't, because it isn't a GWT module. The classes you're trying to
use (java.io.File, for example) are not part of a GWT module and
they're not JRE classes that GWT emulates. Those classes can't be
compiled into JS to run in the browser.

sly

unread,
Jul 16, 2009, 9:19:36 PM7/16/09
to Google Web Toolkit
So is there no way for me to go ahead with using this module ?
How else can I work with excel sheets ? Please do help me.
My application needs to import an external excel sheet browsed in by
the user and the data needs to be read and displayed using GWT.
If anyone knows any working gwt app/project please do let me know.

On Jul 16, 1:06 pm, Isaac Truett <itru...@gmail.com> wrote:
> > After going through many of the threads here, I found out that the
> > reason for this is that I have not inherited this module into my
> > project. Where I am stuck right now is, HOW toINHERITit ???
>
> You can't, because it isn't a GWT module. The classes you're trying to
> use (java.io.File, for example) are not part of a GWT module and
> they're not JRE classes that GWT emulates. Those classes can't be
> compiled into JS to run in the browser.
>
> On Wed, Jul 15, 2009 at 9:57 PM, sly<sly.wicker...@gmail.com> wrote:
>
> > I'm new to gwt and have been working on a project which works with
> > excel sheets. I need to read an excel sheet and use that data in my
> > application.
> > I have included the jar found in this url in the build path
> >http://jexcelapi.sourceforge.net/. I'm developing on eclipse.
> > When I run the project as a gwt app I get the following error.
>
> > Line 20: No source code is available for type java.io.FileInputStream;
> > did you forget toinherita required module?
> > Line 22: No source code is available for type java.io.File; did you
> > forget toinherita required module?
> > Line 38: No source code is available for type jxl.Sheet; did you
> > forget toinherita required module?
> > Line 45: No source code is available for type java.io.InputStream; did
> > you forget toinherita required module?
> > Line 46: No source code is available for type jxl.WorkbookSettings;
> > did you forget toinherita required module?
> > Line 47: No source code is available for type jxl.Workbook; did you
> > forget toinherita required module?
> > Line 49: No source code is available for type jxl.Cell; did you forget
> > toinherita required module?
> > Line 52: No source code is available for type jxl.DateCell; did you
> > forget toinherita required module?
> > Line 57: No source code is available for type java.util.Locale; did
> > you forget toinherita required module?
> > Line 104: No source code is available for type
> > jxl.read.biff.BiffException; did you forget toinherita required
> > module?
>
> > After going through many of the threads here, I found out that the
> > reason for this is that I have not inherited this module into my
> > project. Where I am stuck right now is, HOW toINHERITit ??? Below is
> > a copy of my .gwt.xml
>
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//
> > EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-
> > source/core/src/gwt-module.dtd">
> > <module rename-to='gwtsample'>
>
> >  <inherits name='com.google.gwt.user.User'/>
>
> >  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
>
> >  <entry-point class='com.sample.client.gwtsample'/>
>
> >  <inherits name="com.google.gwt.maps.GoogleMaps" />
>
> >  <script src="http://maps.google.com/maps?
> > gwt=1&amp;file=api&amp;v=2&amp;sensor=false;key=0UJTPX2XKYcABhyx5VXkq-
> > K2YctzpXUYhHEfWTQ" />
> > </module>
>
> > I do not how toinheritthe jxl module.

Isaac Truett

unread,
Jul 17, 2009, 1:05:56 PM7/17/09
to Google-We...@googlegroups.com
Not all Java libraries are GWT modules. What you have there is not a
"module" in the GWT sense. So, no, you can't use it in your GWT
client. You'll need to do your file work on the server.

Dalla

unread,
Jul 19, 2009, 3:35:58 PM7/19/09
to Google Web Toolkit
You could do this using a file upload to the server,
do the excel work on the server side and then serialize the data and
send it back
to the client, displaying it in any way you want using GWT.

--Dalla
http://date-time.appspot.com/
Reply all
Reply to author
Forward
0 new messages