MyEclipse配置weblogic9
这篇笔记放了N久了,我还是觉得放上来可以有个参考。
做了些许修改。。。。。
用了新版本的MyEclipse6.0.1(环境问题可能对开发环境有一定的影响,特别的框架开发SSH)做了简单的测试,果然添加的时候少了一个包,还好我从先前的项目拿过来就没事了
服务器已经换成是weblogic了,在MyEclipse6.0.1配置weblogic9.2
填写相关信息
D:weblogicbea
D:weblogicbeaweblogic92
weblogic
weblogic
D:weblogicbeauser_projectsdomainsbase_domain
AdminServer
D:weblogicbeaweblogic92serverlibweblogic.policy
注意JDK选择weblogic自带的JDK1.5
不做以上那步,启动就会出现如下问题
There are 1 nested errors:
weblogic.management.ManagementException: [Management:141266]Parsing Failure in config.xml: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448754896609940
Caused by: java.io.InvalidClassException: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448754896609940
添加几个JAR如下(这一步不加的话暂时我没发现有什么问题的)
最后,可以从菜单那里直接部署和启动
问题补充------------
出现错误:
java.sql.SQLException: Connections could not be acquired from the underlying database!
A ResourcePool could not acquire a resource from its primary factory or source.
原因: 没有dianxun这个数据库
<property name="jdbcUrl" value="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=dianxun" />
最后我还是发现用6.0建的环境就是有点问题,我用了老版5.1.1正常
特别是在添加三个框架的支持
现在我用了6.6,效果还好
连接MSSQL2000所出现的错误 error establishing socket
原因是还没打补丁
打开企业管理器-〉工具-〉SQL查询分析器-〉帮助-〉关于
查看sql server的详细版本号
如果 是 8.00.194 就是还没打补丁
8.00.760 就是SP3
8.00.2039 就是SP4
打了SP4的补丁就OK了
ERROR [org.hibernate.util.JDBCExceptionReporter] - [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported method: ResultSet.absolute
Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute query
原来是这样
public List queryAll(int currentPage, int lineSize, String provinceName)
throws Exception {
List all = null;
String hql = "from DxCom" + provinceName
+ " as com order by com.comHot desc";
Query q = this.getSession().createQuery(hql);
q.setFirstResult((currentPage - 1) * lineSize);
q.setMaxResults(lineSize);
all = q.list();
return all;
}
还以为HQL语句有错 原来currentPage 我传了个0过去 (currentPage - 1) * lineSize 就成负数了
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'comGroupBusinessImpl' defined in file [E:JAVAnewworkspacedianxunWebRootWEB-INFclassesconfigsspringapplicationContext-business.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required
java.lang.IllegalArgumentException:sessionFactory or hibernateTemplate is required
原因是我是business层的实现类也继承自HibernateDaoSupport 而这层是没有注入sessionFactory的 所以错了 挺傻的错误
DAO hibernatge分页操作
q.setFirstResult((currentPage - 1) * lineSize);
q.setMaxResults(lineSize);
乱码问题
这个问题困扰了我很久,什么方法都试过了,但就是莫名其妙出现这些错误
----璁镐匠姝?
现在我应该可以肯定,出现这种乱码是gbk和utf-8之间的中文差异导致的。
从JS那边传递过来的value值,通过编码传向struts的action
xmlHttp.send("&value=" + encodeURIComponent(_node.value));
而在action里直接用request.getParameter("value");接收就行了。
因为我加了过滤器,已经带有解码的过程,如果再用
new String(request.getParameter("value").getBytes("IOS8859-1"),
"gb2312")就多此一举了,得出来都是问号
这个过程本身没错,不过过滤器我用gbk得出来就是璁镐匠姝? 用utf-8就没事
我很怀疑是JS本身是utf-8的,但我明明设了gbk了,但就是没用。
我只好把项目换成utf-8了