Weird behavior after solution import

Hi to all,
we have an error, only on the server, that appears and desappears from an import to another !
This is very strange an makes me think that code is ok.

The error: we have two template forms that contains some beans and with the “clone.form” we generate forms based on the templates.
When loading one of the forms we have errors when refering to a bean, because it is not loaded.
This behavior changes randomly when making new import of the same solution.
The form we are sure that exist and the “cloneForm” works fine.

For debugging purpose we make an application output of the form elements names and by doing that , we have no errors (maybe because it cause the elements reload?)

Is it a known problem?

Marco

What kind of beans do you use (simple/Servoy aware) and with what version of Servoy?
What kind of errors do you get? Maybe there is helpful info in the log files.

So when you add the application.output on form element names the problem never manifests itself?

I use JScrollPane,Jpanel and JScrollBar and this problem cames since from 5.1.3 (the 5.1.4 do the same ).
At now I’m testing the 5.1.4 version with java 1.6 update 20.

This is a screenshoot of the error:
[attachment=0]error.JPG[/attachment]

As you can see from the java console we have only the elements that aren’t been.
the code for output is this:

application.output('original form:'+forms['palette'].elements.allnames)
application.output('form cloned:'+forms['myclone'].elements.allnames)

In this code I print both the elements of design-Form(called:‘palette’) and the elements of cloned-Form.
They are the same but the program goes in error because I’m trying to point to an object(bean) that doesn’t exist.
Off course the object that I’m trying to point exist (you can see that into the print above)

here the full log:

Java Web Start 1.6.0_20
Uso della versione JRE 1.6.0_20-b02 Java HotSpot(TM) Client VM
Directory principale utente = C:\Documents and Settings\Marcus
----------------------------------------------------
c:   cancella finestra console
f:   finalizza oggetti nella coda di finalizzazione
g:   recupera spazio
h:   visualizza questo messaggio di aiuto
m:   stampa utilizzo memoria
o:   attiva registrazione eventi
p:   ricarica configurazione proxy
q:   nascondi console
r:   ricarica configurazione criteri
s:   esegui dump delle proprietà del sistema e dell'installazione
t:   esegui dump dell'elenco thread
v:   esegui dump dello stack del thread
0-5: imposta livello di traccia su <n>
----------------------------------------------------
original form:[btn_design,tabs_resources,tabs_tasks,tabs_time]
form cloned:[btn_design,tabs_resources,tabs_tasks,tabs_time]
4-giu-2010 10.08.06 com.servoy.j2db.util.Debug error
GRAVE: TypeError: Cannot call method "setSize" of undefined (initGanttBean#899)
org.mozilla.javascript.EcmaError: TypeError: Cannot call method "setSize" of undefined (initGanttBean#899)
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3655)
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3649)
	at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3660)
	at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3678)
	at org.mozilla.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3697)
	at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2115)
	at org.mozilla.javascript.gen.c112._c0(initGanttBean:899)
	at org.mozilla.javascript.gen.c112.call(initGanttBean)
	at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:65)
	at org.mozilla.javascript.gen.c103._c0(showGantt:626)
	at org.mozilla.javascript.gen.c103.call(showGantt)
	at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:73)
	at org.mozilla.javascript.gen.c82._c0(dmo_sch_setAndShowGantt:357)
	at org.mozilla.javascript.gen.c82.call(dmo_sch_setAndShowGantt)
	at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:65)
	at org.mozilla.javascript.gen.c81._c0(onGanttLoad:138)
	at org.mozilla.javascript.gen.c81.call(onGanttLoad)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
	at org.mozilla.javascript.gen.c81.call(onGanttLoad)
	at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:196)
	at com.servoy.j2db.Zwb.Za(Zwb.java:741)
	at com.servoy.j2db.Zwb.Za(Zwb.java:1223)
	at com.servoy.j2db.Zcc.Za(Zcc.java:1)
	at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:27)
	at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:18)
	at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:16)
	at com.servoy.j2db.dataui.Zab.actionPerformed(Zab.java:3)
	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.plaf.basic.BasicButtonListener.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.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)

So when you add the application.output on form element names the problem never manifests itself?

I have checked better and I think that is only a randomly import problem because as I can see from the Java Console we han’t the correct elements nor into the designForm ‘palette’

In our solution we have two forms. In both there was a bean element (JsScrollBar) with the same name.
By renaming one the them, everything seems to work correctly :D .
Bean names’ need to be unique like globals ??

We also notice that in the servoy_repository, the same elements was saved as object_type_id = 12 (beans) for the first releases (probably made with firsts 5.x versions), while now are saved as object_type_id = 4 (fields).
We didn’t found any problem related with that, but I wonder if “4” is the right value!

Regards,
Riccardo

Sorry for the delayed response. I was offline for a while.

Marco - if there is no other error in the console/log suggesting that the bean creation went wrong and you are sure the form element is accessed correctly from JS and should be there please add a case describing this problem to our support system. http://servoy.com/s

Riccardo - what you are saying seems strange indeed. It might be related to the other problem - if imported fields end up to have incorrect types… Can you please create a case for what you mentioned in your post as well?

Thank you.

Opened issue with number: 298596