![](/img/trans.png)
[英]Where in the world is com.ibm.ws.scripting.adminCommand.AdminTask?
[英]Where can I find com.ibm.ws.logging.object.hpel.WsLogRecord
今天我的一名实习生来找我,问他在哪里可以找到以下班级
com.ibm.ws.logging.object.hpel.WsLogRecord
通常,像findjar.com这样的东西都可以找到它,但在这种情况下找不到。 我最终使用Jar Explorer在以下位置的WAS 8库中找到它,但是该过程效率低下:
{server root}\plugins\com.ibm.hpel.logging.jar
这篇文章的目的是提供对可以在哪里找到的见解,并且还询问在在线实用程序无法提供所需见解时查找类的最佳方法是什么。
谢谢,杰里米
我要在运行中的WebSphere实例下找到它的方法是部署一个JSP,该JSP使用DeveloperWorks文章中描述的技术来定位提供特定类的jar。
为了后代,以下是该JSP的来源:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Servlet Container Class Finder</title>
</head>
<body>
<h2>Servlet Container Class Finder</h2>
<p>Enter the fully-qualified name of a Java class
(e.g. org.apache.oro.text.regex.Perl5Compiler) in the field below. The
servlet will attempt to load the class and, if successful, query the
class' <em>java.security.CodeSource</em> for the location of the class
using the following methods:
<pre>
Class.forName(className).getProtectionDomain().getCodeSource()
</pre>
</p>
<p>
<%
String className = request.getParameter("className");
String prefill = "";
if (className != null)
{
prefill = className;
if (className.trim().length() != 0)
{
try
{
java.security.ProtectionDomain pd = Class.forName(className).getProtectionDomain();
if (pd != null)
{
java.security.CodeSource cs = pd.getCodeSource();
if (cs != null)
{
out.println(cs);
}
else
{
out.println("No CodeSource found");
}
}
else
{
out.println("No ProtectionDomain found");
}
}
catch (Throwable t)
{
out.println(t);
}
}
}
%>
</p>
<form method="post" action="<%= request.getRequestURI()%>">
<p>
Class Name: <input type="text" name="className" value="<%= prefill %>" size="40"/>
<input type="submit" value="Submit"/>
</p>
</form>
<p>
Code taken from
<a href="http://www.ibm.com/developerworks/websphere/techjournal/0406_brown/0406_brown.html">
this DeveloperWorks article</a>.
</p>
</body>
</html>
我能够在com.ibm.ws.logging.object.WsLogRecord(减去hpel)下找到WsLogRecord。 我使用eclipse在com.ibm.ws.logging.object下查找,找不到hpel,但是找到了WsLogRecord。 我能够使用jd-eclipse查看实际的类。 .class中的注释给出了文件位置(C:\\ IBM \\ SDP \\ runtimes \\ base_v7 \\ plugins \\ com.ibm.ws.runtime.jar)。 看起来我也找不到在findjar.com上,而.jar随IBM的现成代码一起出现。 我想这不能解决如何在线查找的问题,但是我能够找到它,然后按照上述步骤查看课程。
如果所有其他方法都失败了,并且我无法使用Eclipse Quick Type Hierarchy(该类显示该类位于哪个jar中)来找到该类,那么我将在以下几行中使用shell脚本:
for f in `find /path/to/websphere/lib -name "*.jar"`
do
FOUND=`jar tvf $f | grep WsLogRecord`
if [[ -n $FOUND ]]
then
echo "Found in $f:"
echo $FOUND
fi
done
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.