2012-12-13 25 views
9

Chúng tôi có một ứng dụng khởi chạy qua webstart sử dụng thư viện SWT.Java 7 phá vỡ ứng dụng SWT trên OS X bằng cách sử dụng Web Start

Nó cũng được biết rằng OSX đòi hỏi các thư viện SWT để chạy trong các chủ đề chính, vì vậy chúng tôi có điều này trong jnlp của chúng tôi:

<resources os="Mac"> 
    <j2se version="1.6+" java-vm-args="-XstartOnFirstThread"/> 
    <jar href="swt-mac64.jar"/> 
</resources> 

Kể từ khi chúng tôi đã nâng cấp lên Java 7 (1.7.0_10), nó dường như webstart không vượt qua "-XstartOnFirstThread" đến quá trình java mà nó bắt đầu.

Tôi có thể thấy từ 'ps' rằng quá trình java không nhận được tùy chọn "-XstartOnFirstThread".

Có ai biết cách truy cập webstart để quay lại hành vi trước đó của nó không?

Trân trọng, Gord.

Đây là những gì các bản ghi webstart cho thấy:

Java Web Start 10.10.2.18 
Using JRE version 1.7.0_10-b18 Java HotSpot(TM) 64-Bit Server VM 
User home directory = /Users/shier 
---------------------------------------------------- 
c: clear console window 
f: finalize objects on finalization queue 
g: garbage collect 
h: display this help message 
m: print memory usage 
o: trigger logging 
p: reload proxy configuration 
q: hide console 
r: reload policy configuration 
s: dump system and deployment properties 
t: dump thread list 
v: dump thread stack 
0-5: set trace level to <n> 
---------------------------------------------------- 
    Match: beginTraversal 
Match: digest selected JREDesc: JREDesc[version 1.6+, heap=-1--1, args=-XstartOnFirstThread, href=null, sel=false, null, null], JREInfo: JREInfo for index 0: 
    platform is: 1.7 
    product is: 1.7.0_10 
    location is: http://java.sun.com/products/autodl/j2se 
    path is: /Library/Internet Plug-ins/JavaAppletPlugin.plugin/Contents/Home/bin/java 
    args is: null 
    native platform is: Mac OS X, x86_64 [ x86_64, 64bit ] 
    JavaFX runtime is: JavaFX 2.2.4 found at /Library/Internet Plug-ins/JavaAppletPlugin.plugin/Contents/Home/ 
    enabled is: true 
    registered is: true 
    system is: true 

    Match: ignoring maxHeap: -1 
    Match: ignoring InitHeap: -1 
    Match: digesting vmargs: -XstartOnFirstThread 
    Match: digested vmargs: [JVMParameters: isSecure: false, args: -XstartOnFirstThread] 
    Match: JVM args after accumulation: [JVMParameters: isSecure: false, args: -XstartOnFirstThread] 
    Match: digest LaunchDesc: http://htxuat.example.com/broker/broker-XX.jnlp 
    Match: digest properties: [] 
    Match: JVM args: [JVMParameters: isSecure: false, args: -XstartOnFirstThread] 
    Match: endTraversal .. 
    Match: JVM args final: -XstartOnFirstThread 
    Match: Running JREInfo Version match: 1.7.0.10 == 1.7.0.10 
    Match: Running JVM args match the secure subset: have:<"-Djnlp.application.href=\"http://htxuat.example.com/broker/broker-XX.jnlp \""> satisfy want:<-XstartOnFirstThread> 
