讨论区 » AAS-V10企业版 »
部署应用java.lang.RuntimeException: Cant copy Serializable object:,Caused by: java.io.NotSerializableException: net.bull.javamelody.JdbcWrapper
由 何 善才 在 大约 3 年 之前添加
异常详情信息:
java.lang.RuntimeException: Cant copy Serializable object:
at com.apusic.enterprise.naming.util.NamingUtilsImpl.makeCopyOfObject(NamingUtilsImpl.java:113) ~[aas-naming.jar:?]
at com.apusic.enterprise.naming.impl.LocalSerialContextProviderImpl.rebind(LocalSerialContextProviderImpl.java:93) ~[aas-naming.jar:?]
at com.apusic.enterprise.naming.impl.SerialContext.rebind(SerialContext.java:661) ~[aas-naming.jar:?]
at javax.naming.InitialContext.rebind(InitialContext.java:433) ~[?:1.8.0_202]
at javax.naming.InitialContext.rebind(InitialContext.java:433) ~[?:1.8.0_202]
at net.bull.javamelody.JdbcWrapperHelper.rebindDataSource(JdbcWrapperHelper.java:128) ~[javamelody-core-1.87.0.jar:1.87.0]
at net.bull.javamelody.JdbcWrapper.rebindDataSources(JdbcWrapper.java:473) [javamelody-core-1.87.0.jar:1.87.0]
at net.bull.javamelody.FilterContext.<init>(FilterContext.java:111) [javamelody-core-1.87.0.jar:1.87.0]
at net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:148) [javamelody-core-1.87.0.jar:1.87.0]
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:226) [aas-web-core.jar:?]
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:82) [aas-web-core.jar:?]
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4944) [aas-web-core.jar:?]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5591) [aas-web-core.jar:?]
at com.sun.enterprise.web.WebModule.start(WebModule.java:520) [aas-web-glue.jar:?]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:885) [aas-web-core.jar:?]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:868) [aas-web-core.jar:?]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:644) [aas-web-core.jar:?]
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2032) [aas-web-glue.jar:?]
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1678) [aas-web-glue.jar:?]
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:83) [aas-web-glue.jar:?]
at com.apusic.aas.internal.data.EngineRef.start(EngineRef.java:98) [aas-internal-api.jar:?]
at com.apusic.aas.internal.data.ModuleInfo.start(ModuleInfo.java:267) [aas-internal-api.jar:?]
at com.apusic.aas.internal.data.ApplicationInfo.start(ApplicationInfo.java:358) [aas-internal-api.jar:?]
at com.apusic.enterprise.v10.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:479) [aas-kernel.jar:?]
at com.apusic.enterprise.v10.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:384) [aas-kernel.jar:?]
at com.apusic.enterprise.v10.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:221) [aas-kernel.jar:?]
at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:303) [hk2-locator.jar:?]
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:351) [hk2-locator.jar:?]
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463) [hk2-locator.jar:?]
at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:281) [hk2-runlevel.jar:?]
at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:65) [hk2-runlevel.jar:?]
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102) [hk2-locator.jar:?]
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:92) [hk2-locator.jar:?]
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:66) [hk2-locator.jar:?]
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213) [hk2-runlevel.jar:?]
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144) [hk2-runlevel.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_202]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]
Caused by: java.io.NotSerializableException: net.bull.javamelody.JdbcWrapper
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[?:1.8.0_202]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) ~[?:1.8.0_202]
at com.apusic.enterprise.naming.util.NamingUtilsImpl.makeCopyOfObject(NamingUtilsImpl.java:92) ~[aas-naming.jar:?]
... 38 more
]]
原因:
目前的jndi在绑定和lookup的时候都会先拷贝对象(使用java的序列化机制拷贝,如果没有实现序列化接口则不拷贝).
这里增加一个系统属性:com.apusic.aas.naming.copyObject,当该属性为false的时候不进行拷贝。默认为true
解决:添加jvm参数
这里增加一个系统属性:-Dcom.apusic.aas.naming.copyObject=false
标签:序列化,序列化异常,Serializable