我有一个Websphere应用服务器7.0(Parent Last)的应用程序
请仔细阅读说明以了解问题。
我创建了一个新的websphere个人资料。在其上配置我的应用程序并启动应用程序,现在我测试应用程序时。它运作良好。
现在,我访问了websphere控制台并重新启动了我的应用程序。这次我测试我的应用程序。我收到错误。
日志表示classCastException:
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R java.lang.ClassCastException: com.csc.fs.ra.SimpleConnectionSpecImpl incompatible with com.csc.fs.ra.SimpleConnectionSpecImpl
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.ra.ip.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:69)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.sa.InteractionHandlerBase.getConnection(InteractionHandlerBase.java:165)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.sa.InteractionHandlerBase.execute(InteractionHandlerBase.java:95)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.sa.InteractionHandlerBase.process(InteractionHandlerBase.java:230)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.sa.SystemAccessBase.invokeInteraction(SystemAccessBase.java:374)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.sa.SystemAccessBase.internalInvoke(SystemAccessBase.java:242)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.sa.SystemAccessBase.invoke(SystemAccessBase.java:55)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.sa.SystemAccessBase.login(SystemAccessBase.java:106)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.session.AuthenticatorBase.logonSystemSession(AuthenticatorBase.java:153)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.session.AuthenticatorBase.addSystemSessions(AuthenticatorBase.java:132)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.accel.session.standalone.AuthenticatorBase.logon(AuthenticatorBase.java:224)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.session.AuthenticatorBase.logon(AuthenticatorBase.java:93)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.service.ServiceControllerAbstract.logon(ServiceControllerAbstract.java:387)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.delegate.DirectServiceController.logon(DirectServiceController.java:132)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.delegate.ServiceDelegateDirect.logon(ServiceDelegateDirect.java:133)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.accel.ui.BaseServiceAction.logon(BaseServiceAction.java:124)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.accel.ui.action.desktop.Logon.perform(Logon.java:47)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.accel.ui.ServiceDelegator.execute(ServiceDelegator.java:506)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.accel.ui.ServiceDelegator.processEvent(ServiceDelegator.java:240)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.accel.ui.BeanBase.executeEvent(BeanBase.java:779)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at pagecode.authorization.Logon.submit(Logon.java:66)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at java.lang.reflect.Method.invoke(Method.java:600)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:67)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at javax.faces.component.UICommand.broadcast(UICommand.java:315)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.csc.fs.accel.ui.filters.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:82)
[3/21/13 6:06:18:616 EDT] 0000001d SystemErr R at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
此ClassCastException背后的原因是类SimpleConnectionSpecImpl
的多个版本。
此类由我在外部通过websphere管理控制台配置的资源适配器提供。
但是现在当我停止服务器并重启服务器时,我可以再次使用该应用程序而没有错误。
所以我最接近猜测的websphere是缓存类文件,因为我看到了异常。
有什么想法?想法?
如果您需要更多详细信息,请与我们联系
答案 0 :(得分:1)
您会看到异常,因为有不同的类加载器已加载该类,从技术上讲它们使它们成为不同的类。
我们之前已经解决了这个问题,让类与服务器类路径分开,只让服务器加载它。这样,该类只有一个类加载器,服务器上运行的所有应用程序都可以从那里使用它。
我在这里看到的唯一其他选项是不要重新启动你的应用程序,除非你打算重新启动服务器。我只会觉得这在开发环境中很痛苦,但是一旦你投入生产,我怀疑你经常重启应用程序。