Bug 546000

Summary: Java web start is offered to be opened in Konqueror when Java is not installed
Product: [openSUSE] openSUSE 11.3 Reporter: Zsolt Sági <novell.admin>
Component: JavaAssignee: Michal Vyskocil <mvyskocil>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P4 - Low CC: wolfgang
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Java Web Start not working
Output of NSPR_LOG_MODULES=HelperAppService:5 firefox on KDE4 LiveCD 11.2RC1
NSPR_LOG_MODULES=HelperAppService:5 firefox with disabled kmozillahelper
NSPR_LOG_MODULES=HelperAppService:5 firefox on KDE4 LiveCD 11.4RC2
NSPR_LOG_MODULES=HelperAppService:5 firefox after sun java is installed
NSPR_LOG_MODULES=HelperAppService:5 firefox with disabled mozilla-xulrunner20-gnome

Description Zsolt Sági 2009-10-10 21:03:51 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; hu-HU; rv:1.9.1.3) Gecko/20090909 SUSE/3.5.3-2.1 Firefox/3.5.3

I run openSUSE 11.2 MI8 x86-64, and I experienced that neither Firefox not Konqueror can open .jnlp files. Firefox wants to open these files with Konqueror(!), and Konqueror just displays a text instead of opening them. The results are the same with both 64bit java 1.6 plugin and 32 bit java 1.5 plugin via nspluginwrapper. The Java Web Start application also cannot be started from KDE.

Reproducible: Always

Steps to Reproduce:
1. Start Firefox
2. Visit http://java.sun.com/javase/technologies/desktop/javawebstart/demos.html
3. Try to open any web start demo
Actual Results:  
Won't start

Expected Results:  
Should start
Comment 1 Zsolt Sági 2009-10-10 21:47:51 UTC
I realized that I can start .jnlp files from firefox by assigning them manually to javaws, however, I assume it should be the default in every browser.
Comment 2 Zsolt Sági 2009-10-12 10:53:06 UTC
According to http://www.javatester.org ordinary Java applets don't work either. Firefox wants to download the plugin (unsuccessfully), and Konqueror is also unable to start applets.

Some of my installed java-related packages:

milleniumfalcon:~ # rpm -qa | egrep -i '(java)|(wrapper)'
java-1_5_0-gcj-compat-1.5.0.0-107.10.x86_64
java-1_5_0-sun-1.5.0_update19-1.16.i586
java-1_5_0-sun-alsa-1.5.0_update19-1.16.i586
java-1_5_0-sun-plugin-1.5.0_update19-1.16.i586
nspluginwrapper-1.2.2-4.15.x86_64
Comment 3 Michal Vyskocil 2009-10-13 08:41:03 UTC
Hi,

first of all - don't use java-1_5_0-sun - it has no 64bit plugin and has been removed from 11.2 due the upcoming end of life in about 14 days. So remove it and install java-1_6_0-sun (or java-1_6_0-openjdk) instead which has a native 64bit plugin (the nspluginwrapper don't work with Java).

