Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when opening design using JDK11 #2100

Closed
szolo opened this issue Jul 15, 2019 · 9 comments
Closed

Exception when opening design using JDK11 #2100

szolo opened this issue Jul 15, 2019 · 9 comments
Assignees
Labels
Milestone

Comments

@szolo
Copy link
Contributor

szolo commented Jul 15, 2019

Steps to reproduce

Opening template causes exceptions.

Actual behavior

Windows stacktrace:

Error: 
java.lang.RuntimeException: java.lang.NoSuchMethodException: com.teamdev.jxbrowser.chromium.swing.internal.LightWeightWidget.getPeer()
at com.teamdev.jxbrowser.chromium.swing.internal.NativeWin.getWindowHandle(SourceFile:37) 
at com.teamdev.jxbrowser.chromium.swing.internal.DisplayWatcher.attach(SourceFile:51) 
at com.teamdev.jxbrowser.chromium.swing.internal.LightWeightWidget.enableDisplayWatcher(SourceFile:669) 
at com.teamdev.jxbrowser.chromium.swing.internal.LightWeightWidget.addNotify(SourceFile:695) 

MacOS stacktrace:

java.lang.RuntimeException: java.lang.NoSuchMethodException: com.intellij.openapi.wm.impl.IdeFrameImpl.getPeer()
at com.teamdev.jxbrowser.chromium.swing.internal.NativeMac.a(SourceFile:70)
at com.teamdev.jxbrowser.chromium.swing.internal.NativeMac.getWindowHandle(SourceFile:34)
at com.teamdev.jxbrowser.chromium.swing.internal.DisplayWatcher.attach(SourceFile:51)
at com.teamdev.jxbrowser.chromium.swing.internal.LightWeightWidget.enableDisplayWatcher(SourceFile:669)
at com.teamdev.jxbrowser.chromium.swing.internal.LightWeightWidget.addNotify(SourceFile:695)

Expected behavior

Template should be opened without any exceptions.

IDE, Designer and OS version

  • IntelliJ IDEA - 2019.1.3 - IC-191.7479.19 or IntelliJ IDEA - 2019.2 EAP - IU-192.5728.12.
  • Java 11.0.2 or 11.0.3.
  • Windows 10, MacOS.
  • Designer 4.3.0.final.

Intercom:

Feedback from user (https://app.intercom.io/a/apps/y0ueytrp/inbox/inbox/all/conversations/22952902391):
This problem happens with JDK 11. When using JDK 8 this does not happens. A problem that I am having with both JDK is that Vaadin Designer on IntelliJ does not allow to drag any components on the cavans. I can not edit.

Summary

Starting from 2019.1.3 IntelliJ IDEA is using bundled JDK 11 (https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under).

Our current JxBrowser version 6.22.1 doesn't work well with OpenJDK 11 (bundled in IDEA or standalone) or OracleJDK 11.

I also checked latest released version of the JxBrowser (6.24) and can confirm that it doesn't work as well. Situation with the JxBrowser 6.24 is even worse: you'll see a blank design after opening but it will be rendered correctly after dragging/resizing its corner.

Even though the exception happens it doesn't stop the rendering process, at least for my Windows machine. But I can't say that everything will work as it should, e.g. delete button doesn't work.

Workarounds

  1. Set Designer to open the editor in your local Google Chrome browser, instead of running the editor inside IDE. Source view opens in IDE. See instructions here: https://vaadin.com/labs/designer-chrome
  2. Use IntelliJ IDEA 2018.3 or earlier
  3. Switch back to JDK 8, by changing the underlying JDK version of the IntelliJ IDEA:
    Start the IDE, use Help | Find Action (Ctrl+Shift+A or Cmd+Shift+A on Mac), type "Switch IDE Boot JDK", press Enter.

See paragraph All platforms: switch between installed runtimes at https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under

@szolo
Copy link
Contributor Author

szolo commented Jul 23, 2019

@ripla it looks like there are some issues with JxBrowser... Should be prioritized. Worth trying new JxBrowser version.

@szolo szolo added the feedback label Jul 23, 2019
@szolo szolo changed the title Source mode editing fails Exception when opening design using JDK11 Jul 27, 2019
@szolo
Copy link
Contributor Author

szolo commented Jul 30, 2019

JxBrowser team replied, see https://jxbrowser.support.teamdev.com/support/tickets/7316, but fix will require more time and additional testing for all 3 platforms and 2 IDEs.

For now - introduce popup with clear instructions if IntelliJ IDEA is running under JDK 11. Priority raised, see Intercom dialog with Joonas (@jojule): https://app.intercom.io/a/apps/y0ueytrp/inbox/inbox/all/conversations/23012372705.

@Teodor-Iancu
Copy link

for 2019.2 type "Switch Boot JDK" instead "Switch IDE Boot JDK"

Workaround

Switch back to JDK 8, by changing the underlying JDK version of the IntelliJ IDEA:
Start the IDE, use Help | Find Action (Ctrl+Shift+A or Cmd+Shift+A on Mac), type "Switch Boot JDK", press Enter.

@wuwu2000
Copy link

wuwu2000 commented Aug 21, 2019

To be honest: This can't be the solution to close this issue. It's still a workaround not everybody wants to do. IntelliJ IDEA warns with red letters and bold "Changing these values may cause unwanted behavior"

=> I can not open any file when switching to JDK 8. This may be an intellij bug but this deadlock hinders me to work with the design files. This is quite serious.

This workaround may not work with Intellij 2019.2

@mcsherrylabs
Copy link

This workaround is really poor. Switching IDEA 2019.2 to JDK8 on Ubuntu renders the IDE almost unuseable. Constant stuttering and lagging.

When will this be fixed please?

@tanbt
Copy link
Contributor

tanbt commented Aug 23, 2019

Hi, thanks for getting back. We're working on various solutions to tackle this issue.
Designer is using JxBrowser 6 which causes this exception.

As JxBrowser 7 claims to support JDK 11, we're upgrading with it but found another issues, teamdev confirmed that they're working on the bugs.
https://jxbrowser.support.teamdev.com/support/tickets/7500
https://jxbrowser.support.teamdev.com/support/tickets/7516

Concurrently, external Chrome editor is an experimental feature #1975 which can fix JDK 11 problem, since it doesn't use JxBrowser but starts the editor in an external Chrome browser from user's OS.
This feature is also expected to fix additional problems likes performance issue, 4K screen scaling,...

We're planing to publish this feature in the next release and looking forward to positive feedback.

@szolo
Copy link
Contributor Author

szolo commented Sep 2, 2019

Hello, we've just released Chrome editor support for Designer.

This means that you can change your templates in the browser which is not part of the IDE anymore. More details available here https://vaadin.com/labs/designer-chrome.

Feel free to try this new feature, it will definitely help to overcome JDK 11 problems.

@wuwu2000
Copy link

wuwu2000 commented Sep 4, 2019

Nice thanks! Any chances the Chrome Designer will be compatible for vaadin8 designs?

@szolo
Copy link
Contributor Author

szolo commented Sep 5, 2019

@wuwu2000 we aren't planning to release Chrome editor support for Vaadin 8 Designer in nearest future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants