Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / October 2005

Tip: Looking for answers? Try searching our database.

Jimi error when pre-compiled

Thread view: 
Peter J Seymour - 02 Oct 2005 12:29 GMT
I have an application which works fine as straight java. However, when I
pre-compile it (using in this case the compiler in IBM VisualAge
Enterprise), the application then gets a null image on read from Sun's
Jimi package. On the face of it there's not much to go on here - has
anyone any ideas before I dig deeper?
Regards
Peter
Roedy Green - 02 Oct 2005 13:01 GMT
>I have an application which works fine as straight java. However, when I
>pre-compile it (using in this case the compiler in IBM VisualAge
>Enterprise), the application then gets a null image on read from Sun's
>Jimi package. On the face of it there's not much to go on here - has
>anyone any ideas before I dig deeper?

The problem is possibly a variant on this.

Some dummy Servlet classes come with Sun's JDK.  They are sufficient
to let you test compile, but to do anything useful you must use
classes provided by some implementing womb.

Another possibility:

What version are the two compilers?

What happens when you precompile with JavaC instead?
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

Peter J Seymour - 03 Oct 2005 13:53 GMT
>>I have an application which works fine as straight java. However, when I
>>pre-compile it (using in this case the compiler in IBM VisualAge
[quoted text clipped - 13 lines]
>
> What happens when you precompile with JavaC instead?
Sorry, I should have been more explicit. Execution with javac results is
okay, the result from compilation with the visualage hpj compiler is
faulty (the hpj compiler genreates a native executable).
From taking a general look at the problem I at present suspect that the
hpj compiler does not implement awt.Image which seems rather unlikely.
I am continuing to investigate.
Regards
Peter
Roedy Green - 03 Oct 2005 18:17 GMT
>Sorry, I should have been more explicit. Execution with javac results is
>okay, the result from compilation with the visualage hpj compiler is
>faulty (the hpj compiler genreates a native executable).
> From taking a general look at the problem I at present suspect that the
>hpj compiler does not implement awt.Image which seems rather unlikely.
>I am continuing to investigate.

1. I did not know there were any native compilers left but Jet and
gcj.  What is this called?  Is it just a wrapper or a true AOT
optimising compiler? Do you have to buy something to use this? I am
asking this not to solve your problem but for the Java glossary.

2. Is this correct?  Jimi is a pure Java package  com.sun.jimi for
reading and saving various formats of image files, such as GIF and
JPG. It was originally a third party package, but Sun now owns it. In
Java 1.2+ it was replaced by Advanced Imaging classes such as
com.sun.image.codec.jpeg.JPEGImageEncoder interface. In Java 1.4+ you
have ImageIO.  Jimi is  no longer distributed as part of the JDK.

So it looks as if you you have to do something special to get the Jimi
classes on the classpath.

I would assume your native compiler would need access to the class
files so it could include them in the exe file it produces.  

Your big problem is there is no error message, just a blank image,
correct?, as if you had executed null methods, or they were improperly
compiled.

Your AOT may or may not be able to handle dynamically loaded classes.
You may have to manually include them when you build your exe.  Even
if it can, perhaps it is having trouble finding a class, and the error
message is getting lost because you swallowed an exception.

If I were in your shoes here is how I would proceed:

0. check the buglist for the compiler to see if anyone else has
reported similar problem.

1. decide if this is important enough to throw more time into.

2. search the code near the problem for any place it might quietly
swallow an exception and do a stack trace instead.

3. check the compile time and run time classpaths to be sure all
plausible classes are available.

4. see if there is some feature to manually include dynamically loaded
classes, and manually include more classes than you think necessary.
If it works, prune back.

5. try compiling with the evaluation version of Jet, another AOT
compiler,  to see if it has the same problem. If it does, it may give
different messages that may give a clue.  See
http://mindprod.com/jgloss/jet.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

Peter J Seymour - 04 Oct 2005 21:00 GMT
>>Sorry, I should have been more explicit. Execution with javac results is
>>okay, the result from compilation with the visualage hpj compiler is
[quoted text clipped - 29 lines]
> if it can, perhaps it is having trouble finding a class, and the error
> message is getting lost because you swallowed an exception.

...
Thanks for your comments.
My initial problem was something similar. It turns out that the compile
process was following links between classes to build up a list of
classes and this missed some of the jimi classes. Next I did a mass
compile on everything. This also failed silently, this time with an
obviously corrupt output file. On breaking down the process into steps I
could control I was able to see error messages. The result - a problem
in VA for Java where sometimes but not always a needed stub file cannot
be found. On making that file available I can get something that
actually works. The next step is to try and get a generalised solution.
Makes life interesting I suppose.
As to Visualage for Java, this is (was) an IBM product replaced I
believe by WebSphere. The Enterprise Edition (not the others) had an
ahead-of-time compiler called HPJC, and as far as I know, there is no
other source for this compiler. Also it all works at the 1.1 level. Fine
for some things I do, but not everyones cup of tea.
Regards
Peter


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.