The jnlp handler for Firefox is registered in /etc/mailcap, but it should be suppressed by user's ~/.malcap or ~/.mime.types. Anyway when you'll have 1.6.0 Java, you'll get a working plugins and java webstart on 64bit systems.
Comment 4 Zsolt Sági 2009-10-13 17:58:58 UTC
(In reply to comment #3)
> Hi,
> 
> first of all - don't use java-1_5_0-sun - it has no 64bit plugin and has been
> removed from 11.2 due the upcoming end of life in about 14 days. So remove it
> and install java-1_6_0-sun (or java-1_6_0-openjdk) instead which has a native
> 64bit plugin (the nspluginwrapper don't work with Java).
> 
> The jnlp handler for Firefox is registered in /etc/mailcap, but it should be
> suppressed by user's ~/.malcap or ~/.mime.types. Anyway when you'll have 1.6.0
> Java, you'll get a working plugins and java webstart on 64bit systems.

I installed 64bit java 1.6.0 (the Sun version, since the openjdk version seems to be only able to run basic abblications), but Java Web Start support still has to be enabled manually (as I described above), despite the fact that after 64bit java installation I removed ~/.mozilla, and I don't have ~/.mailcap or ~/.mime.types and my /etc/mailcap is unchanged. (However, java applets started to work.)
Comment 5 Michal Vyskocil 2009-10-14 08:51:31 UTC
Can you provide the output of following commands

NSPR_LOG_MODULES=HelperAppService:5 firefox
grep jnlp /etc/mailcap
ls -lh /usr/bin/javaws

But basically this would work  the jnlp handler in /etc/mailcap points to /usr/bin/javaws, so if it exists, Java Web Start works as on my system (excluding exception from openjdk, as I'm running a devel snapshot).
Comment 6 Zsolt Sági 2009-10-15 16:53:52 UTC
Created attachment 322706 [details]
Java Web Start not working

(In reply to comment #5)
> Can you provide the output of following commands
> 
> NSPR_LOG_MODULES=HelperAppService:5 firefox
> grep jnlp /etc/mailcap
> ls -lh /usr/bin/javaws
> 
> But basically this would work  the jnlp handler in /etc/mailcap points to
> /usr/bin/javaws, so if it exists, Java Web Start works as on my system
> (excluding exception from openjdk, as I'm running a devel snapshot).





tamas@milleniumfalcon:~> NSPR_LOG_MODULES=HelperAppService:5 firefox
2047379216[7f8778d66040]: Here we do an extension lookup for 'js'
2047379216[7f8778d66040]: -- LookUpTypeAndDescription for extension 'js'
2047379216[7f8778d66040]: -- GetFileLocation.  Pref: 'helpers.private_mime_types_file'  EnvVar: '(null)'
2047379216[7f8778d66040]: -- GetTypeAndDescriptionFromMimetypesFile
2047379216[7f8778d66040]: Getting type and description from types file '~/.mime.types'
2047379216[7f8778d66040]: Using extension 'js'
2047379216[7f8778d66040]: -- CreateInputStream
2047379216[7f8778d66040]: Looking in GNOME registry
2047379216[7f8778d66040]: Got MIMEInfo from GNOME registry
2047379216[7f8778d66040]: Here we do an extension lookup for 'js'
2047379216[7f8778d66040]: -- LookUpTypeAndDescription for extension 'js'
2047379216[7f8778d66040]: -- GetFileLocation.  Pref: 'helpers.private_mime_types_file'  EnvVar: '(null)'
2047379216[7f8778d66040]: -- GetTypeAndDescriptionFromMimetypesFile
2047379216[7f8778d66040]: Getting type and description from types file '~/.mime.types'
2047379216[7f8778d66040]: Using extension 'js'
2047379216[7f8778d66040]: -- CreateInputStream
2047379216[7f8778d66040]: Looking in GNOME registry
2047379216[7f8778d66040]: Got MIMEInfo from GNOME registry
2047379216[7f8778d66040]: Here we do an extension lookup for 'js'
2047379216[7f8778d66040]: -- LookUpTypeAndDescription for extension 'js'
2047379216[7f8778d66040]: -- GetFileLocation.  Pref: 'helpers.private_mime_types_file'  EnvVar: '(null)'
2047379216[7f8778d66040]: -- GetTypeAndDescriptionFromMimetypesFile
2047379216[7f8778d66040]: Getting type and description from types file '~/.mime.types'
2047379216[7f8778d66040]: Using extension 'js'
2047379216[7f8778d66040]: -- CreateInputStream
2047379216[7f8778d66040]: Looking in GNOME registry
2047379216[7f8778d66040]: Got MIMEInfo from GNOME registry
2047379216[7f8778d66040]: Here we do an extension lookup for 'js'
2047379216[7f8778d66040]: -- LookUpTypeAndDescription for extension 'js'
2047379216[7f8778d66040]: -- GetFileLocation.  Pref: 'helpers.private_mime_types_file'  EnvVar: '(null)'
2047379216[7f8778d66040]: -- GetTypeAndDescriptionFromMimetypesFile
2047379216[7f8778d66040]: Getting type and description from types file '~/.mime.types'
2047379216[7f8778d66040]: Using extension 'js'
2047379216[7f8778d66040]: -- CreateInputStream
2047379216[7f8778d66040]: Looking in GNOME registry
2047379216[7f8778d66040]: Got MIMEInfo from GNOME registry
*** nss-shared-helper: Shared database disabled (set NSS_USE_SHARED_DB to enable).


tamas@milleniumfalcon:~> grep jnlp /etc/mailcap
application/x-java-jnlp-file;/usr/bin/javaws "%s"
type=application/x-java-jnlp-file; description="Java Web Start"; exts="jnlp"
type=application/x-java-jnlp-file; description="Java Web Start"; exts="jnlp"
type=application/x-java-jnlp-file; description="Java Web Start"; exts="jnlp"
type=application/x-java-jnlp-file; description="Java Web Start"; exts="jnlp"
type=application/x-java-jnlp-file; description="Java Web Start"; exts="jnlp"
type=application/x-java-jnlp-file; description="Java Web Start"; exts="jnlp"
type=application/x-java-jnlp-file; description="Java Web Start"; exts="jnlp"
type=application/x-java-jnlp-file; description="Java Web Start"; exts="jnlp"
type=application/x-java-jnlp-file; description="Java Web Start"; exts="jnlp"


tamas@milleniumfalcon:~> ls -lh /usr/bin/javaws
lrwxrwxrwx 1 root root 24 okt 13 19.30 /usr/bin/javaws -> /etc/alternatives/javaws
tamas@milleniumfalcon:~> ls -lh /etc/alternatives/javaws
lrwxrwxrwx 1 root root 39 okt 13 19.30 /etc/alternatives/javaws -> /usr/lib64/jvm/jre-1.6.0-sun/bin/javaws
tamas@milleniumfalcon:~> ls -lh /usr/lib64/jvm/jre-1.6.0-sun/bin/javaws
-rwxr-xr-x 1 root root 91K júl  3 01.00 /usr/lib64/jvm/jre-1.6.0-sun/bin/javaws
Comment 7 Michal Vyskocil 2009-10-16 09:11:52 UTC
Wolfgang: can you look at it? From my POW is everything OK and it should work. I running on KDE too, but Firefox runs a javaws directly.
Comment 8 Wolfgang Rosenauer 2009-10-16 09:21:39 UTC
Probably I missed something but the above output always shows "js" as extension and not jnlp.
So I see two things:
The webservice doesn't send a mimetype (is it loaded just from a file?) or is the webserver broken?
The file extension is js which I don't believe is a valid extension to identify a jnlp file?
Comment 9 Zsolt Sági 2009-10-16 09:34:07 UTC
Still does not work in 32 bit RC1 from KDE live CD.
Comment 10 Michal Vyskocil 2009-10-16 09:59:41 UTC
(In reply to comment #8)
> Probably I missed something but the above output always shows "js" as extension
> and not jnlp.
> So I see two things:
> The webservice doesn't send a mimetype (is it loaded just from a file?) or is
> the webserver broken?
> The file extension is js which I don't believe is a valid extension to identify
> a jnlp file?

I tested a http://java.sun.com/javase/technologies/desktop/javawebstart/demos.html mentioned in initial comment and all demos has a valid mime type application/x-java-jnlp-file and everything works (after removal of previous user defined garbage).

(In reply to comment #9)
> Still does not work in 32 bit RC1 from KDE live CD.

I'll recheck the LiveCD asap.
Comment 11 Wolfgang Rosenauer 2009-10-16 10:07:01 UTC
Hmm, haven't I explained why it doesn't work for Tamas (most likely)?

Michal, I understand all is working for you with your testcases.
Tamas, it's not working for you and the debug information above suggests that the testcase is broken. A JS file is not recognized as a JNLP file. It's that simple, isn't it?
Comment 12 Michal Vyskocil 2009-10-16 10:14:47 UTC
Created attachment 322839 [details]
Output of NSPR_LOG_MODULES=HelperAppService:5 firefox on KDE4 LiveCD 11.2RC1

This is an output from LiveCD, Firefox offers an Konqueror, even if I'm not sure why.
Comment 13 Michal Vyskocil 2009-10-16 10:19:07 UTC
(In reply to comment #11)
> Hmm, haven't I explained why it doesn't work for Tamas (most likely)?
> 
> Michal, I understand all is working for you with your testcases.

It works on my machine uses Factory (a lot of zypper dup, rpm -e, so it's maybe not a best one :). Please look at the attachment in comment#12 - it's reproducible on KDE LiveCD.
Comment 14 Wolfgang Rosenauer 2009-10-16 10:27:39 UTC
Ok, the log output looks sane. It finds the entry in mailcap. So that part seems to work. Not quite sure where konqueror comes into play but I have a suspicion.
The mailcap stuff gets overridden by gnomevfs "usually". I'm pretty sure there is no jnlp configuration in that though.
So now what can be the issue is mozilla-xulrunner191-kde4 as a new implementation as it tries to get apps from KDE's config and leaves out gnomevfs for that.

Can you make sure that /usr/lib/mozilla/kmozillahelper cannot be loaded on the live cd and try again after restarting Firefox?
Comment 15 Michal Vyskocil 2009-10-16 11:29:09 UTC
Created attachment 322851 [details]
NSPR_LOG_MODULES=HelperAppService:5 firefox with disabled kmozillahelper

Hi Wolfgang, thanks for your great support. chmod 000 on /usr/lib/kmozillahelper helped. After this and zypper in java-1_6_0-sun-plugin, the next restart of Firefox offered me /usr/bin/javaws and webstart application worked well as expected. Please reassign bug to proper maintainer for tracking, I'm not sure if it would go to you, bnc-team-mozilla, or gnome-maintainers.
Comment 16 Lubos Lunak 2009-10-16 12:39:19 UTC
If I'm getting it right, .jnlp is a filetype for starting java apps from the net. It is correct that KDE is asked for the handler app for it, but as soon as something to handle it is installed (java-1-6-0-openjdk), the first choice is 'IcedTea Web Start'. Konqueror is only second in that second, it is first only when there is no real handler for it. So, in the "normal" case everything works.

When the proper java handler is not installed, KDE also offers Konqueror, KWrite and OpenOffice.org Writer as handlers. This is because application/x-java-jnlp-file mimetype claims to be a subclass of the application/xml mimetype (which Konqueror claims to support), and this one in turn claims to be a subclass of the text/plain mimetype (which KWrite and Writer claim to support).

I assume what happens without KDE integration is that Firefox itself fails to recognize other handlers for the mimetype and does whatever it does. I don't quite see what to do here. Not obeying inheritance would e.g. prevent offering kwrite for .spec files.
Comment 17 Wolfgang Rosenauer 2009-10-16 12:51:03 UTC
Basically right. I understood that the Java which supports JNLP is actually installed though? If not there is no problem with Konqueror being offered (while it's still a bit strange in that case).

Firefox w/o KDE integration does:
- ask gnome-vfs
- ask personal mailcap/mime-types
- ask system mailcap/mime-types
until one of them knows an answer.

Firefox w/ KDE integration replaces the first step and mailcap/mime-types is not used anymore if that returns something.
Comment 18 Zsolt Sági 2009-10-16 13:17:44 UTC
I've found something similar: https://bugzilla.novell.com/show_bug.cgi?id=547625

And please also don't forget that Konqueror is absolutely unable to open .jnlp web start files yet!
Comment 19 Michal Vyskocil 2009-10-16 13:40:46 UTC
(In reply to comment #18)
> And please also don't forget that Konqueror is absolutely unable to open .jnlp
> web start files yet!

As Lubos explained inc comment#16 - Konqueror is offered only^ if no Java Webstart is installed (and LiveCD doesn't contains Sun nor openjdk Java by default). In this case Konqueror only show up an jnlp file as a normal xml file. It'd be considered as strange, but intended, behavior.

^ I'm talking about case with disabled /usr/lib/kmozillahelper


*reassigning to bnc-team-mozilla
Comment 20 Zsolt Sági 2009-10-16 13:53:53 UTC
> As Lubos explained inc comment#16 - Konqueror is offered only^ if no Java
> Webstart is installed.

I observed this symptom while java was installed and javaws was in place. I could even open .jnlp files, but to achieve this, I had to manually instruct FireFox to use the command javaws.

Konqueror is still totally unable to open .jnlp files despite the fact that I saved javaws permanently as the application to handle web start stuff.
Comment 21 Zsolt Sági 2010-10-18 11:31:31 UTC
Still applies to 11.3 final.
Comment 22 Michal Vyskocil 2010-10-19 08:56:51 UTC
Hi Tamás, still not able to reproduce your problem. Firefox is able to open jnlp with Java installed and in case it not, it offers Konqueror as a XML viewer, not a browser for launching of jnlp files.
Comment 23 Zsolt Sági 2011-02-18 12:46:48 UTC
(In reply to comment #22)
> Hi Tamás, still not able to reproduce your problem. Firefox is able to open
> jnlp with Java installed and in case it not, it offers Konqueror as a XML
> viewer, not a browser for launching of jnlp files.

What about trying it on a freshly installed openSUSE 11.4 RC1 (with newly ceated home directory, thus using default settings)? This bug still applies to 11.4 RC1!
Comment 24 Zsolt Sági 2011-02-18 12:54:17 UTC
BTW I'm using java-1_6_0-sun-1.6.0.u23-2.11.x86_64
Comment 25 Michal Vyskocil 2011-03-01 12:39:04 UTC
Hi wolfgang, I can this reproduce using latest KDE LiveCD - the Konqueror is offered everytime despite the fact, Java is or is not installed.

There's a following entry in /etc/mailcap

application/x-java-jnlp-file;/usr/bin/javaws "%s"

And there's nothing like kde integration, or personal .mailcap. Can you check following logs from firefox?
Comment 26 Michal Vyskocil 2011-03-01 12:45:22 UTC
Created attachment 416777 [details]
NSPR_LOG_MODULES=HelperAppService:5 firefox on KDE4 LiveCD 11.4RC2
Comment 27 Michal Vyskocil 2011-03-01 12:45:52 UTC
Created attachment 416778 [details]
NSPR_LOG_MODULES=HelperAppService:5 firefox after sun java is installed
Comment 28 Michal Vyskocil 2011-03-01 12:46:20 UTC
Created attachment 416779 [details]
NSPR_LOG_MODULES=HelperAppService:5 firefox with disabled mozilla-xulrunner20-gnome
Comment 29 Wolfgang Rosenauer 2011-03-01 13:02:19 UTC
I'm not sure if we reflect the KDE integration in the logging. I'll check that.

"And there's nothing like kde integration"
on KDE LiveCD? Why not? I guess the supposed behaviour is to use KDE integration always when running under KDE. So only KDE's answer is authoritative. Issue is that we cannot see it in the log.
Lubos, is there an easy way to ask KDE what it returns for certain mimetypes for debugging purposes? The other way might be stepping with a gdb through the relevant parts to see it. I'll check with my 11.4 VM if I can reproduce it also.
Comment 30 Lubos Lunak 2011-03-01 13:38:59 UTC
(In reply to comment #29)
> Lubos, is there an easy way to ask KDE what it returns for certain mimetypes
> for debugging purposes?

You can run 'keditfiletype <mimetype>' to see KDE's preferences for a mimetype.
Comment 31 Michal Vyskocil 2011-03-01 14:37:33 UTC
(In reply to comment #29)
> I'm not sure if we reflect the KDE integration in the logging. I'll check that.
> 
> "And there's nothing like kde integration"
> on KDE LiveCD? Why not? I guess the supposed behaviour is to use KDE
> integration always when running under KDE.

My bad, I thought it's in mozilla-xulrunner20-kde4 - the mozilla-kde4-integration is installed.


(In reply to comment #30)
> (In reply to comment #29)
> > Lubos, is there an easy way to ask KDE what it returns for certain mimetypes
> > for debugging purposes?
> 
> You can run 'keditfiletype <mimetype>' to see KDE's preferences for a mimetype.

And it returns Konqueror. The reason is in missing MimeType in /usr/share/applications/jpackage-java-1_6_0-sun.desktop. The reason why it ever worked for me was the javaws.desktop file from openjdk package.

Tamas: as quick fix please add a following line to the desktop file
MimeType=application/x-java-jnlp-file;

rerun kbuildsysoca4

and the it will work.

Lubos, Wolfgang, thanks for your help.
Comment 32 Michal Vyskocil 2011-03-01 14:43:57 UTC
BTW: sent to Factory by request 63156. Released openSUSE (including 11.4) will be fixed in next maintenance update.
Comment 33 Michal Vyskocil 2011-04-19 08:42:51 UTC
already fixed in factory