在加载jsf页面时,应用程序将引发以下异常。 环境: JSF Websphere 9
Exception:
java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource incompatible with javax.sql.DataSource
SystemErr R at com.vc.impl.DBConnectionFactoryImpl.openConnection(DBConnectionFactoryImpl.java:196)
com.vc.facade.SecureAccessFacade.loadUser(SecureAccessFacade.java:26)
com.vc.ui.filters.SecureAccessFilter.doFilter(SecureAccessFilter.java:53)
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:197)
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:90)
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:969)
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1109)
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4217)
我尝试了以下步骤,但没有解决。 DataSource dataSource =(DataSource)context.lookup(“ java:comp / env / jdbc / Db”);
和 web.xml
<resource-ref>
<description>Resource reference to my database</description>
<res-ref-name>java:comp/env/jdbc/Db</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
How to fix this one.. Thanks