This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 82394 - [55cat] Diagrams are missed from report/exported images on linux/solaris platform
Summary: [55cat] Diagrams are missed from report/exported images on linux/solaris plat...
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Reporting (show other bugs)
Version: 6.x
Hardware: All Linux
: P2 blocker (vote)
Assignee: Yang Su
URL:
Keywords: RELNOTE
: 82405 87370 89914 104073 105529 108737 (view as bug list)
Depends on:
Blocks: 97300
  Show dependency tree
 
Reported: 2006-08-10 14:46 UTC by Sergey Petrov
Modified: 2007-08-03 13:03 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
message log with jpg generation exception (25.88 KB, application/octet-stream)
2006-08-21 10:21 UTC, Andrew Korostelev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Petrov 2006-08-10 14:46:11 UTC
reproducible with b17.
Comment 1 Sergey Petrov 2006-08-10 15:18:03 UTC
may be java 1.6 issue
Comment 2 Sergey Petrov 2006-08-10 15:30:38 UTC
It may be reproducible on linux only.
Comment 3 Peter Lam 2006-08-10 22:43:11 UTC
I'm not able to reproduce this problem using jdk1.6 on linux fc3 system.  Please
provide detail on how to reproduce this problem.
Comment 4 Peter Lam 2006-08-15 00:03:22 UTC
removed REGRESSION keyword since this is not a regression. It exists because JDK
1.6 is used.
Comment 5 Peter Lam 2006-08-15 00:59:16 UTC
I have tested on all platforms including a different linux fc3 system but still
have not been able to reproduce this problem. I think this might be machine
specific issue.
Comment 6 Andrew Korostelev 2006-08-21 10:08:30 UTC
for me Bug is reproducible on several FC3 machines even on jdk1.5 
So mark it as regression with dependency to jdk1.6

Bug may be caused by problems with graphics library.

It looks loke issue 82405 has the same root cause.
Comment 7 Andrew Korostelev 2006-08-21 10:09:37 UTC
correction:
it is a REGRESSION with NO dependency to jdk1.6
Comment 8 Andrew Korostelev 2006-08-21 10:20:28 UTC
There is a problem with graphics library.
This problem should be catched and user should be informed instead of silent
generation of jpg files of zero size.

There is an exception in log caused by (full log is attached):
Caused by: java.lang.ClassCastException: sun.awt.image.DataBufferNative
	at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:405)
	at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:228)
Comment 9 Andrew Korostelev 2006-08-21 10:21:16 UTC
Created attachment 33107 [details]
message log with jpg generation exception
Comment 10 Yang Su 2006-09-15 18:15:47 UTC
*** Issue 82405 has been marked as a duplicate of this issue. ***
Comment 11 Unknown 2006-09-15 18:27:04 UTC
Related bugs filed against jdk:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4908153
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4908153

    Suggested workaround:
    Changing colour depth ... to 16bit makes it go away.
Comment 13 Peter Lam 2006-10-20 00:49:30 UTC
Just found the same problem on Solaris 10 x64 using daily build 061019_4.
Exporting diagram to jpg file results in zero file size and
InvocationTargetException exists in ide logfile as in the original attachement.
Comment 14 Peter Lam 2006-10-20 00:54:32 UTC
Workaround, export to jpg image with "Current Zoom Level" and "Visible Window
Only" options, then it'll work. Of course, generating report would not have this
option.
Comment 15 Sergey Petrov 2006-11-02 09:36:09 UTC
coco_stopper, should be in coco rn (both: about report and about export image)
Comment 16 Yang Su 2006-11-14 20:25:26 UTC
*** Issue 87370 has been marked as a duplicate of this issue. ***
Comment 17 Peter Lam 2006-11-16 22:26:51 UTC
Steps to reproduce:
- create a uml project of any type
- create a diagram of any type, eg, class diagram
- create and name some elements in the diagram
- save the diagram
- from the project tree, right click on the uml project and select Generate
Model Report
Result: the model report is opened to a default web browser. Clicking on the
diagram from the navigation shows an empty diagram on the right.
Comment 18 Peter Lam 2006-11-16 22:31:50 UTC
Another way to reproduce:
- create a uml project of any type
- create a diagram of any type, eg, class diagram
- create and name some elements in the diagram
- save the diagram
- from the diagram toolbar, click on the "Export as Image" button
- from the Export as Image dialog, select "JPEG Image (*.jpg)" image type
- enter a filename or use the default name
- click on OK with other default settings
- open your jpg image file or look at the file size from an external application
Comment 19 Peter Lam 2006-11-27 23:58:04 UTC
*** Issue 89914 has been marked as a duplicate of this issue. ***
Comment 20 Viktor Lapitski 2006-11-28 08:35:08 UTC
different types of internal java2d buffers suggests that we again face the same
java2d specifics - could you please try (on local or remote display - it doesn't
really matter) with -J-Dsun.java2d.pmoffscreen=false . I tried with jdk1.6 on
linux FC3 and it works fine with the switch.
Comment 21 Sergey Petrov 2006-11-28 09:59:37 UTC
did you use system with 16bit color depth of 32?
I can reproduce with/without flag with 061124 build on linux, 32bit(millions)
color depth, java 1.5.0_06.
I can't verify with 1.6 now, because we are testing coco.
Comment 22 Viktor Lapitski 2006-11-28 15:14:49 UTC
the ray of hope was generated by the fact that it didn't work without the flag
on the machine where i tried and did work with the flag. Looks like it isn't a
common case.
Comment 23 David Botterill 2006-12-13 01:15:48 UTC
I'm experiencing this problem as well on Mac OSX 10.4.8 on a MacBook Pro,
2.16GHz Intel Core Duo with 2GB of memory.
Comment 24 Sergey Petrov 2007-02-01 11:28:18 UTC
lot of customers meet the problem
Comment 25 bernd_zedv 2007-05-07 14:13:40 UTC
JPEG images don't work on Ubuntu Linux - and there is no UI to change the color
depth for an average Linux user. Simply editing /etc/X11/xorg.conf to change 24
bit color depth to 16 results in a brocken X11 on an IBM Thinkpad.

