一个Axis问题,一个c3p0问题,谢谢大家

基于Axis1.4开发的web services在Tomcat6下调试正常,可放在Resin3下却出错误, ,错误信息如下。
java.lang.IncompatibleClassChangeError: Class org.apache.axis.MessageContext does not implement the requested interface javax.xml.rpc.handler.MessageContext
at org.apache.axis.transport.http.ServletEndpointContextImpl.getServletContext(ServletEndpointContextImpl.java:39)
at org.springframework.remoting.jaxrpc.ServletEndpointSupport.init(ServletEndpointSupport.java:84)
at org.apache.axis.providers.java.JavaProvider.getNewServiceObject(JavaProvider.java:238)
at org.apache.axis.providers.java.JavaProvider.getServiceObject(JavaProvider.java:91)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:287)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:153)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:266)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:270)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:721)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:643)
at java.lang.Thread.run(Thread.java:619)

2.Resin下部署啦两个网站,都是用啦c3p0,启动时报错,

21:23:02,453 WARN ActiveManagementCoordinator:56 - A C3P0Registry mbean is already registered. This probably means that an application using c3p0 was undeployed, but not all PooledDataSources were closed prior to undeployment. This may lead to resource leaks over time. Please take care to close all PooledDataSources.
21:23:02,453 WARN ActiveManagementCoordinator:69 - Failed to set up C3P0RegistryManager mBean. [c3p0 will still function normally, but management via JMX may not be possible.]
javax.management.InstanceNotFoundException: com.mchange.v2.c3p0:type=C3P0Registry
at com.caucho.jmx.MBeanContext.unregisterMBean(MBeanContext.java:285)
at com.caucho.jmx.AbstractMBeanServer.unregisterMBean(AbstractMBeanServer.java:477)
at com.mchange.v2.c3p0.management.ActiveManagementCoordinator.attemptManageC3P0Registry(ActiveManagementCoordinator.java:62)
at com.mchange.v2.c3p0.C3P0Registry.attemptRegisterRegistryMBean(C3P0Registry.java:217)
at com.mchange.v2.c3p0.C3P0Registry.reregister(C3P0Registry.java:242)
at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.(PoolBackedDataSourceBase.java:228)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.(AbstractPoolBackedDataSource.java:62)
at com.mchange.v2.c3p0.ComboPooledDataSource.(ComboPooledDataSource.java:108)
at com.mchange.v2.c3p0.ComboPooledDataSource.(ComboPooledDataSource.java:104)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:83)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:873)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:413)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at com.caucho.server.webapp.WebApp.start(WebApp.java:1864)
at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:667)
at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549)
at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:160)
at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:659)
at com.caucho.server.host.Host.start(Host.java:450)
at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:667)
at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549)
at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:160)
at com.caucho.server.host.HostContainer.start(HostContainer.java:484)
at com.caucho.server.cluster.Server.start(Server.java:1315)
at com.caucho.server.cluster.Cluster.startServer(Cluster.java:710)
at com.caucho.server.cluster.ClusterServer.startServer(ClusterServer.java:542)
at com.caucho.server.resin.Resin.start(Resin.java:703)
at com.caucho.server.resin.Resin.initMain(Resin.java:1157)
at com.caucho.server.resin.Resin.main(Resin.java:1360)

soa

2个回答

第一个问题可能是jar包冲突导致的。

resin的lib目录有jaxrpc-15.jar,而你的web项目的lib里也应该有类似的jar的。你把web项目的jaxrpc.jar去掉即可。或者替换掉resin的Lib下的jaxrpc-15.jar包。

第二个问题不能算是错误,仍然可以正常运行.

要去掉警告,在项目的web-inf\classes目录下建立一个c3p0.properties文件,里面添加1行:
com.mchange.v2.c3p0.management.ManagementCoordinator=com.mchange.v2.c3p0.management.NullManagementCoordinator。
应该就不会出现第二个问题的信息了。

以上只是估计,希望有所帮助

遮住的部分是NullManagementC[color=violet]oordinator[/color]

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问