Bug 183389 - [PATCH] java/openjdk7 fails using nio.ch.DefaultAsynchronousChannelProvider
Summary: [PATCH] java/openjdk7 fails using nio.ch.DefaultAsynchronousChannelProvider
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Greg Lewis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-28 10:20 UTC by Palle Girgensohn
Modified: 2013-10-30 05:14 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1.88 KB, patch)
2013-10-28 10:20 UTC, Palle Girgensohn
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Palle Girgensohn freebsd_committer 2013-10-28 10:20:00 UTC
Tomcat's latest version, 7.0.47, seems to have changed to use
sun/nio/ch/DefaultAsynchronousChannelProvider.java

with FreeBSD's openjdk, this fails with a java.lang.InternalError: platform not recognized

tomcat 7.0.42 workes fine, but surely doesn't use the asynchronous channel stuff from nio.

Fix: This is already fixed for MaxOS, using kqueue(2). Just changing to accept the 
same lib for FreeBSD *seems* to help. The test case works. Tomcat works. But since this is 
"Asynchrounous Channel", maybe some more tests would be appropriate?
How-To-Repeat: $ cat Foo.java
import java.nio.channels.AsynchronousServerSocketChannel;

class Foo {
   public static void main(String[] args) throws Exception {
       AsynchronousServerSocketChannel.open();
   }
}

$ javac Foo.java
$ java Foo
Exception in thread "main" java.lang.InternalError: platform not recognized
	at sun.nio.ch.DefaultAsynchronousChannelProvider.create(DefaultAsynchronousChannelProvider.java:55)
	at java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder$1.run(AsynchronousChannelProvider.java:88)
	at java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder$1.run(AsynchronousChannelProvider.java:79)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder.load(AsynchronousChannelProvider.java:78)
	at java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder.<clinit>(AsynchronousChannelProvider.java:75)
	at java.nio.channels.spi.AsynchronousChannelProvider.provider(AsynchronousChannelProvider.java:166)
	at java.nio.channels.AsynchronousServerSocketChannel.open(AsynchronousServerSocketChannel.java:138)
	at java.nio.channels.AsynchronousServerSocketChannel.open(AsynchronousServerSocketChannel.java:161)
	at Foo.main(Foo.java:5)

$ java -version
openjdk version "1.7.0_25"
OpenJDK Runtime Environment (build 1.7.0_25-b15)
OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mod
Comment 1 Edwin Groothuis freebsd_committer 2013-10-28 10:20:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->glewis

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2013-10-30 04:29:22 UTC
Author: glewis
Date: Wed Oct 30 04:29:14 2013
New Revision: 332063
URL: http://svnweb.freebsd.org/changeset/ports/332063

Log:
  . Fix DefaultAsynchronousChannelProvider.create to not crash on FreeBSD but
    to instead create an instance of BsdAsynchronousChannelProvider().
  
  PR:		183389
  Submitted by:	girgen@

Added:
  head/java/openjdk7/files/patch-src-solaris-classes-sun-nio-ch-DefaultAsynchronousChanneldProvider.java   (contents, props changed)
Modified:
  head/java/openjdk7/Makefile

Modified: head/java/openjdk7/Makefile
==============================================================================
--- head/java/openjdk7/Makefile	Wed Oct 30 04:27:40 2013	(r332062)
+++ head/java/openjdk7/Makefile	Wed Oct 30 04:29:14 2013	(r332063)
@@ -3,7 +3,7 @@
 
 PORTNAME=	openjdk
 PORTVERSION=	${JDK_MAJOR_VERSION}.${PORT_MINOR_VERSION}.${PORT_BUILD_NUMBER}
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	java devel
 MASTER_SITES=	http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}u${JDK_MINOR_VERSION}/promoted/b${JDK_BUILD_NUMBER}/ \
 		http://download.java.net/jaxp/1.4.5/:jaxp \

Added: head/java/openjdk7/files/patch-src-solaris-classes-sun-nio-ch-DefaultAsynchronousChanneldProvider.java
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/java/openjdk7/files/patch-src-solaris-classes-sun-nio-ch-DefaultAsynchronousChanneldProvider.java	Wed Oct 30 04:29:14 2013	(r332063)
@@ -0,0 +1,13 @@
+$FreeBSD$
+
+--- jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java.orig	2013-10-28 01:26:45.766774262 +0100
++++ jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java	2013-10-28 01:27:24.043766301 +0100
+@@ -50,7 +50,7 @@
+             return new SolarisAsynchronousChannelProvider();
+         if (osname.equals("Linux"))
+             return new LinuxAsynchronousChannelProvider();
+-        if (osname.contains("OS X"))
++        if (osname.contains("OS X") || osname.equals("FreeBSD"))
+             return new BsdAsynchronousChannelProvider();
+         throw new InternalError("platform not recognized");
+     }
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Greg Lewis freebsd_committer 2013-10-30 05:14:46 UTC
State Changed
From-To: open->closed

Committed. Thanks!