简体   繁体   English

Android上java.awt.image.BufferedImage的ClassNotFoundException

[英]ClassNotFoundException for java.awt.image.BufferedImage on Android

I'm getting the title error in my program, and am a bit confused as to why. 我在程序中出现标题错误,并且对原因有些困惑。 I have a program that uses IplImages , and up until now it has been working fine. 我有一个使用IplImages的程序, IplImages ,它一直运行良好。 I'm trying to use multithreading now though, and when I try to use the IplImage class in my MyThread class (which extends Thread), I'm getting this on the debug screen: 我现在尝试使用多线程,当我尝试在MyThread class (扩展Thread)中使用IplImage class时,在调试屏幕上显示了此信息: 在此处输入图片说明

The code I'm using is: 我使用的代码是:

IplImage imageToProcess = cvLoadImage(fileLocation);

Now, that code works just fine when I'm calling it in the MainActivity class , but seems to break when I call it in MyThread. 现在,当我在MainActivity class调用该代码时,它可以正常工作,但是当我在MyThread.调用该代码时,它似乎中断了MyThread.

Anyone have any idea what I'm doing wrong? 有人知道我在做什么错吗?

Android does not have most of the awt classes it only has 2 classes from java.awt.font Android没有大多数awt类,它仅具有java.awt.font中的2个类

See the documentation http://developer.android.com/reference/packages.html 请参阅文档http://developer.android.com/reference/packages.html

There are also other pitfalls like no full support of the java.beans package. 还有其他陷阱,例如没有完全支持java.beans包。

I would recommend to set a breakpoint where the BufferedImage is successfully loaded and then analyse the class loader that loaded the BufferedImage. 我建议设置一个在其中成功加载BufferedImage的断点,然后分析加载BufferedImage的类加载器。 Hopefully it is a URLClassLoader and you can find out the resource that provides tha java.awt.ButteredImage. 希望它是一个URLClassLoader,您可以找到提供java.awt.ButteredImage的资源。

Then set an exception breakpoint to ClassNotFoundException and try the code that fails. 然后将异常断点设置为ClassNotFoundException并尝试失败的代码。 Go back in the stacktrace to the place where the class loading got triggered from and also analyse this class loader. 返回堆栈跟踪中触发了类加载的位置,并分析该类加载器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Android 视图中绘制 java.awt.image.BufferedImage - Drawing a java.awt.image.BufferedImage in an Android View 将位图转换为java.awt.image.BufferedImage - Converting Bitmap into java.awt.image.BufferedImage 如何将多个java.awt.image.BufferedImage传递给Matlab - How to pass a number of java.awt.image.BufferedImage's to Matlab java.awt.Image.BufferedImage 条形码发送以在空白处打印结果 - java.awt.Image.BufferedImage barcode sent to print results in whitespace 如何在java.awt.image.BufferedImage中应用更柔和的清晰度 - how to apply a softer sharpness in java.awt.image.BufferedImage 如何在Android Studio中导入java.awt.image.BufferedImage - How can I import java.awt.image.BufferedImage in Android Studio CodenameOne中java.awt.image.BufferedImage的替代方案是什么 - what is alternative of java.awt.image.BufferedImage in codenameone 为什么java.awt.image.BufferedImage不能序列化? - Why isn't java.awt.image.BufferedImage serializable? 错误:无法将sun.awt.image.ToolkitImage强制转换为java.awt.image.BufferedImage - Error: sun.awt.image.ToolkitImage cannot be cast to java.awt.image.BufferedImage 如何把java.awt.image.BufferedImage / PDXObjectImage转换成System.Drawing.Image? - How to convert from java.awt.image.BufferedImage/PDXObjectImage to System.Drawing.Image?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM