免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: Boson

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决) [复制链接]

论坛徽章:
0
发表于 2003-11-12 18:02 |显示全部楼层

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决)

行,你是老大,真的就没问题了,真是高人啊 ^_^

怪不得总报错,但系统还是正常了,还有这种道理,唉,头晕

有空多来帮我,明天说不定还有问题啊,今天谢谢你了!!!!!!!!!!

论坛徽章:
0
发表于 2003-11-12 18:21 |显示全部楼层

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决)

原帖由 "cinc" 发表:
另外,将来把原来放在 jsp 和 java 文件里的 中文放到资源文件里
这样只转换 资源文件,会比较方便些。



你这个观点我非常赞同,我的HRMS部份已经是这样做了,但还有一些是直接在页面上做的,还有点痛苦,呵呵

论坛徽章:
0
发表于 2003-11-13 09:53 |显示全部楼层

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决)

中间件用的是: jboss3.2.1_tomcat4
数据库: oracle 9
JDBC: 国际中文化的包

问题: 当我发布EJB的时候,我是用JBuilder7直接发布的,奇怪的是,我的某一个EJB,在第一次deploy的时候就会出错, 出错信息如图1. 错误出来以后,我检查了一下错误信息,好像提示我要redeploy一次,于是我重新发布了一下,这样就成功了,成功信息如图2

请大家帮我分析一下,也许是EJB本身错误,但愿是这个错误吧,我不想是再因为是我的JBOSS配置问题了,我觉得JBOSS好像会自动发布EJB的,一般是不用管的,所以我就没有理那么多了,但愿如此吧.


出错信息图1
============================================
09:44:34,390 INFO  [MainDeployer] Deployed package: file:/C:/jboss/server/defaul
t/deploy/staff.jar
09:44:54,468 INFO  [MainDeployer] Starting deployment of package: file:/C:/jboss
/server/default/deploy/sysparm.jar
09:44:55,078 WARN  [ClassLoadingTask] Duplicate class found: com.isw2.tpms.syspa
rm.ps.PsWeekday
Current CS: (file:/C:/jboss/server/default/tmp/deploy/server/default/deploy/sysp
arm.jar/54.sysparm.jar <no certificates>
Duplicate CS: (file:/C:/jboss/server/default/tmp/deploy/server/default/deploy/at
tendance.jar/48.attendance.jar <no certificates>
09:44:55,093 WARN  [verifier] EJB spec violation:
Bean   : PsWeekdayBean
Method : public abstract PsWeekday create() throws CreateException, RemoteExcept
ion
Section: 7.10.6
Warning: The return type for a create(...) method must be the session bean's rem
ote interface type.

09:44:55,093 ERROR [MainDeployer] could not create deployment: file:/C:/jboss/se
rver/default/deploy/sysparm.jar
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
d, see above for error messages.
        at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:487)
        at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
        at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
        at $Proxy7.deploy(Unknown Source)
        at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:302)
        at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:476)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:200)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
loop(AbstractDeploymentScanner.java:211)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
run(AbstractDeploymentScanner.java:190)
09:44:55,109 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment
.scanner.URLDeploymentScanner$DeployedURL@e5d54692{ url=file:/C:/jboss/server/de
fault/deploy/sysparm.jar, deployedLastModified=0 }
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
d, see above for error messages.
        at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:487)
        at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
        at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
        at $Proxy7.deploy(Unknown Source)
        at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:302)
        at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:476)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:200)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
loop(AbstractDeploymentScanner.java:211)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
run(AbstractDeploymentScanner.java:190)
============================================


