私はこのリンクに従ってStruts2とTiles3を使おうとしていました。ただし、web.xmlにlistener-classを追加するとすぐに:
<listener>
<listener-class>org.apache.tiles.extras.complete.CompleteAutoloadTilesListener</listener-class>
</listener>
Glassfishサーバーへのアップロード中に次のエラーが発生しました。
デプロイメント中にエラーが発生しました:アプリのロード中に例外が発生しました:java.lang.IllegalStateException:ContainerBase.addChild:start:org.apache.catalina.LifecycleException:java.lang.NoClassDefFoundError:org / springframewor / core / io / support/ResourcePatternResolver。詳細については、server.logを参照してください。
エラーメッセージは次のとおりです。
[#| 2012-12-23T18:36:10.982 + 0800 | SEVERE | glassfish3.1.2 | javax.enterprise.system.tools.admin.org.glassfish.deployment.admin | _ThreadID = 22; _ThreadName = Thread-4; |クラスcom.sun.enterprise.web.WebApplication開始メソッドの呼び出し中の例外java.lang.Exception:java.lang.IllegalStateException:ContainerBase.addChild:start:org.apache.catalina.LifecycleException:java.lang.NoClassDefFoundError:org / springframework /core/io/support/ResourcePatternResolver at com.sun.enterprise.web.WebApplication.start(WebApplication.java:138)at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)at org.glassfish .internal.data.ModuleInfo.start(ModuleInfo.java:269)at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle 。java:461)at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)at com.sun.enterprise .v3.admin.CommandRunnerImpl $ 1.execute(CommandRunnerImpl.java:348)at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)atcom.sun.enterprise.v3.admin.CommandRunnerImpl。 doCommand(CommandRunnerImpl.java:1085)at com.sun.enterprise.v3.admin.CommandRunnerImpl.access $ 1200(CommandRunnerImpl.java:95)at com.sun.enterprise.v3.admin.CommandRunnerImpl $ ExecutionContext.execute(CommandRunnerImpl.java :1291)com.sun.enterprise.v3.admin.CommandRunnerImpl $ ExecutionContext.execute(CommandRunnerImpl.java:1259)at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil。java:214)at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)at sun.reflect.NativeMethodAccessorImpl .invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java :597)com.sun.jersey.spi.container.JavaMethodInvokerFactory $ 1.invoke(JavaMethodInvokerFactory.java:60)at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider $ ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider。 java:205)com.sun.jersey.server.impl.model.method.dispatchで。ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)atcom.sun.jersey.server.impl.uri.rules。 SubLocatorRule.accept(SubLocatorRule.java:134)at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)at com.sun.jersey.server.impl.uri.rules SubLocatorRule.accept(SubLocatorRule.java:134)at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)at com.sun.jersey.server.impl.uri.rules ResourceClassRule.accept(ResourceClassRule.java:108)at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)at com.sun.jersey.server.impl.uri.rules RootResourceClassesRule.accept(RootResourceClassesRule.java:84)com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)at com .sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)at com.sun.jersey .server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)at org.glassfish.admin .rest.adapter.RestAdapter.service(RestAdapter.java:148)at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)atcom.sun.enterprise。v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)at com.sun.enterprise.v3.services.impl.ContainerMapper $ Hk2DispatcherCallable.call(ContainerMapper.java:354)atcom.sun.enterprise.v3.services。 impl.ContainerMapper.service(ContainerMapper.java:195)at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain .java:137)at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask .java:59)at com.sun.grizzly.ContextTask.run(ContextTask.java:71)at com.sun.grizzly.util.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:532)atcom.sun.grizzly。 util.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:513)at java.lang.Thread.run(Thread.java:680)|#]run(ContextTask.java:71)at com.sun.grizzly.util.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:532)at com.sun.grizzly.util.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:513) java.lang.Thread.run(Thread.java:680)で|#]run(ContextTask.java:71)at com.sun.grizzly.util.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:532)at com.sun.grizzly.util.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:513) java.lang.Thread.run(Thread.java:680)で|#]
Spring Frameworkで何かを探しているようですが、Struts2 + Tiles 3を使用しています。何か足りないものはありますか?
これが私のコードです:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>SongLyricsSystemv1</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.apache.tiles.extras.complete.CompleteAutoloadTilesListener</listener-class>
</listener>
<context-param>
<param-name>insertAttribute</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
tiles.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions>
<definition name="baseLayout" template="WebContent/BaseLayout.jsp">
<put-attribute name="menu" value="WebContent/Menu.jsp" />
</definition>
<definition name="/welcome.tiles" extends="baseLayout">
<put-attribute name="title" value="Welcome" />
<put-attribute name="body" value="WebContent/Welcome.jsp" />
</definition>
<definition name="/customer.tiles" extends="baseLayout">
<put-attribute name="title" value="Customer Form" />
<put-attribute name="body" value="WebContent/Customer.jsp" />
</definition>
<definition name="/customer.success.tiles" extends="baseLayout">
<put-attribute name="title" value="Customer Added" />
<put-attribute name="body" value="WebContent/SuccessCustomer.jsp" />
</definition>
</tiles-definitions>
Struts.xml:
<struts>
<package name="default" namespace="/" extends="struts-default">
<result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>
<action name="login"
class="com.java.actions.LoginAction">
<result name="success" type="tiles">/welcome.tiles</result>
<result name="error">Login.jsp</result>
</action>
<action name="customer"
class="com.java.actions.CustomerAction">
<result name="success" type="tiles">/customer.success.tiles</result>
<result name="input" type="tiles">/customer.tiles</result>
</action>
<action name="customer-form">
<result name="success" type="tiles">/customer.tiles</result>
</action>
</package>
</struts>
jarファイルの私のリスト:
- antlr-2.7.2.jar
- classworlds-1.1.jar
- commons-beanutils-1.8.0.jar
- commons-chain-1.2.jar
- commons-collections-3.1.jar
- commons-digester-2.0.jar
- commons-fileupload-1.2.2.jar
- commons-io-2.0.1.jar
- commons-lang-2.4.jar
- commons-lang3-3.1.jar
- commons-logging-1.1.1.jar
- commons-logging-api-1.1.jar
- commons-validator-1.3.1.jar
- freemarker-2.3.19.jar
- javassist-3.11.0.GA.jar
- javax.servlet-api.jar
- javax.servlet.jsp-api.jar
- jcl-over-slf4j-1.7.2.jar
- jul-to-slf4j-1.7.2.jar
- log4j-over-slf4j-1.7.2.jar
- mvel2-2.1.3.jar
- ognl-3.0.5.jar
- oro-2.0.8.jar
- 楕円形-1.31.jar
- sitemesh-2.4.2.jar
- slf4j-api-1.7.2.jar
- slf4j-ext-1.7.2.jar
- slf4j-jcl-1.7.2.jar
- slf4j-jdk14-1.7.2.jar
- slf4j-log4j12-1.7.2.jar
- slf4j-migrator-1.7.2.jar
- slf4j-nop-1.7.2.jar
- slf4j-simple-1.7.2.jar
- struts2-core-2.3.7.jar
- struts2-tiles-plugin-2.3.7.jar
- tiles-api-3.0.1.jar
- tiles-autotag-core-runtime-1.1.0.jar
- tiles-compat-3.0.1.jar
- tiles-core-3.0.1.jar
- tiles-el-3.0.1.jar
- tiles-extras-3.0.1.jar
- tiles-freemarker-3.0.1.jar
- tiles-jsp-3.0.1.jar
- tiles-mvel-3.0.1.jar
- tiles-ognl-3.0.1.jar
- tiles-request-api-1.0.1.jar
- tiles-request-freemarker-1.0.1.jar
- tiles-request-jsp-1.0.1.jar
- tiles-request-mustache-1.0.1.jar
- tiles-request-servlet-1.0.1.jar
- tiles-request-servlet-wildcard-1.0.1.jar
- tiles-request-velocity-1.0.1.jar tiles-servlet-3.0.1.jar
- tiles-template-3.0.1.jar
- tiles-velocity-3.0.1.jar
- 速度-1.6.3.jar
- xstream-1.4.2.jar
- xwork-core-2.3.7.jar
まだ足りないものはありますか?