Debugging a j2ee project

-->i have getting assignment to debug the j2ee project .
-->but i am unable to capture jsp related errors.
-->how can I debugg project by which I can eliminate errors related jsp from my project.
-->while I am using ecllipse editor .
Message was edited by:
amit.cnb

If you have a jsp file called Commands.jsp, when you display the jsp page in a browser, it gets compiled into a java servlet called Commands_jsp.java (search for a similiarly named java for for whatever your jsp file is called). If you open that file, you will see the java code generated is quite complicated and even if you can set a breakpoint within it, you cant find where to put the breakpoint. Therefore breakpoints will not help.
What I do is comment out most of the tags and scriptlets in the jsp file and run the code. When that part of the file is working, I uncomment out the next section of code and try to get that to work.
An alternative is to crate an empty jsp file and copy pieces of the original jsp file into it piece by piece, verifying each piece before moving onto the next piece.
The following java scriptlet placed in your jsp file will print out a java object's value to the browser page shown in your browser:
<% out.write("some value"); %> (((out is one of the objects implicidly available to you on teh jsp page))))
There may be a product that allows you to set breakpoints in the jsp file (and not the java file generated for that jsp file), but I never saw one yet.

Similar Messages

  • Debugging EP application project

    Hi Experts,
    I am trying to debug EP application project. In order to do this I have done following steps:
    1) Started config tool of J2EE engine.
    2) Switch to current instance and go to debug tab
    3) Set "Enable debug mode" checked
    4) Set valid debug port.
    5) Saved the settings.
    I am however not able to carry out debugging. Can you pls help me out.
    Thanks
    Gaurav

    Hi Shree,
    maybe this blog helps:
    <a href="https://weblogs.sdn.sap.com/pub/wlg/1971">NetWeaver portal debugging</a>
    Greetings,
    Carsten

  • Debugging a J2EE Application

    Hi,
    I´m trying configuring debug on a J2EE Application.
    But when I select one intance with debug mode on appears follow message:
    "The selected server node does not run in restricted load balancing mode ! Please configure it correctly so that the URL extension can be used."
    Anyone knows how configure it ?
    Thanks
    Anderson Carmanhani

    Hi,
    Before any debugging can take place Server Node of J2EE cluster must first switched to debug mode
    There are 2 ways of debugging
    1) Temporary
    2) Permanent
    For temporary switched debug mode ON using J2EE engine view in NWDS
    For permanent switched debug moce ON  using J2EE Visual Administrator
    Option 1:  Start the SAP AS Engine in debug mode through Config Tool:
    1. To enable the debug mode from the Config Tool, visit following path :
         C:\usr\sap\<SID>\JC<SYS_NO>\j2ee\configtool\configtool.bat
    2. Click on the particular instance. Then under the tab VM Environment, Set the DebugMode = true.
    3. Restart the engine now. This will open the J2EE server again in the Debug Mode.
    Option 2: Starting the local debug session
    1. Select "SDM" from J2EE engine (To get this view navigate through Window -> Show View -> J2EE Engine)
    2. Make a right click on "SDM" and choose "Enabling Debugging of Process"
    3. Now, Navigate to Run -> Debug -> Select your Project as "Webdynpro Application" and click "new" button
    4. Now give some name and Click "Browse" to select you project and then click "Apply" and "Debug".
    How to do Debug in NWDS:[Here|http://help.sap.com/saphelp_nw04/helpdata/en/a8/def86ab54da5418a3575373934ca00/frameset.htm] and [this|Re: Acitvating debugging in developer studio; thread.
    Hope this helps!!
    Thanks & Regards
    Vijay

  • A problem with Lucene In a J2EE project

    Hi everyone:
    I am newer for Lucene which is used to build a search eigneer in my J2EE project.
    But I can hardly understand how it works because of my poor English.
    So I need you help:
    * TxtFileIndexer.java
    * Created on 2006�N12��8��, ����3:46
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package classes.php.lucene;
    * @author eingmarra
    import java.io.File;
    import java.io.FileReader;
    import java.io.Reader;
    import java.util.Date;
    import org.apache.lucene.analysis.Analyzer;
    import org.apache.lucene.analysis.standard.StandardAnalyzer;
    import org.apache.lucene.document.Document;
    import org.apache.lucene.document.Field;
    import org.apache.lucene.index.IndexWriter;
    import org.apache.lucene.index.Term;
    import org.apache.lucene.search.Hits;
    import org.apache.lucene.search.IndexSearcher;
    import org.apache.lucene.search.TermQuery;
    import org.apache.lucene.store.FSDirectory;
    public class TxtFileIndexer {
         public String test() {
              return "test is ok hohoho";
          * @param args
         public String createIndex(String indexDir_path,String dataDir_path) throws Exception {
              String result = "";
              File indexDir = new File(indexDir_path);
              File dataDir = new File(dataDir_path);
              Analyzer luceneAnalyzer = new StandardAnalyzer();
              File[] dataFiles = dataDir.listFiles();
              IndexWriter indexWriter = new IndexWriter(indexDir,luceneAnalyzer,true);
              long startTime = new Date().getTime();
              for(int i=0; i < dataFiles.length; i++) {
                   if(dataFiles.isFile() && dataFiles[i].getName().endsWith(".html")) {
                        result += "Indexing file" + dataFiles[i].getCanonicalPath()+"<br />";
                        Document document = new Document();
                        Reader txtReader = new FileReader(dataFiles[i]);
                        document.add(Field.Text("path",dataFiles[i].getCanonicalPath())); //can not pass the Netbeans IDE, maybe the Field class is not support the signature of the fuction Text anymore!!
                        document.add(Field.Text("contents",txtReader)); //can not pass the Netbeans IDE, maybe the Field class is not support the signature of the fuction Text anymore!!
                        indexWriter.addDocument(document);
              indexWriter.optimize();
              indexWriter.close();
              long endTime = new Date().getTime();
              result += "It takes"+(endTime-startTime)
                        + " milliseconds to create index for the files in directory "
                        + dataDir.getPath();
              return result;
         public String searchword(String ss,String index_path) throws Exception {
         String queryStr = ss;
         String result = "Result:<br />";
         //This is the directory that hosts the Lucene index
    File indexDir = new File(index_path);
    FSDirectory directory = FSDirectory.getDirectory(indexDir,false);
    IndexSearcher searcher = new IndexSearcher(directory);
    if(!indexDir.exists()){
         result = "The Lucene index is not exist";
         return result;
    Term term = new Term("contents",queryStr.toLowerCase());
    TermQuery luceneQuery = new TermQuery(term);
    Hits hits = searcher.search(luceneQuery);
    for(int i = 0; i < hits.length(); i++){
         Document document = hits.doc(i);
         result += "<br /><a href='getfile.php?w="+ss+"&f="+document.get("path")+"'>File: " + document.get("path")+"</a>\n";
    return result;
    the code above is from google and it works perfectly in the Lucene1.4. But it not pass the compiler by Netbeans IDE because I use Lucene2.0
    If you have some idea,plz replace these two lines' code with the correct ones.
    Thanks a lot !!

    Hi everyone:
    I am newer for Lucene which is used to build a search eigneer in my J2EE project.
    But I can hardly understand how it works because of my poor English.
    So I need you help:
    * TxtFileIndexer.java
    * Created on 2006�N12��8��, ����3:46
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package classes.php.lucene;
    * @author eingmarra
    import java.io.File;
    import java.io.FileReader;
    import java.io.Reader;
    import java.util.Date;
    import org.apache.lucene.analysis.Analyzer;
    import org.apache.lucene.analysis.standard.StandardAnalyzer;
    import org.apache.lucene.document.Document;
    import org.apache.lucene.document.Field;
    import org.apache.lucene.index.IndexWriter;
    import org.apache.lucene.index.Term;
    import org.apache.lucene.search.Hits;
    import org.apache.lucene.search.IndexSearcher;
    import org.apache.lucene.search.TermQuery;
    import org.apache.lucene.store.FSDirectory;
    public class TxtFileIndexer {
         public String test() {
              return "test is ok hohoho";
          * @param args
         public String createIndex(String indexDir_path,String dataDir_path) throws Exception {
              String result = "";
              File indexDir = new File(indexDir_path);
              File dataDir = new File(dataDir_path);
              Analyzer luceneAnalyzer = new StandardAnalyzer();
              File[] dataFiles = dataDir.listFiles();
              IndexWriter indexWriter = new IndexWriter(indexDir,luceneAnalyzer,true);
              long startTime = new Date().getTime();
              for(int i=0; i < dataFiles.length; i++) {
                   if(dataFiles.isFile() && dataFiles[i].getName().endsWith(".html")) {
                        result += "Indexing file" + dataFiles[i].getCanonicalPath()+"<br />";
                        Document document = new Document();
                        Reader txtReader = new FileReader(dataFiles[i]);
                        document.add(Field.Text("path",dataFiles[i].getCanonicalPath())); //can not pass the Netbeans IDE, maybe the Field class is not support the signature of the fuction Text anymore!!
                        document.add(Field.Text("contents",txtReader)); //can not pass the Netbeans IDE, maybe the Field class is not support the signature of the fuction Text anymore!!
                        indexWriter.addDocument(document);
              indexWriter.optimize();
              indexWriter.close();
              long endTime = new Date().getTime();
              result += "It takes"+(endTime-startTime)
                        + " milliseconds to create index for the files in directory "
                        + dataDir.getPath();
              return result;
         public String searchword(String ss,String index_path) throws Exception {
         String queryStr = ss;
         String result = "Result:<br />";
         //This is the directory that hosts the Lucene index
    File indexDir = new File(index_path);
    FSDirectory directory = FSDirectory.getDirectory(indexDir,false);
    IndexSearcher searcher = new IndexSearcher(directory);
    if(!indexDir.exists()){
         result = "The Lucene index is not exist";
         return result;
    Term term = new Term("contents",queryStr.toLowerCase());
    TermQuery luceneQuery = new TermQuery(term);
    Hits hits = searcher.search(luceneQuery);
    for(int i = 0; i < hits.length(); i++){
         Document document = hits.doc(i);
         result += "<br /><a href='getfile.php?w="+ss+"&f="+document.get("path")+"'>File: " + document.get("path")+"</a>\n";
    return result;
    the code above is from google and it works perfectly in the Lucene1.4. But it not pass the compiler by Netbeans IDE because I use Lucene2.0
    If you have some idea,plz replace these two lines' code with the correct ones.
    Thanks a lot !!

  • Getting Error in Asmx Web Service Unit Testing & not able to debug unit-test Project.

    I am getting below error message while running unit test for ASMX web service
    Failed MyFunction The ASP.NET Web application at 'D:\MyProjectFolder' is already configured for testing by another test run. Only one test run at a time can run
    tests in ASP.NET. If there are no other test runs using this Web application, ensure that the Web.config file does not contain an httpModule named HostAdapter.
    I checked in web.config. Below line already added in web.config. i removed below line to run test again but getting same error message.
    <httpModules>
    <add name="HostAdapter" type="Microsoft.VisualStudio.TestTools.HostAdapter.Web.HttpModule, Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </httpModules>
    i am not able to debug unit test project.
    Please "Mark as Answer" if this post answered your question. :)
    Kalpesh Chhatrala | Software Developer | Rajkot | India
    Kalpesh 's Blog
    VFP Form to C#, Vb.Net Conversion Utility

    Hi Kalpesh,
    >>Failed MyFunction The ASP.NET Web application at 'D:\MyProjectFolder' is already configured for testing by another test run. Only one test run at a
    time can run tests in ASP.NET. If there are no other test runs using this Web application, ensure that the Web.config file does not contain an httpModule named HostAdapter.
    In your web application root, can you find a file named 'web.config.backup'?
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/e2ad0c20-df90-48dc-818c-8c5ec24d9365/visual-studio-test-is-not-hitting-breakpoints-in-debug?forum=vststest
    Fang also shared more information about debugging the unit test for web project here:
    https://social.msdn.microsoft.com/Forums/en-US/daa16086-b1b8-4917-ad8d-65e23b49e1bc/not-able-to-read-webconfig-through-unit-test-feature-by-visual-studiovsts?forum=vststest
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem intregrating Flash help usingRobohelp 8.0 into J2EE project

    Hi,
    I have am working on J2EE project and I have a small issue with getting Flash to run off my localhost server.  I have managed to get the webhelp working but I want to see what the help looks like using flash. I am getting and error when I am trying load the index file:
    "invalid path was requested /application/FlashHelp/whproj"
    I am using have Apache 6.0, struts 1.2.  It loads from the hard drive in both IE and FIrefox but not when I am running from the server.  When running on localhost in Firefox it loads the righthand contents page but none of the dynamic content.  In IE8 it load nothing at all (I assume because it doesn't know what to do after the error is thrown).
    Can anyone shed some light on this topic?
    thanks

    The problem is solved.  The apache server was filtering out .xml files so it was not loading whproj.xml thus all the other *.xml and subsequent flash objects were not loading.  That was only 2 days of trial and error.

  • Help with J2EE Project Management

    Hi,
    We are about to begin a large J2EE project and are wondering if anyone could help with the following questions:
    1. Given the division of labor on J2EE projects (JSP developers, EJB developers, application deployers, etc...), what are "best practices" for building a team and ensuring that they communicate well after the design phase? How will the left arm know what the right arm is doing?
    2. What documentation should be produced during the design phase to give to the developers? Will this allow them to go off and develop independently of each other?
    3. Is there a "best practices" document anywhere on J2EE project management?
    Thanks in advance!!

    Hi,
    I feel any project to start with should have a prior planning,that too particularly for Object oriented programming projects,I feel UML is the best tool for entire process.I think rational software has got lot of Project Management Tools(PMT) and products at all stages.Please go through the rational.com site and hope you could find some info.I feel the answer to your second question is partly 'yes' and partly 'no'.The modules that you can split it up which have got some independent attributes,but it should not be too much in your project,then it affects the work matrix/There should be a optimal process to decide and that you can yourself formulate depending on the time frame,either way the last step of build or integration is not flexible enough that you should mind,modular flexibility can be there but the integration stage you are tied with a fixed process.So plan accordingly using a PMT tool for any project that matters and all the best.Bye
    Hari

  • How to use crystal report in J2EE Project.

    how to use crystal report in J2EE Project.. any one know please inform me...
    thank you..

    http://www.inetsoftware.de/products/crystalclear/Crystal-Reports.htm?adwords=googleCrystal&gclid=CKDD1YDem5UCFRpknAodZA4EhA
    I think this might help u...

  • Which files  should include in path when building J2EE project?

    Hi,
    I'm new to J2EE. Trying some examples on Servlet. But I've the error messages stating that it can't locate the javax.servlet.* classes like the ones below:
    <code>
    import javax.servlet.http.HttpServlet;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    </code>
    Could anybody pls tell me which file (of J2EE SDK) I should include in my path when building J2EE projects?
    thanks,
    jackling

    You need to have $J2EE_HOME/lib/j2ee.jar in your CLASSPATH when compiling your servlet

  • Debugging in J2EE mode in Netweaver7.1

    In Netweaver7.1 we are not able to debug in J2EE mode. Can anybody help regarding this.
    Thanks in advance
    Roopa

    Hi,
    Check these links:
    http://help.sap.com/saphelp_nwce10/helpdata/en/42/9dd20ebb211d75e10000000a1553f6/frameset.htm
    http://help.sap.com/saphelp_nwce10/helpdata/en/73/42e6f3fbd06841b288e5e797e1b168/frameset.htm
    http://help.sap.com/saphelp_nwce10/helpdata/en/42/9dd20ebb211d75e10000000a1553f6/frameset.htm
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/2a1d30e1a44a2ae10000000a11466f/frameset.htm
    Hope that helps.
    Regards,
    Siddhesh

  • Java j2ee project integartion

    Hi
    I have a two project
    first normal j2ee project
    second project-java project which connects to data ,take the data from data file and then insert it into database.
    This data is displayed by jsp pages in first project
    Now I to integrate this I made a jar file of second project and added in lib of web-inf/lib
    But no action . making jar file approach is correct or not? any other idea.
    .Independently the seoncd project is working
    Other option is to make dependency to each other but it wont work as I have to give everything in single war file
    regards

    roy i am not invoking anything just keeping jar file in liv
    but I can post the main file handle.java
    ublic class Handle
         public static void main(String[] args)
              Properties applicationProperties = null;
              PropertiesUtil propertiesUtil = null;
              Properties queryProperties = null;
              PropertiesUtil queriesUtil = null;
              try
                   Logger logger = Logger.getLogger(AuditDataHandler.class);
                   //System.out.println(Constants.APPLICATION_PROPERTY_FILE_PATH);
                   applicationProperties = PropertiesReader.loadProperties(
                                                      Constants.APPLICATION_PROPERTY_FILE,
                                                      Constants.A

  • Running j2ee project in netbeans

    Hi,
    I have developed an j2ee project in netbeans 6.5.1. But I have a problrm in deploying this. When I build and run the project I got the following error.
    Deploying application in domain completed successfully
    Rollback completed successfully
    Trying to create reference for application in target server  failed; Bad File parameter in AppDD ctor: E:\project_eps\esubApplication\dist\gfdeploy
    E:\project\EPS\EPS-war\nbproject\build-impl.xml:556: The module has not been deployed.
    BUILD FAILED
    My project is in the folder E:\Project\EPS...
    But it is showied a reference to another project E:\project_eps\esubApplication. Then I removed this application along with all its sub contenets. Now when I run the project it shows a link to another project EPS1 like this
    Deploying application in domain completed successfully
    Rollback completed successfully
    Trying to create reference for application in target server failed; Cannot find application.xml. Searched for: E:\project_eps\EPS1\dist\gfdeploy\META-INF\application.xml -- perhaps this is not an Application?
    E:\project\EPS\EPS-war\nbproject\build-impl.xml:556: The module has not been deployed.
    BUILD FAILED
    Now I removed EPS1 project also. But still I'm getting the same error.
    My earlier proograms including esubapplication & EPS1 ran successfully.
    Please tell me what is the problem and how to set it. Thanks in advance.

    Hi Louis,
    You can do it by creating a URL iView for that you need to have content administration rights on portal then you can create URL iView in Portal Content Directory (PCD) and then you can attach it to a page or workset or to a role and then give that role authorization to rquired user.
    Ninad

  • Flex and J2EE project

    Trying to create a Flex J2EE project in Eclipse when I get to
    the Server setup the wizard wants the location of the Flex war
    file. I give it the name of my project, still an error What's the
    problem here.
    Shouldn't the wizard setup an new project war file?

    Root folder:
    X:\server\mycompany\deploy\flex.war
    Where X:\ is actually a drive on your server. Use C:\ D:\ or
    E:\ if you run LCDS on your dev machine. In my case, X:\ is a Samba
    connection to a Linux drive on my server where LCDS is installed.
    Root URL:
    http://hostname.int.mycompany.com/flex
    E.g if you installed JBoss on your dev machine, use
    http://localhost:8080/flex
    Context root:
    /flex

  • Regarding execution of a j2ee project.

    Hello I have developed one j2ee project with Tomcat 5.5 & Eclipse 3.2.1
    I have stored my project under <TOMCATHOME>/webapps/ <project1-folder>/
    If i need to develop another project, where i should create my new project folder. If i use the same webapps folder in the TOMCAT_HOME dir, Eclipse gives error like can't make another project.
    Can i make a new project in some other locations other than TOMCAT_HOME dir. For this what steps i need to follow.
    Moreover, i can make a .war file for my new project from Eclipse IDE?
    What is the use of this war file.
    if i need to execute my project from other PC, what should i do for executing my project in different PCs.
    Friends, Please help me in this regard.
    rgds
    tskarthikeyan

    Hello Balu Sir,
    First of all i am new to j2ee environment. Now i am learning only.
    In your reply, it means we can create our own directory for our project in the normal way. we dont need to create the folder under the webapps dir.
    I tried this in Eclipse configured with Tomcat. It has been compiled successfully.
    For example,
    My Project folder is - C:\Java/Eclipse/workspace/ChatServer/
    If i execute the application via tomcat like "http://localhost:8080/ChatServer/MainServlet"
    it gives internal error some thing like that.
    what is wrong in my steps.
    Also you mentioned in your reply, we can export the war file of our project.
    How to execute the project in different pc with this war?
    rgds
    tskarthikeyan

  • How to import an j2ee project into j2ee perspective of  NWDS

    while trying to import an j2ee project into NWDS .....it is giving an error """unbounnd classpath container:org.eclipse.jst.j2ee.internal.web.container".
    So where must be the problem.Should i have to install some eclipse plugins in the NWDS ????

    Hello again
    Sure, you can import the topics as a "batch" by selecting many topics at once.
    As for the links, I'm thinking that as long as you maintain the relative locations between the linked topics, that all should be fine.
    What I mean by the relative locations is to say that if you have a folder structure in the source project, you will need to ensure you have the identical folder structure in the destination. Then ensure the topics are copied to the exact folders.
    Cheers... Rick

Maybe you are looking for