facebook

half displayed JSP [Closed]

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #206408 Reply

    yax3
    Member

    After deploying a web project, my JSP pages can only be half displayed. I’m sure the pages have no errors. Last time after I deployed it, same thing had happened. But after quite some tries, it went away by itself. Now I need to redeploy the project, same thing happened again. However, this time I seems not as lucky as last time. 😕
    Any suggestions? Thanks a lot!!

    #206410

    No Operation
    Member

    which server do you use?

    NOP

    #206411

    yax3
    Member

    I’m using Tomcat 5. And MyEclipse version is 3.7.0. Thanks.

    #206413

    Riyad Kalla
    Member

    yax3,
    If you mean that you only see 1/2 the page in your browser, then an exception is being thrown while the page is processing. If you don’t see anything in the MyEclipse console, open up your Tomcat log file (<TOMCAT INSTALL>\logs\) as the output will be there.

    Its usually a good idea to setup a logger for each app you are working on, so you can segregate the exceptions and messages for each app to their own logger. NOTE: This is a Tomcat functionality, it has nothing to do with MyEclipse, I was only making a “good practice” suggestion.

    #206425

    yax3
    Member

    Thanks a lot, Riyad. By checking the tomcat log, I did find what the problem is. 🙂
    Just a quick question though concerning your reply: how to set up a logger for each app?

    #206427

    Riyad Kalla
    Member

    Ahh, good question. You can fire up the Tomcat Administrator (http://localhost:8080, click “Administrator” when Tomcat is running) and do it from there. Expand the Host node, then 1 other node and you should see your Web App’s Context node (along with some others), if you click that, then look in the right panel, in the dropdown is an option “Create New Logger”.

    OR you can edit the .XML file for your context directly and add something that looks like this to the top of it (right after the <context open tag):

    
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="myapp_log." suffix=".txt" timestamp="true" verbosity="0"/>
    

    Where “myapp” is the name of your app. This will create log files for you in your log dir named similar to the localhost_ files that are there already.

    #206432

    yax3
    Member

    Riyad, Sorry I came back with more questions. 😳

    For your first method, I didn’t find username and pw to log into admin page. Where can I look for the info? I tried the user name and pw in tomcat-users.xml, none of them works.

    For the second one: I found I can modify server.xml under <Tomcat install dir>/conf/ to specify the log info. But the contents of the log would be the same as the “localhost_log” already there in the logs/ folder. And I can only have one log file — if I add the logger to specify myapp_log, the original one would not be logged any more.
    Then I tried modifying admin.xml under <Tomcat install dir>/conf/Catalina/localhost, add the logger right after the context open tag. It didn’t work. I also tried the admin.xml under <Tomcat Install dir>/server/webapps/admin, it still didn’t work. Which xml file should I change?
    Thanks!

    #206433

    Riyad Kalla
    Member

    Riyad, Sorry I came back with more questions.

    No problem, that is what we are here for.

    For your first method, I didn’t find username and pw to log into admin page.

    Please check the Tomcat docs, you need to define the ‘admin’ and optionally ‘manager’ roles and logins. They are NOT in the users file for security reasons. An example, my Tomcat-users looks like this:

    
    <?xml version='1.0' encoding='utf-8'?>
    <tomcat-users>
      <role rolename="tomcat"/>
      <role rolename="role1"/>
      <role rolename="manager"/>
      <role rolename="admin"/>
      <user username="tomcat" password="tomcat" roles="tomcat"/>
      <user username="both" password="tomcat" roles="tomcat,role1"/>
      <user username="role1" password="tomcat" roles="role1"/>
      <user username="admin" password="admin" roles="admin,manager"/>
    </tomcat-users>
    

    For the second one: I found I can modify server.xml under <Tomcat install dir>/conf/ to specify the log info.

    You need to setup a permanent context (using the admin tool or by hand) for your webapp. This will create its very own appName.xml file under <Tomcat Inst>/conf/Catalina/localhost directory. Its in THAT file that you add the logged, or just use the admin tool to do it and use the settings I gave you above.

    Then I tried modifying admin.xml under <Tomcat install dir>/conf/Catalina/localhost, add the logger right after the context open tag.

    Bad idea, that is the context for the admin module, it already has a logger setup if I’m not mistaken. Each webapp will get its own XML file. The reason you don’t have one now for your existing app that you have been running is *probably* because you have Tomcat configured to hot-deploy WAR files that are dropped in, in which case a temporary in-memory context is created. To setup a logger make this context permanent by creating it yourself.

    I need to cut this thread off here as we’ve diverged pretty far from MyEclipse support, I hope I’ve given you enough info to run with.

    #206434

    yax3
    Member

    Riyad, Thank you very much for your resourceful response! 🙂

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: half displayed JSP [Closed]

You must be logged in to post in the forum log in