尝试重新打包由其他开发人员维护的内容并遇到wicket组件问题。老实说,只是寻找正确方向的一个点,以缩小这里实际发生的事情。我无法访问我已经反编译的源代码编译战争。这似乎在他们完美的环境中运行时运行正常,但我需要运行一个稍微不同的java版本。
从这个错误看,它只是找不到"功能"零件。我怎么能追溯这个?反编译ServerStatusPage的类我只看到"功能"作为变量。有没有一种快速的方法我现在可以删除状态页面的违规区域并重新打包war文件?当我尝试时,我最终陷入更多问题,说我排除了应该存在的组件。
运行时的完整错误如下:
2018-02-28 23:04:02,603 ERROR [wicket.RequestCycle] (default task-23) Unable to find component with id 'feature' in [MarkupContainer [Component id = 0, page = extensis.esp.webadmin.pages.serverstatus.ServerStatusPage, path = 7:features:0.ListItem, isVisible = true, isVersioned = true]]. This means that you declared wicket:id=feature in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match.
[markup = vfs:/content/ROOT.war/WEB-INF/classes/extensis/esp/webadmin/pages/serverstatus/ServerStatusPage.html, index = 34, current = '<span wicket:id="feature">' (line 52, column 6)]: wicket.markup.MarkupException: Unable to find component with id 'feature' in [MarkupContainer [Component id = 0, page = extensis.esp.webadmin.pages.serverstatus.ServerStatusPage, path = 7:features:0.ListItem, isVisible = true, isVersioned = true]]. This means that you declared wicket:id=feature in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match.
[markup = vfs:/content/ROOT.war/WEB-INF/classes/extensis/esp/webadmin/pages/serverstatus/ServerStatusPage.html, index = 34, current = '<span wicket:id="feature">' (line 52, column 6)]
at wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:290) [wicket.jar:]
at wicket.MarkupContainer.renderNext(MarkupContainer.java:1381) [wicket.jar:]
at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982) [wicket.jar:]
at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917) [wicket.jar:]
at wicket.Component.renderComponent(Component.java:1712) [wicket.jar:]
at wicket.MarkupContainer.onRender(MarkupContainer.java:927) [wicket.jar:]
at wicket.Component.render(Component.java:1526) [wicket.jar:]
at wicket.markup.html.list.ListView.renderItem(ListView.java:680) [wicket.jar:]
at wicket.markup.html.list.ListView.onRender(ListView.java:641) [wicket.jar:]
at wicket.Component.render(Component.java:1526) [wicket.jar:]
at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334) [wicket.jar:]
at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982) [wicket.jar:]
at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917) [wicket.jar:]
at wicket.Component.renderComponent(Component.java:1712) [wicket.jar:]
at wicket.MarkupContainer.onRender(MarkupContainer.java:927) [wicket.jar:]
at wicket.Component.render(Component.java:1526) [wicket.jar:]
at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334) [wicket.jar:]
at wicket.MarkupContainer.renderAll(MarkupContainer.java:944) [wicket.jar:]
at wicket.Page.onRender(Page.java:864) [wicket.jar:]
at wicket.Component.render(Component.java:1526) [wicket.jar:]
at wicket.Page.renderPage(Page.java:413) [wicket.jar:]
at wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:226) [wicket.jar:]
at wicket.request.compound.DefaultResponseStrategy.respond(DefaultResponseStrategy.java:49) [wicket.jar:]
at wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66) [wicket.jar:]
at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:902) [wicket.jar:]
at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929) [wicket.jar:]
at wicket.RequestCycle.step(RequestCycle.java:1010) [wicket.jar:]
at wicket.RequestCycle.steps(RequestCycle.java:1084) [wicket.jar:]
at wicket.RequestCycle.request(RequestCycle.java:454) [wicket.jar:]
at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219) [wicket.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174) [undertow-servlet-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793) [undertow-core-1.3.15.Final.jar:1.3.15.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_141]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_141]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_141]
正在处理的html文件是:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="refresh" content="15">
<meta http-equiv="Cache-Control" content="no-store, no-cache, max-age=0, must-revalidate">
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="NO-CACHE">
<meta http-equiv="Content-Type" CONTENT="text/html; charset=utf-8">
<script language="JavaScript"><!--
function setIFrameContents(frameName, contents) {
var iFrame = window.frames[frameName];
iFrame.document.open();
iFrame.document.write(contents);
iFrame.document.close();
}
//--></script>
<title wicket:id="pagetitle">Status</title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<div class="main">
<div class="header"></div>
<div class="nav-and-content">
<div class="navbar">
<span wicket:id="navBar"></span>
</div> <!--end nav bar div-->
<div class="lockButton">
<form wicket:id="lockUnlockForm">
<input wicket:id="lockButton" type="image" src=""/>
<input wicket:id="unlockButton" type="image" src=""/>
</form>
</div>
<div class="content">
<p>
<span class="title" wicket:id="title">Status</span>
<span class="error" wicket:id="feedback">Error verbiage if any goes here.</span>
</p>
<br/>
<span wicket:id="features">
<span wicket:id="feature"></span>
</span>
</div> <!-- end content -->
<div class="clear"></div>
</div> <!-- end nav-and-content -->
<div class="footer"></div>
<div class="langs" wicket:id="localeSelectPanel"></div>
</div> <!--end main div-->
</body>
</html>
感谢并原谅我对其中一些人的无知。
答案 0 :(得分:1)
使用ListView的代码应如下所示:
ListView lv = new ListView("features", listOfFeatures) {
@Override protected void onPopulate(ListItem<Feature> li) {
li.add(new FeaturePanel("feature", li.getModel()));
}
}
在您的异常消息组件0
中是ListItem。似乎由于某种原因,行li.add(new FeaturePanel("feature"));
未执行,因此0
没有ID为feature
的孩子。
由于您没有附加调试器的源代码,因此至少您将能够看到组件树中的内容。只需在MarkupContainer.renderNext(MarkupContainer.java:1381)上设置一个断点,并在children
是一个id为this
的ListItem时检查0
成员字段的值是多少。
从类名中我可以说这是Wicket 1.3或更早版本,这是Wicket的旧版本!