Bug #5508
closedLink to "Additional background information on Ptolemy" brings up empty page
0%
Description
Under Windows Server 2008:
If I do Help -> Kepler Documentation,
and click on
"background information on Ptolemy"
I get a blank page that has
jar:file:!/ptolemy/configs/ptinyKepler/intro.htm in the title.
I looked in the jar file and the file is there?
View ->Source brings up a NPE?
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at ptolemy.actor.gui.TextEditorTableau$Factory.createTableau(TextEditorTableau.java:221)
at ptolemy.actor.gui.TextEditorTableau$Factory.createTableau(TextEditorTableau.java:279)
at ptolemy.actor.gui.TableauFrame$ViewMenuListener.actionPerformed(TableauFrame.java:1572)
at org.kepler.gui.MenuMapper$1.actionPerformed(MenuMapper.java:386)
at javax.swing.AbstractButton.fireActionPerformed(Unknown 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(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(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(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown 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.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at ptolemy.actor.gui.TextEditor.getBackground(TextEditor.java:144)
at java.awt.Window.setBackground(Unknown Source)
at java.awt.Frame.setBackground(Unknown Source)
at ptolemy.gui.Top.access$1001(Top.java:141)
at ptolemy.gui.Top$SetBackgroundRunnable.run(Top.java:1889)
at ptolemy.gui.Top.deferIfNecessary(Top.java:247)
at ptolemy.gui.Top.setBackground(Top.java:501)
at ptolemy.actor.gui.TextEditor.setBackground(TextEditor.java:238)
at javax.swing.JFrame.frameInit(Unknown Source)
at javax.swing.JFrame.<init>(Unknown Source)
at ptolemy.gui.Top.<init>(Top.java:162)
at ptolemy.actor.gui.TableauFrame.<init>(TableauFrame.java:133)
at ptolemy.actor.gui.TableauFrame.<init>(TableauFrame.java:168)
at ptolemy.actor.gui.TextEditor.<init>(TextEditor.java:104)
at ptolemy.actor.gui.TextEditor.<init>(TextEditor.java:91)
at ptolemy.actor.gui.TextEditorTableau.<init>(TextEditorTableau.java:89)
at ptolemy.actor.gui.TextEditorTableau.<init>(TextEditorTableau.java:68)
... 46 more
This page works on the Mac and I don't get the NPE.
Updated by Derik Barseghian almost 13 years ago
I haven't been able to reproduce this on XP. I don't have Windows Server 2008, so will probably need you to test again when I release rc3.
Updated by Christopher Brooks almost 13 years ago
The latest Kepler 2.3.0 rc3 continues to display a blank intro window under Windows Server 2008 when run with Java 1.7:
$ /cygdrive/C/Program\ Files/Java/jdk1.7.0/bin/java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
Administrator@JOULE /cygdrive/c/Program FIles/Kepler-2.3
$ /cygdrive/C/Program\ Files/Java/jdk1.7.0/bin/java -jar kepler.jar
Then do Help -> Kepler Documentation,
and click on
"background information on Ptolemy"
I get a blank page that has
jar:file:!/ptolemy/configs/ptinyKepler/intro.htm in the title.
The problem occurs when I run from the command line or via kepler.exe.
In both cases, Java 1.7 is being used.
However, the problem does not occur under Windows Server 2008 with
Java 1.6 when I invoked:
$ /cygdrive/C/Program\ Files/Java/jdk1.6.0_26/bin/java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
Administrator@JOULE /cygdrive/c/Program FIles/Kepler-2.3
/cygdrive/C/Program\ Files/Java/jdk1.6.0_26/bin/java -jar kepler.jar
The problem also does not occur under Windows 2003 when Kepler is invoked
with Java 1.6
Note that Windows Server 2008/Java 1.7 is quite close to Windows 7, so this
bug could be quite common.
I can replicate this using the Ptolemy II nightly build under Java 1.7, so
I'll take a look.
Updated by Christopher Brooks almost 13 years ago
This is a Java 1.7 problem, I'm able to replicate the problem under Java 1.7
under Mac OS X.
I checked in a fix:
bash-3.2$ svn diff -r 62410 ~/ptII/ptolemy/actor/gui/HTMLViewer.java
Index: /Users/cxh/ptII/ptolemy/actor/gui/HTMLViewer.java
===================================================================
--- /Users/cxh/ptII/ptolemy/actor/gui/HTMLViewer.java (revision 62410)
+++ /Users/cxh/ptII/ptolemy/actor/gui/HTMLViewer.java (working copy)@ -53,6 +53,7
@
import ptolemy.gui.Top;
import ptolemy.kernel.util.StringAttribute;
+import ptolemy.util.ClassUtilities;
import ptolemy.util.MessageHandler;
///////////////////////////////////////////////////////////////////
@ -356,6 +357,16
@
* @see #getPage()
*/
public void setPage(URL page) throws IOException {
+ URL jarURL = ClassUtilities.jarURLEntryResource(page.toString());
+ if (jarURL != null) {
+ // Under Java 1.7, JEditorPane.setPage() handles jar urls
+ // differently. In Java 1.6, setPage() would correctly open
+ // jar:file:/Users/cxh/ptII/ptolemy/ptsupport.jar!/doc/mainVergilPtiny.htm
+ // even though doc/MainVergilPtiny.htm is in doc/docConfig.jar,
+ // not ptsupport.jar. So, we look up the jar URL.
+ // See http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5508
+ page = jarURL;
+ }
pane.setPage(page);
}
This fix should be folded in to Kepler-2.3, which means creating another
release candidate.
Updated by Derik Barseghian almost 13 years ago
- build-area-2.3 needs to be deleted and recreated at release (due to movement of jars)
- bug#5540 should be fixed.
- Export As=>XML, PNG, etc need to be tested, I've seen work in this area in ptolemy
- I'll have to remember the black magic used to create a ptolemy 2.3 that doesn't keep a copy of the ptolemy code on our repository.
(And I think I'm forgetting a few other kepler changes that should/will have to be included)
(In reply to comment #3)
This is a Java 1.7 problem, I'm able to replicate the problem under Java 1.7
under Mac OS X.I checked in a fix:
bash-3.2$ svn diff -r 62410 ~/ptII/ptolemy/actor/gui/HTMLViewer.java
Index: /Users/cxh/ptII/ptolemy/actor/gui/HTMLViewer.java ===================================================================
--- /Users/cxh/ptII/ptolemy/actor/gui/HTMLViewer.java (revision 62410)
+++ /Users/cxh/ptII/ptolemy/actor/gui/HTMLViewer.java (working copy)@ -53,6 +53,7
@import ptolemy.gui.Top;
///////////////////////////////////////////////////////////////////
import ptolemy.kernel.util.StringAttribute;
+import ptolemy.util.ClassUtilities;
import ptolemy.util.MessageHandler;@ -356,6 +357,16
@
- @see #getPage()
*/
public void setPage(URL page) throws IOException {
+ URL jarURL = ClassUtilities.jarURLEntryResource(page.toString());
+ if (jarURL != null) {
+ // Under Java 1.7, JEditorPane.setPage() handles jar urls
+ // differently. In Java 1.6, setPage() would correctly open
+ //
jar:file:/Users/cxh/ptII/ptolemy/ptsupport.jar!/doc/mainVergilPtiny.htm
+ // even though doc/MainVergilPtiny.htm is in doc/docConfig.jar,
+ // not ptsupport.jar. So, we look up the jar URL.
+ // See http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5508
+ page = jarURL;
+ }
pane.setPage(page);
}This fix should be folded in to Kepler-2.3, which means creating another
release candidate.
Updated by Christopher Brooks almost 13 years ago
I would fold the change to HTMLViewer in to a branch just 2.3. I agree that there are many changes and we may not want all of them.
The missing Kieler Layout functionality should possibly be fixed.
It is very useful.
The export PNG facility could be skipped.
Just my $0.02.
Updated by Derik Barseghian almost 13 years ago
Do you mean you'd create a branch (61797 + 62410) in the ptolemy repo with this change for me to refer to?
Otherwise the solution is for me to copy the ptolemy 61797 source to the kepler repository, and patch, which is how 2.2 worked, and something I thought we discussed and decided is not good -- the keeping (and patching) of ptII code on the kepler repository.(?)
Kieler layout works in kepler 2.3, it just doesn't work on trunk, either because of a change in kepler trunk or a change in ptolemy trunk, so if we go with either of the above options there's nothing to fix. The Export options should likewise continue to work and shouldn't require extra testing.
Updated by Christopher Brooks almost 13 years ago
Ok, I created a branch with:
svn copy -r 61797 svn+ssh://source.eecs.berkeley.edu/chess/ptII/trunk svn+ssh://source.eecs.berkeley.edu/chess/ptII/branches/kepler-2-3 -m "Creating Kepler-2.3 branch"
Is r61797 the right revision?
To check it out, use
svn co svn+ssh://source.eecs.berkeley.edu/chess/ptII/branches/kepler-2-3 ptII-kepler2.3
or
svn co https://source.eecs.berkeley.edu/svn/chess/ptII/branches/kepler-2-3 ptII-kepler2.3
I checked in the change to HTMLViewer.java
For my own notes, I verified the fix with:
1, Checking out the branch
2. Copying ptII/build.default.xml to build.xml and excluding
ptolemy/actor/lib/logic/fuzzy
and
ptolemy/domains/jogl
3. Building with
ant
4. Copied ptII/jars.xml
5. Built the jar files with
ant -f jars.xml jars
6. Created a script called "doit" that uses just jar files:
java -classpath "${PTII}/ptolemy/ptsupport.jar:${PTII}/ptolemy/vergil/vergil.jar:${PTII}/lib/diva.jar:${PTII}/doc/docConfig.jar:${PTII}/ptolemy/domains/domains.jar" ptolemy.vergil.VergilApplication -ptiny
7. cd'd to a subdirectory so that $PTII was not the cwd (thus avoiding
accidentally finding source files in the path.
8. Ran
sh ../doit
9. Clicked on Overview. The title of the window ended in
ptsupport.jar!/doc/mainVergil.htm
10. File -> New ->Graph Editor -> View -> JVM Properties indicates that
java.version = 1.6.0_29
11. Exit vergil.
12. Under Mac OS X, I had installed a preview version of Java 1.7, so
under Utilities, I selected the Java Preferences program and dragged
the 64 bit version of Java 1.7 to the top and exited Java Preferences.
13. Reran
sh ../doit
14. I get this stack trace in stdout, which I ignore:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:357)
at sun.lwawt.macosx.CImage$Creator.createFromImage(CImage.java:101)
at sun.lwawt.macosx.CPlatformWindow.getImageForTarget(CPlatformWindow.java:693)
at sun.lwawt.macosx.CPlatformWindow.updateIconImages(CPlatformWindow.java:519)
at sun.lwawt.macosx.CPlatformWindow.setVisible(CPlatformWindow.java:484)
at sun.lwawt.LWWindowPeer$1.run(LWWindowPeer.java:260)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:240)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:142)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:134)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
15. The various links in the splash screen work
16. File -> New ->Graph Editor -> View -> JVM Properties has:
java.version = 1.7.0-ea
Updated by Derik Barseghian almost 13 years ago
Yes r61797 is right.
Thanks for doing this.
I'll try to switch kepler-2.3 to use this branch, probably early next week.
(In reply to comment #7)
Ok, I created a branch with:
svn copy -r 61797 svn+ssh://source.eecs.berkeley.edu/chess/ptII/trunk
svn+ssh://source.eecs.berkeley.edu/chess/ptII/branches/kepler-2-3 -m "Creating
Kepler-2.3 branch"Is r61797 the right revision?
To check it out, use
svn co svn+ssh://source.eecs.berkeley.edu/chess/ptII/branches/kepler-2-3
ptII-kepler2.3or
svn co https://source.eecs.berkeley.edu/svn/chess/ptII/branches/kepler-2-3
ptII-kepler2.3I checked in the change to HTMLViewer.java
For my own notes, I verified the fix with:
1, Checking out the branch
2. Copying ptII/build.default.xml to build.xml and excluding
ptolemy/actor/lib/logic/fuzzy
and
ptolemy/domains/jogl
3. Building with
ant
4. Copied ptII/jars.xml
5. Built the jar files with
ant -f jars.xml jars
6. Created a script called "doit" that uses just jar files:
java -classpath
"${PTII}/ptolemy/ptsupport.jar:${PTII}/ptolemy/vergil/vergil.jar:${PTII}/lib/diva.jar:${PTII}/doc/docConfig.jar:${PTII}/ptolemy/domains/domains.jar"
ptolemy.vergil.VergilApplication -ptiny7. cd'd to a subdirectory so that $PTII was not the cwd (thus avoiding
accidentally finding source files in the path.
8. Ran
sh ../doit
9. Clicked on Overview. The title of the window ended in
ptsupport.jar!/doc/mainVergil.htm
10. File -> New ->Graph Editor -> View -> JVM Properties indicates that
java.version = 1.6.0_29
11. Exit vergil.
12. Under Mac OS X, I had installed a preview version of Java 1.7, so
under Utilities, I selected the Java Preferences program and dragged
the 64 bit version of Java 1.7 to the top and exited Java Preferences.
13. Reran
sh ../doit
14. I get this stack trace in stdout, which I ignore:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException:
Width (-1) and height (-1) cannot be <= 0
at
java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:357)
at sun.lwawt.macosx.CImage$Creator.createFromImage(CImage.java:101)
at
sun.lwawt.macosx.CPlatformWindow.getImageForTarget(CPlatformWindow.java:693)
at
sun.lwawt.macosx.CPlatformWindow.updateIconImages(CPlatformWindow.java:519)
at
sun.lwawt.macosx.CPlatformWindow.setVisible(CPlatformWindow.java:484)
at sun.lwawt.LWWindowPeer$1.run(LWWindowPeer.java:260)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:240)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:157)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:146)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:142)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:134)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)15. The various links in the splash screen work
16. File -> New ->Graph Editor -> View -> JVM Properties has:
java.version = 1.7.0-ea
Updated by Derik Barseghian almost 13 years ago
I've switched kepler-2.3 to use this new branch of ptolemy.
On Windows XP I installed java 1.7 (runtime 1.7.0.01_b08) and recompiled and started kepler-2.3, and tried the 'background information on Ptolemy', and it works.
I think this is safe to close, but will leave open until we test on the next rc.
Updated by Derik Barseghian almost 13 years ago
Verified fixed in rc4 on XP w/ java7
Updated by Christopher Brooks almost 13 years ago
Verified fixed in rc4 on Windows Server 2008 w/ java7