Skip to main content

Can't execute native browser. ErrMsg is null

9 replies [Last post]
forcypal
Offline
Joined: 2006-02-17

This problem seems to have come up quite a few times in this forum and I don't seem to be able to find a solution to it.

I am using Mozilla 1.4.1 and Java SE 1.4.2_03 on SuSE 9.1

The script I use to launch the SimpleBrowser demo is:

-- START --

#!/bin/bash

JDIC_HOME=/root/jdic
export JDIC_HOME

MOZILLA_FIVE_HOME=/usr/local/mozilla
export MOZILLA_FIVE_HOME

JAVA_HOME=/usr/lib/java
export JAVA_HOME

J2SDK_HOME=$JAVA_HOME/bin
export J2SDK_HOME

JRE_HOME=$JAVA_HOME/jre/bin
export JRE_HOME

PATH=$J2SDK_HOME:$JRE_HOME:$MOZILLA_FIVE_HOME:$JDIC_BANIARIES:$JDIC_HOME:$PATH
export PATH

LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME
export LD_LIBRARY_PATH

java -classpath $JDIC_HOME:. -Djava.library.path=$JDIC_HOME SimpleBrowser

-- END --

This results in a empty Java window being displayed and the following message printed to the console window:

Can't execute native browser. ErrMsg is null

There are no other messages of any type.

I'm at a dead end, can anyone help??

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
forcypal
Offline
Joined: 2006-02-17

I added the follwowing line to the SimpleBrowser.java:

webBrowser.setDebug(true);

and recompiled it with:

javac -classpath ../../jdic.jar:. SimpleBrowser

When I execute the run.browser script now I get:

-- START --

*** Jtrace: Executing mozembed-linux-gtk1.2 -port=33004
*** Jtrace: connecting ... 0
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 1
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 2
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 3
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 4
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 5
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 6
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 7
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 8
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 9
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 10
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 11
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 12
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 13
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 14
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 15
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 16
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 17
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 18
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 19
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 20
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 21
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 22
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 23
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 24
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 25
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 26
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 27
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 28
*** Jtrace: java.net.ConnectException: Connection refused
*** Jtrace: connecting ... 29
*** Jtrace: java.net.ConnectException: Connection refused
Can't connect to native browser. ErrMsg is null
*** Jtrace:
MyFocusListener: focusGained

*** Jtrace:
MyFocusListener: focusLost

*** Jtrace:
MyFocusListener: focusGaine

-- END --

Hope this helps.

georgez
Offline
Joined: 2003-08-19

Hi,

Now I was confused. But it's not the platform problem, as the platform-dependent part (mozembed-linux-gtk*) works. As I said, the java side then communicates with it using socket.

From the debug message, that mozembed-linux-gtk* does run, but the socket connection from java fails. I can just guess that it's caused by the slowness of mozembed-linux-gtk startup. But this seems unreseanable because it's running on Linux.

So, I didn't find the reason from the code. Would you help to check it using another Linux machine? I'm quite ready to figure out this problem, but can't reproduce it in my place. It might happen in other places as well.

Thanks,

-George.

bd
Offline
Joined: 2004-11-26

Has anyone solved this problem? I'm getting the same thing with SuSE 9.0 and mozilla 6.0 and mozilla 7.3

Thanks

georgez
Offline
Joined: 2003-08-19

Hi,

The problem is, JDIC Browser needs to find the default browser (mozilla) path to use it. In your environment, it should work if your running mozilla is set as the default browser (6.0 or 7.3). You know, you can run any version of mozilla binary without setting it as the system default browser.

Please set this running browser as the default browser by specifing its (/usr/local/mozilla ?) in Launch menu -> Preferences -> Advanced -> Preferred Applications -> Web Browser -> Custom Web Browser -> Command, the complete command should be: /usr/local/mozilla %s. (remember this %s). OR, add the binary path (/usr/local/) to $PATH. JDIC Browser will check these settings.

If the native files (jdic.so, mozembed-***) locate at the same location as the jdic.jar file, there are no other required settings.

Please try it out, and give your feedback.

Thanks,
-George.

bd
Offline
Joined: 2004-11-26

Yes, that's the solution. (I was sure I'd tried that, but apparently not).

Thanks

forcypal
Offline
Joined: 2006-02-17

Right...

Just in case this is a problem with my installation of SuSE I have re-installed a FULL installion of SuSE 9.1 with all libraries and packages on the SuSE 9.1 DVD. I also did a FULL update of all packages using the SuSE online update tool (this took a while)

I logged on as root to a GNOME 2.4 session and downloaded and installed both Mozilla 1.4.1 (/usr/local/mozilla) and JDIC 0.8.6.1 (/root/Build/JDIC-0.8.6.1-bin.linux).

I set the default browser using the following method:

