You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Gerardo Gómez <ge...@gmail.com> on 2011/11/07 05:06:29 UTC

Problem when showing a dialog of a deployed extension

Hello everyone.
I have a problem when i try to show some dialogs of an extension i've
modified. But this error has a peculiarity, it only happens with some
dialogs, other dialogs can be showed. The error showed on the console is
this one:

com.sun.star.uno.RuntimeException: [jni_uno bridge error] Java calling UNO
method setText: [map_to_uno():string] null-ref given!
java stack trace:
        at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native
Method)
        at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:175)
        at $Proxy36.setText(Unknown Source)
        at util.OoTextField.setText(OoTextField.java:50)
        at
org.openoffice.gdocs.ui.LoginPanel.fillCredentials(LoginPanel.java:179)
        at
org.openoffice.gdocs.ui.LoginPanel.readCreditionals(LoginPanel.java:202)
        at org.openoffice.gdocs.ui.LoginPanel.setSystem(LoginPanel.java:212)
        at
org.openoffice.gdocs.ui.dialogs.UploadDialog.<init>(UploadDialog.java:181)
        at org.openoffice.gdocs.UNOGDocs$2.run(UNOGDocs.java:231)
        at java.lang.Thread.run(Thread.java:662)

I'm developing the extension on NetBeans 6.8, deploying the OXT file on
OpenOffice.org 3.3 and the dialog i try to show is from the UNO-AWT. If you
have any idea how can i solve this problem would be really appreciated.

Thanks

Re: Problem when showing a dialog of a deployed extension

Posted by Gerardo Gómez <ge...@gmail.com>.
Hello Reizinger.
Thank you for the feedback. That sounds weird, because i've solved the
problem earlier before, i will check if i didn't upload the latest version
or whatever.
I've encounter also problems on the Mac PCs, so maybe indeed it is the
extension.

On Tue, Nov 8, 2011 at 7:41 AM, Reizinger Zoltán <zr...@hdsnet.hu>wrote:

