Hi Agustin,

Am 19.04.2007 um 16:49 schrieb Agustin Almonte:

> Hi, thanks for your reply. I'm using qooxdoo 0.6.6, and my problem  
> is that
> enviroment variable is null when method is call.

Which method are you talking about? setQooxdooEnvironment() or  
someRemoteMethod()?

My guess is that your setQooxdooEnvironment() method is never called,  
leaving _env == null.

> Should i force environment
> setter method... how can this be done?

No, it can't be forced. However, it should always be called  
automatically before any other remote methods in a class are called.  
Here's the relevant excerpt from the qooxdoo source code (which is  
executed when your service class is instantiated):

Class[] paramTypes = new Class[1];
Object[] params = new Object[1];
paramTypes[0] = Environment.class;
...
method = MethodUtils.getMatchingAccessibleMethod(clazz,
         "setQooxdooEnvironment", paramTypes);
if (method != null) {
     params[0] = new Environment();
     method.invoke(inst, params);
}

So if there is a public method called "setQooxdooEnvironment" that  
has a single parameter of type Environment, it is called by the  
framework.

Some guesses why it's not called in your case:

- Maybe you declared it private or protected instead of public?

- Maybe there's a typo in the method name? The method is optional and  
thus not part of the RemoteServiceInterface. As a side-effect, the  
compiler/IDE won't warn you if you make a typo.

- Maybe you imported the wrong Environment class (can easily happen  
when using an IDE's auto-completion)? For example, there's a class  
org.omg.CORBA.Environment in the JDK. But what you need here is  
net.sf.qooxdoo.rpc.Environment.

If you still can't get it to work, maybe you can share the relevant  
parts of your code? Or did you make a verbatim copy (including all  
imports) of the example in the user manual?

Regards,

   Andreas


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to