2012-08-17 24 views
2

我的一個實習生來找我,問他在哪裏可以找到下面的類我在哪裏可以找到今天com.ibm.ws.logging.object.hpel.WsLogRecord

com.ibm.ws.logging.object.hpel.WsLogRecord 

通常類似於findjar.com會發現它,但在這種情況下它不能。最後我用瓶子資源管理器中找到它在以下位置內爲8個庫,但這個過程是低效的:

{server root}\plugins\com.ibm.hpel.logging.jar 

這篇文章的目的是爲了讓您瞭解在那裏可以找到,但還當公用事業在線沒有提供您需要的洞察力時,要問什麼是找到班級的最佳方式。

感謝, 傑里米

+0

鏈接JarExplorer:https://github.com/javalite/jar-explorer – ipolevoy 2015-03-19 05:33:47

回答

1

我能找到WsLogRecord com.ibm.ws.logging.object.WsLogRecord下(減去HPEL)。我使用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的開箱即用代碼。我想這不能回答如何在網上找到它,但我能夠找到它,然後通過上述步驟查看課程。

1

如果一切都失敗,我無法找到使用Eclipse快速類型層次的類,它表示在罐子類的生活,我會用大意如下的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 
2

我在WebSphere的一個正在運行的實例下所做的工作是部署a JSP that uses a technique described in a DeveloperWorks article來查找提供特定類的jar。

對於後人,這裏的that 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> 
相關問題