Applications -> Desktop Preferences -> Advanced -> Preferred Applications -> Custom Web Browser = /usr/local/mozilla %s

I wrote a new launch script to run the demo called "run.browser" which I run from the JDIC home directory:

-- START --

#!/bin/bash

JDIC_DEMO=SimpleBrowser
export JDIC_DEMO

JDIC_HOME=/root/Build/jdic-0.8.6.1-bin-linux
export JDIC_HOME

LD_LIBRARY_PATH=$JDIC_HOME
export LD_LIBRARY_PATH

PATH=$JDIC_HOME:$PATH
export PATH

CLASSPATH=$JDIC_HOME/jdic.jar:$JDIC_HOME/demo/$JDIC_DEMO
export CLASSPATH

java $JDIC_DEMO

-- END --

On execution of this script I get the following error:

-- START --

org.jdesktop.jdic.init.JdicInitException: org.jdesktop.jdic.init.JdicInitException: Can't locate the native browser path!
at org.jdesktop.jdic.init.JdicManager.initBrowserNative(Unknown Source)
at org.jdesktop.jdic.browser.WebBrowser.(Unknown Source)
at SimpleBrowser.main(Unknown Source)
Caused by: org.jdesktop.jdic.init.JdicInitException: Can't locate the native browser path!
... 3 more

-- END --

I then set the default browser to the actual mozilla 1.4.1 binary which is:

/usr/local/mozilla/mozilla %s

and I get the same old error message:

Can't execute native browser. ErrMsg is null

I am determined to resolve this! ;-)

Any further ideas?

forcypal
Offline
Joined: 2006-02-17

I am using JDIC 0.8.6.1

The "mozembed-linux-gtk1.2 -test" worked fine. The java window displayed correctly and I could navigate to a Web page.

I am still getting the "Can't execute native browser. ErrMsg is null" error message when trying to run the SimpleBrowser demo.

Any ideas?

georgez
Offline
Joined: 2003-08-19

Hi,

This is strange. I verified in my place with below script:
-- START of run.browser --
#!/bin/bash

JDIC_HOME=/tmp/jdic-0.8.6.1-bin-linux
export JDIC_HOME

MOZILLA_FIVE_HOME=/usr/local/mozilla-1.4.1
export MOZILLA_FIVE_HOME

PATH=$MOZILLA_FIVE_HOME:$JDIC_HOME:$PATH
export PATH

LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME
export LD_LIBRARY_PATH

java -classpath $JDIC_HOME/jdic.jar:. -Djava.library.path=$JDIC_HOME SimpleBrowser
-- END --

/tmp/jdic-0.8.6.1-bin-linux/demo/SimpleBrowser>run.browser
Both the Browser and SimpleBrowser worked fine.

To help check it again, please follow below instructions strictly:
https://jdic.dev.java.net/documentation/README.html#Installation

for 0.8.6.1, there is no need to set MOZILLA_FIVE_HOME or add it to LD_LIBRARY_PATH. If it's not set, the code will try to check the default browser and set these variables.
So, please set this browser as the default browser by specifing the browser path (/usr/local/mozilla ?) in Launch menu -> Preferences -> Advanced -> Preferred Applications -> Web Browser -> Custom Web Browser -> Command, the complete command should be: /usr/local/mozilla %s. (remember this %s)

Then:
1. Add jdic.jar to CLASSPATH.
2. Add the directory of native libraries (*.so) toLD_LIBRARY_PATH (on Linux/Solaris), and add the directory of native executable files (mozembed- 3. Go to demo/SimpleBrowser directory, run "java SimpleBrowser".

It should work.

By the way, the "mozembed--gtk*" is a modified TestGtkEmbed bundled in Mozilla releases, which is actually a C++ app. The java side communicates with it using socket.

Thanks,
-George.

georgez
Offline
Joined: 2003-08-19

Hi,

I'm sorry for the problem. The settings seem fine. What JDIC version are you using?

With all the settings, please try to run "mozembed-linux-gtk1.2 -test" (for mozilla using gtk1.2) or "mozembed-linux-gtk2 -test" (for mozilla using gtk2), which
should be under /root/jdic. If it runs successfully, there should be a popup window.

The JDIC Browser works as an out-process way: the java side communicates with the standalone, running mozembed-linux-gtk*.

If it doesn't run, there might be another problem: mozembed-linux-gtk1.2 or mozembed-linux-gtk2 losts the executable permission. Then please try to "chmod +x mozembed-linux-gtk*" and run it again.

By the way, with the latest JDIC release 0.8.6.1 (for Linux), the Browser works with mozilla 1.4 through 1.8a4:
http://www.javadesktop.org/forums/thread.jspa?threadID=5587&tstart=0

Please give me your feedback. I want to figure out the problem.

Thanks,
-George.