How to debug Sun's classes using Eclipse

Sometimes happens to me during the debugging of my application to have the necessity to "step into"
in some Sun's classes (java.lang.String, or swing classes or something else).
Even if Sun provide us the sources, I have not found a way to debug Sun classes because the Sun
classes are shipped in jars without the debug informations.
Eclipse open correctly the Sun's source but, without the debug informations into Sun's jars, is impossible
to proceed with debugging.
Does anyone can help me?
Thanks.

I have not used Eclipse but I think this may do it. While u are build' ing ur project can u place the jar files in the source path so that their classes also get compiled! If u can do then u can step into sun's code.
s

Similar Messages

  • How to debug a swing application using eclipse IDE

    plz tell me how can i approach to understand SWING GUI application using eclipse debugging procedure.
    for example:
    i would like to know how the program flow is, for creating a particular screen.
    how to approach my SWING application flow eaasily... plz suggest me anyone!!!

    avula wrote:
    plz tell me how can i approach to understand SWING GUI application using eclipse debugging procedure.
    for example:
    i would like to know how the program flow is, for creating a particular screen.
    how to approach my SWING application flow eaasily... plz suggest me anyone!!!Add break points and step through the code, you can examine the stack, and variables in the debug perspective .

  • How to debug a function module using in the generic datasource?

    Hi all,
    We have created a generic data source using function modulle and have been extracting the data for a single customer it contains single records but it has pulled out more than 10,000 records. how to debug the function module used in the data source.
    since we schedule for extraction in bi and back ground job gets triggered in ecc for extraction,
    i know in se37 we can select the function module name and then debug but still need to check while the bacground job is trigered through bi.
    Thanks

    Yes you can debug the Function Module.
    Open the function module in SE37 and put a break point in the code where you want to check from, then come to RSA3 and give the datasource name and check the Debug check box on this screen, once you click on the start button it will take you the place where you have placed the break point in the FM, by pressing F5 you can see the flow of the FM.
    Let me know whether this solves your issue.

  • How to Debug a Java Project in Eclipse using Tomcat6.0

    Hi
    Can anybody help me with the following questions.
    1.How to create a java project in eclipse(I am using jsp,servlets,jsf,spring,jasper,struts).
    2.How to debug my application in Eclipse Europa by putting break points.
    3.how should i add Tomcat6.0 to my project in order to debug my application so that i can put break points while running the applications and observe the values.
    Thanks
    Bala

    You may find this tutorial useful regarding to JSF, Eclipse and Tomcat: http://balusc.blogspot.com/2008/01/jsf-tutorial-with-eclipse-and-tomcat.html
    To put breakpoints, just doubleclick on the left gray rule of the code, you'll get blue bullets at the left rule, indicating a break point. Run Tomcat in debug modus (rightclick Tomcat � debug). Use the Eclipse debug perspective to step in the code (window � open perspective � debug).

  • How to debug weblogic 8.1 with eclipse ?

    Hi,
    how can I debug my weblogic 8.1 application ?
    I`m using eclipse, but the plugin I´ve got, is only for versions 6.x and 7.0 .
    So I tried remote debugging but eclipse could not connect to the VM, I do not
    know why.
    Any ideas ??
    Thanks
    Holger

    It is quite easy to rewrite the plugin to work with 8.1
    We have done so - please contact me if you want the plugin.
    Sincerely,
    Paul Nyheim
    "HOs" <[email protected]> wrote in message
    news:3f72ce93$[email protected]..
    >
    Hi,
    how can I debug my weblogic 8.1 application ?
    I`m using eclipse, but the plugin I´ve got, is only for versions 6.x and7.0 .
    So I tried remote debugging but eclipse could not connect to the VM, I donot
    know why.
    Any ideas ??
    Thanks
    Holger

  • How to debug serlvet and EJB using IDE

    Anybody knows how to debug Servlet and EJB through standard IDE, like
    Symantec or VisualAge? Does the attach to process works?
    Thanks.

    1) Download and install the jpda package from sun (Java Platform Debugger
    Architecture, it contains the jdwp.dll, this has to be in your %PATH%
    variable).
    2) Start weblogic with something like this:
    %JDK_HOME%\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y
    ,address=8000 -ms64m -mx64m -Xbootclasspath:%JAVACLASSPATH% -classpath
    %WEBLOGICHOME%\classes\boot -Dweblogic.class.path=%WEBLOGICCLASSPATH% -Dwebl
    ogic.home=%WEBLOGICHOME% -Dweblogic.system.name=MyServer -Djava.security.man
    ager -Djava.security.policy==%WEBLOGICHOME%\weblogic.policy weblogic.Server
    3) address is the portnumber (in this example 8000) for the remote debugger.
    Attach to the VM with arguments -host <hostname> -port <address>
    -Falk
    "test" <[email protected]> wrote in message
    news:8frkq6$ru5$[email protected]..
    Anybody knows how to debug Servlet and EJB through standard IDE, like
    Symantec or VisualAge? Does the attach to process works?
    Thanks.

  • How to configure a servlet program using Eclipse?

    Hi,
    Am just learning Java and J2ee..Am not efficient..Don't laugh @ my question..
    I installed jdk 1.6, Apache tomcat 5.0 and eclipse 3.2.1 and also installed wtp plugin to work with j2ee perspective of eclipse..I did this in my PC..could U plz tell me what I need to install in addition?
    How come I write my Servlet program using Eclipse...
    Thanq
    Vani.

    This is the Sun Java System Messaging Server forum. Though this application software bears Java in it's name it has nothing to do with the programming language Java.

  • How to create an EJB Module using Eclipse

    Hi,
    How do I create a single EJB module and make a deployable EJB jar? I already have a existing source directory that contains the java files and the deployment descriptor. I am using Eclipse Ganymede 3.4 and Weblogic 9.2.
    Thanks.
    Edited by: user10387019 on Dec 9, 2008 1:39 PM

    Start out by creating an empty EJB project using the EJB Project wizard. Make sure to specify your WebLogic 9.2 installation as target runtime on the first page of the wizard. If your EJB source code is plain spec-compliant EJB, then your project is ready. If you are using WLS EjbGen technology, then you will also need to enable that feature on the project. You can do that at project creation by clicking the Modify button next to the Configuration combo on the first page of the wizard and then selecting WebLogic EJB Gen Support facet.
    Once the project is created, you are ready to import your source. You have several choices here. You can either copy your source into the src directory created for you or you can delete that source directory and link to a source directory elsewhere on the file system. To do the latter, right click on the project and select properties. Go to Java Build Path and select the Source tab. Remove the existing source directory. Then click on Link Source button and point to your existing source directory.
    That should be all that's necessary. Hope that helps.
    - Konstantin

  • How to debug java stored procedures using jdwp with Eclipse IDE?

    I need to debug the java stored procedures loaded in Oracle 9.2.0.6. The java files are loaded into the database using dbms_java.loadjava('-force -debug -verbose -resolve lib/java_stored_procs.jar'); The jar contains .java files and the database resolves and compiles them into .class files. Works fine but I need to debug the code. I am tried of the println method since takes too much and too many iterations.
    My IDE is Eclipse 3.1. I want to use the jdwp for debugging in my IDE. Any one who knows the exact steps?
    Thanks a lot.

    I need to debug the java stored procedures loaded in Oracle 9.2.0.6. The java files are loaded into the database using dbms_java.loadjava('-force -debug -verbose -resolve lib/java_stored_procs.jar'); The jar contains .java files and the database resolves and compiles them into .class files. Works fine but I need to debug the code. I am tried of the println method since takes too much and too many iterations.
    My IDE is Eclipse 3.1. I want to use the jdwp for debugging in my IDE. Any one who knows the exact steps?
    Thanks a lot.

  • Suns standard classes use of constants - bad coding convention

    Wasn't sure where to post this, it didn't quite fit into Java Runtime Environment or Java Virtual Machine forums.
    I was browsing through The Java Standard classes and was amazed by their use of constants. Throughout the codes there is inserted direct constants in the code without any use of global constant declarations.
    Eg: java.lang.StringCoding:
    All over the code is inserted "ISO-8859-1" (used as default encoding) directly instead of using a declared constant DEFAULTENCODING. What if Sun want to change default encoding?
    Seems strange to me that such coding conventions are used by Sun. Any reason for this or just sloppy programing?
    Gil

    Looks like sloppy programming to me. I see no possible
    reason for it. You're not the first person to
    criticise Sun's source code. Maybe they outsourced it
    to http://www.newtechusa.com/PPI/main.asp (I can never
    remember how to format links, no matter how often
    people tell me!)
    RObinThere's logic in getting primates to program.
    Based on the popular theory that an infinite number of monkeys could
    randomly produce the works of Shakespeare, they could also produce the perfect software implementation of any given problem. The downside being that the printed documentation will be smeared liberally with faeces.
    regards,
    Owen

  • How to debug for Eixt Class CL_RSPLS_CR_EXIT_BASE

    Hello,
    I have created a input ready query and I have a requirement where we can use based on the characteristic of Organisation and Country to derive the Material group.
    For example:
    Country     Organsiation    Material group
    16            4518          =====> 164518
    I know I can use classes in SE24.
    I am assuming I should use CL_RSPLS_CR_EXIT_BASE for my requirement.
    I have defined a characterisitc relationship with Organisation and Country as source characteristic and  Material group as target and chose Characteristic Combinations Based On : Exit class and Exit Class: CL_RSPLS_CR_EXIT_BASE
    In IF_RSPLS_CR_METHODS~DERIVE  :
    FIELD-SYMBOLS: <l_chavl> TYPE ANY.
    data:  l_pur_org type /BI0/oid_pur_org,
            l_country type /bi0/oid_country.
    ASSIGN COMPONENT 'D_PUR_ORG' OF STRUCTURE c_s_chas
    TO <l_chavl>.
      l_pur_org = <l_chavl>.
    ASSIGN COMPONENT 'D_COUNTRY' OF STRUCTURE c_s_chas
    TO <l_chavl>.
      l_country = <l_chavl>.
    CLEAR <l_chavl>.
    CONCATENATE '10' l_pur_org l_country INTO <l_chavl>.
    ASSIGN COMPONENT 'D_MTLGROUP' OF STRUCTURE c_s_chas
    TO <l_chavl>.
    For the above function  I get Organisation and Country from input schedule and it should derive  Material group and save it into the cube.
    Is code wrong? It can not debug when i execute the query.
    ps. I have tried to create break-point, and external break-point. But it does not work.
    Thanks for your suggestion.
    Edited by: gang qin on Jan 11, 2010 9:12 PM

    Hi.
    First you should create your OWN class based on CL_RSPLS_CR_EXIT_BASE  via se24.
    Second redefine 3 methods: CHECK and CREATE without any code and DERIVE with your code.
    As I understand your material group should be: '10' (constant) + pur_org + country cancateneted.
    If Im right plz try the next code (plz note the code is not checked and debigged. If you will set breakpoint in method derive in your own class you can debug it).
    You can change this code in section with comments "**** Your derivation algorithm here"
    METHOD if_rspls_cr_methods~derive.
    infrastructure needed by the buffer:
      DATA: l_s_mesg   TYPE if_rspls_cr_types=>tn_s_mesg,
            l_is_valid TYPE rs_bool.
      FIELD-SYMBOLS: <l_th_buf> TYPE HASHED TABLE,
                     <l_s_buf>  TYPE ANY.
      CLEAR e_t_mesg.
    use the buffer?
    o_use_buffer is switched on by default in the constructor
      IF o_use_buffer = rs_c_true.
      yes:
        ASSIGN o_r_th_buf->* TO <l_th_buf>.
        ASSIGN o_r_s_buf->*  TO <l_s_buf>.
        <l_s_buf> = c_s_chas.
        READ TABLE <l_th_buf> INTO <l_s_buf> FROM <l_s_buf>.
        IF sy-subrc = 0.
          IF o_r_is_valid->* = rs_c_true.
            c_s_chas = <l_s_buf>.
            RETURN.
          ELSE.
            IF e_t_mesg IS SUPPLIED.
              APPEND o_r_s_mesg->* TO e_t_mesg.
            ENDIF.
            RAISE EXCEPTION TYPE cx_rspls_failed
              EXPORTING
                msgid = o_r_s_mesg->msgid
                msgty = o_r_s_mesg->msgty
                msgno = o_r_s_mesg->msgno
                msgv1 = o_r_s_mesg->msgv1
                msgv2 = o_r_s_mesg->msgv2
                msgv3 = o_r_s_mesg->msgv3
                msgv4 = o_r_s_mesg->msgv4.
          ENDIF.
        ENDIF.
      ENDIF.
    Your derivation algorithm here:
      FIELD-SYMBOLS: <zpur_org>   TYPE ANY.
      FIELD-SYMBOLS: <zcountry>   TYPE ANY.
      FIELD-SYMBOLS: <zmat_grp>   TYPE ANY.
      ASSIGN COMPONENT '/BI0/d_pur_org'   OF STRUCTURE <l_s_buf> TO <zpur_org>.
      ASSIGN COMPONENT '/BI0/d_country'   OF STRUCTURE <l_s_buf> TO <zcountry>.
      ASSIGN COMPONENT '/BI0/'D_MTLGROUP' OF STRUCTURE <l_s_buf> TO <zmat_grp>.
      CONCATENATE '10' <zpur_org> <zcountry> INTO <zmat_grp>.
      l_is_valid = 'X'.
    End of your derivation algorithm:
    update the buffer with the result:
    l_s_mesg should contain a message in the 'invalid' case
    l_is_valid should indicate whether derivation was possible
    <l_s_buf> should contain the derived fields
      IF o_use_buffer = rs_c_true.
        o_r_is_valid->* = l_is_valid.
        IF o_r_is_valid->* = rs_c_true.
          INSERT <l_s_buf> INTO TABLE <l_th_buf>.
          c_s_chas = <l_s_buf>.
        ELSE.
          IF e_t_mesg IS SUPPLIED.
            o_r_s_mesg->* = l_s_mesg.
            APPEND l_s_mesg TO e_t_mesg.
          ENDIF.
          INSERT <l_s_buf> INTO TABLE <l_th_buf>.
          RAISE EXCEPTION TYPE cx_rspls_failed
            EXPORTING
              msgid = l_s_mesg-msgid
              msgty = l_s_mesg-msgty
              msgno = l_s_mesg-msgno
              msgv1 = l_s_mesg-msgv1
              msgv2 = l_s_mesg-msgv2
              msgv3 = l_s_mesg-msgv3
              msgv4 = l_s_mesg-msgv4.
        ENDIF.
      ENDIF.
    ENDMETHOD.

  • Remote Debugging Weblogic 92 application using Eclipse 3.4

    Hi,
    1. I have the below debug options in the startweblogic script.
    set JAVA_OPTIONS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=javadebug,suspend=n
    2. I have configured remote debugging in Eclipse. Connection type - Standard Socket (attach), host =localhost, port 7001. 7001 is the listen port that I have specified in config.xml.
    3. When I run weblogic, I see the message listening for transport dt_socket address. Since address=javadebug, each time the dt_socket address is different.
    4. In Eclipse IDE, the debug prespective indicates the server has started. But when I click on the debug buttin in the Debug configuration dialog, I get the error below
    Failed to connect to remote VM. Connection timed out.
    org.eclipse.jdi.TimeoutException
    Note: Another thread in this forum mentions using the same port that is specified in the java_options but that did not work either. Any ideas what might be wrong?
    Thanks.
    RS.

    I think that value of "javadebug" is only used for shared memory transport, not socket transport. You have to choose a port that isn't being used by anything else. The value 8453 is a typical default value for this. Specify that instead of "javadebug", and use 8453 in your connection from Eclipse.

  • How can i create  Jar file using Eclipse IDE.

    Hi Guys
    Am new to java. I want convert my project into executable jar file.
    In my project am using itext.jar.And some other folder.
    already i create jar file.But its not working.only its working 4 modules after that its say file cannot found exception.but the file path is correct.i dont know why its happen.
    This is my project folder strutre also
    Log:->
    src(folder)
    logs(folder)
    comments(folder)
    lib-->itext.jar.
    images-->1,gif
    properties-->catconfig.properties (file)
    now can i create jar file
    this code also show error when i run the jar file
    And this is my catconfig. properties file
    fileName=total_system_log.log
    DDSingle=DD_bysingleIP_comment.txt
    DDRange=DD_byrange_comment.txt
    NDPing=ping_comments.txt
    NDFPing=fping_comments.txt
    reportFileName=report.txt
    moduleFileName=Modules.txt
    propFileName=nameDetails.properties
    Choice=DDSingle
    logFileName=DDSingleIP_10.32.0.2.log
    finalReport=FinalReport.txt
    logFilePath=\logs\
    commentFilePath=\\Comments\\
    its very urgent for me . could u pls send my error  and u r ideas.
    thanks for u r Ansewering.
    import java.io.BufferedReader;
    import java.io.DataOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.InputStream;
    import java.io.RandomAccessFile;
    import java.util.Properties;
    import java.util.ResourceBundle;
    import java.util.ArrayList;
    public class LogReader {  
        public void getValuesFromFilesOnly(String Choice,String logFileName)
              try {
                   ArrayList commentsList = new ArrayList();
                   ArrayList tempList = new ArrayList();
                   String userdir = System.getProperty("user.dir");
                   String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                   String commentDir =ResourceBundle.getBundle("catconfig").getString(Choice);
                   String commentFilePath=ResourceBundle.getBundle("catconfig").getString("commentFilePath");
                   String currentdir1 =userdir+logFilePath+logFileName;
                   StringBuffer strBuff=new StringBuffer();
                   RandomAccessFile randomFile = null;
                   RandomAccessFile commentsFile = null;
                   String tempLine = null;
                   String commentLine = null;
                   String catVersion = null;
                   String finalReport=null;
                   int colon = 0;                    
                   int counter = 0;
                   boolean startFlag = false;
                   boolean endFlag = false;                    
                   boolean endOfFileFlag = false;          
                   System.out.println("Log file checked----->"+currentdir1);
                   System.out.println("comments file used--->"+commentDir);
                   try {
                        randomFile = new RandomAccessFile(currentdir1, "r");
                   } catch (Exception e) {
                        System.out.println("exception@getValuesFromFilesOnly@begin : "+e);
                   System.out.println("hi test1");
                   String commentDir1=userdir+commentFilePath+commentDir;
                   try{
                   System.out.println("Comment Dir:"+commentDir1);
                   commentsFile = new RandomAccessFile(commentDir1, "r");
                   catch (Exception e) {
                        System.out.println("exception@getValuesFromCommentDirOnly@begin : "+e);
                   while ((commentLine = commentsFile.readLine()) != null) {                         
                        String checkLine = commentLine.substring(commentLine.indexOf("=")+1, commentLine.length());
                        String message = commentLine.substring(0,commentLine.indexOf("="));
                        commentsList.add(checkLine);
                   commentsFile.close();
                   String startComment = (String)commentsList.get(0);
                   String endComment = (String)commentsList.get(commentsList.size()-1);
                   strBuff.append("                          CAT LOG REPORT                           \n\n");
                   while ((tempLine = randomFile.readLine()) != null) {               
                        if(tempLine.contains("CAT version is :"))
                             colon = tempLine.indexOf("is :");
                             catVersion = tempLine.substring(colon+4,tempLine.length());
                             String version=tempLine;
                             strBuff.append("Version : "+catVersion+"\n");
                             System.out.println("catVersion is :"+catVersion);
                        commentsFile = new RandomAccessFile(commentDir1, "r");
                        while ((commentLine = commentsFile.readLine()) != null) {
                             String checkLine = commentLine.substring(commentLine.indexOf("=")+1, commentLine.length());
                             String message = commentLine.substring(0,commentLine.indexOf("="));
                             checkLine=checkLine.toLowerCase();
                             tempLine=tempLine.toLowerCase();
                             if(tempLine.contains(checkLine))
                                  colon = tempLine.indexOf("info -");
                                  catVersion = tempLine.substring(colon+7,tempLine.length());
                                  strBuff.append(message+" ==> "+catVersion+"\n");
                                  System.out.println(message+" ==> "+catVersion);
                                  tempList.add(message+" ==> "+catVersion);
                                  if (catVersion.contains(startComment)){
                                       startFlag = true;
                                       counter++;
                                       System.out.println("*******startFlag**********"+startFlag);
                                  if (catVersion.contains(endComment)){
                                       endFlag = true;
                                       System.out.println("*******endFlag**********"+endFlag);
                                  if (startFlag == true && endFlag == true){
                                       System.out.println("******************************************");
                                       System.out.println("-------------Successfull completion-------");
                                       System.out.println("******************************************");
                                       startFlag = false;
                                       endFlag = false;
                                       counter = 0;
                                       tempList.clear();
                                  if (startFlag == true && endFlag == false && counter > 1){
                                       System.out.println("******************************************");
                                       System.out.println("---------------Failure after-----:"+tempList.get(tempList.size()-1));
                                       System.out.println("******************************************");
                                       //startFlag = false;
                                       //endFlag = false;
                                       counter = 0;
                                       tempList.clear();
                        commentsFile.close();
                   endOfFileFlag = true;
                   if (startFlag == true && endFlag == false && endOfFileFlag == true){
                        System.out.println("******************************************");
                        System.out.println("---------------Failure after-----:"+tempList.get(tempList.size()-1));
                        System.out.println("******************************************");
                        startFlag = false;
                        endFlag = false;
                        counter = 0;
                        tempList.clear();
                   randomFile.close();
                 System.out.println("hi");
                   finalReport=ResourceBundle.getBundle("catconfig").getString("finalReport");
                   savereportFile(strBuff,finalReport);
                   System.out.println("Report Generated");
              } catch (Exception e){
                   System.out.println("Exception@getValuesFromFilesOnly : "+e);
        public void findDetails()
             String currentdir1 = ResourceBundle.getBundle("catconfig").getString("fileName");     
             String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
             String userdir = System.getProperty("user.dir");
             RandomAccessFile randomFile = null;
             StringBuffer strBuff=new StringBuffer();
             StringBuffer strBuff1=new StringBuffer();
             StringBuffer strBuff2=new StringBuffer();
             String tempLine = null;     
              String catVersion = null;
              String timeStr=null;
              String nameStr=null;
              String startIP="";
              String endIP="";
              String tempStart="";
              String tempEnd="";
              String reportFileName="";
              String moduleFileName="";
              String propFileName="";
              int startPos=0;
              int endPos=0;
              int fromIndex=0;
              boolean versionFlag=false;
              boolean ndFlag=false;
              boolean ddFlag=false;
              try {
                   randomFile = new RandomAccessFile(userdir+logFilePath+currentdir1, "r");
                   while ((tempLine = randomFile.readLine()) != null) {
                        if(tempLine.contains("CAT version is :") && !versionFlag)
                             startPos = tempLine.indexOf("is :");
                             catVersion = tempLine.substring(startPos+4,tempLine.length());
                             String version=tempLine;
                             strBuff.append("version : "+version+"\n");
                             versionFlag=true;
                             //System.out.println("version : "+version);
                        if(tempLine.contains("Inside NetworkDiscoverySlider.jsp"))
                             ndFlag=true;
                             strBuff.append("ND start : "+tempLine+"\n");                         
                        if(tempLine.contains("Inside NetworkDiscoveryDetails.jsp"))
                             strBuff.append("ND end : "+tempLine+"\n");
                             //System.out.println(" ND end : "+tempLine);
                        if(tempLine.contains("Given IPRange from"))
                             startPos = tempLine.indexOf("from");
                             catVersion = tempLine.substring(startPos+5,tempLine.length());
                             strBuff.append("NDRange : "+catVersion+"\n");     
                             //strBuff.append("NDRange : "+tempLine+"\n");                                             
                             //System.out.println("NDRange :"+catVersion);     
                             startPos=0;
                             fromIndex=tempLine.indexOf(":");
                             endPos= tempLine.indexOf(':', fromIndex+2);
                             //System.out.println("fromIndex : "+fromIndex+" endPos : "+endPos);
                             timeStr=tempLine.substring(startPos, endPos);
                             nameStr=catVersion.replaceAll(" ", "_");                         
                             strBuff2.append("ND_"+timeStr+" "+catVersion+" = "+"NDRange_"+nameStr+".log\n");
                        if(tempLine.contains("inside ByIpAddress.jsp"))
                             ddFlag=true;
                             strBuff.append("DD Start : "+tempLine+"\n");                                                  
                        if(tempLine.contains("start_IpAddress:"))
                             startPos = tempLine.indexOf("start_IpAddress:");
                             catVersion = tempLine.substring(startPos+16,tempLine.length());
                             startIP=catVersion;                         
                        if(tempLine.contains("end_IpAddress"))
                             startPos = tempLine.indexOf("end_IpAddress");
                             catVersion = tempLine.substring(startPos+13,tempLine.length());
                             endIP=catVersion;                         
                             if(endIP.length()==0)
                                  System.out.println("hi5");
                                  strBuff.append("DDSingleIP : "+startIP+"\n");
                                  //strBuff.append("DDSingleIP : "+tempLine+"\n");                              
                                  //System.out.println("DDSingleIP : "+startIP);
                                  //startPos = tempLine.indexOf(" ");
                                  startPos=0;
                                  fromIndex=tempLine.indexOf(":");
                                  endPos= tempLine.indexOf(':', fromIndex+2);
                                  timeStr=tempLine.substring(startPos, endPos);     
                                  strBuff2.append("DD_"+timeStr+" "+startIP+" = "+"DDSingleIP_"+startIP+".log\n");
                             else
                                  strBuff.append("DDRangeIP : "+startIP + " to "+ endIP+"\n");
                                  //strBuff.append("DDRangeIP : "+tempLine+"\n");                              
                                  //System.out.println("DDRangeIP : "+startIP + " to "+ endIP);
                                  //startPos = tempLine.indexOf(" ");
                                  startPos=0;
                                  fromIndex=tempLine.indexOf(":");
                                  endPos= tempLine.indexOf(':', fromIndex+2);
                                  timeStr=tempLine.substring(startPos, endPos);                         
                                  strBuff2.append("DD_"+timeStr+" "+startIP+" to "+endIP+" = "+"DDRangeIP_"+startIP +"_to_"+ endIP+".log\n");
                        if(tempLine.contains("set percentage completedCount: 100"))
                             System.out.println("hi...1");
                             strBuff.append("DD End : "+tempLine+"\n");
                             //System.out.println("DD End : "+tempLine);          
                   reportFileName=ResourceBundle.getBundle("catconfig").getString("reportFileName");
                   savereportFile(strBuff,reportFileName);
                   if(ndFlag)
                        strBuff1.append("Network Discovery\n");                    
                   if(ddFlag)
                        strBuff1.append("Device Discovery\n");
                   moduleFileName=ResourceBundle.getBundle("catconfig").getString("moduleFileName");
                   savereportFile(strBuff1,moduleFileName);
                   propFileName=ResourceBundle.getBundle("catconfig").getString("propFileName");
                   savereportFile(strBuff2,propFileName);
              } catch (Exception e)
                   System.out.println("error hi1");
                   System.out.println("Exception@findDetails : "+e);
        public void savereportFile(StringBuffer strBuff,String targetFileName)
              try{
                   String userdir = System.getProperty("user.dir");
                   String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                   String reportFile=userdir+logFilePath+targetFileName;     
                   String fileContent="";
                   fileContent=strBuff.toString();
                      //System.out.println("file content : "+fileContent);
                      FileWriter fileWriter = new FileWriter(reportFile);
                      if(fileContent!=null)
                           fileWriter.write(fileContent);
                      fileWriter.close();
              catch(Exception e)
                   System.out.println("error hi1");
                   System.out.println("Exception@savereportFile : "+e);
        public ArrayList<String> getFileNames()
             String reportFile=ResourceBundle.getBundle("catconfig").getString("reportFileName");
             String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
             String userdir = System.getProperty("user.dir");
              RandomAccessFile repFile=null;
              String reportLine = null;
              int colon=0;
              int fromIndex=0;     
              int startPos=0;
              int endPos=0;
              String timeStr="";
              String fileName=null;          
              ArrayList<String> nameList=new ArrayList<String>();          
             try
                  reportFile=userdir+logFilePath+reportFile;
                  repFile = new RandomAccessFile(reportFile, "r");
                  while ((reportLine = repFile.readLine()) != null) {                    
                        if(reportLine.contains("NDRange"))
                             colon=reportLine.indexOf(" : ");
                             fileName=reportLine.substring(colon+3, reportLine.length());
                             fileName="NDRange_"+fileName.replaceAll(" ", "_");
                             nameList.add(fileName);
                             System.out.println("fileName : "+fileName);
                        if(reportLine.contains("DDSingleIP"))
                             colon=reportLine.indexOf(" : ");
                             fileName=reportLine.substring(colon+3, reportLine.length());
                             fileName="DDSingleIP_"+fileName.replaceAll(" ", "_");
                             nameList.add(fileName);
                             System.out.println("fileName : "+fileName);
                        if(reportLine.contains("DDRangeIP"))
                             colon=reportLine.indexOf(" : ");
                             fileName=reportLine.substring(colon+3, reportLine.length());
                             fileName="DDRangeIP_"+fileName.replaceAll(" ", "_");
                             nameList.add(fileName);
                             System.out.println("fileName : "+fileName);
                  repFile.close();
             catch(Exception e)
                   System.out.println("Error@getFileNames : "+e);
             return nameList;
        public void writeFile(String oldLogName,String newLogName)
             try
                   FileOutputStream writeFile=null;               
                   String line = null;
                   String userdir = System.getProperty("user.dir");
                   String reportFile=ResourceBundle.getBundle("catconfig").getString("reportFileName");     
                   String newLogPath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                   RandomAccessFile repFile=null;               
                   String reportLine = null;
                   String tempLine=null;
                   String prevLine=null;
                   String nextLine=null;
                   String target=null;
                   String tempStr=null;
                   String startStr=null;
                   String endStr=null;          
                   int pos=0;
                   boolean flag=false;
                   boolean writeFlag=false;
                   boolean versionFlag=false;               
                   //System.out.println("newLogName : "+newLogName);     
                   newLogPath=userdir+newLogPath;
                   System.out.println("newLogPath : "+newLogPath);     
                   BufferedReader buffRead = new BufferedReader(new FileReader(oldLogName));
                   writeFile = new FileOutputStream(newLogPath+newLogName+".log", false);//true-for append mode
                   DataOutputStream dout=new DataOutputStream(writeFile);               
                   tempStr=newLogName.replace("_", " ");
                   pos=tempStr.indexOf(" ");
                   startStr=tempStr.substring(0,pos);
                   endStr=tempStr.substring(pos+1, tempStr.length());
                   target=startStr+" : "+endStr;
                   System.out.println("target ===> "+target);               
                   reportFile=newLogPath+reportFile;
                   repFile = new RandomAccessFile(reportFile, "r");
                  while ((reportLine = repFile.readLine()) != null) {                   
                       if(reportLine.contains(target))
                            flag=true; 
                            prevLine=tempLine;
                            //System.out.println("prevLine *****: "+prevLine);
                       else
                            tempLine=reportLine;
                            if(flag==true)
                                 nextLine=reportLine;
                                 flag=false;
                                 //System.out.println("nextLine *******:"+nextLine);
                                 break;
                  repFile.close();     
                 if(prevLine!=null && prevLine.length()>0)
                       pos=prevLine.lastIndexOf(" : ");
                       prevLine=prevLine.substring(pos+3, prevLine.length());
                       //System.out.println("prevLine : "+prevLine);
                  else
                       System.out.println("Starting line not available for : "+target);
                  if(nextLine!=null && nextLine.length()>0)
                        pos=nextLine.lastIndexOf(" : ");
                        nextLine=nextLine.substring(pos+3, nextLine.length());
                        //System.out.println("nextLine : "+nextLine);
                  else
                       System.out.println("Ending line not available for : "+target);
                       nextLine=prevLine;
                   while ((line=buffRead.readLine()) != null) {     
                        if(line.contains("CAT version is :") && !versionFlag)
                             versionFlag=true;
                             dout.writeBytes(line+"\n");                         
                        if(line.contains(prevLine))
                             writeFlag=true;                         
                        if(line.contains(nextLine))
                             writeFlag=false;
                             break;
                        if(writeFlag)
                             dout.writeBytes(line+"\n");
                  dout.writeBytes(nextLine+"\n");
                   buffRead.close();     
                   System.out.println("done");
              catch(Exception e)
                   System.out.println("Exception@writeFile : "+e.getMessage());
        public String folderCheck(String foldName)
              File folder=null;
              File newFile=null;
              String[] folderContent=null;
              String tempFileName="";
              String newLogName="";
              int count=0;     
              String logFilePath="";     
              String fileName="";
              String feedBackMsg="";          
              String userdir = System.getProperty("user.dir");
              logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
              fileName=ResourceBundle.getBundle("catconfig").getString("fileName");
              folder=new File(foldName);
              if(folder.isDirectory())
                   newLogName=userdir+logFilePath+fileName;
                   //System.out.println("newLogName : "+newLogName);
                   newFile=new File(newLogName);
                   if(newFile.exists())
                        newFile.delete();
                   folderContent= folder.list();
                   if (folderContent != null && folderContent.length>0)
                        System.out.println("folder has files : "+folderContent.length);                    
                        for(int iterate=0;iterate < folderContent.length;iterate++){                         
                             if (folderContent[iterate].toLowerCase().contains("system"))
                                  count++;                              
                                  tempFileName=foldName+"/"+folderContent[iterate];     
                                  try
                                       FileOutputStream appendedFile=null;
                                       BufferedReader buffRead = new BufferedReader(new FileReader(tempFileName));
                                       appendedFile = new FileOutputStream(newLogName, true);//true-for append mode
                                        DataOutputStream dout=new DataOutputStream(appendedFile);
                                        String line = null;
                                       System.out.println("writting : "+tempFileName);
                                       while ((line=buffRead.readLine()) != null) {                                        
                                            dout.writeBytes(line+"\n");
                                       buffRead.close();          
                                       //System.out.println("done");
                                  catch(Exception e)
                                       System.out.println("Exception@folderCheck : "+e);
                        if(count==0)
                             feedBackMsg="syslognotavail";
                             //System.out.println("System Log(s) not available");
                        else
                             feedBackMsg="syslogavail";
                             //System.out.println(count +" System log(s) avail");
                   else
                        feedBackMsg="filesnotavail";
                        //System.out.println("Files are not in the folder");
              else
                   feedBackMsg="Dirnotavil";
                   //System.out.println("Directory not exists in the given name");
              return feedBackMsg;
        public ArrayList<String> loadFileContent(String selectedStr)
             //System.out.println("inside loadFileContent()");
             String logFilePath="";
             String propFileName="";
             String line="";
             String choice="";
             String tempStr="";
             int startPos=0;
             int endPos=0;
             ArrayList<String> timeList=new ArrayList<String>();
             String userdir = System.getProperty("user.dir");
             try
                  logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                  propFileName=ResourceBundle.getBundle("catconfig").getString("propFileName");
                  propFileName=userdir+logFilePath+propFileName;
                  BufferedReader buffRead = new BufferedReader(new FileReader(propFileName));
                  if(selectedStr.equalsIgnoreCase("Device Discovery"))
                       choice="DD";
                  else if(selectedStr.equalsIgnoreCase("Network Discovery"))
                       choice="ND";
                  while ((line=buffRead.readLine()) != null) {                                        
                        if(line.contains(choice))
                             System.out.println(line);
                             startPos=line.indexOf("_");
                             endPos=line.indexOf(" =");
                             tempStr=line.substring(startPos+1, endPos);
                             System.out.println("tempStr : "+tempStr);
                             timeList.add(tempStr);
                   buffRead.close();          
             catch(Exception e)
                  System.out.println("Exception@loadFileContent : "+e);
             return timeList;
        public String getFileName(String timeStr)
             System.out.println("inside getFileName");
             String logFilePath="";
             String propFileName="";
             String line="";
             String tempStr="";
             int startPos=0;
             String userdir = System.getProperty("user.dir");
             try
                  logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                  propFileName=ResourceBundle.getBundle("catconfig").getString("propFileName");
                  propFileName=userdir+logFilePath+propFileName;              
                  BufferedReader buffRead = new BufferedReader(new FileReader(propFileName));              
                  while ((line=buffRead.readLine()) != null) {                                        
                        if(line.contains(timeStr))
                             System.out.println(line);
                             startPos=line.indexOf(" = ");                         
                             tempStr=line.substring(startPos+3, line.length());
                             System.out.println("tempStr : "+tempStr);                         
                   buffRead.close();          
             catch(Exception e)
                  System.out.println("Exception@loadFileContent : "+e);
             return tempStr;
        public ArrayList loadFile()
             String logFilePath="";
             String moduleFileName="";
             String line="";         
             ArrayList<String> moduleList=new ArrayList<String>();
             String userdir = System.getProperty("user.dir");
             try
                  logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
                  moduleFileName=ResourceBundle.getBundle("catconfig").getString("moduleFileName");
                  moduleFileName=userdir+logFilePath+moduleFileName;
                  BufferedReader buffRead = new BufferedReader(new FileReader(moduleFileName));              
                  while ((line=buffRead.readLine()) != null) {     
                       moduleList.add(line);                    
                   buffRead.close();          
             catch(Exception e)
                  System.out.println("Exception@loadFile : "+e);
             return moduleList;
    public static void main(String[] args) {          
         System.out.println("Inside main");     
         //String userdir = System.getProperty("user.dir");
         //System.out.println("userdir : "+userdir);
         /*ArrayList<String> fileNameList=new ArrayList<String>();
         String Choice="";     
         String logFileName="";     
         String logFilePath="";     
         String totalLog="";     
         String newLog="";     
         String folderName="";
         Choice=ResourceBundle.getBundle("catconfig").getString("Choice");
         logFileName=ResourceBundle.getBundle("catconfig").getString("logFileName");     
         logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
         folderName=ResourceBundle.getBundle("catconfig").getString("folderName");
         totalLog=ResourceBundle.getBundle("catconfig").getString("fileName");     */
         /*try
              //to write the total log
              //folderCheck(folderName);
              //to find the details in the given log
              //findDetails();
              //to split the logs accordingly
              totalLog=logFilePath+totalLog;          
              fileNameList=getFileNames();;
              System.out.println("FileNameList size = "+fileNameList.size());
              for(int i=0;i<fileNameList.size();i++)
                   newLog=fileNameList.get(i).toString();
                   writeFile(totalLog,newLog);
              //to analyse the logs & to produce reports          
              //getValuesFromFilesOnly(Choice,logFileName);          
         }catch (Exception e)
              System.out.println(e.getMessage());
    }[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    JSP is used for server validation.
    So you need a an application server (like Tomcat or Jboss) to execute your jsp files.
    you can create the .war file of your simple jsp application and put it in the server.
    then you will have to access your page using a web browser.
    the URL will be
    http://<ComputerName or IP Address>:<PortNumber>/<WarFileName>/<MainJspPage>
    (eg: http://100.100.100.252:8080/SimpleApplication/mainPage.jsp)
    -Achyuth

  • How to check the customer class using CRM_PRICING_BADI...

    Hello Experts,
    I am using the said BADI in transaction CRMD_ORDER to check the
    customer class and condition exclusion. What data do I need to use and pass?
    Sorry since I am fairly new to CRM module.Hope you can help me guys.Thank you and take care!

    No answer...

  • How to import a Java class using Rule Author ?

    I want to recreate the following ruleset using the Oracle Rule author
    RL> ruleset parse {
    import java.lang.Integer;
    rule A {
    String total = "12";
    int t = Integer.parseInt(total);
    if (t == 12) {
    println("Total=" + t);
    Does anyone know how to create the RL line "import java.lang.Integer;" using Rule Author ?

    The line "import java.lang.Integer" isn't necessary if you fully qualify the reference to Integer.

Maybe you are looking for

  • Apple-ID im App-Store inaktiv, im iTunes aktiv???!!!

    Hallo Community! Der App-Store sagt, dass die Apple-ID meiner Mutter inaktiv ist, aber wenn Sie sich mit iTunes anmeldet steht dort, dass die Apple-ID aktiv ist. Nur im App-Store kann sie sich nicht anmelden. Weiss jemand an was das liegen kann? Viel

  • How to return package name?

    for example, I have a program Bank.java package MyBank; public class Bank { What should I write in the program if I want the program to return me the package name? Thanks!

  • SCSI device and Windows 2008 Guest OS HVM

    Hi all, customer installed Windows 2008 as a guest HVM on Oracle VM. They can't see external SCSI storage if the vm.cfg file consists of following records: 'phy:/dev/sdd,ioemu:sdc,w', 'phy:/dev/sde,ioemu:sdd,w', 'phy:/dev/sdf,ioemu:sde,w', 'phy:/dev/

  • Error occurs while transfering flat data to sap.

    hi friends , i am not able to update  the data to  the transaction 'XK01' from the text file. this is my code. Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code. And use code tags to

  • Boot Camp Cannot Partition

    I have issues. So here we go... My main issue here is I cannot partion my system with Boot Camp Assistant. As far as I can tell I've followed every step correctly to this point. Everything is updated I had Microsoft send me a new, full version of Win