自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

chaplinlong的博客

每一次转身,只是不想错过。

  • 博客(76)
  • 资源 (3)
  • 收藏
  • 关注

原创 Attempt to invoke virtual method int android.graphics.Bitmap.getWidth() on a null object

公司之前老项目升级:之前使用:BitmapFactory.decodeFile(path,myOptions);一直很好的,今天突然 ‘int android.graphics.Bitmap.getWidth()’ on a null 一直报null。奇怪的是,28一下手机正常,29不正常。马上想到是Android Q的特性。 BitmapFactory.Options myOptions = new BitmapFactory.Options(); myOptions.inJustD

2020-05-23 12:18:28 5106 1

原创 Deprecated: use FragmentPagerAdapter(FragmentManager, int) with BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMEN

viewpage+多fragment时,遇到以下deprecatedDeprecated: use FragmentPagerAdapter(FragmentManager, int) with BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT解决办法: vp_main.adapter = object : FragmentPagerAdapter(supportFragmentManager, FragmentPagerAdapter.BEHA

2020-06-01 18:36:06 3807 3

原创 android.os.FileUriExposedException: file:///storage/emulated/0/DCIM/Camera/2018012Android 7.0相继崩溃的问题

今天项目的bug:android.os.FileUriExposedException: file:///storage/emulated/0/DCIM/Camera/20180121181328.jpg exposed beyond app through ClipData.Item.getUri()build.gradle中加入:

2018-01-21 18:24:53 11930 8

原创 android的Notification折叠

android 的Notification 看起来简单,但是api老是改。用的时候确实很麻烦。这里写一个折叠的Demo。 布局文件:activity_main<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xml

2016-12-06 14:54:50 3306

原创 android 5.x设置actionBar色调

android 5.x提供了色调的方法,其实很简单,直接上代码。 api至少21./ 创建Palette对象 Palette.generateAsync(bitmap, new Palette.PaletteAsyncListener() { @TargetApi(Build.VERSION_CODES.LOL

2016-12-05 20:28:28 439

原创 android studio谁用butterknife(正确地打开方式)

最近在用butterknife。网上有很多引用的方法。好多不太准确。这里就说一哈。 1、在android studio中添加插件:butterknife 2.在项目的build.gradle中添加: classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’ // 添加这行 3.添加依赖: compile ‘com.jakewha

2016-11-15 16:36:34 567

原创 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)设置后的效果

android app开发时,查看之前的会有这样的设置。 //如果sdk版本大于4.4则设置状态栏透明化 会导致首页状态栏减少 /* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { Window window = getWindow(); window.setFlags

2016-11-15 14:14:21 20413 1

原创 Invalid bean definition with name 'mailSender' defined in class path resource [office.mail.xml

今天项目出现这个异常。看完整的。org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'mailSender' defined in class path resource [office.mail.xml]: Could not resolve placeh

2016-08-24 00:50:58 3658

原创 java.lang.OutOfMemoryError: PermGen space 解决

今天写项目时,突然遇到这个问题。java.lang.OutOfMemoryError: PermGen spacePermGen space,Permanent Generation space,指内存的永久保存区域OutOfMemoryError: PermGen space从表面上看就是内存益出,解决方法也一定是加大内存。我是这样解决的:先清掉项目缓存,再清掉workspace.metadata

2016-08-22 17:40:48 392

原创 c3p0异常,exception is java.lang.NoClassDefFoundError: com/mchange/v2/log/jdk14logging/ForwardingLogger

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested excepti

2016-08-19 15:38:52 2540

原创 spring中的增强:注解和schema配置几种情况

这里说一下spring的增强。先看schema的五种情况,如下代码:注意: 环绕增强的参数:ProceedingJoinPoint jp。ProceedingJoinPoint 是JoinPoint的子类。public class MyAop { public void before(JoinPoint jp){ System.out.println("before");

2016-08-18 00:11:03 3347 1

原创 Class<SpringJUnit4ClassRunner> cannot be resolved to a type spring4.32的junit测试报错解决

直接上bugClass<SpringJUnit4ClassRunner> cannot be resolved to a type看代码@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/bean-aspect.xml") public class Test1 {1,记得导入spring的test jar包。 2.记

2016-08-17 01:27:25 12953 4

原创 org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException 解决

Failed to instantiate [org.springframework.aop.aspectj.AspectJExpressionPointcut]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/Reflectio

2016-08-14 18:09:20 908

转载 spring的几个问题

今天只看几个问题。 1.BeanFactory与applicationContext BeanFactory 可以理解为含有bean集合的工厂类。BeanFactory 包含了种bean的定义,以便在接收到客户端请求时将对应的bean实例化。BeanFactory还能在实例化对象的时生成协作类之间的关系。此举将bean自身与bean客户端的配置中解放出来。BeanFactory还包含了bea

2016-08-13 22:05:56 492

原创 hibernate的一个分页的写法

直接上代码:// 按条件分页查询投票集合 public List<Subject> getSubjectList(String title, Integer pageNumber, Integer pageSize) { if(pageNumber==null){ pageNumber = 1; }

2016-08-12 23:28:39 417

原创 .NonUniqueObjectException: a different object with the same identifier等的解决

这几天写hibernate+struts2+easyui+Oracle小项目时遇到的异常。org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [entity.TbBooks#1]看英语,就表示

2016-08-12 00:36:04 779

原创 hibernate+Struts2+jquery easyui 做分页处理时的一些问题

合在一起做的时候,问题就多了。 1. select count(*) as col_0_0_ from JBIT.GOODS goods0_看到上面的sql,马上就会想到,获取所有记录时,面对long型的转换,修改Dao中代码。Integer.parseInt(session.createQuery(" select count(*) from Good

2016-08-08 18:10:42 1160

原创 ajax入门的一些基本用法

本篇文章,说说ajax的写的几种情况。 最原始的写法。<script type="text/javascript"> function test(){ var xmlHttpRequest=null; if (window.XMLHttpRequest) { xmlHttpRequest=new XMLHttpRequest(

2016-08-06 22:31:11 445

原创 商品订购系统时出现的问题汇总 not-null property references a null or transient value 等

最近用hibernate和struts2写的一个小的项目,出现了很多问题。还算顺利。问题点回顾。 1.配置struts2,直接忘记在web.xml配置核心控制器。2.1.3之前是FiltDispatcher,之后是filter.StrutsPrepareAndExecuteFilter.忘记配了,直接不报错误。<filter> <filter-name>struts2</f

2016-08-06 00:08:37 7308

原创 org.hibernate.LazyInitializationException解决办法

ERROR org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception occurred during processing request: [org.hibernate.LazyInitializationException: could not initialize proxy - no Session, co

2016-08-04 00:53:48 11232

原创 java中简单工厂模式

简单工厂模式,其实结合例子来说更容易理解。拿汽车举例子,Car首先是一个接口,有一些抽象的公共的方法。car1,car2……就可以实现这个接口。在做一个接口的类,将Car作为参数去判断car的类型,到底是car1,car2……。 下面看代码。 接口:package carDemo;public interface Car { void stop(); void run();}汽

2016-08-02 15:14:27 443

原创 The file cannot be validated as the XML definition 异常解决办法

在struts2中配置验证框架时,回报上面的错误。这时候,要学会读懂英文意思。文件不能被验证的XML定义。下面看完整的错误提示。The file cannot be validated as the XML definition "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd" that is specified as des

2016-07-30 22:14:13 7235

原创 ajax调用时,document.getElementById获取不到值

今天写ajax的一个小例子的时候,document.getElementById居然获取不到值,后来找到了,对自己很是无语。 先看jsp页面<body> <script type="text/javascript"> var req = null; function test() { var name = document.all.na

2016-07-29 16:24:06 2917

原创 struts2的下载及注意事项

先看action类。package actions;import java.io.BufferedInputStream;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.InputStream;import java.io.UnsupportedEncodingExcepti

2016-07-28 15:15:25 410

原创 Address already in use: JVM_Bind解决办法

早上写的时候。突然myeclipse就报这个错误。Address already in use: JVM_Bind网上看到了很多解决办法。但多不靠谱。 比如。重新配个tomcat,或者换个tomcat版本…… 仔细分析英文提示:说明JVM已经被占用了。有其他程序在用,事实上你好像没有其他的程序。果断:ctrl+alt+delete.结束一个javaw.exe运行程序就好。 当然,发现还是报错,

2016-07-27 10:02:10 14433

原创 struts2中上传,及注意问题

先看简单的jsp页面 <form action="fileupload.action" method="post" enctype="multipart/form-data"> <input type="file" name="image" /> <input type="submit" /> </form> <img alt="" src="imag

2016-07-27 00:47:29 281

原创 struts的几个小异常

ERROR org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception occurred during processing request: [org.hibernate.PropertyValueException: not-null property references a null or transient

2016-07-27 00:23:56 1277

原创 自定义struts2的mvc时几个异常

D:\myeclipse\my\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_9.0.0.me201211011550\tomcat\bin\mystruts.dtd (系统找不到指定的文件。)1,解决方案,把你的dtd文件放那个路径下。或者dtd和xml文件不分开。See Servlet Spec 2.3, section 9

2016-07-25 23:50:17 258

原创 Myeclipse导出uml类图和导出javadoc时"错误: 编码GBK的不可映射字符"解决

1.Myeclipse导出uml类图很简单,项目-右键=new-UML2 mode-这时根据自己的需要添加就好了。 选择类图,右键export就可以导出,图片格式。 2。Myeclipse导出javadoc时,如果出现编码GBK的不可映射字符”。一般提示都很友好,你会看到那个页面出错。 第一种解决办法:导出时在VM设置行中加入以下代码 -encoding utf-8 -charset u

2016-07-24 20:01:08 493

原创 ERROR org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception

出现这个错误的时候,异常后面跟着是我请求的路径。 解决办法1:检查你的Method方法配置<action name="release" class="actions.HouseAction" method="releaseHouse"> <result name="success">/page/fabu.jsp</result> <result na

2016-07-24 09:31:49 27079

原创 Caused by: java.sql.BatchUpdateException: ORA-01438: 值大于为此列指定的允许精度如何解决

Caused by: java.sql.BatchUpdateException: ORA-01438: 值大于为此列指定的允许精度 遇到这个问题时,从以下几点找原因 1.检查列所对应的实体的类型是否写错。 2.由于我用Oracle,主键是自增长,检查自增长的配置。若是用注解写的。看看有木有写错。@Id @GeneratedValue(strategy = GenerationType

2016-07-22 21:36:35 15364

原创 hibernate与struts2一起时的异常处理

今天项目刚将hibernate与struts2放一起。异常还不少。ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...log4j:WARN No app

2016-07-22 00:17:37 4770

原创 Javassist library is missing in classpath! Please add missed dependency!异常

看懂英语很简单。Javassist library 这个jar包丢了。javassist-3.20.0-GA.jar就好。 另外: struts2的核心控制器去掉了其中的.ngorg.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

2016-07-20 08:38:20 1451

原创 java反射调用方法时,Class . can not access a member of class . with modifiers "private" 等异常解决

先看javabean类:目的使用反射调用私有方法:package com.imooc.reflect;public class Student { private void add(){ System.out.println("增加数据!"); } private int id; private String name; public int ge

2016-07-19 21:38:06 55840 2

原创 读取mystruts2的xml文件——dom4j读取

先看mystruts2的xml文件:这里写<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE mystruts SYSTEM "mystruts.dtd"><mystruts> <actions> <action name="register" class="RegisterAction">

2016-07-18 21:12:51 400

原创 编写xml文件时,The markup in the document preceding the root element must be well-formed.等bug

今天写dtd,xml文件时,连续报bug。 The markup in the document preceding the root element must be well-formed. 错误原因:ELEMENT 写成ElEMENT。 另外:xml区分大小写。<!DOCTYPE poem system "poem1.dtd" ><!doctype poem SYSTEM "poem1.

2016-07-17 18:21:10 20261

原创 Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: 表或视图不存在,分页等关于hibernate测试的几个问题

今天的hibernate出现一个错误 1.异常。Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: 表或视图不存在异常很明显。马上想到的是数据库连接是不是改了。我之前的用户名是htest,后面改成htest1。立刻改掉。<property name="connection.username">htest1</property>还是报错。

2016-07-16 09:15:53 20707

原创 not-null property references a null or transient value: 等关于cinema项目bug

今天改一个项目,遇到好多bug。以下一一说主要bug。 1.not-null property references a null or transient value: entity.Film.name很明显,意思是不能有一个空的属性引用。 解决:检查数据库,允许为空,发现还是报错。 在xml文件中,去掉属性中not-null即可。2.Could not execute JDBC batc

2016-07-14 23:31:22 737

原创 An AnnotationConfiguration instance is required to use...等几个异常

1.异常: An AnnotationConfiguration instance is required to use 意思是,用了注解了,自然要用注解类生成SessionFactory private static Configuration configuration = new AnnotationConfiguration();当然了,如果你用Hibernate4以上的版本,就没有这种

2016-07-13 21:42:42 3299

原创 Mapped Statements collection does not contain value for ......

这种问题,只要知道关键字Mapped 就表示是映射文件出错。在根据for后面指定的内容,就可以定位错误了。然后错误只可能是:namespace,id或者是resultType。

2016-07-13 01:21:14 361

android动画加载

android加载时,两个球交换刷新

2016-12-13

商品订购系统

hibernate,struts2,实现简单的商品订购。内含数据库。

2016-08-12

hibernate分页查询

hibernate分页查询,里面包含数据库。自己写的。能正常运行。

2016-08-12

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除