Is there no other solution - like generating .png in place of .jpg files?
Comment 26 Sergey Petrov 2007-05-16 15:35:47 UTC
*** Issue 104073 has been marked as a duplicate of this issue. ***
Comment 27 Peter Lam 2007-05-18 01:12:02 UTC
Workaround: 
Looks like adding the following flag to netbeans_default_options in
{ide-install-dir}/etc/netbeans.conf is a workaround on both Solaris and Linux
platforms from my testing with both jdk 1.5 and jdk 1.6. Not sure about Mac OS X
platform yet. I'll have to try it to see. I'll update this issue after I try it out.
Comment 28 Andrew Korostelev 2007-05-22 10:48:06 UTC
flag suggested by petersl is 
-J-Dsun.java2d.pmoffscreen=false
Comment 29 trembovetski 2007-05-30 01:20:29 UTC
Another workaround besides the property (which,
btw, will affect rendering performance) is to use 
javax.imageio.ImageIO.write instead of the 
(soon to be removed from the jdk) JPEGImageEncoder.

Also, it is typically better to use png than jpeg for
diagrams and such.

Dmitri
Comment 30 Yang Su 2007-06-01 02:24:36 UTC
Dmitri,thanks for the info. 

We now managed to bypass TomSawyer library that uses JPEGImageEncoder,
re-implemented the logic to save diagram using ImageIO, it works great for all
platforms now.
Comment 31 Yang Su 2007-06-01 02:34:51 UTC
Forgot to mention that png is now default image format for web report, the file
size is much smaller than jpg, and png is lossless. We used to have performance
issue with png generation (com.keypoint.PngEncoder), that's why jpg was used for
report, I believe png performance issue should also go away with the latest API
changes, please verify.
Comment 32 Yang Su 2007-06-04 18:32:18 UTC
*** Issue 105529 has been marked as a duplicate of this issue. ***
Comment 33 Peter Lam 2007-06-07 00:26:05 UTC
verified in build netbeans-hudson-trunk-346-full.zip (20070606) on the following
platforms:

ubuntu linux local & remote using vnc
solaris 10 x86 local & remote using vnc
mac os x using vnc
windows xp

exporting diagrams to png format on local and remote using vnc also requires no
more -J-Dsun.java2d.pmoffscreen=false flag.
Comment 34 Peter Lam 2007-06-15 01:26:01 UTC
for documentation purpose. the fix for this bug also fixed other issues (97300, 78312, 78574) not listed as duplicates
in this issue.
Comment 35 Sergey Petrov 2007-07-03 11:45:32 UTC
*** Issue 108737 has been marked as a duplicate of this issue. ***
Comment 36 jinb 2007-07-09 15:00:37 UTC
Fix of the issue was backported into release55_fixes branch and presents builds starting with Build070630.

RCS file: /cvs/uml/webreport/manifest.mf,v
old revision 1.1.2.6
new revision 1.1.2.6.2.1

RCS file: /cvs/uml/webreport/src/org/netbeans/modules/uml/reporting/dataobjects/DiagramData.java,v
old revision 1.1.2.8
new revision 1.1.2.8.4.1

RCS file: /cvs/uml/webreport/src/org/netbeans/modules/uml/reporting/templates/help.html,v
old revision 1.1.2.4
new revision 1.1.2.4.8.1

RCS file: /cvs/uml/webreport/src/org/netbeans/modules/uml/reporting/ReportTask.java,v
old revision 1.1.2.15
new revision 1.1.2.15.4.1

RCS file: /cvs/uml/core/manifest.mf,v
old revision 1.1.2.6.2.2
new revision 1.1.2.6.2.3

RCS file: /cvs/uml/core/src/org/netbeans/modules/uml/ui/products/ad/viewfactory/ETEGraphImageEncoder.java,v
old revision 1.1.2.3
new revision 1.1.2.3.8.1

RCS file: /cvs/uml/core/src/org/netbeans/modules/uml/ui/swing/drawingarea/ADDrawingAreaControl.java,v
old revision 1.1.2.24.4.2
new revision 1.1.2.24.4.3
Comment 37 Peter Lam 2007-07-12 02:31:52 UTC
For the record, backporting has been verified in the following platforms.

Solaris 10 x86 local & remote using vnc: NB5.5, NB5.5.1
Ubuntu Linux 6.10 local & remote using vnc: NB5.5, NB5.5.1
Windows XP: NB5.5, NB5.5.1
Comment 38 Peter Lam 2007-07-13 08:50:56 UTC
Also verified on Mac OS.