达梦Linux调取图形化页面报错: Screen for GtkWindow not set

第一种办法:直接22端口用dmdba用户登录!!!百试百灵

第二种:以下方式为参考:

[dmdba@bogon tool]$ ./console

(Console:62267): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(Console:62267): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(Console:62267): Gtk-CRITICAL **: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed

(Console:62267): Gtk-WARNING **: Screen for GtkWindow not set; you must always set

a screen for a GtkWindow before using the window

(Console:62267): Gtk-WARNING **: Screen for GtkWindow not set; you must always set

a screen for a GtkWindow before using the window

(Console:62267): Gdk-CRITICAL **: IA__gdk_screen_get_display: assertion 'GDK_IS_SCREEN (screen)' failed

(Console:62267): Gdk-CRITICAL **: IA__gdk_display_get_pointer: assertion 'GDK_IS_DISPLAY (display)' failed

(Console:62267): Gdk-CRITICAL **: IA__gdk_screen_get_monitor_at_point: assertion 'GDK_IS_SCREEN (screen)' failed

(Console:62267): Gtk-WARNING **: Screen for GtkWindow not set; you must always set

a screen for a GtkWindow before using the window

(Console:62267): Gdk-CRITICAL **: IA__gdk_screen_get_n_monitors: assertion 'GDK_IS_SCREEN (screen)' failed

(Console:62267): Gtk-WARNING **: Screen for GtkWindow not set; you must always set

a screen for a GtkWindow before using the window

(Console:62267): Gdk-CRITICAL **: IA__gdk_screen_get_monitor_geometry: assertion 'GDK_IS_SCREEN (screen)' failed

(Console:62267): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap: assertion 'GDK_IS_SCREEN (screen)' failed

(Console:62267): Gdk-CRITICAL **: IA__gdk_colormap_get_visual: assertion 'GDK_IS_COLORMAP (colormap)' failed

(Console:62267): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap: assertion 'GDK_IS_SCREEN (screen)' failed

(Console:62267): Gdk-CRITICAL **: IA__gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed

(Console:62267): Gdk-CRITICAL **: IA__gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed

(Console:62267): Gdk-CRITICAL **: IA__gdk_window_new: assertion 'GDK_IS_WINDOW (parent)' failed

#

# A fatal error has been detected by the Java Runtime Environment:

#

# SIGSEGV (0xb) at pc=0x00007f3998bb2597, pid=62267, tid=139885766346496

#

# JRE version: OpenJDK Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26)

# Java VM: OpenJDK 64-Bit Server VM (25.20-b23 mixed mode linux-amd64 compressed oops)

# Problematic frame:

# C [libgdk-x11-2.0.so.0+0x7b597] gdk_window_enable_synchronized_configure+0x7

#

# Core dump written. Default location: /dm8/tool/core or core.62267

#

# An error report file with more information is saved as:

# /dm8/tool/hs_err_pid62267.log

#

# If you would like to submit a bug report, please visit:

# http://bugreport.sun.com/bugreport/crash.jsp

# The crash happened outside the Java Virtual Machine in native code.

# See problematic frame for where to report the bug.

#

./console: line 20: 62267 Aborted (core dumped) "$JAVA_HOME/bin/java" -Xms256m -Xmx2048m -XX:+PerfDisableSharedMem -DDM_HOME="$DM_HOME" -Djava.library.path="$DM_HOME/bin" -Ddameng.log.file="$TOOL_HOME/log4j.xml" -DeclipseHome="$TOOL_HOME" -Dosgi.nl="$INSTALL_LANGUAGE" -Ddameng.dts.explorer.root="$TOOL_HOME/workspace/local/dts" -Ddameng.isql.explorer.root="$TOOL_HOME/workspace/local/isql" -Duse_bak2=true -Dapp.name=console -jar "$TOOL_HOME/plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar" -os linux -ws gtk -arch x86_64 -showsplash "$TOOL_HOME/console.bmp" -data "$TOOL_HOME/workspace/console" -product com.dameng.console.product -name Console

[dmdba@bogon tool]$

[dmdba@bogon tool]$

[dmdba@bogon tool]$

解决如下:

检查变量:

[dmdba@bogon tool]$ echo $DISPLAY

[dmdba@bogon tool]$ exit

logout

切回root设置:

[root@bogon ~]# export DISPLAY=:2

[root@bogon ~]# xhost +

xhost: unable to open display ":2"

[root@bogon ~]# export DISPLAY=:0

[root@bogon ~]# xhost +

access control disabled, clients can connect from any host

[root@bogon ~]# su - dmdba

切回dmdba用户

Last login: Tue Aug 3 11:12:37 CST 2021 on pts/4

[dmdba@bogon ~]$ export DISPLAY=:0

[dmdba@bogon ~]$ xhost +

access control disabled, clients can connect from any host

[dmdba@bogon ~]$ cd /dm8/tool/

[dmdba@bogon tool]$ ls

analyzer console dbca.sh dropins hs_err_pid62246.log manager.bmp p2 templates

analyzer.bmp console.bmp disql dts hs_err_pid62267.log monitor plugins version.sh

backup.xml core.62246 dmagent dts.bmp log4j.xml monitor.bmp restore.xml workspace

configuration core.62267 dmservice.sh dts_cmd_run.sh manager nca.sh server_connection.xml

再次执行:

[dmdba@bogon tool]$ ./console

更多资讯请上达梦技术社区了解:https://eco.dameng.com

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Linux 上使用 wxWidgets,并且使用 gtk_plug_new() 函数来嵌入 wxWidgets 应用程序可能会比较复杂,因为 wxWidgets 是一个跨平台的UI框架,它并不直接使用 GTK+ 的特定函数。 如果你希望将 wxWidgets 应用程序嵌入到一个现有的 GTK+ 窗口中,你需要使用 wxGTK 模块提供的函数来创建 wxWidgets 的顶级窗口,并使用 gtk_plug_new() 函数来创建一个插件窗口。然后,你可以通过将插件窗口嵌入到 GTK+ 窗口中,将 wxWidgets 应用程序显示在 GTK+ 窗口中。 以下是一个示例代码,展示了如何在 Linux 上使用 gtk_plug_new() 来嵌入 wxWidgets 应用程序: ```cpp #include <wx/wx.h> #include <gtk/gtk.h> class MyFrame : public wxFrame { public: MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title) { // 创建你的界面元素 // ... } }; class MyApp : public wxApp { public: virtual bool OnInit() override { // 初始化 GTK+ if (!wxApp::OnInit()) return false; gtk_init(nullptr, nullptr); // 创建 GTK+ 窗口 GtkWidget* gtkWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(GTK_WINDOW(gtkWindow), 800, 600); // 创建插件窗口 GtkWidget* plug = gtk_plug_new(0); gtk_container_add(GTK_CONTAINER(gtkWindow), plug); // 创建 wxWidgets 顶级窗口 MyFrame* frame = new MyFrame("My App"); frame->SetSize(800, 600); frame->Create(plug); // 显示 GTK+ 窗口 gtk_widget_show_all(gtkWindow); return true; } }; wxIMPLEMENT_APP(MyApp); ``` 在这个示例中,我们创建了一个自定义的 wxFrame 类 MyFrame,并在其中添加了一些界面元素。在 MyApp 类的 OnInit() 方法中,我们先调用 wxApp::OnInit() 来初始化 wxWidgets 和 GTK+,然后使用 gtk_window_new() 创建一个 GTK+ 窗口。接下来,我们使用 gtk_plug_new() 创建一个插件窗口,并将它添加到 GTK+ 窗口中。最后,我们创建了一个 MyFrame 实例,并将它的插件窗口设置为刚刚创建的插件窗口。最终,我们显示 GTK+ 窗口。 请注意,这只是一个简单的示例,实际上在将 wxWidgets 应用程序嵌入到 GTK+ 窗口中时还可能涉及到其他复杂的问题。如果你需要更多的控制权和灵活性,可能需要深入研究 wxWidgets 和 GTK+ 的文档,并根据自己的需求进行适当的调整和定制。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值