gpt4 book ai didi

java - 在 tomcat 服务器中部署 war 文件时出现此异常

转载 作者:行者123 更新时间:2023-11-29 06:04:30 24 4
gpt4 key购买 nike

我正在使用 Eclipse 中的 Jetty 服务器在 Tapestry 中做 Web 项目。

在 eclipse 中运行时它工作正常。但是当我在 Tomcat 服务器中部署 war 文件时。我得到以下堆栈跟踪。请帮助我

org.apache.tapestry5.ioc.internal.OperationException
java.lang.ClassNotFoundException: caught an exception while obtaining a class file for net.video.pages.Index

trace
Constructing instance of page class net.video.pages.Index
Creating ComponentAssembler for net.video.pages.Index

java.lang.ClassNotFoundException
caught an exception while obtaining a class file for net.video.pages.Index

exception
org.apache.tapestry5.ioc.internal.OperationException: javassist.NotFoundException: org.json.JSONException

org.apache.tapestry5.ioc.internal.OperationException
javassist.NotFoundException: org.json.JSONException

trace
Constructing instance of page class net.video.pages.Index
Creating ComponentAssembler for net.video.pages.Index
Transforming component class net.video.pages.Index

javassist.NotFoundException
org.json.JSONException

javassist.ClassPool.get(ClassPool.java:436)
javassist.ClassPool.get(ClassPool.java:655)
javassist.CtBehavior.getExceptionTypes(CtBehavior.java:335)
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.toMethodSignature(InternalClassTransformationImpl.java:1595)
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.access$000(InternalClassTransformationImpl.java:54)
org.apache.tapestry5.internal.services.InternalClassTransformationImpl$TransformMethodImpl.<init>(InternalClassTransformationImpl.java:107)
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.recordMethod(InternalClassTransformationImpl.java:1143)
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.preloadMethods(InternalClassTransformationImpl.java:894)
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.preloadMembers(InternalClassTransformationImpl.java:887)
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.<init>(InternalClassTransformationImpl.java:805)
org.apache.tapestry5.internal.services.ComponentClassTransformerImpl$1.run(ComponentClassTransformerImpl.java:186)
org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:50)
org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:47)
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:46)
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.run(PerThreadOperationTracker.java:56)
org.apache.tapestry5.ioc.internal.RegistryImpl.run(RegistryImpl.java:1058)
org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:111)
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.onLoad(ComponentInstantiatorSourceImpl.java:212)
javassist.Loader.findClass(Loader.java:340)
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader.findClass(ComponentInstantiatorSourceImpl.java:102)
javassist.Loader.loadClass(Loader.java:311)
java.lang.ClassLoader.loadClass(ClassLoader.java:266)
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:305)
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.getInstantiator(ComponentInstantiatorSourceImpl.java:285)
org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:222)
org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:219)
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.createAssembler(PageLoaderImpl.java:218)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.getAssembler(PageLoaderImpl.java:208)
org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:180)
org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:174)
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
org.apache.tapestry5.internal.pageload.PageLoaderImpl.loadPage(PageLoaderImpl.java:173)
org.apache.tapestry5.internal.services.PageSourceImpl.getPage(PageSourceImpl.java:81)
org.apache.tapestry5.internal.services.NonPoolingRequestPageCacheImpl.get(NonPoolingRequestPageCacheImpl.java:74)
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:55)
org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2326)
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48)
org.apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.java:47)
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45)
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:321)
net.snovabits.services.AppModule$1.service(AppModule.java:90)
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:984)
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:974)
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90)
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:80)
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103)
org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:272)
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:928)
org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:147)

最佳答案

我有一个类似的问题,它在 eclipse 中工作,但在 tomcat 中部署时,它会抛出错误。这可能是因为在 eclipse 中你在不同的位置提供了一些 jar 文件并在类路径中使用它。

因此请确保您所有的 jar 都在项目 lib 文件夹中可用

关于java - 在 tomcat 服务器中部署 war 文件时出现此异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8986222/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com