NDK开发测试小问题(A resource was acquired at attached stack trace but never released.)

今天测试NDK遇到一个小问题,通过java端传递一个字符串给c端,然后c端将两个字符串拼接后返回。三下五除二,编译运行,android模拟器直接崩溃,然后报了一个错误A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. java.lang.Throwable: Explicit termination method ‘release’ not called。看了一会也不知道什么原因,然后想着会不会是传递字符串的时候用的是汉字,所以将java端和c端的字符串都改成英语后,在logcat中得到了想要的结果。这里android模拟器用的是系统自带的.

A resource was acquired at attached stack trace but never released. See java.io

09-25

01-24 02:26:15.960: E/StrictMode(22962): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.rn01-24 02:26:15.960: E/StrictMode(22962): java.lang.Throwable: Explicit termination method 'release' not calledrn01-24 02:26:15.960: E/StrictMode(22962): at dalvik.system.CloseGuard.open(CloseGuard.java:184)rn01-24 02:26:15.960: E/StrictMode(22962): at android.view.Surface.(Surface.java:293)rn01-24 02:26:15.960: E/StrictMode(22962): at android.view.SurfaceView.(SurfaceView.java:98)rn01-24 02:26:15.960: E/StrictMode(22962): at demo.playfile.util.VideoView.(VideoView.java:117)rn01-24 02:26:15.960: E/StrictMode(22962): at demo.playfile.util.VideoView.(VideoView.java:111)rn01-24 02:26:15.960: E/StrictMode(22962): at java.lang.reflect.Constructor.constructNative(Native Method)rn01-24 02:26:15.960: E/StrictMode(22962): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)rn01-24 02:26:15.960: E/StrictMode(22962): at android.view.LayoutInflater.createView(LayoutInflater.java:587)rn01-24 02:26:15.960: E/StrictMode(22962): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)rn01-24 02:26:15.960: E/StrictMode(22962): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)rn01-24 02:26:15.960: E/StrictMode(22962): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)rn01-24 02:26:15.960: E/StrictMode(22962): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)rn01-24 02:26:15.960: E/StrictMode(22962): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)rn01-24 02:26:15.960: E/StrictMode(22962): at MovieShow.MovieDetail.onCreateView(MovieDetail.java:84)rn01-24 02:26:15.960: E/StrictMode(22962): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1478)rn01-24 02:26:15.960: E/StrictMode(22962): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)rn01-24 02:26:15.960: E/StrictMode(22962): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)rn01-24 02:26:15.960: E/StrictMode(22962): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)rn01-24 02:26:15.960: E/StrictMode(22962): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1460)rn01-24 02:26:15.960: E/StrictMode(22962): at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)rn01-24 02:26:15.960: E/StrictMode(22962): at android.os.Handler.handleCallback(Handler.java:725)rn01-24 02:26:15.960: E/StrictMode(22962): at android.os.Handler.dispatchMessage(Handler.java:92)rn01-24 02:26:15.960: E/StrictMode(22962): at android.os.Looper.loop(Looper.java:137)rn01-24 02:26:15.960: E/StrictMode(22962): at android.app.ActivityThread.main(ActivityThread.java:5117)rn01-24 02:26:15.960: E/StrictMode(22962): at java.lang.reflect.Method.invokeNative(Native Method)rn01-24 02:26:15.960: E/StrictMode(22962): at java.lang.reflect.Method.invoke(Method.java:511)rn01-24 02:26:15.960: E/StrictMode(22962): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:954)rn01-24 02:26:15.960: E/StrictMode(22962): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:721)rn01-24 02:26:15.960: E/StrictMode(22962): at dalvik.system.NativeStart.main(Native Method)rnrn这是什么原因啊

stack trace 你会不会??

05-25

