Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
370 views
in Technique[技术] by (71.8m points)

java - Weblogic Guava issue when deploying application

I'm trying to deploy an application to a weblogic server, and I get the following error.
I have guava.jar in my classpath, I tried with all the latest versions I tried from 10 and up. Can somebody help me out with this?

    <Error> <Console> <BEA-240003> <Administration Console encountered the following error: weblogic.application.ModuleException: [HTTP:101216]Servlet: "action" failed to preload on startup in Web application: "...".
java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor()Lcom/google/common/util/concurrent/ListeningExecutorService;
            at com.google.common.cache.LocalCache.<clinit>(LocalCache.java:155)
            at com.google.common.cache.LocalCache$LocalManualCache.<init>(LocalCache.java:4750)
            at com.google.common.cache.LocalCache$LocalLoadingCache.<init>(LocalCache.java:4858)
            at com.google.common.cache.CacheBuilder.build(CacheBuilder.java:739)
            at com.my.app.servers.UserServer.<clinit>(UserServer.java:42)
            at com.my.app.ActionServlet.setAppProperties(DesActionServlet.java:207)
            at com.my.app.ActionServlet.init(DesActionServlet.java:167)
            at javax.servlet.GenericServlet.init(GenericServlet.java:240)
            at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:299)
            at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:250)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
            at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
            at weblogic.servlet.internal.StubSecurityHelper.initServletInstance(StubSecurityHelper.java:94)
            at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:82)
            at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:74)
            at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:60)
            at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:34)
            at weblogic.servlet.internal.ServletStubImpl.initStubLifecycleHelper(ServletStubImpl.java:624)
            at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:565)
            at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1874)
            at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1848)
            at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1738)
            at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2740)
            at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1704)
            at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781)
            at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
            at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
            at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
            at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
            at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:212)
            at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:111)
            at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
            at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
            at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
            at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
            at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
            at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)
            at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)
            at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
            at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)
            at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:48)
            at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
            at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
            at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:582)
            at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:148)
            at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:114)
            at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:335)
            at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
            at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
            at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
            at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
            at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
            at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
            at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
            at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)



Caused by: java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor()Lcom/google/common/util/concurrent/ListeningExecutorService;
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It looks like you're running against a different version of Guava than you compiled against. Possibly you are running against multiple versions of Guava, and you are randomly getting the wrong one. This may be happening if one of your other dependencies has wrongly bundled Guava.

To figure out where this copy of MoreExecutors is coming from, I've heard that you can find it reflectively by using this snippet in UserServer:

MoreExecutors.class.getProtectionDomain().getCodeSource().getLocation()

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...