> Another problem,  when I open OOo main window, without any document, and
> click on "Oo2GDocs" menu item, OOo crash with runtime error.
>
> Zoltan
>
> 2011.11.08. 13:40 keltezéssel, Reizinger Zoltán írta:
>
>  2011.11.07. 23:42 keltezéssel, Gerardo Gómez írta:
>>
>>> Hello Ariel.
>>>
>>> the underlying issue is in LoginPanel.fillCredentials():
>>>
>>>> this.getUserNameTextField().
>>>> setText(creditionals.**getUserName());
>>>> creditionals.getUserName() returns null. You should check if this is a
>>>> bug
>>>> or the expected behaviour (no OOo API bug in either case).
>>>>
>>>>  I'm agree with you, it is more a fillCredentials() problem, it would be
>>> better to construct the credentionals.userName as an empty string instead
>>> of a null one. But because it was (at least), an enhancement, i was only
>>> "replicating" the effect.
>>>
>>> I've Uploaded in my GitHub account, the .oxt (the extension itself), so
>>> everybody who wants, could test it. As far as i've tested, it seems that
>>> in
>>> linux and windows the extension works great.
>>>
>> I added your extension 0.0.1 version, downloaded today, tested under
>> win7, to OOo 3.3 and OOo 3.4Beta(oracle), and AOOo 3.4.
>> Java versions selected: 1.6.0_27 (and same with java 1.6.0_18):
>> I get same error from all versions, I copied here as I get from debug
>> version of AOOo 3.4 messages.
>>
>> When clicked on "configure" button:
>> ---------------------------
>> Debug Output
>> ---------------------------
>> Error: UnoWrapper::**SetWindowInterface: there already *is* a
>> WindowInterface for this window!
>> From File y:/apache/trunk/main/toolkit/**source/helper/unowrapper.cxx at
>> Line 186
>> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
>> ---------------------------
>> Igen   Nem   Mégse
>> ---------------------------
>> Second:
>> ---------------------------
>> Debug Output
>> ---------------------------
>> Error: VCLXToolkit::createWindow: did #133706# resurge?
>> From File y:/apache/trunk/main/toolkit/**source/awt/vclxtoolkit.cxx at
>> Line 1138
>> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
>> ---------------------------
>> Igen   Nem   Mégse
>> ---------------------------
>> Third:
>> ---------------------------
>> Debug Output
>> ---------------------------
>> Error: [jni_uno bridge error] Java calling UNO method setText:
>> [map_to_uno():string] null-ref given!
>> java stack trace:
>>    at com.sun.star.bridges.jni_uno.**JNI_proxy.dispatch_call(Native
>> Method)
>>
>>    at com.sun.star.bridges.jni_uno.**JNI_proxy.invoke(JNI_proxy.**
>> java:175)
>>
>>    at $Proxy33.setText(Unknown Source)
>>
>>    at util.OoTextField.setText(**OoTextField.java:50)
>>
>>    at org.openoffice.gdocs.ui.**dialogs.ConfigDialog.<init>(**
>> ConfigDialog.java:157)
>>
>>    at org.openoffice.gdocs.UNOGDocs$**1.run(UNOGDocs.java:104)
>>
>>    at java.lang.Thread.run(Thread.**java:619)
>>
>>
>> From File Y:/apache/trunk/main/bridges/**source/jni_uno/jni_java2uno.**cxx
>> at Line 633
>> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
>> ---------------------------
>> Igen   Nem   Mégse
>> ---------------------------
>>
>>
>> When I clicked on "Export to Google docs":
>> ---------------------------
>> Debug Output
>> ---------------------------
>> Error: [jni_uno bridge error] Java calling UNO method setText:
>> [map_to_uno():string] null-ref given!
>> java stack trace:
>>    at com.sun.star.bridges.jni_uno.**JNI_proxy.dispatch_call(Native
>> Method)
>>
>>    at com.sun.star.bridges.jni_uno.**JNI_proxy.invoke(JNI_proxy.**
>> java:175)
>>
>>    at $Proxy33.setText(Unknown Source)
>>
>>    at util.OoTextField.setText(**OoTextField.java:50)
>>
>>    at org.openoffice.gdocs.ui.**LoginPanel.fillCredentials(**
>> LoginPanel.java:179)
>>
>>    at org.openoffice.gdocs.ui.**LoginPanel.readCreditionals(**
>> LoginPanel.java:202)
>>
>>    at org.openoffice.gdocs.ui.**LoginPanel.setSystem(**
>> LoginPanel.java:212)
>>
>>    at org.openoffice.gdocs.ui.**dialogs.UploadDialog.<init>(**
>> UploadDialog.java:181)
>>
>>    at org.openoffice.gdocs.UNOGDocs$**2.run(UNOGDocs.java:231)
>>
>>    at java.lang.Thread.run(Thread.**java:619)
>>
>>
>> From File Y:/apache/trunk/main/bridges/**source/jni_uno/jni_java2uno.**cxx
>> at Line 633
>> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
>> ---------------------------
>> Igen   Nem   Mégse
>> ---------------------------
>>
>> I hope this help you.
>>
>> Zoltan
>>
>>
>>>
>>> On Mon, Nov 7, 2011 at 3:41 PM, Ariel Constenla-Haile<
>>> ariel.constenla.haile@gmail.**com <ar...@gmail.com>>
>>>  wrote:
>>>
>>>  Hello Gerardo,
>>>>
>>>> On Mon, Nov 07, 2011 at 02:25:40PM -0600, Gerardo Gómez wrote:
>>>>
>>>>> I have addressed my problem with the null ref, it was due to assigning
>>>>> to
>>>>> xText.setText, a null string, i only added an if:
>>>>>
>>>>> public void setText(String text){
>>>>>     if (text != null)
>>>>>         this.xTextComponent.setText(**text);
>>>>> }
>>>>>
>>>> another option:
>>>>
>>>> public void setText( String text ) {
>>>>    this.xTextComponent.setText( text == null ? "" : text );
>>>> }
>>>>
>>>> an empty string will clear the text field (a null string will crash
>>>> OOo). May be clearing the text field is the desired effect when you get
>>>> a null string reference.
>>>>
>>>>  I'm not really happy with this solution, but it seams to work good, so
>>>>> until i don't find any other solution i will keep it this way.
>>>>>
>>>> the underlying issue is in LoginPanel.fillCredentials():
>>>>
>>>> this.getUserNameTextField().**setText(creditionals.**getUserName());
>>>>
>>>> creditionals.getUserName() returns null. You should check if this is a
>>>> bug
>>>> or the expected behaviour (no OOo API bug in either case).
>>>>
>>>>  Thank you for your help Ariel.
>>>>>
>>>> You're welcome.
>>>>
>>>> Nice to see you took the work to convert the Java dialogs to UNO awt. We
>>>> all know it's a lot of extra code, but a nicer integration with OOo UI.
>>>>
>>>>
>>>> Regards
>>>> --
>>>> Ariel Constenla-Haile
>>>> La Plata, Argentina
>>>>
>>>>
>>
>>
>

Re: Problem when showing a dialog of a deployed extension

Posted by Reizinger Zoltán <zr...@hdsnet.hu>.
Another problem,  when I open OOo main window, without any document, and 
click on "Oo2GDocs" menu item, OOo crash with runtime error.

Zoltan

2011.11.08. 13:40 keltezéssel, Reizinger Zoltán írta:
> 2011.11.07. 23:42 keltezéssel, Gerardo Gómez írta:
>> Hello Ariel.
>>
>> the underlying issue is in LoginPanel.fillCredentials():
>>> this.getUserNameTextField().
>>> setText(creditionals.getUserName());
>>> creditionals.getUserName() returns null. You should check if this is 
>>> a bug
>>> or the expected behaviour (no OOo API bug in either case).
>>>
>> I'm agree with you, it is more a fillCredentials() problem, it would be
>> better to construct the credentionals.userName as an empty string 
>> instead
>> of a null one. But because it was (at least), an enhancement, i was only
>> "replicating" the effect.
>>
>> I've Uploaded in my GitHub account, the .oxt (the extension itself), so
>> everybody who wants, could test it. As far as i've tested, it seems 
>> that in
>> linux and windows the extension works great.
> I added your extension 0.0.1 version, downloaded today, tested under 
> win7, to OOo 3.3 and OOo 3.4Beta(oracle), and AOOo 3.4.
> Java versions selected: 1.6.0_27 (and same with java 1.6.0_18):
> I get same error from all versions, I copied here as I get from debug 
> version of AOOo 3.4 messages.
>
> When clicked on "configure" button:
> ---------------------------
> Debug Output
> ---------------------------
> Error: UnoWrapper::SetWindowInterface: there already *is* a 
> WindowInterface for this window!
> From File y:/apache/trunk/main/toolkit/source/helper/unowrapper.cxx at 
> Line 186
> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
> ---------------------------
> Igen   Nem   Mégse
> ---------------------------
> Second:
> ---------------------------
> Debug Output
> ---------------------------
> Error: VCLXToolkit::createWindow: did #133706# resurge?
> From File y:/apache/trunk/main/toolkit/source/awt/vclxtoolkit.cxx at 
> Line 1138
> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
> ---------------------------
> Igen   Nem   Mégse
> ---------------------------
> Third:
> ---------------------------
> Debug Output
> ---------------------------
> Error: [jni_uno bridge error] Java calling UNO method setText: 
> [map_to_uno():string] null-ref given!
> java stack trace:
>     at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native 
> Method)
>
>     at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:175)
>
>     at $Proxy33.setText(Unknown Source)
>
>     at util.OoTextField.setText(OoTextField.java:50)
>
>     at 
> org.openoffice.gdocs.ui.dialogs.ConfigDialog.<init>(ConfigDialog.java:157)
>
>     at org.openoffice.gdocs.UNOGDocs$1.run(UNOGDocs.java:104)
>
>     at java.lang.Thread.run(Thread.java:619)
>
>
> From File Y:/apache/trunk/main/bridges/source/jni_uno/jni_java2uno.cxx 
> at Line 633
> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
> ---------------------------
> Igen   Nem   Mégse
> ---------------------------
>
>
> When I clicked on "Export to Google docs":
> ---------------------------
> Debug Output
> ---------------------------
> Error: [jni_uno bridge error] Java calling UNO method setText: 
> [map_to_uno():string] null-ref given!
> java stack trace:
>     at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native 
> Method)
>
>     at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:175)
>
>     at $Proxy33.setText(Unknown Source)
>
>     at util.OoTextField.setText(OoTextField.java:50)
>
>     at 
> org.openoffice.gdocs.ui.LoginPanel.fillCredentials(LoginPanel.java:179)
>
>     at 
> org.openoffice.gdocs.ui.LoginPanel.readCreditionals(LoginPanel.java:202)
>
>     at org.openoffice.gdocs.ui.LoginPanel.setSystem(LoginPanel.java:212)
>
>     at 
> org.openoffice.gdocs.ui.dialogs.UploadDialog.<init>(UploadDialog.java:181)
>
>     at org.openoffice.gdocs.UNOGDocs$2.run(UNOGDocs.java:231)
>
>     at java.lang.Thread.run(Thread.java:619)
>
>
> From File Y:/apache/trunk/main/bridges/source/jni_uno/jni_java2uno.cxx 
> at Line 633
> Abort ? (Yes=abort / No=ignore / Cancel=core dump)
> ---------------------------
> Igen   Nem   Mégse
> ---------------------------
>
> I hope this help you.
>
> Zoltan
>
>>
>>
>> On Mon, Nov 7, 2011 at 3:41 PM, Ariel Constenla-Haile<
>> ariel.constenla.haile@gmail.com>  wrote:
>>
>>> Hello Gerardo,
>>>
>>> On Mon, Nov 07, 2011 at 02:25:40PM -0600, Gerardo Gómez wrote:
>>>> I have addressed my problem with the null ref, it was due to 
>>>> assigning to
>>>> xText.setText, a null string, i only added an if:
>>>>
>>>> public void setText(String text){
>>>>      if (text != null)
>>>>          this.xTextComponent.setText(text);
>>>> }
>>> another option:
>>>
>>> public void setText( String text ) {
>>>     this.xTextComponent.setText( text == null ? "" : text );
>>> }
>>>
>>> an empty string will clear the text field (a null string will crash
>>> OOo). May be clearing the text field is the desired effect when you get
>>> a null string reference.
>>>
>>>> I'm not really happy with this solution, but it seams to work good, so
>>>> until i don't find any other solution i will keep it this way.
>>> the underlying issue is in LoginPanel.fillCredentials():
>>>
>>> this.getUserNameTextField().setText(creditionals.getUserName());
>>>
>>> creditionals.getUserName() returns null. You should check if this is 
>>> a bug
>>> or the expected behaviour (no OOo API bug in either case).
>>>
>>>> Thank you for your help Ariel.
>>> You're welcome.
>>>
>>> Nice to see you took the work to convert the Java dialogs to UNO 
>>> awt. We
>>> all know it's a lot of extra code, but a nicer integration with OOo UI.
>>>
>>>
>>> Regards
>>> -- 
>>> Ariel Constenla-Haile
>>> La Plata, Argentina
>>>
>
>


Re: Problem when showing a dialog of a deployed extension

Posted by Reizinger Zoltán <zr...@hdsnet.hu>.
2011.11.07. 23:42 keltezéssel, Gerardo Gómez írta:
> Hello Ariel.
>
> the underlying issue is in LoginPanel.fillCredentials():
>> this.getUserNameTextField().
>> setText(creditionals.getUserName());
>> creditionals.getUserName() returns null. You should check if this is a bug
>> or the expected behaviour (no OOo API bug in either case).
>>
> I'm agree with you, it is more a fillCredentials() problem, it would be
> better to construct the credentionals.userName as an empty string instead
> of a null one. But because it was (at least), an enhancement, i was only
> "replicating" the effect.
>
> I've Uploaded in my GitHub account, the .oxt (the extension itself), so
> everybody who wants, could test it. As far as i've tested, it seems that in
> linux and windows the extension works great.
I added your extension 0.0.1 version, downloaded today, tested under 
win7, to OOo 3.3 and OOo 3.4Beta(oracle), and AOOo 3.4.
Java versions selected: 1.6.0_27 (and same with java 1.6.0_18):
I get same error from all versions, I copied here as I get from debug 
version of AOOo 3.4 messages.

When clicked on "configure" button:
---------------------------
Debug Output
---------------------------
Error: UnoWrapper::SetWindowInterface: there already *is* a 
WindowInterface for this window!
 From File y:/apache/trunk/main/toolkit/source/helper/unowrapper.cxx at 
Line 186
Abort ? (Yes=abort / No=ignore / Cancel=core dump)
---------------------------
Igen   Nem   Mégse
---------------------------
Second:
---------------------------
Debug Output
---------------------------
Error: VCLXToolkit::createWindow: did #133706# resurge?
 From File y:/apache/trunk/main/toolkit/source/awt/vclxtoolkit.cxx at 
Line 1138
Abort ? (Yes=abort / No=ignore / Cancel=core dump)
---------------------------
Igen   Nem   Mégse
---------------------------
Third:
---------------------------
Debug Output
---------------------------
Error: [jni_uno bridge error] Java calling UNO method setText: 
[map_to_uno():string] null-ref given!
java stack trace:
     at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native Method)

     at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:175)

     at $Proxy33.setText(Unknown Source)

     at util.OoTextField.setText(OoTextField.java:50)

     at 
org.openoffice.gdocs.ui.dialogs.ConfigDialog.<init>(ConfigDialog.java:157)

     at org.openoffice.gdocs.UNOGDocs$1.run(UNOGDocs.java:104)

     at java.lang.Thread.run(Thread.java:619)


 From File Y:/apache/trunk/main/bridges/source/jni_uno/jni_java2uno.cxx 
at Line 633
Abort ? (Yes=abort / No=ignore / Cancel=core dump)
---------------------------
Igen   Nem   Mégse
---------------------------


When I clicked on "Export to Google docs":
---------------------------
Debug Output
---------------------------
Error: [jni_uno bridge error] Java calling UNO method setText: 
[map_to_uno():string] null-ref given!
java stack trace:
     at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native Method)

     at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:175)

     at $Proxy33.setText(Unknown Source)

     at util.OoTextField.setText(OoTextField.java:50)

     at 
org.openoffice.gdocs.ui.LoginPanel.fillCredentials(LoginPanel.java:179)

     at 
org.openoffice.gdocs.ui.LoginPanel.readCreditionals(LoginPanel.java:202)

     at org.openoffice.gdocs.ui.LoginPanel.setSystem(LoginPanel.java:212)

     at 
org.openoffice.gdocs.ui.dialogs.UploadDialog.<init>(UploadDialog.java:181)

     at org.openoffice.gdocs.UNOGDocs$2.run(UNOGDocs.java:231)

     at java.lang.Thread.run(Thread.java:619)


 From File Y:/apache/trunk/main/bridges/source/jni_uno/jni_java2uno.cxx 
at Line 633
Abort ? (Yes=abort / No=ignore / Cancel=core dump)
---------------------------
Igen   Nem   Mégse
---------------------------

I hope this help you.

Zoltan

>
>
> On Mon, Nov 7, 2011 at 3:41 PM, Ariel Constenla-Haile<
> ariel.constenla.haile@gmail.com>  wrote:
>
>> Hello Gerardo,
>>
>> On Mon, Nov 07, 2011 at 02:25:40PM -0600, Gerardo Gómez wrote:
>>> I have addressed my problem with the null ref, it was due to assigning to
>>> xText.setText, a null string, i only added an if:
>>>
>>> public void setText(String text){
>>>      if (text != null)
>>>          this.xTextComponent.setText(text);
>>> }
>> another option:
>>
>> public void setText( String text ) {
>>     this.xTextComponent.setText( text == null ? "" : text );
>> }
>>
>> an empty string will clear the text field (a null string will crash
>> OOo). May be clearing the text field is the desired effect when you get
>> a null string reference.
>>
>>> I'm not really happy with this solution, but it seams to work good, so
>>> until i don't find any other solution i will keep it this way.
>> the underlying issue is in LoginPanel.fillCredentials():
>>
>> this.getUserNameTextField().setText(creditionals.getUserName());
>>
>> creditionals.getUserName() returns null. You should check if this is a bug
>> or the expected behaviour (no OOo API bug in either case).
>>
>>> Thank you for your help Ariel.
>> You're welcome.
>>
>> Nice to see you took the work to convert the Java dialogs to UNO awt. We
>> all know it's a lot of extra code, but a nicer integration with OOo UI.
>>
>>
>> Regards
>> --
>> Ariel Constenla-Haile
>> La Plata, Argentina
>>


Re: Problem when showing a dialog of a deployed extension

Posted by Gerardo Gómez <ge...@gmail.com>.
Hello Ariel.

the underlying issue is in LoginPanel.fillCredentials():
>
> this.getUserNameTextField().
> setText(creditionals.getUserName());
> creditionals.getUserName() returns null. You should check if this is a bug
> or the expected behaviour (no OOo API bug in either case).
>

I'm agree with you, it is more a fillCredentials() problem, it would be
better to construct the credentionals.userName as an empty string instead
of a null one. But because it was (at least), an enhancement, i was only
"replicating" the effect.

I've Uploaded in my GitHub account, the .oxt (the extension itself), so
everybody who wants, could test it. As far as i've tested, it seems that in
linux and windows the extension works great.


On Mon, Nov 7, 2011 at 3:41 PM, Ariel Constenla-Haile <
ariel.constenla.haile@gmail.com> wrote:

> Hello Gerardo,
>
> On Mon, Nov 07, 2011 at 02:25:40PM -0600, Gerardo Gómez wrote:
> > I have addressed my problem with the null ref, it was due to assigning to
> > xText.setText, a null string, i only added an if:
> >
> > public void setText(String text){
> >     if (text != null)
> >         this.xTextComponent.setText(text);
> > }
>
> another option:
>
> public void setText( String text ) {
>    this.xTextComponent.setText( text == null ? "" : text );
> }
>
> an empty string will clear the text field (a null string will crash
> OOo). May be clearing the text field is the desired effect when you get
> a null string reference.
>
> > I'm not really happy with this solution, but it seams to work good, so
> > until i don't find any other solution i will keep it this way.
>
> the underlying issue is in LoginPanel.fillCredentials():
>
> this.getUserNameTextField().setText(creditionals.getUserName());
>
> creditionals.getUserName() returns null. You should check if this is a bug
> or the expected behaviour (no OOo API bug in either case).
>
> > Thank you for your help Ariel.
>
> You're welcome.
>
> Nice to see you took the work to convert the Java dialogs to UNO awt. We
> all know it's a lot of extra code, but a nicer integration with OOo UI.
>
>
> Regards
> --
> Ariel Constenla-Haile
> La Plata, Argentina
>

Re: Problem when showing a dialog of a deployed extension

Posted by Ariel Constenla-Haile <ar...@gmail.com>.
Hello Gerardo,

On Mon, Nov 07, 2011 at 02:25:40PM -0600, Gerardo Gómez wrote:
> I have addressed my problem with the null ref, it was due to assigning to
> xText.setText, a null string, i only added an if:
> 
> public void setText(String text){
>     if (text != null)
>         this.xTextComponent.setText(text);
> }

another option:

public void setText( String text ) {
    this.xTextComponent.setText( text == null ? "" : text );
}

an empty string will clear the text field (a null string will crash
OOo). May be clearing the text field is the desired effect when you get
a null string reference.

> I'm not really happy with this solution, but it seams to work good, so
> until i don't find any other solution i will keep it this way. 

the underlying issue is in LoginPanel.fillCredentials():

this.getUserNameTextField().setText(creditionals.getUserName());

creditionals.getUserName() returns null. You should check if this is a bug
or the expected behaviour (no OOo API bug in either case).

> Thank you for your help Ariel.

You're welcome.

Nice to see you took the work to convert the Java dialogs to UNO awt. We
all know it's a lot of extra code, but a nicer integration with OOo UI.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: Problem when showing a dialog of a deployed extension

Posted by Gerardo Gómez <ge...@gmail.com>.
I have addressed my problem with the null ref, it was due to assigning to
xText.setText, a null string, i only added an if:

public void setText(String text){
    if (text != null)
        this.xTextComponent.setText(text);
}

I'm not really happy with this solution, but it seams to work good, so
until i don't find any other solution i will keep it this way. Thank you
for your help Ariel.


2011/11/7 Gerardo Gómez <ge...@gmail.com>

> In this case the text is null (the string passed as argument to the
> setText method). The xTextComponent it is constructed correctly.
> I've uploaded all the NetBeans project to my GitHub account, you can check
> all the code and test the whole project just by downloading everything
> contained there: https://github.com/GerardoGR/UNOGDocs
>
>
> On Mon, Nov 7, 2011 at 12:12 AM, Ariel Constenla-Haile <
> ariel.constenla.haile@gmail.com> wrote:
>
>> On Sun, Nov 06, 2011 at 11:29:37PM -0600, Gerardo Gómez wrote:
>> > Yes, i had already set a breakpoint, and i don't think the problem is on
>> > the UploadDialog.java, because i can execute it separately from the
>> > extension. It only happens, when i deploy it (from netbeans), to my
>> > OpenOffice.org.
>>
>> did you try debugging the extension? Context menu "Debug Extension in
>> Target OpenOffice.org", or the hard way by attaching the debugger.
>>
>> > This is the code i use to show/hide a dialog
>> >
>> >     public void setVisible(boolean visible){
>> > //        If this dialog is modal...
>> >         if (modal){
>> >             if (visible){
>> > //                ...it uses execute to show the dialog.
>> >                 this.xDialog.execute();
>> >             }
>> >             else{
>> > //                ...it uses endExecute to hide the dialog.
>> >                 this.xDialog.endExecute();
>> >             }
>> >         }
>> > //        If this dialog is not modal...
>> >         else{
>> > //            ...it uses the setVisible method from the xWindow object.
>> >             this.xWindow.setVisible(visible);
>> >         }
>> >     }
>> >
>> > It seems also, that either in the extension execution and the execution
>> > from the main method, has the same parameters (a null string).
>> >
>> > public void fillCredentials(Creditionals creditionals) {
>> >
>> >
>> this.getRememberPassCheckBox().setState(creditionals.getWsCreditionalsReadedFromDisk());
>> > //      credentionals.getUserName() == null
>> >         this.getUserNameTextField().setText(creditionals.getUserName());
>> >         this.getPasswordTextField().setText(creditionals.getPassword());
>> >     }
>> >
>> > public void setText(String text){
>> >         this.xTextComponent.setText(text);
>> >     }
>>
>> what is null in this case? text or xTextComponent?
>>
>> If your extension is open source, may be you could point to the NB project
>> source and we can test what's hapening.
>>
>> Regards
>> --
>> Ariel Constenla-Haile
>> La Plata, Argentina
>>
>
>

Re: Problem when showing a dialog of a deployed extension

Posted by Gerardo Gómez <ge...@gmail.com>.
In this case the text is null (the string passed as argument to the setText
method). The xTextComponent it is constructed correctly.
I've uploaded all the NetBeans project to my GitHub account, you can check
all the code and test the whole project just by downloading everything
contained there: https://github.com/GerardoGR/UNOGDocs

On Mon, Nov 7, 2011 at 12:12 AM, Ariel Constenla-Haile <
ariel.constenla.haile@gmail.com> wrote:

> On Sun, Nov 06, 2011 at 11:29:37PM -0600, Gerardo Gómez wrote:
> > Yes, i had already set a breakpoint, and i don't think the problem is on
> > the UploadDialog.java, because i can execute it separately from the
> > extension. It only happens, when i deploy it (from netbeans), to my
> > OpenOffice.org.
>
> did you try debugging the extension? Context menu "Debug Extension in
> Target OpenOffice.org", or the hard way by attaching the debugger.
>
> > This is the code i use to show/hide a dialog
> >
> >     public void setVisible(boolean visible){
> > //        If this dialog is modal...
> >         if (modal){
> >             if (visible){
> > //                ...it uses execute to show the dialog.
> >                 this.xDialog.execute();
> >             }
> >             else{
> > //                ...it uses endExecute to hide the dialog.
> >                 this.xDialog.endExecute();
> >             }
> >         }
> > //        If this dialog is not modal...
> >         else{
> > //            ...it uses the setVisible method from the xWindow object.
> >             this.xWindow.setVisible(visible);
> >         }
> >     }
> >
> > It seems also, that either in the extension execution and the execution
> > from the main method, has the same parameters (a null string).
> >
> > public void fillCredentials(Creditionals creditionals) {
> >
> >
> this.getRememberPassCheckBox().setState(creditionals.getWsCreditionalsReadedFromDisk());
> > //      credentionals.getUserName() == null
> >         this.getUserNameTextField().setText(creditionals.getUserName());
> >         this.getPasswordTextField().setText(creditionals.getPassword());
> >     }
> >
> > public void setText(String text){
> >         this.xTextComponent.setText(text);
> >     }
>
> what is null in this case? text or xTextComponent?
>
> If your extension is open source, may be you could point to the NB project
> source and we can test what's hapening.
>
> Regards
> --
> Ariel Constenla-Haile
> La Plata, Argentina
>

Re: Problem when showing a dialog of a deployed extension

Posted by Ariel Constenla-Haile <ar...@gmail.com>.
On Sun, Nov 06, 2011 at 11:29:37PM -0600, Gerardo Gómez wrote:
> Yes, i had already set a breakpoint, and i don't think the problem is on
> the UploadDialog.java, because i can execute it separately from the
> extension. It only happens, when i deploy it (from netbeans), to my
> OpenOffice.org. 

did you try debugging the extension? Context menu "Debug Extension in
Target OpenOffice.org", or the hard way by attaching the debugger.

> This is the code i use to show/hide a dialog
> 
>     public void setVisible(boolean visible){
> //        If this dialog is modal...
>         if (modal){
>             if (visible){
> //                ...it uses execute to show the dialog.
>                 this.xDialog.execute();
>             }
>             else{
> //                ...it uses endExecute to hide the dialog.
>                 this.xDialog.endExecute();
>             }
>         }
> //        If this dialog is not modal...
>         else{
> //            ...it uses the setVisible method from the xWindow object.
>             this.xWindow.setVisible(visible);
>         }
>     }
> 
> It seems also, that either in the extension execution and the execution
> from the main method, has the same parameters (a null string).
> 
> public void fillCredentials(Creditionals creditionals) {
> 
> this.getRememberPassCheckBox().setState(creditionals.getWsCreditionalsReadedFromDisk());
> //      credentionals.getUserName() == null
>         this.getUserNameTextField().setText(creditionals.getUserName());
>         this.getPasswordTextField().setText(creditionals.getPassword());
>     }
> 
> public void setText(String text){
>         this.xTextComponent.setText(text);
>     }

what is null in this case? text or xTextComponent?

If your extension is open source, may be you could point to the NB project
source and we can test what's hapening.

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: Problem when showing a dialog of a deployed extension

Posted by Gerardo Gómez <ge...@gmail.com>.
Yes, i had already set a breakpoint, and i don't think the problem is on
the UploadDialog.java, because i can execute it separately from the
extension. It only happens, when i deploy it (from netbeans), to my
OpenOffice.org. This is the code i use to show/hide a dialog

    public void setVisible(boolean visible){
//        If this dialog is modal...
        if (modal){
            if (visible){
//                ...it uses execute to show the dialog.
                this.xDialog.execute();
            }
            else{
//                ...it uses endExecute to hide the dialog.
                this.xDialog.endExecute();
            }
        }
//        If this dialog is not modal...
        else{
//            ...it uses the setVisible method from the xWindow object.
            this.xWindow.setVisible(visible);
        }
    }

It seems also, that either in the extension execution and the execution
from the main method, has the same parameters (a null string).

public void fillCredentials(Creditionals creditionals) {

this.getRememberPassCheckBox().setState(creditionals.getWsCreditionalsReadedFromDisk());
//      credentionals.getUserName() == null
        this.getUserNameTextField().setText(creditionals.getUserName());
        this.getPasswordTextField().setText(creditionals.getPassword());
    }

public void setText(String text){
        this.xTextComponent.setText(text);
    }

I'm not an UNO expert, but maybe the resources are managed in a different
way when deploying to an extension than executing UNO code from a main
method.

Thank you for your suggestion.

On Sun, Nov 6, 2011 at 11:09 PM, Ariel Constenla-Haile <
ariel.constenla.haile@gmail.com> wrote:

> Hello Gerardo,
>
> On Sun, Nov 06, 2011 at 10:06:29PM -0600, Gerardo Gómez wrote:
> > Hello everyone.
> > I have a problem when i try to show some dialogs of an extension i've
> > modified. But this error has a peculiarity, it only happens with some
> > dialogs, other dialogs can be showed. The error showed on the console is
> > this one:
> >
> > com.sun.star.uno.RuntimeException: [jni_uno bridge error] Java calling
> UNO
> > method setText: [map_to_uno():string] null-ref given!
> > java stack trace:
> >         at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native
> > Method)
> >         at
> com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:175)
> >         at $Proxy36.setText(Unknown Source)
> >         at util.OoTextField.setText(OoTextField.java:50)
> >         at
> > org.openoffice.gdocs.ui.LoginPanel.fillCredentials(LoginPanel.java:179)
> >         at
> > org.openoffice.gdocs.ui.LoginPanel.readCreditionals(LoginPanel.java:202)
> >         at
> org.openoffice.gdocs.ui.LoginPanel.setSystem(LoginPanel.java:212)
> >         at
> >
> org.openoffice.gdocs.ui.dialogs.UploadDialog.<init>(UploadDialog.java:181)
> >         at org.openoffice.gdocs.UNOGDocs$2.run(UNOGDocs.java:231)
> >         at java.lang.Thread.run(Thread.java:662)
> >
> > I'm developing the extension on NetBeans 6.8, deploying the OXT file on
> > OpenOffice.org 3.3 and the dialog i try to show is from the UNO-AWT. If
> you
> > have any idea how can i solve this problem would be really appreciated.
>
> without seeing any code, it is hard to guess. Did you already set
> a breakpoint at UploadDialog.java:181 and see why you are sending the
> message setText to a null object?
>
> Regards
> --
> Ariel Constenla-Haile
> La Plata, Argentina
>

Re: Problem when showing a dialog of a deployed extension

Posted by Ariel Constenla-Haile <ar...@gmail.com>.
Hello Gerardo,

On Sun, Nov 06, 2011 at 10:06:29PM -0600, Gerardo Gómez wrote:
> Hello everyone.
> I have a problem when i try to show some dialogs of an extension i've
> modified. But this error has a peculiarity, it only happens with some
> dialogs, other dialogs can be showed. The error showed on the console is
> this one:
> 
> com.sun.star.uno.RuntimeException: [jni_uno bridge error] Java calling UNO
> method setText: [map_to_uno():string] null-ref given!
> java stack trace:
>         at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native
> Method)
>         at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:175)
>         at $Proxy36.setText(Unknown Source)
>         at util.OoTextField.setText(OoTextField.java:50)
>         at
> org.openoffice.gdocs.ui.LoginPanel.fillCredentials(LoginPanel.java:179)
>         at
> org.openoffice.gdocs.ui.LoginPanel.readCreditionals(LoginPanel.java:202)
>         at org.openoffice.gdocs.ui.LoginPanel.setSystem(LoginPanel.java:212)
>         at
> org.openoffice.gdocs.ui.dialogs.UploadDialog.<init>(UploadDialog.java:181)
>         at org.openoffice.gdocs.UNOGDocs$2.run(UNOGDocs.java:231)
>         at java.lang.Thread.run(Thread.java:662)
> 
> I'm developing the extension on NetBeans 6.8, deploying the OXT file on
> OpenOffice.org 3.3 and the dialog i try to show is from the UNO-AWT. If you
> have any idea how can i solve this problem would be really appreciated.

without seeing any code, it is hard to guess. Did you already set
a breakpoint at UploadDialog.java:181 and see why you are sending the
message setText to a null object?

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina