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 191868 - Errors running app in JNLP mode when jnlp.sign.jars=false
Summary: Errors running app in JNLP mode when jnlp.sign.jars=false
Status: RESOLVED INCOMPLETE
Alias: None
Product: apisupport
Classification: Unclassified
Component: Harness (show other bugs)
Version: 6.x
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-11 19:00 UTC by simpatico
Modified: 2012-11-05 18:26 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
application data folder with logs (8.94 KB, application/x-zip-compressed)
2010-11-11 19:00 UTC, simpatico
Details
test case for NB 6.9 with logs from user's home dir (319.66 KB, application/octet-stream)
2011-03-20 12:32 UTC, gusto2
Details
NB 7.0 JNLP RPC app log (4.70 KB, application/zip)
2011-03-22 09:34 UTC, gusto2
Details

Note You need to log in before you can comment on or make changes to this bug.
Description simpatico 2010-11-11 19:00:36 UTC
Created attachment 102924 [details]
application data folder with logs

I've had this problem with my own project and here are the steps to reproduce:

1. Open the maven crud sample application and fix it to work with 7 (download from here http://www.2shared.com/file/_3yz8g2U/MavenCRUDSample.html).
2. Build it as a jws application.
3. Run it, and it'll fail. See logs attached.

My suspect is that it has to do with windowmanager being redefined. The same sample crud application ant-based runs as a jnlp application with no problem.

P1: I cannot redefine windowmanager, needed for releasing new versions with a custom window size. Hack could be to force the file into the jar after the build?
Comment 1 Jesse Glick 2010-11-11 19:19:07 UTC
Workarounds surely exist, not P1.
Comment 2 Jesse Glick 2010-11-11 19:44:12 UTC
Your reactor POM indicates you are in fact using NB 6.8, which has a well-known stack overflow in JNLP mode. Should have been patched in 6.8.1 but it seems no Maven release of this was ever made. Try using 6.9.1 instead.

*** This bug has been marked as a duplicate of bug 176798 ***
Comment 3 Jesse Glick 2010-11-11 19:46:26 UTC
*** Bug 191869 has been marked as a duplicate of this bug. ***
Comment 4 Jesse Glick 2010-11-11 19:47:33 UTC
BTW your project ZIP is orders of magnitude bigger than it needs to be; run mvn clean before packing and it should be small enough to attach directly to BZ.
Comment 5 simpatico 2010-11-12 02:13:54 UTC
(In reply to comment #1)
> Workarounds surely exist, not P1.

could you suggest a workaround?
http://wiki.netbeans.org/DevFaqInitialMainWindowSize
The weight attribute doesn't work.
For the implemententation dependency, I don't know how to declare it (i.e. what version number, and there are no working examples).

copy file WindowManager.wswmgr from Core - Windows module into the source folder of your own module. 
What is my source folder 'src' or inside resources where layer.xml lies?
Any sample maven project where this works?
Comment 6 simpatico 2010-11-12 05:04:06 UTC
The filesystems is looking into the wrong directory. The file is persisted in windowmanager directory under resources.

msg
Caused: java.io.FileNotFoundException: JAR entry org/netbeans/core/windows/resources/windowmanager.wswmgr not found in C:\Users\kahloutg\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\48\7efbd070-355ec1f2
	at com.sun.jnlp.JNLPCachedJarURLConnection.connect(Unknown Source)
	at com.sun.jnlp.JNLPCachedJarURLConnection.getInputStream(Unknown Source)
	at java.net.URL.openStream(Unknown Source)
	at org.openide.filesystems.XMLFileSystem$FileObjRef.getInputStream(XMLFileSystem.java:986)
Caused: java.io.FileNotFoundException: Windows2/WindowManager.wswmgr
	at org.openide.filesystems.XMLFileSystem$FileObjRef.getInputStream(XMLFileSystem.java:988)
	at org.openide.filesystems.XMLFileSystem.getInputStream(XMLFileSystem.java:406)
	at org.openide.filesystems.XMLFileSystem.access$500(XMLFileSystem.java:167)
	at org.openide.filesystems.XMLFileSystem$Impl.inputStream(XMLFileSystem.java:785)
	at org.openide.filesystems.StreamPool.createInputStream(StreamPool.java:105)
	at org.openide.filesystems.AbstractFileObject.getInputStream(AbstractFileObject.java:215)
	at org.openide.filesystems.MultiFileObject.getInputStream(MultiFileObject.java:645)
	at org.openide.filesystems.MultiFileObject.getInputStream(MultiFileObject.java:645)
	at org.netbeans.core.windows.persistence.WindowManagerParser$PropertyHandler.readData(WindowManagerParser.java:880)
	at org.netbeans.core.windows.persistence.WindowManagerParser.readProperties(WindowManagerParser.java:365)
	at org.netbeans.core.windows.persistence.WindowManagerParser.load(WindowManagerParser.java:110)
	at org.netbeans.core.windows.persistence.PersistenceManager.loadWindowSystem(PersistenceManager.java:1118)
	at org.netbeans.core.windows.PersistenceHandler.load(PersistenceHandler.java:120)
	at org.netbeans.core.windows.WindowSystemImpl.load(WindowSystemImpl.java:73)
	at org.netbeans.core.GuiRunLevel$2.run(GuiRunLevel.java:181)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:137)
	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)