成功信息图2
============================================
09:45:50,156 INFO  [MainDeployer] Undeploying file:/C:/jboss/server/default/depl
oy/sysparm.jar
09:45:50,156 WARN  [ServiceController] Ignoring request to stop nonexistent serv
ice: null
09:45:50,156 WARN  [ServiceController] Ignoring request to destroy nonexistent s
ervice: null
09:45:50,156 WARN  [ServiceController] Ignoring request to remove nonexistent se
rvice: null
09:45:50,156 WARN  [DeploymentInfo] Could not delete directory file:/C:/jboss/se
rver/default/tmp/deploy/server/default/deploy/sysparm.jar/54.sysparm.jar restart
will delete it
09:45:50,156 INFO  [MainDeployer] Undeployed file:/C:/jboss/server/default/deplo
y/sysparm.jar
09:45:50,156 INFO  [MainDeployer] Starting deployment of package: file:/C:/jboss
/server/default/deploy/sysparm.jar
09:45:50,781 INFO  [EjbModule] Creating
09:45:50,796 INFO  [EjbModule] Deploying PsDepartmentBean
09:45:50,796 INFO  [EjbModule] Deploying PsTitleBean
09:45:50,812 INFO  [EjbModule] Deploying PsAptitudeTypeBean
09:45:50,828 INFO  [EjbModule] Deploying PsPositionMemberBean
09:45:50,843 INFO  [EjbModule] Deploying PsProjectArcBean
09:45:50,843 INFO  [EjbModule] Deploying PsProjectMemberBean
09:45:50,859 INFO  [EjbModule] Deploying PsVacationBean
09:45:50,859 INFO  [EjbModule] Deploying BsSysParmBean
09:45:50,875 INFO  [EjbModule] Deploying PsWeekdayBean
09:45:50,890 INFO  [StatelessSessionContainer] Creating
09:45:50,906 INFO  [StatelessSessionInstancePool] Creating
09:45:50,906 INFO  [StatelessSessionInstancePool] Created
09:45:50,906 INFO  [StatelessSessionContainer] Created
09:45:50,906 INFO  [StatelessSessionContainer] Creating
09:45:50,906 INFO  [StatelessSessionInstancePool] Creating
09:45:50,906 INFO  [StatelessSessionInstancePool] Created
09:45:50,921 INFO  [StatelessSessionContainer] Created
09:45:50,921 INFO  [StatelessSessionContainer] Creating
09:45:50,921 INFO  [StatelessSessionInstancePool] Creating
09:45:50,921 INFO  [StatelessSessionInstancePool] Created
09:45:50,921 INFO  [StatelessSessionContainer] Created
09:45:50,921 INFO  [StatelessSessionContainer] Creating
09:45:50,921 INFO  [StatelessSessionInstancePool] Creating
09:45:50,921 INFO  [StatelessSessionInstancePool] Created
09:45:50,937 INFO  [StatelessSessionContainer] Created
09:45:50,937 INFO  [StatelessSessionContainer] Creating
09:45:50,937 INFO  [StatelessSessionInstancePool] Creating
09:45:50,937 INFO  [StatelessSessionInstancePool] Created
09:45:50,937 INFO  [StatelessSessionContainer] Created
09:45:50,937 INFO  [StatelessSessionContainer] Creating
09:45:50,953 INFO  [StatelessSessionInstancePool] Creating
09:45:50,953 INFO  [StatelessSessionInstancePool] Created
09:45:50,953 INFO  [StatelessSessionContainer] Created
09:45:50,953 INFO  [StatelessSessionContainer] Creating
09:45:50,968 INFO  [StatelessSessionInstancePool] Creating
09:45:50,968 INFO  [StatelessSessionInstancePool] Created
09:45:50,968 INFO  [StatelessSessionContainer] Created
09:45:50,968 INFO  [StatelessSessionContainer] Creating
09:45:50,984 INFO  [StatelessSessionInstancePool] Creating
09:45:50,984 INFO  [StatelessSessionInstancePool] Created
09:45:50,984 INFO  [StatelessSessionContainer] Created
09:45:50,984 INFO  [StatelessSessionContainer] Creating
09:45:50,984 INFO  [StatelessSessionInstancePool] Creating
09:45:50,984 INFO  [StatelessSessionInstancePool] Created
09:45:51,000 INFO  [StatelessSessionContainer] Created
09:45:51,000 INFO  [EjbModule] Created
09:45:51,000 INFO  [EjbModule] Starting
09:45:51,000 INFO  [StatelessSessionContainer] Starting
09:45:51,078 INFO  [StatelessSessionInstancePool] Starting
09:45:51,078 INFO  [StatelessSessionInstancePool] Started
09:45:51,078 INFO  [StatelessSessionContainer] Started
09:45:51,078 INFO  [StatelessSessionContainer] Starting
09:45:51,093 INFO  [StatelessSessionInstancePool] Starting
09:45:51,109 INFO  [StatelessSessionInstancePool] Started
09:45:51,109 INFO  [StatelessSessionContainer] Started
09:45:51,109 INFO  [StatelessSessionContainer] Starting
09:45:51,125 INFO  [StatelessSessionInstancePool] Starting
09:45:51,125 INFO  [StatelessSessionInstancePool] Started
09:45:51,125 INFO  [StatelessSessionContainer] Started
09:45:51,125 INFO  [StatelessSessionContainer] Starting
09:45:51,156 INFO  [StatelessSessionInstancePool] Starting
09:45:51,156 INFO  [StatelessSessionInstancePool] Started
09:45:51,156 INFO  [StatelessSessionContainer] Started
09:45:51,171 INFO  [StatelessSessionContainer] Starting
09:45:51,203 INFO  [StatelessSessionInstancePool] Starting
09:45:51,203 INFO  [StatelessSessionInstancePool] Started
09:45:51,203 INFO  [StatelessSessionContainer] Started
09:45:51,203 INFO  [StatelessSessionContainer] Starting
09:45:51,234 INFO  [StatelessSessionInstancePool] Starting
09:45:51,234 INFO  [StatelessSessionInstancePool] Started
09:45:51,234 INFO  [StatelessSessionContainer] Started
09:45:51,234 INFO  [StatelessSessionContainer] Starting
09:45:51,265 INFO  [StatelessSessionInstancePool] Starting
09:45:51,265 INFO  [StatelessSessionInstancePool] Started
09:45:51,265 INFO  [StatelessSessionContainer] Started
09:45:51,265 INFO  [StatelessSessionContainer] Starting
09:45:51,296 INFO  [StatelessSessionInstancePool] Starting
09:45:51,296 INFO  [StatelessSessionInstancePool] Started
09:45:51,296 INFO  [StatelessSessionContainer] Started
09:45:51,296 INFO  [StatelessSessionContainer] Starting
09:45:51,343 INFO  [StatelessSessionInstancePool] Starting
09:45:51,343 INFO  [StatelessSessionInstancePool] Started
09:45:51,343 INFO  [StatelessSessionContainer] Started
09:45:51,343 INFO  [EjbModule] Started
09:45:51,343 INFO  [EJBDeployer] Deployed: file:/C:/jboss/server/default/deploy/
sysparm.jar
09:45:51,390 INFO  [MainDeployer] Deployed package: file:/C:/jboss/server/defaul
t/deploy/sysparm.jar
============================================

