com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 232? 5C

GSON解析json格式字符串,利用GSON的fromJson函数,将Json字符串解析为java对象,spark本地模式可以执行,但是在集群上yarn模式一直出现以下错误:
com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 232

1个回答

GSON的jar更新为最新的一下试试

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ClassNotFoundException: com.google.gson.Gson
Servlet.service() for servlet [ns] in context with path [/EC] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/google/gson/Gson] with root cause java.lang.ClassNotFoundException: com.google.gson.Gson at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) at com.ns.controllers.impl.systemDevice.SystemManageImpl.SendDeviceControlOrder(SystemManageImpl.java:307) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)
arcgis-android:100.0.0依赖gson.2.3.1.jar失败,是什么原因呢?
很无语的一个问题。 依赖'com.esri.arcgisruntime:arcgis-android:100.0.0'同步时报出“Error:Failed to resolve: com.google.code.gson:gson:2.3.1”。 clean project之后又报出: Error:A problem occurred configuring project ':app'.> Could not resolve all dependencies for configuration ':app:_debugApkCopy'. > Could not resolve com.google.code.gson:gson:2.3.1. Required by: project :app > com.esri.arcgisruntime:arcgis-android:100.0.0 > Could not resolve com.google.code.gson:gson:2.3.1. > Could not get resource 'https://jcenter.bintray.com/com/google/code/gson/gson/2.3.1/gson-2.3.1.pom'. > Could not HEAD 'https://jcenter.bintray.com/com/google/code/gson/gson/2.3.1/gson-2.3.1.pom'. > Server sent an unsupported extension: type_35 很尴尬啊,找了很久不知道什么问题。 在线依赖“com.esri.arcgisruntime:arcgis-android:100.0.0”,更可怕直接卡在下download arcgis-android-100.0.0.aar上面。(一直开着VPN) 按照官网文档和网上大神的经验配置离线: 1、本地配置maven,并将arcgis-android-100.0.0.aar和arcgis-android-100.0.0.pom放入在C:\Users\Administrator\.m2\repository\com\esri\arcgis\android\arcgis-android\100.0.0和C:\Users\Administrator\.m2\repository\com\esri\arcgisruntime\arcgis-android\100.0.0(因为不知道哪个对,索性就配置了两个)。 2、so文件放在了src/main/jinLibs文件夹下,并在build.gradle配置了。 3、arcgis-android-api.jar和gson-2.3.1.jar放在libs下并依赖。 4、project下的build.gradle也配置了本地仓库。 ![![图片说明](https://img-ask.csdn.net/upload/201706/04/1496572186_730793.png)图片说明](https://img-ask.csdn.net/upload/201706/04/1496572169_652169.png)
:Expected BEGIN_ARRAY求大神们
12-03 01:40:58.903 3439-3456/? E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.h954gmail.y.cnch, PID: 3439 com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $ at com.google.gson.Gson.fromJson(Gson.java:899) at com.google.gson.Gson.fromJson(Gson.java:852) at com.google.gson.Gson.fromJson(Gson.java:801) at com.h954gmail.y.cnch.fragment.HomeFragment$1.onResponse(HomeFragment.java:88) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $ at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) at com.google.gson.Gson.fromJson(Gson.java:887) at com.google.gson.Gson.fromJson(Gson.java:852)  at com.google.gson.Gson.fromJson(Gson.java:801)  at com.h954gmail.y.cnch.fragment.HomeFragment$1.onResponse(HomeFragment.java:88)  at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126)  at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)  at java.lang.Thread.run(Thread.java:818)  求解!!
解析包含null的原始json数组
Json数组: {"userName":null," msgArr":[null],"numrow":0} //String result Gson: new Gson().fromJson(result, MyClass.class); MyClass: public String userName; public int[] msgArr; ... 错误stack: at java.lang.IllegalArgumentException: Primitive array can't take null values. at java.lang.reflect.Array.set(Array.java:406) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:78) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172) at com.google.gson.Gson.fromJson(Gson.java:803) at com.google.gson.Gson.fromJson(Gson.java:768) at com.google.gson.Gson.fromJson(Gson.java:717) at com.google.gson.Gson.fromJson(Gson.java:689) at com.test.dao.RequestBase.onPostExecute(RequestBase.java:79) 如果不能修改json字符串 "msgArr=[null]",怎么解除这个异常?
JAVA如何获取本地.json文件并遍历
因为开发的原因,后期要测试,就在网上抓取了一些商品数据,并组成了json文件.然而我在从本地读取并遍历的时候,遇到了点问题.无法直接遍历,报错Exception in thread "main" com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 2 column 2 path $ at com.google.gson.JsonParser.parse(JsonParser.java:65) at com.google.gson.JsonParser.parse(JsonParser.java:45) at com.enation.framework.util.JsonUtil.parseJsonArray(JsonUtil.java:103) at com.enation.framework.util.JsonUtil.toList(JsonUtil.java:43) at com.enation.app.b2b2c.front.api.goods.InsertGoods.main(InsertGoods.java:136) Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 2 column 2 path $ at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1574) at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1423) at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:546) at com.google.gson.stream.JsonReader.peek(JsonReader.java:429) at com.google.gson.JsonParser.parse(JsonParser.java:60) ... 4 more ``` ```因为json文件中有特别多的数据,哪位大神有好点的方法,特别是有代码的话更好,万分感谢!
gson将json格式的字符串转成java对象,json字符串中long怎么转变不会报错?
# gson将json格式的字符串转成java对象,json字符串中long怎么转变不会报错? public static void main(String[] args) { long timel=12323232L; SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time=sdf.format(timel); System.out.println(time);//正常 Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create(); String obj="[{\"name\":\"caochuankui\",\"time\":"+timel+"}]"; JSONArray objo=new JSONArray(obj); GsonTest gt=gson.fromJson(objo.toString(), GsonTest.class);//报错 System.out.println(gt.getTime()); } } 错误信息如下: 1970-01-01 11:25:23 Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $ at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:200) at com.google.gson.Gson.fromJson(Gson.java:810) at com.google.gson.Gson.fromJson(Gson.java:775) at com.google.gson.Gson.fromJson(Gson.java:724) at com.google.gson.Gson.fromJson(Gson.java:696) at com.pagecofig.util.GsonTest.main(GsonTest.java:67) Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $ at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:387) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:189) ... 5 more 这要怎么解决,求大神指点
求大神帮我com.google.gson.stream.MalformedJsonException
我别的界面用的解析方法都是一样的,别的界面的数据就是能解析出来,但是这个界面总是出现![图片说明](https://img-ask.csdn.net/upload/201607/29/1469756038_409519.png)![图片说明](https://img-ask.csdn.net/upload/201607/29/1469756049_973899.png)这个问题,但是那个JSON的格式又没有错,这问题已经卡了好几天了,望大神帮我解决一下,万分感谢
坐等求救,java用ssh的时候,Gson解析json有外键的时候报错
java.lang.UnsupportedOperationException: Attempted to serialize java.lang.Class: org.hibernate.proxy.HibernateProxy. Forgot to register a type adapter? com.google.gson.internal.bind.TypeAdapters$1.write(TypeAdapters.java:73) com.google.gson.internal.bind.TypeAdapters$1.write(TypeAdapters.java:69) com.google.gson.TypeAdapter$1.write(TypeAdapter.java:191) com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69) com.google.gson.internal.bind.ArrayTypeAdapter.write(ArrayTypeAdapter.java:95) com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69) com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:125) com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:243) com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69) com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:125) com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:243) com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69) com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:125) com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:243) com.google.gson.internal.bind.ObjectTypeAdapter.write(ObjectTypeAdapter.java:107) com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69) com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:97) com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:61) com.google.gson.Gson.toJson(Gson.java:669) com.google.gson.Gson.toJson(Gson.java:648) com.google.gson.Gson.toJson(Gson.java:603) com.google.gson.Gson.toJson(Gson.java:583) com.gx.lyf.other.controls.NoticeAction.text(NoticeAction.java:96) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
Expected a BEGIN_ARRAY but was STRING at line
android访问本机后台没问题。能够返回正常的数据,但是我把本机后台项目打包成war包放在 服务器上,然后用android去访问服务器,就会报如下错误: ``` Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $ at com.google.gson.Gson.fromJson(Gson.java:899) at com.google.gson.Gson.fromJson(Gson.java:852) at com.google.gson.Gson.fromJson(Gson.java:801) at com.example.ldp.com.activity.StudentActivity.initFruits(StudentActivity.java:107) at com.example.ldp.com.activity.StudentActivity.onCreate(StudentActivity.java:51) at android.app.Activity.performCreate(Activity.java:5231) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) ``` 访问代码: ``` private void initFruits(){ Map<String,String> map = new HashMap<>(); map.put("username",username); String str = HttpGetUtil.SendPostHttp("showcourse/toshowcourse.action",map); Log.i("LDP",str); Gson gson = new Gson(); coursesList = gson.fromJson(str,new TypeToken<List<Course>>(){}.getType()); if(coursesList.size()==0){ Toast.makeText(StudentActivity.this,"cuowu",Toast.LENGTH_SHORT).show(); } } ``` 后台返回的json数据格式: ![图片说明](https://img-ask.csdn.net/upload/201705/08/1494226654_710863.png)
用ssm框架做的项目,用浏览器登录后点击目录,点一次没有错,点第二次就报错。
求教大神帮忙看看,感激不尽!!!! 严重: Servlet.service() for servlet [springmvc] in context with path [] threw exception [Request processing failed; nested exception is com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: empty String] with root cause java.lang.NumberFormatException: empty String at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) at sun.misc.FloatingDecimal.parseDouble(Unknown Source) at java.lang.Double.parseDouble(Unknown Source) at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1201) at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:225) at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:217) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) at com.google.gson.Gson.fromJson(Gson.java:887) at com.google.gson.Gson.fromJson(Gson.java:852) at com.google.gson.Gson.fromJson(Gson.java:801) at com.google.gson.Gson.fromJson(Gson.java:773) at com.edu.controller.SyllabusController.queryList(SyllabusController.java:42) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2549) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2538) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)
android studio 上传代码到Git,添加的依赖包也会上传上去吗?
假如我在项目里面添加了一些第三方jar包 比如说 compile 'com.google.code.gson:gson:2.2.4' 。。。。。。 然后当我将代码上传到Git时,会把这些jar包一起上传上去吗?还是这是把这些compile保代码存着,然后当别人下载代码到android studio时,再在自己的电脑上面下载这些第三方jar包?
遇到Program type already present: android.support.v4.app.BackStackRecord$Op这个问题
运行代码的时候,出现了这个问题 ``` Program type already present: android.support.v4.app.BackStackRecord$Op Message{kind=ERROR, text=Program type already present: android.support.v4.app.BackStackRecord$Op, sources=[Unknown source file], tool name=Optional.of(D8)} ``` 虽然不知道具体意思,感觉就是v4包冲突,可是我不会找在哪冲突的 在网上疯狂搜解决办法,没有一个奏效 给各位大佬呈上我的build.gradle ``` apply plugin: 'com.android.application' android { compileSdkVersion 27 defaultConfig { applicationId "com.example.asus.bs_im" minSdkVersion 16 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" //use legacy for android 6.0 useLibrary 'org.apache.http.legacy' } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { api fileTree(include: ['*.jar'], dir: 'libs') api 'com.android.support.constraint:constraint-layout:1.0.2' implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:support-v4:27.1.1' implementation 'com.squareup.okhttp3:okhttp:3.8.1' implementation 'com.google.code.gson:gson:2.8.1' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' api project(':easeui') configurations { all*.exclude group: 'com.android.support', module: 'support-v13' } } ``` 整了两三个小时了,各种办法都试过了,希望有大佬来拯救一下我这个辣鸡
使用Rxjava+Retrofit时出错
楼主是萌新,在使用Rxjava2+retrofit2时编译完成之后会报错: Caused by: java.lang.IllegalArgumentException: Unable to create call adapter for io.reactivex.Observable<java.lang.String>for method NewsService.getUser 依赖: compile 'io.reactivex.rxjava2:rxjava:2.0.4' compile 'io.reactivex.rxjava2:rxandroid:2.0.1' compile 'com.squareup.okhttp3:okhttp:3.5.0' compile 'com.google.code.gson:gson:2.8.0' compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0' compile 'com.squareup.retrofit2:converter-gson:2.1.0' 部分代码: Retrofit retrofit = new Retrofit.Builder() .addConverterFactory(GsonConverterFactory.create()) .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .baseUrl("http://takeapp.com.cn/Home/register/") .build(); NewsService api = retrofit.create(NewsService .class); api.getUser("13222222222",MD5Tool.md5("123")); Service类接口: @POST("login") Observable<String> getUser(@Field("phone_num") String username, @Field("password") String password); 请问要如何解决
run的时候完美,一到签名打包release就报错
Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/gson/JsonSerializer; ## Warning:warning: Ignoring InnerClasses attribute for an anonymous inner class ## (com.common.cliplib.a.c) that doesn't come with an ## associated EnclosingMethod attribute. This class was probably produced by a ## compiler that did not target the modern .class file format. The recommended ## solution is to recompile the class from source, using an up-to-date compiler ## and without specifying any "-target" type options. The consequence of ignoring ## this warning is that reflective operations on this class will incorrectly ## indicate that it is *not* an inner class. 下为build.grild ```dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.umeng.analytics:analytics:latest.integration' compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.orhanobut:logger:1.15' compile 'com.android.support:cardview-v7:23.4.0' compile 'com.jakewharton:butterknife:7.0.1' compile 'com.android.support:support-annotations:23.1.1' compile 'org.greenrobot:eventbus:3.0.0' compile 'com.google.code.gson:gson:2.4' compile 'com.android.support:recyclerview-v7:23.+' compile 'com.android.support:design:23.4.0' compile 'com.getbase:floatingactionbutton:1.5.1' compile 'com.github.clans:fab:1.6.4' compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2' compile 'io.github.yavski:fab-speed-dial:1.0.1' compile 'cc.trity.floatingactionbutton:library:1.0.0' compile files('libs/adshower-library.jar') compile files('libs/umeng-analytics-v6.1.0.jar') } ``` 有说是包名重复可是看了一下没有重复的啊
在网络请求的时候出现以下报错
遇到了这么个问题,用的Retrofit+rxjava+Okhttp,求解答 ``` Process: com.example.tidus.ristrat, PID: 7166 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tidus.ristrat/com.example.tidus.ristrat.activity.RiskAssessmentActivity}: java.lang.IllegalArgumentException: Unable to create converter for class com.example.tidus.ristrat.bean.RiskAssessmentBean for method IRetrofitServer.doRiskTableListGet at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3260) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3396) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2009) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7319) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934) Caused by: java.lang.IllegalArgumentException: Unable to create converter for class com.example.tidus.ristrat.bean.RiskAssessmentBean for method IRetrofitServer.doRiskTableListGet at retrofit2.ServiceMethod$Builder.methodError(ServiceMethod.java:755) at retrofit2.ServiceMethod$Builder.createResponseConverter(ServiceMethod.java:741) at retrofit2.ServiceMethod$Builder.build(ServiceMethod.java:172) at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:170) at retrofit2.Retrofit$1.invoke(Retrofit.java:147) at java.lang.reflect.Proxy.invoke(Proxy.java:1006) at $Proxy3.doRiskTableListGet(Unknown Source) at com.example.tidus.ristrat.mvp.model.RiskAssessmentModel.getRiskAssessment(RiskAssessmentModel.java:25) at com.example.tidus.ristrat.mvp.presenter.RiskAssessmentPresenter.getRiskAssessment(RiskAssessmentPresenter.java:16) at com.example.tidus.ristrat.activity.RiskAssessmentActivity.initPresenterData(RiskAssessmentActivity.java:183) at com.example.tidus.ristrat.activity.RiskAssessmentActivity.initData(RiskAssessmentActivity.java:158) at com.example.lib_core.base.BaseActivity.onCreate(BaseActivity.java:44) at android.app.Activity.performCreate(Activity.java:7783) at android.app.Activity.performCreate(Activity.java:7772) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3235) ... 11 more Caused by: java.lang.SecurityException: Can not make a java.lang.reflect.Method constructor accessible at java.lang.reflect.AccessibleObject.setAccessible0(AccessibleObject.java:153) at java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:132) at com.google.gson.internal.reflect.PreJava9ReflectionAccessor.makeAccessible(PreJava9ReflectionAccessor.java:31) at com.google.gson.internal.ConstructorConstructor.newDefaultConstructor(ConstructorConstructor.java:103) at com.google.gson.internal.ConstructorConstructor.get(ConstructorConstructor.java:85) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:101) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.ArrayTypeAdapter$1.create(ArrayTypeAdapter.java:48) at com.google.gson.Gson.getAdapter(Gson.java:458) 2019-09-04 13:57:04.536 7166-7166/com.example.tidus.ristrat E/AndroidRuntime: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102) at com.google.gson.Gson.getAdapter(Gson.java:458) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117) 2019-09-04 13:57:04.537 7166-7166/com.example.tidus.ristrat E/AndroidRuntime: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102) at com.google.gson.Gson.getAdapter(Gson.java:458) at retrofit2.converter.gson.GsonConverterFactory.responseBodyConverter(GsonConverterFactory.java:64) at retrofit2.Retrofit.nextResponseBodyConverter(Retrofit.java:330) at retrofit2.Retrofit.responseBodyConverter(Retrofit.java:313) at retrofit2.ServiceMethod$Builder.createResponseConverter(ServiceMethod.java:739) ... 25 more ``` Bean类 ``` package com.example.tidus.ristrat.bean; import android.view.View; import java.io.Serializable; import java.util.List; public class RiskAssessmentBean implements Serializable { private String code; private String message; private String server_code; private ServerParamsBean server_params; public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getServer_code() { return server_code; } public void setServer_code(String server_code) { this.server_code = server_code; } public ServerParamsBean getServer_params() { return server_params; } public void setServer_params(ServerParamsBean server_params) { this.server_params = server_params; } public static class ServerParamsBean implements Serializable { private String PATIENT_ID; private Object DOCTOR_NAME; private Object REPORT_CODE; private Object REPORT_ID; private String IN_DEPT_CODE; private String IN_DEPT_NAME; private String PATIENT_NAME; private String BIRTHDAY; private String PATIENT_SEX; private String MEDICAL_REC_NUMBER; private String VISIT_SQ_NO; private String BED_NUMBER; private List<WENJUANNAMEBean> WENJUANNAME; public String getPATIENT_ID() { return PATIENT_ID; } public void setPATIENT_ID(String PATIENT_ID) { this.PATIENT_ID = PATIENT_ID; } public Object getDOCTOR_NAME() { return DOCTOR_NAME; } public void setDOCTOR_NAME(Object DOCTOR_NAME) { this.DOCTOR_NAME = DOCTOR_NAME; } public Object getREPORT_CODE() { return REPORT_CODE; } public void setREPORT_CODE(Object REPORT_CODE) { this.REPORT_CODE = REPORT_CODE; } public Object getREPORT_ID() { return REPORT_ID; } public void setREPORT_ID(Object REPORT_ID) { this.REPORT_ID = REPORT_ID; } public String getIN_DEPT_CODE() { return IN_DEPT_CODE; } public void setIN_DEPT_CODE(String IN_DEPT_CODE) { this.IN_DEPT_CODE = IN_DEPT_CODE; } public String getIN_DEPT_NAME() { return IN_DEPT_NAME; } public void setIN_DEPT_NAME(String IN_DEPT_NAME) { this.IN_DEPT_NAME = IN_DEPT_NAME; } public String getPATIENT_NAME() { return PATIENT_NAME; } public void setPATIENT_NAME(String PATIENT_NAME) { this.PATIENT_NAME = PATIENT_NAME; } public String getBIRTHDAY() { return BIRTHDAY; } public void setBIRTHDAY(String BIRTHDAY) { this.BIRTHDAY = BIRTHDAY; } public String getPATIENT_SEX() { return PATIENT_SEX; } public void setPATIENT_SEX(String PATIENT_SEX) { this.PATIENT_SEX = PATIENT_SEX; } public String getMEDICAL_REC_NUMBER() { return MEDICAL_REC_NUMBER; } public void setMEDICAL_REC_NUMBER(String MEDICAL_REC_NUMBER) { this.MEDICAL_REC_NUMBER = MEDICAL_REC_NUMBER; } public String getVISIT_SQ_NO() { return VISIT_SQ_NO; } public void setVISIT_SQ_NO(String VISIT_SQ_NO) { this.VISIT_SQ_NO = VISIT_SQ_NO; } public String getBED_NUMBER() { return BED_NUMBER; } public void setBED_NUMBER(String BED_NUMBER) { this.BED_NUMBER = BED_NUMBER; } public List<WENJUANNAMEBean> getWENJUANNAME() { return WENJUANNAME; } public void setWENJUANNAME(List<WENJUANNAMEBean> WENJUANNAME) { this.WENJUANNAME = WENJUANNAME; } public static class WENJUANNAMEBean implements Serializable { private int MERCHANT_ID; private int SITE_ID; private int DEPARTMENT; private int FORM_ID; private String FORM_NAME; private int FORM_TYPE; private int FORM_SEQ; private String BUSINESS_CLASS; private List<XUANXIANGBean> XUANXIANG; private boolean che_color; private int form_id; public int getForm_id() { return form_id; } public void setForm_id(int form_id) { this.form_id = form_id; } public boolean isChe_color() { return che_color; } public void setChe_color(boolean che_color) { this.che_color = che_color; } public int getMERCHANT_ID() { return MERCHANT_ID; } public void setMERCHANT_ID(int MERCHANT_ID) { this.MERCHANT_ID = MERCHANT_ID; } public int getSITE_ID() { return SITE_ID; } public void setSITE_ID(int SITE_ID) { this.SITE_ID = SITE_ID; } public int getDEPARTMENT() { return DEPARTMENT; } public void setDEPARTMENT(int DEPARTMENT) { this.DEPARTMENT = DEPARTMENT; } public int getFORM_ID() { return FORM_ID; } public void setFORM_ID(int FORM_ID) { this.FORM_ID = FORM_ID; } public String getFORM_NAME() { return FORM_NAME; } public void setFORM_NAME(String FORM_NAME) { this.FORM_NAME = FORM_NAME; } public int getFORM_TYPE() { return FORM_TYPE; } public void setFORM_TYPE(int FORM_TYPE) { this.FORM_TYPE = FORM_TYPE; } public int getFORM_SEQ() { return FORM_SEQ; } public void setFORM_SEQ(int FORM_SEQ) { this.FORM_SEQ = FORM_SEQ; } public String getBUSINESS_CLASS() { return BUSINESS_CLASS; } public void setBUSINESS_CLASS(String BUSINESS_CLASS) { this.BUSINESS_CLASS = BUSINESS_CLASS; } public List<XUANXIANGBean> getXUANXIANG() { return XUANXIANG; } public void setXUANXIANG(List<XUANXIANGBean> XUANXIANG) { this.XUANXIANG = XUANXIANG; } public static class XUANXIANGBean implements Serializable { private String GROUP_TAB; private int GROUP_TAB_ID; private List<WENJUANBean> WENJUAN; public String getGROUP_TAB() { return GROUP_TAB; } public void setGROUP_TAB(String GROUP_TAB) { this.GROUP_TAB = GROUP_TAB; } public int getGROUP_TAB_ID() { return GROUP_TAB_ID; } public void setGROUP_TAB_ID(int GROUP_TAB_ID) { this.GROUP_TAB_ID = GROUP_TAB_ID; } public List<WENJUANBean> getWENJUAN() { return WENJUAN; } public void setWENJUAN(List<WENJUANBean> WENJUAN) { this.WENJUAN = WENJUAN; } public static class WENJUANBean implements Serializable { private int FACTOR_GROUP_SEQ; private String FACTOR_GROUP_ID; private String FACTOR_GROUP_NAME; private List<SublistBean> sublist; public int getFACTOR_GROUP_SEQ() { return FACTOR_GROUP_SEQ; } public void setFACTOR_GROUP_SEQ(int FACTOR_GROUP_SEQ) { this.FACTOR_GROUP_SEQ = FACTOR_GROUP_SEQ; } public String getFACTOR_GROUP_ID() { return FACTOR_GROUP_ID; } public void setFACTOR_GROUP_ID(String FACTOR_GROUP_ID) { this.FACTOR_GROUP_ID = FACTOR_GROUP_ID; } public String getFACTOR_GROUP_NAME() { return FACTOR_GROUP_NAME; } public void setFACTOR_GROUP_NAME(String FACTOR_GROUP_NAME) { this.FACTOR_GROUP_NAME = FACTOR_GROUP_NAME; } public List<SublistBean> getSublist() { return sublist; } public void setSublist(List<SublistBean> sublist) { this.sublist = sublist; } public static class SublistBean implements Serializable { private int FACTOR_GROUP_ID; private String FACTOR_GROUP_NAME; private String FACTOR_GROUP_DESC; private int FACTOR_GROUP_SEQ; private Object GROUP_SHOW_LAYOUT; private int RISK_FACTOR_ID; private String RISK_FACTOR_NAME; private int SCORE_SHOW_TYPE; private int MUTEX_GROUP; private String isslect; private String ANALYSIS_SOURCE_STR; private String CURRENT_DESC; private List<OptionListBean> optionList; private View shuruValue; private boolean checked; public boolean isChecked() { return checked; } public void setChecked(boolean checked) { this.checked = checked; } public View getShuruValue() { return shuruValue; } public void setShuruValue(View shuruValue) { this.shuruValue = shuruValue; } public int getFACTOR_GROUP_ID() { return FACTOR_GROUP_ID; } public void setFACTOR_GROUP_ID(int FACTOR_GROUP_ID) { this.FACTOR_GROUP_ID = FACTOR_GROUP_ID; } public String getFACTOR_GROUP_NAME() { return FACTOR_GROUP_NAME; } public void setFACTOR_GROUP_NAME(String FACTOR_GROUP_NAME) { this.FACTOR_GROUP_NAME = FACTOR_GROUP_NAME; } public String getFACTOR_GROUP_DESC() { return FACTOR_GROUP_DESC; } public void setFACTOR_GROUP_DESC(String FACTOR_GROUP_DESC) { this.FACTOR_GROUP_DESC = FACTOR_GROUP_DESC; } public int getFACTOR_GROUP_SEQ() { return FACTOR_GROUP_SEQ; } public void setFACTOR_GROUP_SEQ(int FACTOR_GROUP_SEQ) { this.FACTOR_GROUP_SEQ = FACTOR_GROUP_SEQ; } public Object getGROUP_SHOW_LAYOUT() { return GROUP_SHOW_LAYOUT; } public void setGROUP_SHOW_LAYOUT(Object GROUP_SHOW_LAYOUT) { this.GROUP_SHOW_LAYOUT = GROUP_SHOW_LAYOUT; } public int getRISK_FACTOR_ID() { return RISK_FACTOR_ID; } public void setRISK_FACTOR_ID(int RISK_FACTOR_ID) { this.RISK_FACTOR_ID = RISK_FACTOR_ID; } public String getRISK_FACTOR_NAME() { return RISK_FACTOR_NAME; } public void setRISK_FACTOR_NAME(String RISK_FACTOR_NAME) { this.RISK_FACTOR_NAME = RISK_FACTOR_NAME; } public int getSCORE_SHOW_TYPE() { return SCORE_SHOW_TYPE; } public void setSCORE_SHOW_TYPE(int SCORE_SHOW_TYPE) { this.SCORE_SHOW_TYPE = SCORE_SHOW_TYPE; } public int getMUTEX_GROUP() { return MUTEX_GROUP; } public void setMUTEX_GROUP(int MUTEX_GROUP) { this.MUTEX_GROUP = MUTEX_GROUP; } public String getIsslect() { return isslect; } public void setIsslect(String isslect) { this.isslect = isslect; } public String getANALYSIS_SOURCE_STR() { return ANALYSIS_SOURCE_STR; } public void setANALYSIS_SOURCE_STR(String ANALYSIS_SOURCE_STR) { this.ANALYSIS_SOURCE_STR = ANALYSIS_SOURCE_STR; } public String getCURRENT_DESC() { return CURRENT_DESC; } public void setCURRENT_DESC(String CURRENT_DESC) { this.CURRENT_DESC = CURRENT_DESC; } public List<OptionListBean> getOptionList() { return optionList; } public void setOptionList(List<OptionListBean> optionList) { this.optionList = optionList; } public static class OptionListBean implements Serializable { private int RISK_FACTOR_ID; private int FACTOR_OPTION_ID; private String FACTOR_OPTION; private String OPTION_TYPE; private Object VALUE_START; private Object VALUE_END; private Object SEX; private int AGE_BEGIN; private int AGE_END; private int RISK_SCORE; private int CHANGE_FLAG; private Object RISK_SCORE_CHANGE; private int RISK_LEVEL; private Object DISEASE_CODE; private Object BAD_HABITS; private Object BAD_HABITS_DESC; private Object BAD_HABITS_IMPROVE; private boolean itemChecked; public boolean isItemChecked() { return itemChecked; } public void setItemChecked(boolean itemChecked) { this.itemChecked = itemChecked; } public int getRISK_FACTOR_ID() { return RISK_FACTOR_ID; } public void setRISK_FACTOR_ID(int RISK_FACTOR_ID) { this.RISK_FACTOR_ID = RISK_FACTOR_ID; } public int getFACTOR_OPTION_ID() { return FACTOR_OPTION_ID; } public void setFACTOR_OPTION_ID(int FACTOR_OPTION_ID) { this.FACTOR_OPTION_ID = FACTOR_OPTION_ID; } public String getFACTOR_OPTION() { return FACTOR_OPTION; } public void setFACTOR_OPTION(String FACTOR_OPTION) { this.FACTOR_OPTION = FACTOR_OPTION; } public String getOPTION_TYPE() { return OPTION_TYPE; } public void setOPTION_TYPE(String OPTION_TYPE) { this.OPTION_TYPE = OPTION_TYPE; } public Object getVALUE_START() { return VALUE_START; } public void setVALUE_START(Object VALUE_START) { this.VALUE_START = VALUE_START; } public Object getVALUE_END() { return VALUE_END; } public void setVALUE_END(Object VALUE_END) { this.VALUE_END = VALUE_END; } public Object getSEX() { return SEX; } public void setSEX(Object SEX) { this.SEX = SEX; } public int getAGE_BEGIN() { return AGE_BEGIN; } public void setAGE_BEGIN(int AGE_BEGIN) { this.AGE_BEGIN = AGE_BEGIN; } public int getAGE_END() { return AGE_END; } public void setAGE_END(int AGE_END) { this.AGE_END = AGE_END; } public int getRISK_SCORE() { return RISK_SCORE; } public void setRISK_SCORE(int RISK_SCORE) { this.RISK_SCORE = RISK_SCORE; } public int getCHANGE_FLAG() { return CHANGE_FLAG; } public void setCHANGE_FLAG(int CHANGE_FLAG) { this.CHANGE_FLAG = CHANGE_FLAG; } public Object getRISK_SCORE_CHANGE() { return RISK_SCORE_CHANGE; } public void setRISK_SCORE_CHANGE(Object RISK_SCORE_CHANGE) { this.RISK_SCORE_CHANGE = RISK_SCORE_CHANGE; } public int getRISK_LEVEL() { return RISK_LEVEL; } public void setRISK_LEVEL(int RISK_LEVEL) { this.RISK_LEVEL = RISK_LEVEL; } public Object getDISEASE_CODE() { return DISEASE_CODE; } public void setDISEASE_CODE(Object DISEASE_CODE) { this.DISEASE_CODE = DISEASE_CODE; } public Object getBAD_HABITS() { return BAD_HABITS; } public void setBAD_HABITS(Object BAD_HABITS) { this.BAD_HABITS = BAD_HABITS; } public Object getBAD_HABITS_DESC() { return BAD_HABITS_DESC; } public void setBAD_HABITS_DESC(Object BAD_HABITS_DESC) { this.BAD_HABITS_DESC = BAD_HABITS_DESC; } public Object getBAD_HABITS_IMPROVE() { return BAD_HABITS_IMPROVE; } public void setBAD_HABITS_IMPROVE(Object BAD_HABITS_IMPROVE) { this.BAD_HABITS_IMPROVE = BAD_HABITS_IMPROVE; } } } } } } } } ``` 网络请求的时候 doRiskTableListGet()这个方法报错 ``` public class RiskAssessmentModel implements IRiskAssessmentContart.IRiskAssessmentModel { @SuppressLint("CheckResult") @Override public void getRiskAssessment(HashMap<String, Object> params, final IRequestCallback iRequestCallback) { RetrofitUtils.getInstance().createService(IRetrofitServer.class) .doRiskTableListGet(ApiService.RISK_TABLE_LIST, params) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer<RiskAssessmentBean>() { @Override public void accept(RiskAssessmentBean riskAssessmentBean) throws Exception { if (iRequestCallback != null) { iRequestCallback.onSuccess(riskAssessmentBean); } } }, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) throws Exception { if (iRequestCallback != null) { iRequestCallback.onFailed(throwable); } } }); } ``` 这是我进到doRiskTableListGet()方法内的代码 ``` @GET Observable<RiskAssessmentBean> doRiskTableListGet(@Url String apiUrl, @QueryMap HashMap<String, Object> params); ```
tomcat经常挂掉,过程如下
八月 18, 2016 10:59:13 上午 org.apache.coyote.AbstractProtocol pause 信息: Pausing ProtocolHandler ["http-apr-9996"] 八月 18, 2016 10:59:13 上午 org.apache.coyote.AbstractProtocol pause 信息: Pausing ProtocolHandler ["ajp-apr-8021"] 八月 18, 2016 10:59:13 上午 org.apache.catalina.core.StandardService stopInternal 信息: Stopping service Catalina 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 严重: The web application [/] registered the JDBC driver [com.mysql.fabric.jdbc.FabricMySQLDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 严重: The web application [/] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [FileWatchdog] but has failed to stop it. This is very likely to create a memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@76776dce]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@1aca2c25]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@4f183ee0]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@40c80cb1]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@db959b1]) and a value of type [com.yunze.bcpt.service.pay.weixinpay.common.Configure.Account] (value [OA]) but failed to remove it when the web app lication was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. "/home/tomcat/bcpt/weixin/logs/catalina.out" 710295L, 232929613C 710150,1 99% 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@4f5ea590]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@4b3e241a]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@76776dce]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@40c80cb1]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@3af7a81]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@4ec7b9a5]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@4f183ee0]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/] created a ThreadLocal with key of type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@4ec7b9a5]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going t o be renewed over time to try and avoid a probable memory leak. 八月 18, 2016 10:59:13 上午 org.apache.coyote.AbstractProtocol stop 信息: Stopping ProtocolHandler ["http-apr-9996"] 八月 18, 2016 10:59:13 上午 org.apache.coyote.AbstractProtocol stop 信息: Stopping ProtocolHandler ["ajp-apr-8021"] 八月 18, 2016 10:59:13 上午 org.apache.coyote.AbstractProtocol destroy 信息: Destroying ProtocolHandler ["http-apr-9996"] 八月 18, 2016 10:59:13 上午 org.apache.coyote.AbstractProtocol destroy 信息: Destroying ProtocolHandler ["ajp-apr-8021"] 这个是catlina.out在程序每次挂掉前的输出,没有其他的错误日志 export JAVA_OPTS="-server -Xms650m -Xmx650m -Xmn260m -XX:PermSize=256m -XX:MaxPermSize=256m -Xss256K -XX:+DisableExplicitGC -XX:SurvivorRatio=2 -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=1 -XX: +CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -Djava.awt.headless=true -XX:+PrintClassHistogram -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC - Xloggc:/var/log/gc.log -XX:ErrorFile=/var/log/hs_err_pid.log" 多次调试还是会挂,这是目前的JVM参数,同时还运行了另一个tomcat实例,但那一个就不会挂,感谢各位大神指点
SDK打包成aar时,如何自动加载所依赖的jar包
最近需要以前的项目封装一个SDK,aar文件,以前的项目引用jar包的方式都是 通过implementation 'com.google.code.gson:gson:2.8.0'引用第三方jar包的, 但是现在封装成arr时,怎么使用这种方式在arr使用的时候自动去加载需要的jar包呢? * 有一种方式是将需要的jar文件放到libs目录下,但是这样打出来的包非常臃肿,而且有的jar包还会依赖其他jar文件,这样的后果就是造成java.lang.ClassNotFoundException: Didn't find class的异常,所以不希望使用这种方式,有其他更好的方式吗 *
Androidstudio编译的App5.几系统上能运行,4.4系统上不行,闪屏就退了求大神们指教
这是我 gradle android { compileSdkVersion 23 buildToolsVersion "23.0.1" useLibrary 'org.apache.http.legacy' sourceSets { main { jniLibs.srcDirs = ['libs'] } } /* 。。。。。。。。。*/ //签名 signingConfigs { debug { } release {// 自己的签名文件 storeFile file("E:\\Apk\\jklc.jks") storePassword "123456" keyAlias "jklc" keyPassword "123456" } } defaultConfig { applicationId "com.jklc.healthyarchives" minSdkVersion 16 targetSdkVersion 24 versionCode 1 versionName "1.0" } buildTypes { debug { // 显示Log buildConfigField "boolean", "LOG_DEBUG", "true" versionNameSuffix "-debug" minifyEnabled false zipAlignEnabled false shrinkResources false signingConfig signingConfigs.debug } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.2.0' compile 'com.alibaba:fastjson:1.2.10' compile 'com.google.code.gson:gson:2.2.4' compile 'com.squareup.okhttp:okhttp:2.0.0' compile 'de.greenrobot:eventbus:2.4.0' compile 'com.facebook.fresco:fresco:0.12.0' compile 'com.jakewharton:butterknife:5.1.1' compile files('libs/httpmime-4.1.1.jar') compile files('libs/Sunflower.jar') }
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
JDK12 Collectors.teeing 你真的需要了解一下
前言 在 Java 12 里面有个非常好用但在官方 JEP 没有公布的功能,因为它只是 Collector 中的一个小改动,它的作用是 merge 两个 collector 的结果,这句话显得很抽象,老规矩,我们先来看个图(这真是一个不和谐的图????): 管道改造经常会用这个小东西,通常我们叫它「三通」,它的主要作用就是将 downstream1 和 downstre...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
【图解经典算法题】如何用一行代码解决约瑟夫环问题
约瑟夫环问题算是很经典的题了,估计大家都听说过,然后我就在一次笔试中遇到了,下面我就用 3 种方法来详细讲解一下这道题,最后一种方法学了之后保证让你可以让你装逼。 问题描述:编号为 1-N 的 N 个士兵围坐在一起形成一个圆圈,从编号为 1 的士兵开始依次报数(1,2,3…这样依次报),数到 m 的 士兵会被杀死出列,之后的士兵再从 1 开始报数。直到最后剩下一士兵,求这个士兵的编号。 1、方...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
GitHub标星近1万:只需5秒音源,这个网络就能实时“克隆”你的声音
作者 | Google团队 译者 | 凯隐 编辑 | Jane 出品 | AI科技大本营(ID:rgznai100) 本文中,Google 团队提出了一种文本语音合成(text to speech)神经系统,能通过少量样本学习到多个不同说话者(speaker)的语音特征,并合成他们的讲话音频。此外,对于训练时网络没有接触过的说话者,也能在不重新训练的情况下,仅通过未知...
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
【管理系统课程设计】美少女手把手教你后台管理
【文章后台管理系统】URL设计与建模分析+项目源码+运行界面 栏目管理、文章列表、用户管理、角色管理、权限管理模块(文章最后附有源码) 1. 这是一个什么系统? 1.1 学习后台管理系统的原因 随着时代的变迁,现如今各大云服务平台横空出世,市面上有许多如学生信息系统、图书阅读系统、停车场管理系统等的管理系统,而本人家里就有人在用烟草销售系统,直接在网上完成挑选、购买与提交收货点,方便又快捷。 试想,若没有烟草销售系统,本人家人想要购买烟草,还要独自前往药...
4G EPS 第四代移动通信系统
目录 文章目录目录4G 与 LTE/EPCLTE/EPC 的架构E-UTRANE-UTRAN 协议栈eNodeBEPCMMES-GWP-GWHSSLTE/EPC 协议栈概览 4G 与 LTE/EPC 4G,即第四代移动通信系统,提供了 3G 不能满足的无线网络宽带化,主要提供数据(上网)业务。而 LTE(Long Term Evolution,长期演进技术)是电信领域用于手机及数据终端的高速无线通...
日均350000亿接入量,腾讯TubeMQ性能超过Kafka
整理 | 夕颜出品 | AI科技大本营(ID:rgznai100)【导读】近日,腾讯开源动作不断,相继开源了分布式消息中间件TubeMQ,基于最主流的 OpenJDK8开发的Tencent Kona JDK,分布式HTAP数据库 TBase,企业级容器平台TKEStack,以及高性能图计算框架Plato。短短一周之内,腾讯开源了五大重点项目。其中,TubeMQ是腾讯大数据平台部门应用的核心组件,...
相关热词 c# plc s1200 c#里氏转换原则 c# 主界面 c# do loop c#存为组套 模板 c# 停掉协程 c# rgb 读取图片 c# 图片颜色调整 最快 c#多张图片上传 c#密封类与密封方法
立即提问