Dec 13, 2012 10:19:49 AM com.example.log.JavaUtilLogger infoImpl 
INFO: Available host [tcp:htxuat.example.com:49200] 
Dec 13, 2012 10:19:49 AM com.example.log.JavaUtilLogger infoImpl 
INFO: Available host [ssl:htxuat.example.com:49301] 
Dec 13, 2012 10:19:49 AM com.example.log.JavaUtilLogger infoImpl 
INFO: Will try the first address [tcp:htxuat.example.com:49200] 
Dec 13, 2012 10:19:49 AM com.example.log.JavaUtilLogger infoImpl 
INFO: Using host [tcp:htxuat.example.com:49200] 
Dec 13, 2012 10:19:49 AM com.example.log.JavaUtilLogger infoImpl 
INFO: Don't forget to change back the logging, this is only temporary 
Dec 13, 2012 10:19:49 AM com.example.log.JavaUtilLogger infoImpl 
INFO: Using library /Users/shier/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:. 
Dec 13, 2012 10:19:49 AM com.example.log.JavaUtilLogger infoImpl 
INFO: Registering [com.example.client.ClientController] 
JNLPClassLoader: Finding library libswt-cocoa-3738.dylib 
JNLPClassLoader: Finding library libswt-cocoa.dylib 
JNLPClassLoader: Finding library libswt-pi-cocoa-3738.dylib 
JNLPClassLoader: Finding library libswt-pi-cocoa.dylib 
***WARNING: Display must be created on main thread due to Cocoa restrictions. 
Dec 13, 2012 10:19:50 AM com.example.log.JavaUtilLogger errorImpl 
SEVERE: Problem 
org.eclipse.swt.SWTException: Invalid thread access 
    at org.eclipse.swt.SWT.error(SWT.java:4282) 
    at org.eclipse.swt.SWT.error(SWT.java:4197) 
    at org.eclipse.swt.SWT.error(SWT.java:4168) 
    at org.eclipse.swt.widgets.Display.error(Display.java:1065) 
    at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) 
    at org.eclipse.swt.widgets.Display.create(Display.java:805) 
    at org.eclipse.swt.graphics.Device.<init>(Device.java:130) 
    at org.eclipse.swt.widgets.Display.<init>(Display.java:696) 
    at org.eclipse.swt.widgets.Display.<init>(Display.java:687) 
    at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) 
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:270) 
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:263) 
    at com.example.swt.ShellViewParent.attach(ShellViewParent.java:124) 
    at com.example.swt.MultipleParents.init(MultipleParents.java:55) 
    at com.example.client.mvc.ViewController.setViewParents(ViewController.java:320) 
    at com.example.client.mvc.ViewController.setViewParents(ViewController.java:287) 
    at com.example.client.mvc.ViewController.setViewParents(ViewController.java:278) 
    at com.example.client.gui.prefs.PreferencesViewController.<init>(PreferencesViewController.java:53) 
    at com.example.client.ClientController.init(ClientController.java:353) 
    at com.example.mvc.Controller.register(Controller.java:51) 
    at com.example.client.Application.loadComponents(Application.java:153) 
    at com.example.client.Application.start(Application.java:139) 
    at com.example.client.Application.main(Application.java:166) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:601) 
    at com.sun.javaws.Launcher.executeApplication(Unknown Source) 
    at com.sun.javaws.Launcher.executeMainClass(Unknown Source) 
    at com.sun.javaws.Launcher.doLaunchApp(Unknown Source) 
    at com.sun.javaws.Launcher.run(Unknown Source) 
    at java.lang.Thread.run(Thread.java:722) 

org.eclipse.swt.SWTException: Invalid thread access 
    at org.eclipse.swt.SWT.error(SWT.java:4282) 
    at org.eclipse.swt.SWT.error(SWT.java:4197) 
    at org.eclipse.swt.SWT.error(SWT.java:4168) 
    at org.eclipse.swt.widgets.Display.error(Display.java:1065) 
    at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) 
    at org.eclipse.swt.widgets.Display.create(Display.java:805) 
    at org.eclipse.swt.graphics.Device.<init>(Device.java:130) 
    at org.eclipse.swt.widgets.Display.<init>(Display.java:696) 
    at org.eclipse.swt.widgets.Display.<init>(Display.java:687) 
    at org.eclipse.swt.widgets.Display.getDefault(Display.java:1383) 
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:270) 
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:263) 
    at com.example.swt.ShellViewParent.attach(ShellViewParent.java:124) 
    at com.example.swt.MultipleParents.init(MultipleParents.java:55) 
    at com.example.client.mvc.ViewController.setViewParents(ViewController.java:320) 
    at com.example.client.mvc.ViewController.setViewParents(ViewController.java:287) 
    at com.example.client.mvc.ViewController.setViewParents(ViewController.java:278) 
    at com.example.client.gui.prefs.PreferencesViewController.<init>(PreferencesViewController.java:53) 
    at com.example.client.ClientController.init(ClientController.java:353) 
    at com.example.mvc.Controller.register(Controller.java:51) 
    at com.example.client.Application.loadComponents(Application.java:153) 
    at com.example.client.Application.start(Application.java:139) 
    at com.example.client.Application.main(Application.java:166) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:601) 
    at com.sun.javaws.Launcher.executeApplication(Unknown Source) 
    at com.sun.javaws.Launcher.executeMainClass(Unknown Source) 
    at com.sun.javaws.Launcher.doLaunchApp(Unknown Source) 
    at com.sun.javaws.Launcher.run(Unknown Source) 
    at java.lang.Thread.run(Thread.java:722) 
+0

Tôi nghĩ rằng Apple đã sử dụng để sửa đổi phiên bản java/javaws của họ để cho phép tùy chọn -XstartOnFirstThread. Tôi nghĩ rằng Oracle không thực hiện thêm bước đó vì họ đã thực hiện phân phối java trên mac. –

+0

JNLP có khai báo 'tất cả các quyền 'không? Tôi chắc chắn rằng yêu cầu sẽ bị bỏ qua nếu không. Hãy chắc chắn kiểm tra JNLP bằng cách sử dụng [JaNeLA] (http://pscode.org/janela/). –

Trả lời

1

Tôi đã nhìn thấy điều này cũng với Java 7 và tự hỏi nếu đó là một lỗi Java 7 dựa trên bài đăng này từ người khác (tôi đã đi trước và đã gửi một báo cáo lỗi vì tôi không thấy bất kỳ từ việc tìm kiếm thông qua cơ sở dữ liệu lỗi Java): http://www.java.net/forum/topic/jdk/java-se/webstart-os-x-xstartonfirstthread

Cách giải quyết mà tôi đã tìm thấy chỉ đơn giản là sử dụng javaws từ Java 6 do Apple cung cấp, mặc dù tôi phải khởi chạy nó từ dòng lệnh: /System/Library/Java/Support/Deploy.bundle/Contents/MacOS/javaws myjnlp.jnlp

Các vấn đề liên quan