
JavaEE
文章平均质量分 84
2Tu
https://2tu.github.io
展开
-
Spring中Bean的作用域与StepScope关系、疑问
Spring中Bean的作用域与StepScope关系、疑问Spring Bean有5个作用域,但是最近有需求在多个地方获取同一个Bean,只修改其中一个参数。那么Bean只在一个地方注入,修改属性就好,名字能一样吗?一系列问题 这个StepScope是什么鬼,5个默认的Scope能满足需求吗? Bean scopes Scope Description singleton Sc原创 2018-01-17 17:29:58 · 6602 阅读 · 0 评论 -
hibernate annotations @Entity hql "XX not mapped"
首先我在配置文件里面已经有配置 com.travelsky.ism.bean 然后我在bean里面也指出了@Entity@Table(name="xxx")再者我也没有写错对象名所以不存在是这三种问题让我抓狂。最后发现是@Id @GeneratedValue(strategy= GenerationT原创 2012-04-15 04:21:13 · 754 阅读 · 0 评论 -
org.xml.sax.SAXParseException: Content is not allowed in prolog.
文件的开端错误我少写了个网上也有说BOM什么的原因及其解决办法:1.xml编码错误该xml是UTF-8编码的,如果该文件通过UltraEdit编辑后,会在无BOM头的UTF-8文件中加入BOM,但是DOM4j不认这个BOM(dom4j1.3),解决的办法可以通过升级dom4j到1.6解决www.dom4j.org什么是BOM?http://w原创 2012-04-15 20:52:59 · 740 阅读 · 0 评论 -
Hibernate exception
org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentException occurred while calling setter of com.travelsky.ism.bean.UserBase.userGroupId; nested exception is org.hibernate.Pr原创 2012-04-12 10:21:16 · 713 阅读 · 0 评论 -
struts2 FilterDispatcher StrutsPrepareAndExecuteFilter
StrutsPrepareAndExecuteFilter与FilterDispatcher的区别org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterorg.apache.struts2.dispatcher.FilterDispatcherFilterDispatcher是早期struts2的过原创 2012-04-11 11:25:46 · 1543 阅读 · 0 评论 -
install the CLEARCASE with eclipse 3.4,duplicate location
详情:http://www-01.ibm.com/support/docview.wss?uid=swg24025674duplicate locationinstall new software然后再出现的界面中将已经安装的部分software卸掉,一般这样做了貌似还是不可以继续安装的,Don't worry ! 再继续进行下原创 2012-04-06 14:23:08 · 859 阅读 · 0 评论 -
tomcat加载项目原理解惑
今天新遇到一个问题,同样是在启动startup.bat的时候, 最后得出的结论居然是java_home这个环境变量的值后面加了个";(分号)"的原因.得出的解释是加上分号代表有两个值以上,java_home不能有两个值. 在tomcat的webapps下加入了一个文件夹,希望通过启动tomcat来访问文件夹下面的文件.然而在启动startup.bat和在eclipse下原创 2011-10-10 09:42:57 · 2829 阅读 · 0 评论 -
Duplicate modifier for the method isExist in type UploadMusicInfoController
Duplicate modifier for the method isExist in type UploadMusicInfoController在UploadMusicInfoController类中重复修饰isExist方法. 由于isExist方法之前多写了一个权限关键字造成.原创 2012-01-06 11:42:08 · 10394 阅读 · 0 评论 -
SimplDateFormat 日期格式转换
SimpleDateFormat now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");Calendar c = Calendar.getInstance();System.out.println("insertTime--->"+now.format(c.getTime()));SimpleDateFormat now = new Simpl原创 2012-01-04 00:19:28 · 1122 阅读 · 0 评论 -
获得当前时间
SimpleDateFormat simpleDateTimeFormat = new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " ); Calendar c = Calendar.getInstance(Locale.CHINESE); //getInstance() String nowtime = simpleD原创 2012-01-02 14:37:09 · 491 阅读 · 0 评论 -
Struts2,oracle实现GOOGLE的分页样式
BAIDU的搜索我的实现,跟google的是一样的,没有像百度一样加载20条要修改的地方分为三处:Pager.java,Action,jspPager.java是用来存储各种页面属性以及定义输出到页面的分页样式的。Action则是将数据库里面的数据查询出来,然后将其传输到页面,当然还有Pager.java里面的输出样式也在这里面传输到页面。jsp取出原创 2012-04-16 15:24:48 · 1289 阅读 · 0 评论 -
configure integration Hibernate3,Spring3,Struts2,JPA
记各种抓狂,各种报错web.xml<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schem原创 2012-04-16 15:40:27 · 1063 阅读 · 0 评论 -
Manifest中找不到versionCode?
Manifest中找不到versionCode?起因17年做的update(升级平台)交由其它团队维护后,发现解析Manifest后未找到versionCode、versionName信息。 大家都讲终极绝招,使用aapt来获取,但是这样耦合低,并且得在服务器上维护Android环境,显然不合理。所以要干他 此文都是解决思路,心急直接看最后的结论环境Android Stu原创 2018-01-11 13:19:37 · 3744 阅读 · 1 评论 -
日期格式化 YYYY日期错位
日期格式化 YYYY日期错位起因支付系统通知账务还款结果时,对请求时间使用“YYYYMMddHHmmss”格式化,20171231变为了20181231致使数据不匹配。 我们大多都知道mm与MM的区别,因为分和月会同时出现,但很少会关注其它的pattern大小写有无区分。 重现demo如下 Date date = new Date(2017 - 1900, 1原创 2018-01-10 21:23:46 · 978 阅读 · 1 评论 -
java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut
从公司把项目拷回来报此错公司的环境是jdk1.6本机为1.7jdk版本与aspectJrt不符。替换aspectjrt即可下载地址http://www.eclipse.org/aspectj/downloads.php原创 2012-05-22 21:27:31 · 989 阅读 · 0 评论 -
tomcat does not exist /多个tomcat运行在一台机器上/一个tomcat运行多个实例
异常 之 java.lang.IllegalArgumentException:Document base *** does not exist or is not a readable这是由于在webapps里面将项目删除,却没有在其它相应的工作目录删除确定3点:1.该项目的War文件从***\apache-tomcat-6.0.16\webapps 移出;2.该项目原创 2012-05-31 10:32:57 · 964 阅读 · 0 评论 -
Struts2自动添加 table tr 等问题
<td>解决方法:修改struts.xml文件,在其中加入如下行REFERENCES:http://blog.sina.com.cn/s/blog_5f055bd90100u1wq.html原创 2012-05-14 10:32:01 · 966 阅读 · 0 评论 -
java中OOA,OOT, OOP, OOD, OOSM,OOM英文表示的含义是什么?
OOA - Object-Oriented Analysis(面向对象分析)OOT - Object-Oriented Testing (面向对象测试)OOP - Object-Oriented Programming (面象对象编程)OOD - Object-Oriented Design(面向对象设计)OOSM - Object-Oriented Softwar原创 2012-04-19 09:26:57 · 3572 阅读 · 2 评论 -
SQL Server 对 Image字段进行操作
将图片写入数据库 public void testUploadPicture() { String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; String url = "jdbc:sqlserver://192.168.0.108:1433;databasename=music";原创 2012-01-02 15:58:31 · 1193 阅读 · 0 评论 -
jquery.validationEngine+ajax验证
利用jquery.validationEngine ajax验证后台id是否已存在前台jquery validation框架验证 jsp:/js/css/validationEngine.jquery.css"/>/js/jquery/jquery-1.4.2.m原创 2011-09-20 09:06:00 · 6038 阅读 · 7 评论 -
Cannot refer to a non-final variable music inside an inner class defined in a different method
Change modifier of 'music' to finalhttp://stackoverflow.com/questions/1299837/cannot-refer-to-a-non-final-variable-inside-an-inner-class-defined-in-a-differen最近在写程序的时候一直出现这个提示,一直没有时间来查询原因.不解,先把标原创 2011-12-16 23:50:53 · 1672 阅读 · 0 评论 -
OutputStream write文件比原来的大
在server端使用out.write(buffer, 0, byteRead);在client端获取后使用out.write(buffer);写出来的文件会比源文件大,而且大小不太固定.如果我在client也换成out.write(buffer, 0, byteRead);则完全没问题.求教.API上是说write(byte[] b)也是写入的b.length个字节.难道是这里的原创 2012-02-04 10:46:49 · 1545 阅读 · 0 评论 -
java.lang.IllegalArgumentException at java.sql.Date.getHours JSONException
在我这里是由于java.util.Date 和 java.sql.Date的转换问题造成的.好像是由于在json里要输出的实体类中的一个属性类型为java.sql.Date.我将其改变成了java.util.Date.就好了.另附上:java.util.Date 转换为 java.sql.Datejava.util.Date 就是在除了SQL语句的情况下面使用j原创 2011-12-15 13:51:55 · 3928 阅读 · 1 评论 -
Open quote is expected for attribute "{1}" associated with an element type "name".
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.xml.XmlBeanDefinitionStoreExcepti原创 2011-12-15 15:59:04 · 17676 阅读 · 0 评论 -
publishing failed with multiple errors eclipse
question:I clean and restarted Tomcat Server. From that time the error comes as followsPublishing failed with multiple errors Resource is out of sync with the file systemCan you help me原创 2011-12-14 16:46:46 · 5382 阅读 · 1 评论 -
严重: BAD packet signature 18245
发现是我不小心将url上的端口号写错了.原创 2011-12-14 14:20:37 · 1306 阅读 · 0 评论 -
- No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing in
- No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing instance of type Test (e.g. x.new A() where x is an instance of Test).public class Test {原创 2011-12-14 11:25:12 · 8286 阅读 · 0 评论 -
Eclipse里选一个变量后,这个类里的该变量不变色了
1.使用“Alt+Shift+O”对该提示功能的开/关切换 Eclipse中Preference中--->General--->Editor--->Text Editors --> Annotations -->Occurrence中,选择颜色。首选项里的java->editor->Mark Occurrences里设置原创 2011-12-22 16:57:40 · 1165 阅读 · 1 评论 -
no suitable driver at java.sql.DriverManager
出现这样的情况,一般有四种原因: 一:连接URL格式出现了问题(Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/XX","root","XXXX") [qzhao]:我的配置如下: com.mysql.jdbc.Driver jdbc:mysql://10.111.3.244原创 2011-12-11 13:32:45 · 1848 阅读 · 0 评论