论坛徽章:
0
发表于 2003-11-13 18:02 |显示全部楼层

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决)

大家帮我看看,是JBOSS的配置问题引起EJB出错,还是我的EJB本身就是有错的

论坛徽章:
0
发表于 2003-11-13 21:49 |显示全部楼层

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决)

要不试试,不要直接覆盖的拷贝过去,而是:
先 undeploy ,就是把那些文件删掉,再 deploy 新的。

论坛徽章:
0
发表于 2003-11-14 15:06 |显示全部楼层

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决)

原帖由 "cinc" 发表:
要不试试,不要直接覆盖的拷贝过去,而是:
先 undeploy ,就是把那些文件删掉,再 deploy 新的。



我也是通过JBuilder中的deploy功能发布的, 跟你说的一样, 这些方法我都试过了,还是要报错.  其实我的那个EJB主要是当第一次发布的时候,就报错,但然后接着再redeploy的时候就不错了, 而且我的HRMS能正常

论坛徽章:
0
发表于 2003-11-14 15:23 |显示全部楼层

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决)

cinc老大, 麻烦再帮我看看这个问题!

1.在Jboss中,JSP文件用include方法的时候,A页面已经定义了<%@ page contentType="text/html;charset=UTF-8"%>;, 然后在被include的B页面,就不能再定义<%@ page contentType="text/html;charset=UTF-8"%>;了,这是不是JBOSS的特点啊,Weblogic是完全支持的.

2.接上面的问题,如果A页面include了B页面,而在B页面有一些汉字要处理,处理完成后会传到C页面进行显示,这时,在B页面将不能再用<%@ page import="com.isw2.ubf.be.*"%>;,我的HRMS用了这种方法,导致出现很多乱码,只有把<%@ page import="com.isw2.ubf.be.*"%>;放到A页面定义,才能解决这个问题,这是什么原因啊?有没有办法解决?

论坛徽章:
0
发表于 2003-11-14 16:28 |显示全部楼层

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决)

不好意思 jboss 的 web 功能还没用过,没遇到过这种情况。

1。我在 tomcat 里 include 页面的时候每个页面都必须写
<%@ page contentType="text/html;charset=gb2312"%>;

2。不知道你用的是 <%@ include file="filename" %>;
还是 <jsp:include page="includedPage" />;
两个是有些不一样的。
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSPIntro8.html
如果用 第一个,可能会出现你说的这个问题。

论坛徽章:
0
发表于 2003-11-14 16:59 |显示全部楼层

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决)

JBOSS只提供EJB服务的,所以要做WEB方面的支持,必须和TOMCAT等其他第三方软件集成,如我现在用的是JBOSS_TOMCAT版的

我用的是第一种的方法直接include的,出现的问题还不少.
1. 中文乱码: 子页面如果再用了<%@ page import="com.isw2.ubf.be.*"%>;方法,就会在其他页面出现中文乱码.

2.主页面用了<%@ page contentType="text/html;charset=gb2312"%>; 方法,被include的子页面就不能再定义此方法,否则出错

我的HRMS是已经写好的了,现在只是修改,要是没有好的办法,那就真是累死我了,哈哈

论坛徽章:
0
发表于 2003-11-14 18:22 |显示全部楼层

【协助置顶】从GBK到UTF-8的国际中文化实施问题(已解决)

那样确实会存在问题

<%@ include file="filename" %>;

只是把子页面的内容在 jsp 页面编译的时候加入 主页面
比较适合 include 静态页面

我们一般用 <jsp:include  来 include 动态页面,还可以把参数从父页面
传到子页面。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP