18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3620061

By: the-e-factory

Hi, I receive an error that is new for me, I didn't had it before with the same code, maybe I missed somthing:

when I load the application entry page in one browser everyting works okAc and I can use the application like normal.
When I load it (same moment) in a second browser window it loads the entry page, but when I want to use the application it gives me the following (new) error:

The new parent must be in the same desktop [Div ../..]

I thought: because the enry page(a zul file, with a div with the use attribut)is loaded, there is a new desktop, session etc, and there is no interference ?
thankx
eduard

delete retag edit

## 10 Replies

18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3620110

By: tomyeh

As you guested, each HTTP request creates a new desktop, so no interference at all.

Please check the desktop ID by viewing the source HTML. You shall see something like <script type="text/javascript"> zk_action="/zkdemo/zkau"; zk_desktopId="gm77"; </script>

Make sure they are different.

Please try http://localhost/zkdemo/test/test.zul as you described above to see if it happens again.

BTW, did it happen to both IE and FF, or just one of them?

18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3620151

By: matteo_barbieri

Tom,
I read this post and I found that I have a similar problem.
I'm pretty sure it's this that causes my ClassLoaderException (see

Here is what happens to me:

- I load once the application and got "g6c" as Desktop id
- I load another browser instance an got "g7c"
- When I login with the first instance I change the src attribute of an Include component, so I view the real application, but the DesktopId has been changed to "g7c"!
- The DesktopId of the second instance is still "g7c" but it gaves me the exception.
- Tomcat manager tells me that there are only one session open

It happens wit both IE and FF.
If I had the time I'll try to recreate the problem with simpler code.

18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3620183

By: tomyeh

Matteo,

Please post it to Bugs. I'll try to write some codes that could reproduce the phenomena. Without it, it is like shooting in the dark.

18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3620200

By: tomyeh

>> When I login with the first instance I change the src attribute of an
>> Include
component, so I view the real application, but the DesktopId has been changed to "g7c"!

Mateo, could you illustrate this by codes? The desktop ID shall never change until you press reload sendRedirect, or hyperlink to another page. Of course, recycling g7c is another issue.

18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3622313

By: the-e-factory

Hi,

I tried some things in firefox aswell as IE.

It seems like in firefox every time I create a new window (new tab or new window) it creates a new desktop id but al the windows/tabs that are open yet will be changed to this id also ??

In IE it seems that the desktop id is different (and didn't change) in every new window but the eror is the same ?

After I have the error (in FF and IE) I get the error of some fellow component is not found. When I close the browsers and load the page again, the fellow eror is still there ? I have to reload the apllication in tomcat to solve the error.
The created sessions stay active, even when I close the browsers, is it strange that only when I load the page in a new IE window a new session in tomcat is created (even when I have the desktop error) when I do the same with FF, no session is created at the server.
Hopefully you allready found the fix and is this message just containing words to ignore :-) eduard

18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3622481

By: tomyeh

I am uploading ZK Nightly 3/10. Please download it and create i3-log.conf under $TOMCAT_DIR/conf with the following line: com.potix.zk.ui.http.DHtmlLayoutServlet=DEBUG Then, you'll see whether a desktop is created in$TOMCAT_DIR/logs/stdout*

----
The correct behavior of ZK shall be

1. If this is an update request (Ajax), it located the desktop by the desktop ID sent from client (zk_desktopId).

2. It creates a desktop only if the request is not Ajax.

Thus, it, theoretically, has no the issue you mentioned. However, there might be something strange that we don't expect. Take a look at the log. And, post the codes that causes the problem. Thanks.

18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3641889

By: the-e-factory

Hi, sorry for the late response, to busy :(

The error report:
(I use 1.1, off course ;)

11 21-mrt-2006 11:36:20 com.potix.util.logging.LogService configure:365
INFO: Opening C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\i3-log.conf.
12 21-mrt-2006 11:36:20 com.potix.util.logging.LogService configure:365
INFO: Opening C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\i3-log.conf.
13 21-mrt-2006 11:36:27 com.potix.zk.ui.http.DHtmlLayoutServlet getSession:294
FINE: Creating a new sess
13 21-mrt-2006 11:36:27 com.potix.zk.ui.http.DHtmlLayoutServlet process:351
FINE: Creates from /Layout.zul
13 21-mrt-2006 11:36:28 com.potix.zk.ui.http.DHtmlLayoutServlet getDesktop:381
FINE: Create desktop for /Layout.zul
13 21-mrt-2006 11:37:06 com.potix.zk.ui.http.DHtmlLayoutServlet process:351
FINE: Creates from /Layout.zul
13 21-mrt-2006 11:37:06 com.potix.zk.ui.http.DHtmlLayoutServlet getDesktop:381
FINE: Create desktop for /Layout.zul
13 21-mrt-2006 11:37:10 com.potix.zk.ui.sys.UiEngineImpl handleError:472
SEVERE: >>com.potix.zk.ui.UiException: The new parent must be in the same desktop:
[Div _pc2/_pc2]
>> at com.potix.zk.ui.AbstractComponent.setParent(AbstractComponent.java:552)
>> at com.potix.zk.ui.AbstractComponent.insertBefore(AbstractComponent.java:631)
>> at com.potix.zk.ui.AbstractComponent.appendChild(AbstractComponent.java:646)
>> at com.fotoalbum.controler.Builder.maakhoofdtoolbar(Builder.java:175)
>> at
>>java
:47)
>> at
ava:395)
>> at
>>va:2
85)

Could it be a code problem, the application is working when I load the page just one time. Do You have a clue what could be the problem so I can focus on the wright peace of code!

18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3642425

By: tomyeh

The meaning of the exception:
First, each event is associated with a desktop (i.e., Event.getTarget().getDesktop()).
Then, whatever components you created in the event listener belong the same desktop. You cannot attach them to other desktops.

Now back your issue. Did you cache components somewhere (in memory) and reuse them violating the above rule?

Notice: this is not a hard limit. If you really need resue components this way, just post the request. We didn't support it because I didn't think it is really useful.

18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3644039

By: the-e-factory

Actually I used a static variable in a Builder object with static build methods, and the initialization happened the first time the page gets loaded, of course when I loaded the page again this Builder object violated againts the rule !!

Problem solved, thank you verry much !!

ps I think it's a good rule, to keep things clear, so no request for me, for this, other things I have in mind but the ZK team goes so fast !!, I try to be in sync, always searching time. Good work, I like to be surprised in a positive way!!
And off course I voted too: succes!!

18691 1 10 129

Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3644065

By: tomyeh

Thanks ;)

[hide preview]