- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我在 Mac OS X 10.7.5 上使用 Java 1.7。它会在执行触及任何 ImageIO API 时挂起。
import javax.imageio.ImageIO;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
public class ImageMain implements IApplication {
@Override
public Object start(IApplicationContext context) throws Exception {
ImageIO.getCacheDirectory();
return IApplication.EXIT_OK;
}
@Override
public void stop() {
// TODO Auto-generated method stub
}
}
jstack 输出:
013-12-03 11:37:57 Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.0-b56 mixed mode):
"Attach Listener" daemon prio=5 tid=0x00007fbada8c5000 nid=0x8a23 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Worker-JM" prio=5 tid=0x00007fbadb941000 nid=0x6007 in Object.wait() [0x0000000116ee6000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000007f85bf428> (a java.util.ArrayList)
at org.eclipse.core.internal.jobs.InternalWorker.run(InternalWorker.java:58)
- locked <0x00000007f85bf428> (a java.util.ArrayList)
"Start Level Event Dispatcher" daemon prio=5 tid=0x00007fbadb92c800 nid=0x5d03 in Object.wait()[0x0000000115bbf000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00000007f96b2838> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread) at java.lang.Object.wait(Object.java:503) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent(EventManager.java:400) - locked <0x00000007f96b2838> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:336)
"State Saver" prio=5 tid=0x00007fbadb895800 nid=0x5b03 in Object.wait() [0x0000000115ab7000]
java.lang.Thread.State: RUNNABLE
at sun.awt.AppContext$2.run(AppContext.java:271)
at sun.awt.AppContext$2.run(AppContext.java:260)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.initMainAppContext(AppContext.java:260)
at sun.awt.AppContext.access$200(AppContext.java:133)
at sun.awt.AppContext$3.run(AppContext.java:314)
at sun.awt.AppContext$3.run(AppContext.java:298)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.getAppContext(AppContext.java:297)
at sun.awt.AppContext$6.getContext(AppContext.java:841)
at sun.misc.SharedSecrets.getJavaAWTAccess(SharedSecrets.java:200)
at java.util.TimeZone.getDefaultInAppContext(TimeZone.java:730)
at java.util.TimeZone.getDefaultRef(TimeZone.java:620)
at java.util.Date.normalize(Date.java:1193)
at java.util.Date.toString(Date.java:1027)
at java.util.Properties.store0(Properties.java:823)
at java.util.Properties.store(Properties.java:812)
at org.eclipse.osgi.storagemanager.StorageManager.save(StorageManager.java:551)
at org.eclipse.osgi.storagemanager.StorageManager.update(StorageManager.java:310)
at org.eclipse.osgi.storagemanager.StorageManager.closeOutputStream(StorageManager.java:903)
at org.eclipse.osgi.storagemanager.ManagedOutputStream.close(ManagedOutputStream.java:52)
at java.io.FilterOutputStream.close(FilterOutputStream.java:160)
at java.io.FilterOutputStream.close(FilterOutputStream.java:160)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.saveBundleDatas(BaseStorage.java:598)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.saveAllData(BaseStorage.java:461)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage$StateSaver.run(BaseStorage.java:1306)
- locked <0x00000007f96b8c48> (a org.eclipse.osgi.internal.resolver.SystemState)
at java.lang.Thread.run(Thread.java:724)
"Framework Event Dispatcher" daemon prio=5 tid=0x00007fbadb948000 nid=0x5903 in Object.wait() [0x00000001159b6000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000007f96b2520> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
at java.lang.Object.wait(Object.java:503)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent(EventManager.java:400)
- locked <0x00000007f96b2520> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:336)
"State Data Manager" daemon prio=5 tid=0x00007fbadb828000 nid=0x5703 waiting for monitor entry [0x00000001158b3000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.eclipse.osgi.internal.baseadaptor.StateManager.run(StateManager.java:303)
- waiting to lock <0x00000007f96b8c48> (a org.eclipse.osgi.internal.resolver.SystemState)
at java.lang.Thread.run(Thread.java:724)
"Framework Active Thread" prio=5 tid=0x00007fbadb05b800 nid=0x5503 in Object.wait() [0x00000001157b0000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000007f96b7310> (a org.eclipse.osgi.framework.internal.core.Framework)
at org.eclipse.osgi.framework.internal.core.Framework.run(Framework.java:1862)
- locked <0x00000007f96b7310> (a org.eclipse.osgi.framework.internal.core.Framework)
at java.lang.Thread.run(Thread.java:724)
"Service Thread" daemon prio=5 tid=0x00007fbad9806000 nid=0x4f03 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread1" daemon prio=5 tid=0x00007fbadc001800 nid=0x4d03 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" daemon prio=5 tid=0x00007fbadb829800 nid=0x4b03 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"JDWP Command Reader" daemon prio=5 tid=0x00007fbadd002000 nid=0x4903 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"JDWP Event Helper Thread" daemon prio=5 tid=0x00007fbadd000000 nid=0x4703 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"JDWP Transport Listener: dt_socket" daemon prio=5 tid=0x00007fbadb828800 nid=0x4503 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" daemon prio=5 tid=0x00007fbadb81a000 nid=0x4303 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" daemon prio=5 tid=0x00007fbadb803000 nid=0x3a03 in Object.wait() [0x0000000114b56000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000007f96e30b0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
- locked <0x00000007f96e30b0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:189)
"Reference Handler" daemon prio=5 tid=0x00007fbadb800800 nid=0x3803 in Object.wait() [0x0000000114a53000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000007f96e2af8> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:503)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
- locked <0x00000007f96e2af8> (a java.lang.ref.Reference$Lock)
"main" prio=5 tid=0x00007fbad9041000 nid=0x707 runnable [0x00007fff6ccd1000]
java.lang.Thread.State: RUNNABLE
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
- locked <0x00000007f96e20e0> (a java.util.Vector)
- locked <0x00000007f96a0ad8> (a java.util.Vector)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1843)
at java.lang.Runtime.load0(Runtime.java:795)
- locked <0x00000007f9727830> (a java.lang.Runtime)
at java.lang.System.load(System.java:1061)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
- locked <0x00000007f96e20e0> (a java.util.Vector)
- locked <0x00000007f96a0ad8> (a java.util.Vector)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
- locked <0x00000007f9727830> (a java.lang.Runtime)
at java.lang.System.loadLibrary(System.java:1087)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1646)
at java.awt.Toolkit.<clinit>(Toolkit.java:1668)
at sun.awt.AppContext$2.run(AppContext.java:271)
at sun.awt.AppContext$2.run(AppContext.java:260)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.initMainAppContext(AppContext.java:260)
at sun.awt.AppContext.access$200(AppContext.java:133)
at sun.awt.AppContext$3.run(AppContext.java:314)
at sun.awt.AppContext$3.run(AppContext.java:298)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.getAppContext(AppContext.java:297)
at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:154)
at javax.imageio.ImageIO.<clinit>(ImageIO.java:65)
at com.sap.ImageTest.ImageMain.start(ImageMain.java:13)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
"VM Thread" prio=5 tid=0x00007fbad908e000 nid=0x3603 runnable
"GC task thread#0 (ParallelGC)" prio=5 tid=0x00007fbad904d000 nid=0x2603 runnable
"GC task thread#1 (ParallelGC)" prio=5 tid=0x00007fbad904d800 nid=0x2803 runnable
"GC task thread#2 (ParallelGC)" prio=5 tid=0x00007fbad904e000 nid=0x2a03 runnable
"GC task thread#3 (ParallelGC)" prio=5 tid=0x00007fbad904e800 nid=0x2c03 runnable
"GC task thread#4 (ParallelGC)" prio=5 tid=0x00007fbad904f800 nid=0x2e03 runnable
"GC task thread#5 (ParallelGC)" prio=5 tid=0x00007fbad9050000 nid=0x3003 runnable
"GC task thread#6 (ParallelGC)" prio=5 tid=0x00007fbad9050800 nid=0x3203 runnable
"GC task thread#7 (ParallelGC)" prio=5 tid=0x00007fbad9051000 nid=0x3403 runnable
"VM Periodic Task Thread" prio=5 tid=0x00007fbada801000 nid=0x5103 waiting on condition
JNI global references: 2810
最佳答案
确实 Oracle 在这方面有一个问题,但与 ISGI 无关,而是与 Mac JRE 有关:http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8019496您可以尝试将此添加到您的启动配置中。-Djava.awt.headless=true
关于java - 在 OSGI 应用程序 Mac OS X - Java 1.7 中引用时 ImageIO 挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20330807/
在javax.imageio.ImageIO中,有一个方法#write(RenderedImage im, String formatName, OutputStream output),它接受开发人
我对此问题感到非常困惑。我在jai-imageio-core上使用的是1.3.0版本,请检查下面的依赖关系,我完全不知道如何从jar中找出如何在JVM中加载一个类文件(RawImageReaderSp
我的应用程序正在将图像保存到文件夹中。同时另一个软件监视该文件夹并打印粘贴的图像。 我遇到的问题是打印应用程序可以在打印机上发送一半渲染的图像,或者根本不对保存的图像使用react。 我正在使用 ja
在下面的代码片段中,我尝试使用 javax.imageio.ImageIO 设置我的 JFrame 实例的图标,但出现以下异常。你能告诉我我缺少什么吗? import javax.imagei
我正在尝试将 Spring Web 应用程序部署到在 Windows Azure 上的生产环境中运行的 Tomcat 7(尝试过 Ubuntu 和 Windows Datacenter VM)。遗憾的
在使用套接字通过网络传输图像时,我遇到了一个奇怪的问题: 当我使用 ImageIO.write() 将图像写入一个套接字的 OutputStream 并使用 ImageIO.write() 从另一个套
下面您将看到一张来自土耳其的名为“simit”的精美糕点图片。它取自 iPad 2,因此它是尺寸为 720*960 的 JPEG。 问题是,当我使用 javax.imageio.ImageIO.rea
我在 Tomcat 5.5 中有一个 Servlet,它读取文件夹中的本地镜像。然后将图像发送回 Applet。 我收到此消息“javax.imageio.IIOException:无法创建 Imag
我有一张图片,称之为 grayscale.jpg。现在我在 The Gimp 中打开该图像并将颜色模式更改为 RGB 并将其保存为 color.jpg。如果我在任何图像查看器中查看 grayscale
这个问题在这里已经有了答案: Can't import javax.imageio.ImageIO in Android application (1 个回答) 关闭 9 年前。 当我试图做的时候,
我想将 Canvas 对象保存为图像,为此我想使用 ImageIO 类。我正在使用 Eclipse,但是当我尝试导入此库时(导入 javax.imageio.ImageIO;)Eclipse 向我显示
protected void doGet(HttpServletRequest req, HttpServletResponse response) throws IOExceptio
我正在尝试通过套接字发送图像,但我遇到了一个奇怪的问题。ImageIO.write 发送的数据比 ImageIO.read 接收的数据多。例如,如果我在循环中有以下代码: (客户端) out.writ
我在 python 中处理一些图像,我正在尝试将一系列大小为 961x509 的图像转换为 MP4 电影文件。我已经这样做了并且它正在工作但是我有一个非常烦人的问题,警告说是这样的: WARNING:
Apple 的图像 I/O 编程指南说道: Image I/O resides in the Application Services framework in Mac OS X, and in th
我一直在开发一个程序,其中使用来自此 API (musicg) 的代码:http://code.google.com/p/musicg/ 但是,我的代码中仍有一部分给我带来了麻烦(GraphicRen
我无法加载 JAI 1.3.0 的 ImageIO 类。 Java 6 和 Web 应用程序服务器 (WAS) 8.5。我的代码适用于 Java 6 和 WAS(7.0.19)。 我已经在 pom.x
我一直在使用 javax.imageio.ImageIO 中的 ImageIO.read() 和 ImageIO.write() 方法来读取和写入图像,我发现有些图像的颜色发生了奇怪的变化。 即使我将
如果图像不是RGB颜色,如何解码图像。它应该通过支持所有格式(Jpg、Png、Gif来解码图像) code>..etc) 任何 api 都可以解码。 这是失败的代码行。那么可以使用哪种方法来解决该问题
以下测试在 Java 9 上失败,而在 Java 8 中通过: @Test public void getImage_SetValueUsingConstructor_ShouldReturnCorr
我是一名优秀的程序员,十分优秀!