[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-18 Thread sb
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926





--- Additional comments from s...@openoffice.org Fri Feb 18 11:16:13 + 
2011 ---
Created an attachment (id=75872)
fix for the BeanShell editor


-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-18 Thread sb
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926


User sb changed the following:

What|Old value |New value

 Assigned to|jl|sb

  Status|STARTED   |NEW





--- Additional comments from s...@openoffice.org Fri Feb 18 11:23:02 + 
2011 ---
The remaining problem was that merely calling SwingUtilities.invokeLater already
triggers the dreaded Apple AWT Java VM was loaded on first thread -- can't
start AWT. failure.  So, the solution is to wrap the call to
SwingUtilities.invokeLater in a fresh thread, to avoid calling invokeLater on
the AppKit thread.  (Note that the invokeLater part is necessary on all
platforms, to conform to the Swing threading requirements.  It was erroneously
missing from the ScriptEditorForBeanShell code.)

The attached ScriptEditorForBeanShell.patch fixes this for the BeanShell editor.
 The JavaScript editor apparently has the same problem and will need to be
fixed, too.

-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-18 Thread ronyf
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926





--- Additional comments from ro...@openoffice.org Fri Feb 18 14:56:35 + 
2011 ---
Stephan, thank you *very much* for your efforts and solution! Studying your
patch allowed me to change ScriptEditorForooRexx accordingly and it works as
well! Again, thank you very much!

-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-18 Thread cloph
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926





--- Additional comments from cl...@openoffice.org Fri Feb 18 16:36:16 + 
2011 ---
Results: plain DEV300_m100 on PPC/10.4: Invoking Edit from Tools|Macros → 
Organize Beanshell/Javascript results in a crash (Bus Error)

with the ScriptEditorForBeanShell.patch applied, using Edit for beanshell 
macros works.

That being said, a solution that would require each and every extension author 
to 
add special code to avoid this problem is not really helpful...


-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-18 Thread sb
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926


User sb changed the following:

What|Old value |New value

  Status|NEW   |RESOLVED

  Resolution|  |FIXED





--- Additional comments from s...@openoffice.org Fri Feb 18 19:58:53 + 
2011 ---
fixed as http://hg.services.openoffice.org/cws/sb141/rev/43bea9e7a54b; on Mac 
OS X only, it turned 
out the JavaScript editor still has a different problem, see issue 117015

@cloph: a solution that would require each and every extension author to add 
special code [...] is not 
really helpful:  Agreed.  However, (a) as I already wrote, I don't see a 
better solution, (b) only extensions 
that use Java AWT/Swing are affected, and (c) using AWT/Swing in extensions was 
never encouraged (yes, 
lame excuse, I know---but still).

-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-17 Thread sb
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926


User sb changed the following:

What|Old value |New value

  CC|'cloph,ericb,fs,kso,macpor|'cd,cloph,ericb,fs,kso,mac
|t,ronyf,ssa,wijngaarde'   |port,pl,ronyf,sb,ssa,wijng
|  |aarde'





--- Additional comments from s...@openoffice.org Thu Feb 17 15:25:47 + 
2011 ---
I think I now understand what happens, more or less.  The Apple AWT Java VM was
loaded on first thread -- can't start AWT. message appears to be a red herring.
 What is relevant is apparently not the thread on which the VM was created (via
JNI_CreateJavaVM), but rather the thread on which any Java AWT/Swing
functionality is actually triggered.  This interpretation would be in line with
what http://developer.apple.com/library/mac/#technotes/tn2005/tn2147.html JNI
Development on Mac OS X - Thread-Safe JNI Programming - Calling AWT/Swing From
AppKit says---the AppKit thread (i.e., the OOo main thread) must call AWT/Swing
only asynchronously (e.g., via javax.swing.SwingUtilities.inovkeLater).

As a proof of concept, the attached SvxScriptOrgDialog.patch (against
DEV300_m100) modifies the Tools - Macros - Organize Macros - BeanShell... -
Edit button so that it does its work asynchronously in a new thread, instead of
synchronously on the OOo main thread (i.e., the AppKit thread).  With the patch
applied, at least with a DEV300_m100 unxmacxi non-pro OOo and Java 1.5.0_26 on
Mac OS X 10.5.8, the editor window appears.

The java_seperate_thread.diff patch appears not to be necessary after all.  Also
note that that patch is not correct, as the code in
stoc/source/javavm/javavm.cxx expects the JNIEnv* returned from jfw_startVM to
be attached to the current thread, which it no longer would be.

In the above proof of concept, it was easy to asynchronously offload the edit
code to a new thread (as the surrounding code does not expect any response back
from the edit code, anyway, and lets it progress in parallel).  However, I do
not think that it is possible to automatically offload from the OOo main thread
all work that might involve Java AWT/Swing functionality (maybe cd or pl can
give input here).  I think this rather needs to be seen the other way around: 
Java code executed in OOo cannot make assumptions about the thread it is running
on; thus, to work cross platform (incl. Mac OS X), this code must assume that it
might run on the AppKit thread and take the necessary measures when calling
AWT/Swing (e.g., via invokeLater).

-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-17 Thread sb
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926





--- Additional comments from s...@openoffice.org Thu Feb 17 15:26:58 + 
2011 ---
Created an attachment (id=75862)
proof of concept


-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-17 Thread cloph
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926





--- Additional comments from cl...@openoffice.org Thu Feb 17 15:39:10 + 
2011 ---
thanks for the alternative patch, I'll try it later on PPC/10.4, just one 
question regarding my patch:

 note that that patch is not correct, as the code in
 stoc/source/javavm/javavm.cxx expects the JNIEnv* returned from jfw_startVM to
 be attached to the current thread, which it no longer would be.

Yes, but only to detach it right away, so the patch just skips that step:

What am I missing? (feel free to reply by mail instead of commenting here)
--- stoc/source/javavm/javavm.cxx   (revision 276725)
+++ stoc/source/javavm/javavm.cxx   (working copy)
@@ -950,7 +950,9 @@
 if (bStarted)
 {
 {
+#ifndef MACOSX // Mac creates the JVM in a seperate thread already
 DetachCurrentThread detach(m_pJavaVm);
+#endif
 // necessary to make debugging work; this thread will be
 // suspended when the destructor of detach returns
 m_xVirtualMachine = new jvmaccess::VirtualMachine(


-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-17 Thread sb
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926





--- Additional comments from s...@openoffice.org Thu Feb 17 15:44:37 + 
2011 ---
@cloph:  The call to setUpUnoVirtualMachine(pMainThreadEnv); expects
pMainThreadEnv to be attached to the current thread.  (Note that
DetachCurrentThread only does its work in the destructor, i.e., after the call
to setUpUnoVirtualMachine.)

-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-17 Thread mh
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926


User mh changed the following:

What|Old value |New value

  CC|'cd,cloph,ericb,fs,kso,mac|'cd,cloph,ericb,fs,kso,mac
|port,pl,ronyf,sb,ssa,wijng|port,mh,pl,ronyf,sb,ssa,wi
|aarde'|jngaarde'

   Status whiteboard|  |RM-S3





-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-17 Thread ronyf
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926





--- Additional comments from ro...@openoffice.org Thu Feb 17 17:52:03 + 
2011 ---
Stephan,

thank you *very much* for tackling this!

Changed the code to use SwingUtilities.invokeLater() instead of synchroneously
calling initUI() in the classes (originally copied from the bash scripting
framework implementation, if my memory serves well, just creating an
oorexx-directory and adapting the Java code copied from bash to ooRexx 
accordingly):

com.sun.star.script.framework.provider.oorexx.PlainSourceView.java
com.sun.star.script.framework.provider.oorexx.ScriptEditorForooRexx.java

Tested the code under Windows (the Tools - Macros - ... - Edit is still
functional ;) ).

Unfortunately, the editor does still not show up on MacOSX. (The scripts
execute, it is possible to create a new script from the supplied template.)

The Mac logs (using the Console.app) does not show any messages from OOo nor
from Java (enabling tracing and logging using the Java Preference utility in
Application/Utilities), so I am not sure how to get at that information. 

Is it possible to activate tracing/debugging from the release version of OOo 3.3
for MacOSX somehow to become able to learn more about what happens in detail? 


-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-17 Thread sb
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926





--- Additional comments from s...@openoffice.org Thu Feb 17 20:00:50 + 
2011 ---
@ronyf:  I will see whether I can come up with a proper patch for the BeanShell 
case (that does not hack the 
C++ SvxScriptOrgDialog but rather modifies the involved Java code).

-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-16 Thread ronyf
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926


User ronyf changed the following:

What|Old value |New value

  CC|'cloph,ericb,fs,macport,ss|'cloph,ericb,fs,macport,ro
|a,wijngaarde' |nyf,ssa,wijngaarde'





-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-16 Thread ronyf
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926





--- Additional comments from ro...@openoffice.org Wed Feb 16 10:57:21 + 
2011 ---
This should be a priority P1, a showstopper-bug all along: 

The scripting framework of OOo is of strategic, tactical and operational
importance, like it or not! Not having it function properly on MacOSX *cripples*
OOo bad time on that platform! 

It is only because of the possibilities to write macros/scripts that also
allow non-professional programmers (end-user programmers) to become able to
drive/program OOo. Employing this infrastructure also locks such
users/businesses into the OOo environment. 

Plus only macros/scripts allow professional OOo developers to easily create
applications, useful functionalities for their customers in an easy way
(development and deployment alike)! Doing so, they get locked into OOo as well.

Not being able to edit existing macros at all on MacOSX because of this
(stupid) error, renders that part inaccessible and as a result totally useless
to business users of OOo on MacOSX!

Not having such a showstopper error fixed is therefore not understandable
for me as this hints that those who allot resources to fixing issues have no
clues about the impact and importance of the scripting framework on users and
businesses! 

What are the reasons that the OOo developers ignore this unbelievable error
for so long? Why hasn't it been solved long ago once and forever ?

---

Whoever starts to work with Java on MacOSX using JNI will immediately be drawn
to this very MacOSX issue of the CFRunLoop in the main thread and the JVM to
have to be loaded in a separate thread if awt gets excercised. Apple has been
very open and informative about this very issue (see links below), since 2005!

In OOo it is a base feature, that awt/swing must work. Therefore I am totally
stunned that this unbelievable defect has not been fixed long ago! It not only
affects the scripting framework, but any Java code that employs awt/swing.

Here a few links to (quite old!) Mac-documentation about this:

   http://developer.apple.com/library/mac/#technotes/tn2005/tn2147.html
  
http://developer.apple.com/library/mac/#samplecode/simpleJavaLauncher/Introduction/Intro.html

  
http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html
  
http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Java14Development/04-JavaUIToolkits/JavaUIToolkits.html#//apple_ref/doc/uid/TP40001901-SW1

Oh, once started on a separate thread it is possible to attach to the JVM from
other threads as well, AFAICT.

[BTW: judging from the OpenJDK-wiki OpenJDK will exhibit the very same behaviour
as the Apple ports of Java. So the problem won't go away, if someone would be
speculating in that direction. Plus it seems, that the Apple changes to Java in
the awt/swing area are being taken over as well by OpenJDK.]

---

*Again, I consider this a showstopper error which should stop branching OOo
3.4, until it is fixed!*

How could I increase the priority of this issue to P1?



-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org



[porting-issues] [Issue 92926] Java AWT doesn't work (can't start)

2011-02-16 Thread kso
To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=92926


User kso changed the following:

What|Old value |New value

  CC|'cloph,ericb,fs,macport,ro|'cloph,ericb,fs,kso,macpor
|nyf,ssa,wijngaarde'   |t,ronyf,ssa,wijngaarde'





--- Additional comments from k...@openoffice.org Wed Feb 16 13:19:51 + 
2011 ---
cc-ing myself.

-
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

-
To unsubscribe, e-mail: issues-unsubscr...@porting.openoffice.org
For additional commands, e-mail: issues-h...@porting.openoffice.org


-
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org