下面是完整的stack trace,请问错在哪?rnrnHTTP Status 500 - rn-------------------------------------------------------------------------rntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Unable to compile class for JSPrnrnAn error occurred at line: 19 in the jsp file: /DisplayCourse.jsprnGenerated servlet error:rnInvalid character constantrnrnrn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)rn org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.8 logs.rnrnrn-------------------------------------------------------------------------rnrnApache Tomcat/5.5.8rn================================================================rnrn上面完整stack trace message, 请问是什么错?rn

stack trace 高手请进!!!

05-25

---------- DisplayCourse.jsp (完整的JSP 代码)---------------rn<%@page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="errorpage.jsp" %>rnrn 选报课程rnrnrn 您可以选报的课程为 rn rn<%rnString id = (String)session.getAttribute("id");rnString cour_id,name,dep,prepare,class_id,room_id,cour_time;rnString tea_name=null;rnResultSet rs=null;rnrs=check.getCourse(id);rnwhile(rs.next())rncour_id=rs.getString("id");rnname=rs.getString("name");rnprepare=rs.getString("prepare");rndep=rs.getString("dep");rnclass_id=rs.getString("class_id");rnroom_id=rs.getString("room_id");rncour_time=rs.getString("cour_time");rntea_name=rs.getString("tea_name");rn%>rn rn rn 课程号rn 课程名rn 预修课rn 系别rn 班级号rn 教室号rn 上课时间rn 教师rn 选择rn rn rn <%=cour_id%>rn <%=name%>rn <%=prepare%>rn <%=prepare%>rn <%=class_id%>rn <%=room_id%>rn <%=cour_time%>rn <%=tea_name%>rn 注册 rnrn rn <%rnrn%>rnrn rn < rnrnrnrn下面是完整的stack trace,请问错在哪?rnrnHTTP Status 500 - rn-------------------------------------------------------------------------rntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Unable to compile class for JSPrnrnAn error occurred at line: 19 in the jsp file: /DisplayCourse.jsprnGenerated servlet error:rnInvalid character constantrnrnrn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)rn org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.8 logs.rnrnrn-------------------------------------------------------------------------rnrnApache Tomcat/5.5.8rn

关于stack trace

05-06

[code=java]package cn.vanke.stackTrace;rnrnimport java.util.Scanner;rnrnpublic class StackTraceTest rn public static int factorial(int n)rn rn System.out.println("factorial("+n+"):");rn Throwable t = new Throwable();rn StackTraceElement[] frames = t.getStackTrace();rn for(StackTraceElement f : frames)rn rn System.out.println(f);rn rn int r;rn if (n<= 1)rn rn r = 1;rn rn elsern rn r = n * factorial(n-1); rn rn System.out.println("return " + r);rn return r;rn rn rnrn public static void main(String[] args) rn Scanner in = new Scanner(System.in);rn System.out.println("Enter n:");rn int n = in.nextInt();rn factorial(n); rn rnrn[/code]rnrn我不懂得控制台的结果,那个行数是代表什么,到底是怎么样的一行才会被trace?rnfactorial(3):rncn.vanke.stackTrace.StackTraceTest.factorial(StackTraceTest.java:9)//为什么直接到9?rncn.vanke.stackTrace.StackTraceTest.main(StackTraceTest.java:33) //为什么又回到33?rnfactorial(2):rncn.vanke.stackTrace.StackTraceTest.factorial(StackTraceTest.java:9) rncn.vanke.stackTrace.StackTraceTest.factorial(StackTraceTest.java:22)rncn.vanke.stackTrace.StackTraceTest.main(StackTraceTest.java:33)rnfactorial(1):rncn.vanke.stackTrace.StackTraceTest.factorial(StackTraceTest.java:9)rncn.vanke.stackTrace.StackTraceTest.factorial(StackTraceTest.java:22) //为什么这边两个22行?rncn.vanke.stackTrace.StackTraceTest.factorial(StackTraceTest.java:22)rncn.vanke.stackTrace.StackTraceTest.main(StackTraceTest.java:33)rnreturn 1rnreturn 2rnreturn 6

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试