[catch] at java.awt.EventDispatchThread.run(Unknown Source)
ALL [null]: Cannot load window system persistent data, user directory content is broken. Resetting to default layout...
WARNING [org.netbeans.core.windows.PersistenceHandler]

msg
Caused: java.io.FileNotFoundException: JAR entry org/netbeans/core/windows/resources/windowmanager.wswmgr not found in C:\Users\kahloutg\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\48\7efbd070-355ec1f2
	at com.sun.jnlp.JNLPCachedJarURLConnection.connect(Unknown Source)
	at com.sun.jnlp.JNLPCachedJarURLConnection.getInputStream(Unknown Source)
	at java.net.URL.openStream(Unknown Source)
	at org.openide.filesystems.XMLFileSystem$FileObjRef.getInputStream(XMLFileSystem.java:986)
Caused: java.io.FileNotFoundException: Windows2/WindowManager.wswmgr
	at org.openide.filesystems.XMLFileSystem$FileObjRef.getInputStream(XMLFileSystem.java:988)
	at org.openide.filesystems.XMLFileSystem.getInputStream(XMLFileSystem.java:406)
	at org.openide.filesystems.XMLFileSystem.access$500(XMLFileSystem.java:167)
	at org.openide.filesystems.XMLFileSystem$Impl.inputStream(XMLFileSystem.java:785)
	at org.openide.filesystems.StreamPool.createInputStream(StreamPool.java:105)
	at org.openide.filesystems.AbstractFileObject.getInputStream(AbstractFileObject.java:215)
	at org.openide.filesystems.MultiFileObject.getInputStream(MultiFileObject.java:645)
	at org.openide.filesystems.MultiFileObject.getInputStream(MultiFileObject.java:645)
	at org.netbeans.core.windows.persistence.WindowManagerParser$PropertyHandler.readData(WindowManagerParser.java:880)
	at org.netbeans.core.windows.persistence.WindowManagerParser.readProperties(WindowManagerParser.java:365)
	at org.netbeans.core.windows.persistence.WindowManagerParser.load(WindowManagerParser.java:110)
	at org.netbeans.core.windows.persistence.PersistenceManager.loadWindowSystem(PersistenceManager.java:1118)
	at org.netbeans.core.windows.PersistenceHandler.load(PersistenceHandler.java:130)
	at org.netbeans.core.windows.WindowSystemImpl.load(WindowSystemImpl.java:73)
	at org.netbeans.core.GuiRunLevel$2.run(GuiRunLevel.java:181)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:137)
	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)
[catch] at java.awt.EventDispatchThread.run(Unknown Source)
ALL [null]: Cannot load even default layout, using internally predefined configuration.
INFO [org.netbeans.core.windows.persistence]: [PersistenceManager.getTopComponentForID] Problem when deserializing TopComponent for tcID:'runtime'. Reason: Top component runtime could not be located or loaded from Components folder.
INFO [org.netbeans.core.windows.persistence]: [PersistenceManager.getTopComponentForID] Problem when deserializing TopComponent for tcID:'ComponentInspector'. Reason: Top component ComponentInspector could not be located or loaded from Components folder.
INFO [org.netbeans.core.windows.persistence]: [PersistenceManager.getTopComponentForID] Problem when deserializing TopComponent for tcID:'CommonPalette'. Reason: Top component CommonPalette could not be located or loaded from Components folder.
Comment 7 simpatico 2010-11-12 06:33:40 UTC
manually placing the file where it's looking for it using jar uf and the sign again is a workaround.
http://netbeans.org/bugzilla/show_bug.cgi?id=191545
Comment 8 Jesse Glick 2010-11-12 21:39:31 UTC
Please provide a test case using NB 6.9 or later so I can point to where the problem in your code is. (Possible there is a problem in the Platform, but this sounds more like a user error.)

Regarding main window size, add comments to bug #191545; I don't know anything about it.
Comment 9 gusto2 2011-03-20 12:32:51 UTC
Created attachment 107129 [details]
test case for NB 6.9 with logs from user's home dir

This is the test case I created, repeatable on NB 6.9

JnlpTestApp is a project folder of a Netbeans module standalone app with 1 module included. A layer.xml was created. Repeatable steps:
 - create a Netbeans module app
 - create a module with a layer.xml 
 - build a JNLP Application
 - deploy the created .war (I used a tomcat6)

When the application starts, just a blank windows is displayed with error messages. Logs are created in the user's hgome dir (included in the attached archive). The workarounds proposed did not work so far (or I was not able to comprehend the steps needed).

Regards
          Gabriel
Comment 10 gusto2 2011-03-21 14:09:00 UTC
(In reply to comment #9)
> Created an attachment (id=107129) [details]
> test case for NB 6.9 with logs from user's home dir
> 
> This is the test case I created, repeatable on NB 6.9
> 
> JnlpTestApp is a project folder of a Netbeans module standalone app with 1
> module included. A layer.xml was created. Repeatable steps:
>  - create a Netbeans module app
>  - create a module with a layer.xml 
>  - build a JNLP Application
>  - deploy the created .war (I used a tomcat6)
> 
> When the application starts, just a blank windows is displayed with error
> messages. Logs are created in the user's hgome dir (included in the attached
> archive). The workarounds proposed did not work so far (or I was not able to
> comprehend the steps needed).
> 
> Regards
>           Gabriel

The proposed workaround (placing windowmanager.wswmgr into sources) works with the zip and installer distribution, but not with deployed JNLP war.
Comment 11 Jesse Glick 2011-03-21 14:17:38 UTC
Your last attachment was not even a Maven project, so clearly not the right component.

Using a NB post-7.0 dev build, I created an (Ant-based) NB RCP app, added a module with a layer, built a JNLP WAR, deployed on GF v3, launched it using JDK 6 on Ubuntu. The main window appeared normally, and after opening the Properties window and relaunching, the app came back up in the same configuration.

You might have some kind of bad JNLP cache, perhaps? Try clearing it.
Comment 12 Jesse Glick 2011-03-21 14:18:32 UTC
(In reply to comment #5)
> The weight attribute doesn't work.

See bug #195827.
Comment 13 gusto2 2011-03-21 21:52:01 UTC
(In reply to comment #11)
> Your last attachment was not even a Maven project, so clearly not the right
> component.
> 
> Using a NB post-7.0 dev build, I created an (Ant-based) NB RCP app, added a
> module with a layer, built a JNLP WAR, deployed on GF v3, launched it using JDK
> 6 on Ubuntu. The main window appeared normally, and after opening the
> Properties window and relaunching, the app came back up in the same
> configuration.
> 
> You might have some kind of bad JNLP cache, perhaps? Try clearing it.

Jesse, 

You are right, maybe this bug we are talking about is not related to the correct version and maven project, can you point me out where should I place the new bug / find an existing one?

I tryed the same steps on NB 7.0b2 and I got the same (errors) results even on a clean systems (a new openSUSE installation). The interesting part is, that normal (windows, zip, linux) installations work, runnig JNLP application from the NB menu works too, it appears only when running JNLP from a deployed war. Maybe access rights to create the configuration files?

I will test it all throughroughly again and I try to provide more complete data (hopeffully tomorrow). 

Thank you for your prompt response
Comment 14 gusto2 2011-03-22 09:34:00 UTC
Created attachment 107179 [details]
NB 7.0 JNLP RPC app log

Hello,

I did more tests. 

Caused: java.io.FileNotFoundException: [WinSys] Missing Window Manager configuration file	at org.netbeans.core.windows.persistence.WindowManagerParser$PropertyHandler.readData(WindowManagerParser.java:866)	at org.netbeans.core.windows.persistence.WindowManagerParser.readProperties(WindowManagerParser.java:365)

ALL [null]: Cannot load even default layout, using internally predefined configuration.
INFO [org.netbeans.core.windows.persistence]: [PersistenceManager.getTopComponentForID] Problem when deserializing TopComponent for tcID:'runtime'. Reason: Top component runtime could not be located or loaded from Components folder.
INFO [org.netbeans.core.windows.persistence]: [PersistenceManager.getTopComponentForID] Problem when deserializing TopComponent for tcID:'properties'. Reason: Top component properties could not be located or loaded from Components folder.



On NB 7.0b2 the errors are different, see the log. Anyway I solved the problem, when building the JNLP war for a RPC app, the jars MUST be signed and for quicker building I disabled jar signing (jnlp.sign.jars=false in the project properties). In that case the .nb-app-xxxx folder will miss the window management configuration files (I don't know why yet, but I will have a look later).

When set 'jnlp.sign.jars=true', the war is built, deployed and ran correctly.
Maybe a BIG WARNING should be printed :)

Tested on Windows XP and opensuse, sun jdk 1.6_20, tomcat and glassfish. I've read that when deploying the war to the glassfish, it should sign the jars itself, but it did not happened (I did not expect it itself though).

Thank you for your patience.

Gabriel
Comment 15 Jesse Glick 2011-03-22 15:00:47 UTC
Ah, here we have the importance of a reproducible test case. :-)

Leaving JARs unsigned is not well supported; see bug #118017 for another known problem. Perhaps this mode should just be removed entirely. Will see if I can reproduce your issue later.
Comment 16 Jaroslav Tulach 2012-11-05 15:07:28 UTC
Still valid? What comment contains the steps to reproduce I could use currently?