Fork me on GitHub

websphere 6.1与cas单点登录的版本问题

 

今天公司招了个新员工,让他去测试websphere6.1下的cas环境的搭建,发现由于jdk的原因,cas搭建失败,我自己测试后发现tomcat在jre1.6下运行cas-server3.5版本没有问题,而换成了jre1.5的tomcat环境,就会报错,bad version,所以确定是由于jdk版本不同造成的原因,我把cas-server-3.5.2-release.zip里面的src源码重新用jdk1.5编译后,依旧的不能用,估计它依赖了许多的第三方jdk1.6++的jar包,带不起来。所以用websphere7.x版本去搭建cas-server-3.5.2-release.zip,结果有一个xml报错。

[13-5-8 1:57:37:724 CST] 0000001b JPAPxmlInfo   E   CWWJP0040E: 在应用程序 cas 模块 cas.war 的 persistence.xml 文件中检测到不正确的语法或错误,行号为 25,列号为 23。产生了以下相关的错误消息:javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: cvc-complex-type.3.1:对于相应属性 use,元素“persistence”的“version”属性值“2.0”无效。属性“version”具有已确定的值“1.0”。]
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:326)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:500)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:206)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:175)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:148)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:195)
    at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:247)
    at com.ibm.ws.jpa.management.JPAScopeInfo.processPersistenceUnit(JPAScopeInfo.java:140)
    at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:169)
    at com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModule(JPAComponentImpl.java:895)
    at com.ibm.ws.jpa.management.JPAComponentImpl.stateChanged(JPAComponentImpl.java:748)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1079)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1302)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.setState(DeployedModuleImpl.java:221)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:607)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:944)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:740)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2051)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:385)
    at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:328)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$300(CompositionUnitMgrImpl.java:113)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:895)
    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1613)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1:对于相应属性 use,元素“persistence”的“version”属性值“2.0”无效。属性“version”具有已确定的值“1.0”。
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.processOneAttribute(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
    at org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown Source)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:85)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:113)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:202)
    ... 22 more
    
[13-5-8 1:57:38:036 CST] 0000001a servlet       I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [ibmasyncrsp] [/IBM_WS_SYS_RESPONSESERVLET] [rspservlet]: 初始化成功。
[13-5-8 1:57:38:067 CST] 0000001b FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: 已在 D:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\cas_5e8f5e8f_13.05.08_01.57.37.98911990.txt com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits 353 发出 FFDC 事件。
[13-5-8 1:57:38:082 CST] 0000001a webcontainer  I com.ibm.ws.wswebcontainer.VirtualHost addWebApplication SRVE0250I: Web 模块 WebSphere ASYNC Response Servlet Application 已绑定到 default_host[*:9080,*:9443,*:5060,*:5061,*:443]。
[13-5-8 1:57:38:082 CST] 0000001b FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: 已在 D:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\cas_5e8f5e8f_13.05.08_01.57.38.06711991.txt com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs 167 发出 FFDC 事件。
[13-5-8 1:57:38:082 CST] 0000001b DeployedAppli W   WSVR0206E: 应用程序 cas.ear/deployments/cas 的模块 cas.war 未能启动
[13-5-8 1:57:38:098 CST] 0000001b ApplicationMg W   WSVR0101W: 启动 cas 时发生错误
[13-5-8 1:57:38:098 CST] 0000001b ApplicationMg A   WSVR0217I: 正在停止应用程序:cas
[13-5-8 1:57:38:114 CST] 0000001b FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: 已在 D:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\cas_5e8f5e8f_13.05.08_01.57.38.09811992.txt com.ibm.ws.wsaddressing.urimap.EndpointMappingListener 1:196:1.8 发出 FFDC 事件。
[13-5-8 1:57:38:332 CST] 0000001b ApplicationMg A   WSVR0220I: 应用程序已停止:cas
[13-5-8 1:57:38:332 CST] 0000001b CompositionUn E   WSVR0194E: BLA WebSphere:blaname=cas 中的组合单元 WebSphere:cuname=cas 未能启动。
[13-5-8 1:57:38:332 CST] 0000001b FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: 已在 D:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\cas_5e8f5e8f_13.05.08_01.57.38.33211993.txt com.ibm.wsspi.runtime.component.WsComponentImpl 297 发出 FFDC 事件。
[13-5-8 1:57:38:613 CST] 0000001a ApplicationMg A   WSVR0221I: 应用程序已启动:ibmasyncrsp
[13-5-8 1:57:38:613 CST] 0000001a CompositionUn A   WSVR0191I: 已启动 BLA WebSphere:blaname=ibmasyncrsp 中的组合单元 WebSphere:cuname=ibmasyncrsp。
[13-5-8 1:57:38:628 CST] 00000000 ContainerHelp E   WSVR0501E: 创建组件 com.ibm.ws.runtime.component.CompositionUnitMgrImpl@6fd86fd8 时出错
com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.metadata.MetaDataException: CWWJP0040E: The persistence.xml in application cas, module cas.war, has a syntax error at line number: 25, column number: 23.
    at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:185)
    at com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModule(JPAComponentImpl.java:895)
    at com.ibm.ws.jpa.management.JPAComponentImpl.stateChanged(JPAComponentImpl.java:748)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1079)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1302)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.setState(DeployedModuleImpl.java:221)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:607)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:944)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:740)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2051)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:385)
    at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:328)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$300(CompositionUnitMgrImpl.java:113)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:895)
    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1613)
Caused by: com.ibm.ws.metadata.MetaDataException: CWWJP0040E: The persistence.xml in application cas, module cas.war, has a syntax error at line number: 25, column number: 23.
    at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:432)
    at com.ibm.ws.jpa.management.JPAScopeInfo.processPersistenceUnit(JPAScopeInfo.java:140)
    at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:169)
    ... 16 more
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1:对于相应属性 use,元素“persistence”的“version”属性值“2.0”无效。属性“version”具有已确定的值“1.0”。
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.processOneAttribute(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
    at org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown Source)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:85)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:113)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:202)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:175)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:148)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:195)
    at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:247)
    ... 18 more

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1:对于相应属性 use,元素“persistence”的“version”属性值“2.0”无效。属性“version”具有已确定的值“1.0”。

 

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1:对于相应属性 use,元素“persistence”的“version”属性值“2.0”无效。属性“version”具有已确定的值“1.0”。

 

解决方法:

 

进入你的websphere7.x里应用的路径里,找到D:\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-RJC5V1IPB5ACell01\cas.ear\cas.war\WEB-INF\classes\META-INF\persistence.xml

把文件用记事本打开后,修改

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
        version="2.0">

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
        version="1.0">

 

就是把2.0改为1.0后,websphere7.x搭建cas服务端成功。

 

改造后的页面也很ok!

IE浏览器可能看不到这么绚的效果,还在测试中。

 

验证码功能还没做出来。。有点2,拦截器可能拦截了验证码的请求,还在研究中。。。

 

明天准备测试测试客户端。看看会不会有什么恶心的事情发生~~

 

websphere6.x不支持cas3.0以上版本,切记。

 

cas server端下载地址:

 

http://downloads.jasig.org/cas/

 

 

2013年5月7日21:42:21

落雨

qq 394263788

posted @ 2013-05-07 21:43  _落雨  阅读(1153)  评论(0编辑  收藏  举报