GConf Error: Failed to contact configuration server

Hi.
I developed a java application to organize the articles and notes for what I need for my work reports.
The path appear in a jlist component and by clicking on I’d like the file opened.
The application works fine in /home side.
In /root side I get this message error:
“GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon.”
I work in KDE (OpenSuse 11.4). Why I need a configuration tipically of GNOME?
Many thanks in advance for the help.

To begin with, I do not know anything about writing Java applications, thus I read this noly as that you are running an application.

Then when I understand you correct, you say it runs when in /home, you probably meaning being within the home directory of a user (/home/<username>) being that user, or is my assumption wrong?

Then you say it does not run when you are in /root, with is the home directory of the root user. Thus suggesting that you run then as root (else you would not even have access to /root). Why do you even have the idea of running an application as root?

I am sorry. I’ll try to be clearer.
The application resides in /usr/local/myfolder.
Briefly, among other options, I can choose from a list of paths to files shown in a JList component.
By clicking on the path I would like to open the file with the application system configured to do so (Okular or Acrobat Reader for .pdf file, Kwrite for .txt file and so on).
But I get this message error:
“GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon.”
The error is not a question of permissions: I get the same in user mode and in superuser mode.
I work in OpenSuse 11.4 with KDE.
Configuring GConf, I believe, is typical of GNOME and I don’t know how to handle it.
Can you help me to find a solution, examples about GConf configuration or documentation?
Many thanks.

I am myself a developer working with java, but I fail to see what you really
do and therefore do not understand your problem. You may want to install
gconf-editor to look into your gconf settings. And the general documentation
can be found here
http://www.gnome.org/projects/gconf/

Google spits out a lot of results on that error, without more details from
your side (a detailed description what you really do step by step) I cannot
help much more. Maybe you have simply a problem with wrong rights of some
configuration files like this
https://bugs.launchpad.net/ubuntu/+source/gconf/+bug/367169


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.5 | nVidia
ION | 3GB Ram

I can’t answer fully, but maybe I can give you some pointers.

> I work in KDE (OpenSuse 11.4). Why I need a configuration tipically of
> GNOME?

Most probably because whatever application you are running makes use of
some Gnome library, which tries to phone home :slight_smile:

Do you perhaps have some Gnome components installed but not its basic
infrastructure? (i.e. broken dependencies?)

> “GConf Error: Failed to contact configuration server; the most common
> cause is a missing or misconfigured D-Bus session bus daemon.”

When I get that error, it is because I have used su in a terminal to
become another user, and then started a graphical application that uses
Gnome libraries. The application can’t make use of the original
logged-in user’s session information. (which makes sense from a security
point of view)

> The application works fine in /home side.
> In /root side I get this message error:

I don’t understand what you mean by this, especially in the context of:

> The error is not a question of permissions: I get the same in user
> mode and in superuser mode.

I think you need to provide more information about your code, preferably
a cut-down, minimal example program that compiles and shows the problem.

Well.
My project is a desktop application which manages data stored in a database. (Hibernate, swing).
I used all the canonical stuff for this kinds of applications: main window, forms, text and area fields, buttons and so on.
In a form showing data got from the database there is a Jlist component displaying the paths of files added to increase documentation. For example: /home/name/mydir/WhatHappened.pdf
The code is very simple as you can see.

private void jList1MouseClicked(java.awt.event.MouseEvent evt) {
String valore = jList1.getSelectedValue().toString();
try{
File file = new File(valore);
if(file.exists() && Desktop.isDesktopSupported()){
Desktop.getDesktop().open(file);
}else{
Chiusure c = new Chiusure();
c.fileNoEsiste();
}
}catch(Exception ex){
System.out.println("La causa: “+ex.getCause() +” il messaggio: "+ex.getMessage());

    }
  }                

In development environment (Netbeans 7.0) the files are opened without problem.
If I launch application from the .jar I get the annoying error message that’s question of my posts.
I hope to have been clear.
Many thanks in advance.

Ok, now I understand what you are after. From reading your code it should
work as you expect out of the box. I can test later today since I do not sit
now in front of my development machine (I never needed to use the Desktop
class to invoke the standard application to open a file on linux until now
only on windows, but I am interested to see what happens on linux).
By the way can you answer in the meantime the following question (not sure
if it makes any difference at all): Are you using openJDK or the sun/oracle
java version in netbeans and directly on your system? Depending on your
settings in the IDE they may differ.
When I am back at my PC I hope I can tell you more.


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.5 | nVidia
ION | 3GB Ram

martin_helm wrote:
> When I am back at my PC I hope I can tell you more.
>
I cannot reproduce your problem (it works with openJDK and with the oracle
java version, I tested on two machines now - see below which i used), so I
am a bit clueless now what your problem can be, it seems not to be your
program but something outside of java seems to be misconfigured


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.5 | nVidia
ION | 3GB Ram

Hi there,

I am having exactly the same problem, but it is not related to java development. If I do make myself root (su) and call any application (emacs, …) I get the following message:

GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See GConf configuration system for information. (Details - 1: Failed to get connection to session: The connection is closed)
g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.
Terminated

I recently changed from 11.2 to 11.4. Of course I was expecting such simple basic things to run out of the box …

CU

Ingolf

On 2011-09-30 07:16, inmaho wrote:
>
> Hi there,
>
> I am having exactly the same problem, but it is not related to java
> development. If I do make myself root (su) and call any application
> (emacs, …) I get the following message:

Use “su -”.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Hi Carlos,

thanks a lot, that did the trick. I take it from the man page, that this minus makes it a login shell.

Of course you can guess the next question…

What would I have to do to change the default behavior if I call su that its a login shell without giving the minus. Should I make an alias?

Again thanks

Ingolf

On 2011-09-30 19:46, inmaho wrote:

> Of course you can guess the next question…
>
> What would I have to do to change the default behavior if I call su
> that its a login shell without giving the minus. Should I make an
> alias?

Get yourself accustomed to use the dash :slight_smile:

Of course you can use an alias, but then you will forget about it and not
use it on another computer or system.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

This one saved my day, have been wading the google hits for this error message.

// Bojm