JDK-7142921 : (fs) Files.probeContentType reports a MIME type of "text/plain" on Ubuntu 11.04
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 7,8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: generic
  • Submitted: 2012-02-06
  • Updated: 2014-04-09
  • Resolved: 2012-12-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b68Fixed
Related Reports
Relates :  
Description
Test machine: sc11136070

Below test case fails on ubuntu only. It works well on Solaris
java/nio/file/Files/probeContentType/Basic.java

Command:
/net/koori/onestop/jtreg/4.1/promoted/latest/binaries/jtreg/linux/bin/jtreg -a -va -nr -w:$HOME/temp -r:$HOME/temp -jdk:/net/koori/onestop/jdk/8/latest/binaries/linux-amd64 -timeoutFactor:5 /net/koori/onestop/jdk/8/latest/ws/jdk/test/java/nio/file/Files/probeContentType/Basic.java

Log:
java.lang.RuntimeException: Unexpected type: text/plain
	at Basic.main(Basic.java:64)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:474)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:722)

JavaTest Message: Test threw exception: java.lang.RuntimeException: Unexpected type: text/plain
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: Unexpected type: text/plain

TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Unexpected type: text/plain

Comments
Need to be backported to jdk7u. The same issue there. 7u55 nightly. /net/scanas411.us.oracle.com/export/java-re/jdk/7u55/ea/RE/b00_2013-12-08-1601_484/ws-b00_2013-12-08-1601_484/build/linux-amd64 Also fails against JDK 7u45 #section:build ----------messages:(3/88)---------- command: build Basic reason: Named class compiled on demand elapsed time (seconds): 0.0 result: Passed. All files up to date #section:main ----------messages:(3/105)---------- command: main Basic reason: User specified action: run main/othervm Basic elapsed time (seconds): 0.133 ----------System.out:(1/42)---------- probe /tmp/foo2254241083627887494.html... ----------System.err:(13/723)---------- java.lang.RuntimeException: Unexpected type: text/plain at Basic.main(Basic.java:64) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94) at java.lang.Thread.run(Thread.java:744) JavaTest Message: Test threw exception: java.lang.RuntimeException: Unexpected type: text/plain JavaTest Message: shutting down test STATUS:Failed.`main' threw exception: java.lang.RuntimeException: Unexpected type: text/plain ----------rerun:(20/2024)*---------- DISPLAY=sc11152338.us.oracle.com:1 \\ HOME=/export/home/aurora/ \\ LANG=en_US.UTF-8 \\ PATH=/bin:/usr/bin \\ CLASSPATH=/export/home/aurora/sandbox/jtreg/lib/javatest.jar:/export/home/aurora/sandbox/jtreg/lib/jtreg.jar:/export/home/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/file/Files/probeContentType:/export/home/aurora/sandbox/testbase/test/java/nio/file/Files/probeContentType:/export/home/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/file:/export/home/aurora/sandbox/jdk/lib/tools.jar \\ /export/home/aurora/sandbox/jdk/bin/java \\ -Dtest.vm.opts='-d64 -d64 -ea -esa' \\ -Dcompile.jdk=/export/home/aurora/sandbox/jdk \\ -Dtest.src.path=/export/home/aurora/sandbox/testbase/test/java/nio/file/Files/probeContentType:/export/home/aurora/sandbox/testbase/test/java/nio/file \\ -Dtest.src=/export/home/aurora/sandbox/testbase/test/java/nio/file/Files/probeContentType \\ -Dtest.tool.vm.opts='-J-d64 -J-d64 -J-ea -J-esa' \\ -Dtest.class.path=/export/home/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/file/Files/probeContentType:/export/home/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/file \\ -Dtest.timeout.factor=4.0 \\ -Dtest.classes=/export/home/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/file/Files/probeContentType \\ -Dtest.class.path.prefix=/export/home/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/file/Files/probeContentType:/export/home/aurora/sandbox/testbase/test/java/nio/file/Files/probeContentType:/export/home/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/file \\ -Dtest.jdk=/export/home/aurora/sandbox/jdk \\ -Dtest.java.opts= \\ -Dtest.compiler.opts= \\ -d64 -d64 -ea -esa \\ com.sun.javatest.regtest.MainWrapper /export/home/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/file/Files/probeContentType/Basic.jta result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Unexpected type: text/plain test result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Unexpected type: text/plain
10-12-2013

Verified in b80
26-03-2013

EVALUATION The FileTypeDetector that we ship on Linux uses the GNOME APIs and they returning "text/plain" on this system where the test expects "text/html".
13-02-2012