'ClassCastException: Same project works on different laptop with same JDK, IDC etc

Recently, I have switched to a new laptop. The project(Java EE) which works on my old laptop, does not work on the new laptop. Ensured project version is the same, JDK is same, IDE is eclipse

But the project gives me ClassCastException on the new laptop.

(Both laptops are Mac, different model same OS)

The error is thrown by the library which is being used.

Stack Trace

SEVERE: The bean instance SomeCacheRetriever threw a system exception:java.lang.ClassCastException: com.api.client.AdminServiceClient cannot be cast to io..security.api.provider.AdminService
java.lang.ClassCastException: com.api.client.AdminServiceClient cannot be cast to io.security.api.provider.AdminService
    at io.evaluator.EvaluationServiceImpl.consumeManagedServices(EvaluationServiceImpl.java:249)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

Feb 09, 2022 4:00:36 PM org.apache.openejb.assembler.classic.Assembler destroyApplication
INFO: Undeploying app: /Users/AppName/target/app-1.0.2-SNAPSHOT
Feb 09, 2022 4:00:36 PM sun.reflect.NativeMethodAccessorImpl invoke
SEVERE: ContainerBase.removeChild: destroy: 
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_destroy]) for component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] in state [STARTING_PREP]
    at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:402)
    at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
    at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:826)
    at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1627)
    at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1607)
    at org.apache.tomee.catalina.TomcatWebAppBuilder.undeployWebApps(TomcatWebAppBuilder.java:763)
    at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:2226)
    at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1037)
    at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:717)
    at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1298)
    at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1124)
    at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)```


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source