java.lang.NoSuchMethodError:org.apache.tiles.TilesException:method <init>(Ljava / lang / String; Ljava / lang / Throwable;)找不到V </init>

时间:2014-06-30 17:04:16

标签: struts2 struts tiles

启动struts应用程序时出现上述错误。  以下是出口订单。

    /WEB-INF/src
    /WEB-INF/lib/freemarker-2.3.16.jar
    /WEB-INF/lib/javassist-3.7.ga.jar
    /WEB-INF/lib/ognl-3.0.jar
    JRE System library[jrocket... ]
    /WEB-INF/lib/commons-beanutils-1.8.0.jar
    /WEB-INF/lib/commons-digester-1.8.1.jar
    /WEB-INF/lib/commons-fileupload-1.2.1.jar
    /WEB-INF/lib/commons-io-1.3.2.jar
    /WEB-INF/lib/commons-logging-1.0.4.jar
    /WEB-INF/lib/commons-logging-api-1.1.jar
    /WEB-INF/lib/log4j-1.2.14.jar
    /WEB-INF/lib/struts2-config-browser-plugin-2.2.1.jar
    /WEB-INF/lib/struts2-core-2.2.1.jar
    /WEB-INF/lib/struts2-tiles-plugin-2.2.1.jar
    /WEB-INF/lib/tiles-api-2.1.2.jar
    /WEB-INF/lib/tiles-compat-2.1.2.jar
    /WEB-INF/lib/tiles-jsp-2.1.2.jar
    /WEB-INF/lib/tiles-servlet-2.1.2.jar
    /WEB-INF/lib/xwork-core-2.2.1.jar
    weblogic/api.jar
    json-2010.01.05.jar
    /WEB-INF/lib/tiles-core-2.1.2.jar

请帮忙。我会很开心的

2014-06-30 13:51:39,448 INFO org.apache.tiles.context.AbstractTilesApplicationContextFactory.createFactory:72 - 初始化Tiles2应用程序上下文。 。 。     2014-06-30 13:51:39,458 INFO org.apache.tiles.context.AbstractTilesApplicationContextFactory.createFactory:91 - 完成初始化Tiles2应用程序上下文。     2014-06-30 13:51:39,480 INFO org.apache.tiles.factory.TilesContainerFactory.initializeContainer:362 - 初始化Tiles2容器。 。 。         (Ljava / lang / String; Ljava / lang / Throwable;)找不到V.     java.lang.NoSuchMethodError:org.apache.tiles.TilesException:方法(Ljava / lang / String; Ljava / lang / Throwable;)找不到V         at org.apache.tiles.factory.NotAvailableFeatureException。(NotAvailableFeatureException.java:71)         at org.apache.tiles.portlet.context.NotAPortletEnvironmentException。(NotAPortletEnvironmentException.java:71)         在org.apache.tiles.portlet.context.PortletTilesRequestContextFactory。(PortletTilesRequestContextFactory.java:68)         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)         截断。请参阅日志文件以获取完整的堆栈跟踪

2014-06-30 13:51:39,524 INFO  org.apache.tiles.servlet.context.ServletUtil.setContainer:151 - Removing TilesContext for context: weblogic.servlet.internal.WebAppServletContext
<Jun 30, 2014 1:51:39 PM EDT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1404150699134' for task '0'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException: 
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1510)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.NoSuchMethodError: org.apache.tiles.TilesException: method <init>(Ljava/lang/String;Ljava/lang/Throwable;)V not found
    at org.apache.tiles.factory.NotAvailableFeatureException.<init>(NotAvailableFeatureException.java:71)
    at org.apache.tiles.portlet.context.NotAPortletEnvironmentException.<init>(NotAPortletEnvironmentException.java:71)
    at org.apache.tiles.portlet.context.PortletTilesRequestContextFactory.<init>(PortletTilesRequestContextFactory.java:68)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    Truncated. see log file for complete stacktrace

<Jun 30, 2014 1:51:39 PM EDT> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 7 task for the application 'inhouse_brands'.> 
<Jun 30, 2014 1:51:39 PM EDT> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating start task for application 'inhouse_brands'.> 
<Jun 30, 2014 1:51:39 PM EDT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: 
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1510)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.NoSuchMethodError: org.apache.tiles.TilesException: method <init>(Ljava/lang/String;Ljava/lang/Throwable;)V not found
    at org.apache.tiles.factory.NotAvailableFeatureException.<init>(NotAvailableFeatureException.java:71)
    at org.apache.tiles.portlet.context.NotAPortletEnvironmentException.<init>(NotAPortletEnvironmentException.java:71)
    at org.apache.tiles.portlet.context.PortletTilesRequestContextFactory.<init>(PortletTilesRequestContextFactory.java:68)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    Truncated. see log file for complete stacktrace

1 个答案:

答案 0 :(得分:0)

将此罐子添加到WEB-INF/lib文件夹

  

公地lang3-3.1.jar
  公地郎2.4.jar
  SLF4J-API x.x.x.jar
  SLF4J-log4j12-x.x.x.jar
  的log4j-x.x.x.jar

最重要的是,这个jar不在你的项目中,所以首先下载它并将其添加到你的构建路径。

  

瓦片-core.2.x.x.jar
  瓷砖,模板2.x.x.jar
  瓷砖的portlet-2.x.x.jar

您可以根据项目需要自行选择版本。 commons-lang-x.x,jar。如果你收到错误也回复。

如果您是堆叠溢出的新用户,那么我建议您学习如何接受答案Please see click HERE

编辑:
另外我想告诉你struts2-tiles-plugin-2.2.1.jar取决于 tiles 2.0.6 而不是tile 2.2.1。嗯,没关系。但这只是为了您的信息。您应该使用与您的支柱兼容的适当版本的瓷砖。至少尝试一次使用兼容版本。

您的错误所说的是资源无法使用,因为它不在portlet环境中。

我建议您Learn portlet integration of tiles

您遗失了tiles-portlet-2.x.x.jarportlet-ext.xml文件

编辑2:

检查JRE中的rt.jar

如果您没有在类路径中使用它,则无法访问您需要使用的任何类,例如java.lang.Stringjava.io.File