Debugging a remote tomcat servlet

I have the following setup:
win2000sp2advanced server with an application (Interwoven TeamSite) running a scaled down version of Tomcat 3. This tomcat is serving a war called webdesk.war. Runtime, the war file is unpacked in this location: c:\iw-home\httpd\webapps\webdesk
Sun Java Studio 8 on a winxpsp2 laptop
I setup the following java and UML model in JS8:
UMLProjectWebDesk
WebDeskSRC
My objective is to run a remote debugging session on the servlet and to set a breakpoint in the servlet class which I can see listed, using the projects view, in Libraries> webdesk.jar>com.interwoven.teamsite.filesys>FileTemplatesServlet.class
I configured debugging on the TS servlet with the following switch on servletd.exe (the tomcat start executable called via a perl script to start as a windows service):
"-Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n".
When I select Run>AttachDebugging, I select JPDA Debugger, SocketAttach, dt_socket, 10.101.2.153 and port 8888 where 10.101.2.153 is the ip address of the server where servletd.exe is running and the servlet resides.
In the Debugger Console I see "Attaching to 10.101.2.153:8888" and " User program running" so I guess that the debugger is actually attached (I have seen errors before when I did not put any attributes on the server's jvm).
The problem that I have is more of a lack of understanding in the software. I googled a lot without finding the exact answers before resolving to this forum. I hope I am not asking for something stupid here, but need some guidance.
It seems that the servlet class FileTemplatesServlet.java has not been downloaded by Java Studio Enterprise 8, so that I cannot put a breakpoint on this class.
I also tried to put a breakpoint on any other jsp file that is part of my remote application and it seems not to work.
The question is if someone can establish if I did something terribly wrong in setting up this project? Something simple I oversaw?
arnout cator
Technical Support Engineer
[email protected]

thanks for the reploy! To be more specific:
I have the source code for all the libraries that the web application uses here: c:\TS_JSE_debugging\webdesk\WEB-INF\lib
I want to set a breakpoint in the local java source file C:\TS_JSE_debugging\webdesk\WEB-INF\lib\webdesk\com\interwoven\teamsite\filesys\FileTemplatesServlet.java
In JSE8 I went into the java project properties window and clicked on the Sources tab. I added the Package Folder C:\TS_JSE_debugging\webdesk\WEB-INF\lib to the Source Package Folder. R:\iw-home\httpd\webapps\webdesk\WEB-INF\jspc was already listed there. I understand that JSE8 decompiled all the class files in the jspc folder into .java files and put them in the jspc folder. That makes me believe that my servlet FileTemplatesServlet.class should be debugged when I set a breakpoint now on a line in my local decompiled source in FileTemplatesServlet.java.
I did that and then I get a message back in the bottom left pane of the JSE8 UI saying: " Source file for com.interwoven.teamsite.filesys.FileTemplatesServlet not found"
Question is: I thought I just added the source to the project?
I am now proceeding into the other 2 replies!
thanks
arnout cator

Similar Messages

  • How to remote debug JSPs on Tomcat 5.0 from JDev 10.1.2

    I can remote debug Java applications and servlets. But I can not make it stop within any JSP pages while doing remote debug. I have no problem if I debug locally within the built-in OC4J server.
    I set my project properties with remote debugging -> Attaching to JPDA. I start my tomcat using catalina jpda start after setting environment variables JPDA_ADDRESS=8000 and JPDA_TRANSPORT=dt_socket.
    Please help,
    TIA

    Ashraf, thanks for sharing your experience. I would like to comment on your precedure.
    Jdeveloper 10.1.2
    Tomcat 4.1.31 ( version 5.x.x won't work as it needs jdk 1.5 at least, and jdev is configured to run with 1.4 )I was able to use Jdeveloper 9.0.5 to debug a servlet running in Tomcat 5.5.9 with jdk 1.5.0. I would belive there is no fundamental obstacle for Jdeveloper 10.1.2 to debug Tomcat 5.x.x, thanks to the nature of JPDA.
    a- backup $TOMCAT$\bin\catalina.bat.
    b- edit $TOMCAT$\bin\catalina.bat to include the following:
    set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xnoagent -Djava.compiler=NONE
    -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000Another way is to set your environment variable JAVA_OPTS. There is then no need to modify catalina.bat.

  • Remote Debugging Jdev11 and Tomcat 5.5 ?

    Hi,
    How could i make remote debugging Jdevelopper11 and Tomcat5 ?
    Where could i configure remote Tomcat option ?
    Regards
    Philippe

    Here are some steps with JDev 10g
    http://technology.amis.nl/blog/1984/java-platform-debugger-architecture-jpda-with-tomcat-oc4j-eclipse-intellij-idea-and-jdeveloper
    JDev 11g should be basically the same.

  • How to debug flash remoting?

    Hi I am using -  flashremoting.jar 1.0.52502 on tomcat.
    I have a 3 year old application that is running on 1 server, it works fine there, the flash client can connect to the java tomcat server and call methods and all is well.
    We are trying to stand this application up on another server, and I cant get the flash remoting to work, the server side java methods never get called (I added logging to them).
    In the adobe troubleshooting it says to go to /gateway and you should get a blank page.
    The weird thing is on both the server that works and the server that doesnt work, if I go there in a browser I get:
    HTTP Status 404 - /flashservices/index.html
    This is the same for both servers. So im not sure what to try next. Im not an expert in flash my flash guy says the client gets:  "Error opening URL"
    The url in the flashvars looks good, the flashgateway.jar file is in the web-inf/lib folder , the frconfig.txt is in web-inf/classes
    my web.xml has this:
    <servlet>
            <servlet-name>FlashGatewayServlet</servlet-name>
            <display-name>Flash Remoting Servlet</display-name>
            <description>
                Servlet-based plugin to Flash Remoting
            </description>
            <servlet-class>
                flashgateway.controller.GatewayServlet
            </servlet-class>
            <load-on-startup>10</load-on-startup>
        </servlet>
    <servlet-mapping>
            <servlet-name>FlashGatewayServlet</servlet-name>
            <url-pattern>/gateway</url-pattern>
        </servlet-mapping>
    what can I check next, how can I troubleshoot this and figure out if its a client problem or a server problem, or somewhere in the middle?
    thanks
    Joel

    I got on line with tech support to get them to show me how to use it. The guy hardly knew anything about it himself. From the coldfusion group and was the guy who was supposed to know. I screen shared with him and every time we tried debugging from flex it would just stop. Seems that if something goes wrong in a coldfusion library, the debugger just stops and so it is something upsteam of your break point. Of course there is nothing to show you that, but it became clear. The guy didn't have any better idea than I did what was going on. I figured that out.
    If you check the docs about CF and flex, their recommendation is write it all as a CF app. debug it and then hook flex to it. Pure garbage. Anybody hear of DRY. I have dumped ever using CF on the back end. It is not an oop language. It is a tag based language for markup pages with quasi script and its ORM is so inflexible its a joke.
    Went back to ruby on rails and rubyamf for my backend to flex apps (with Mate as MVC framework) and I could not be happier. Never had such an unpleasant develpment experience than working with Coldfusion as the backend to a flex app. Good luck.

  • CiscoWorks Tomcat Servlet Engine service does not start

    Hello!
    CiscoWorks  Tomcat Servlet Engine service does not start.
    Events in the Windows Event Viewer:
    The CiscoWorks Tomcat Servlet Engine service terminated unexpectedly. It has done this 1 time(s).
    output pdshow and file stderr.log,  hs_err_pid2128.log attached.
    Do  you have an idea how to resolve this?
    Thanks!

    The only things which I see are wrong are the start types for the IPM NG database engine and HUM database engine services.  They must be set to Manual, not Automatic.  However, that would not account for the Tomcat crash.  The crash points to an error in the code which processes regdaemon.xml, but I see no reason why that should be failing.  As I said before, I think it would be best to open a Service Request.  Remote access would be helpful to dig into this problem in more detail.
    Please support CSC Helps Haiti
    https://supportforums.cisco.com/docs/DOC-8895
    https://supportforums.cisco.com

  • HOW TO: Debug a remote JSP

    <h1>HOW TO: Debug a remote JSP</h1>
    <strong>Note: </strong>The process of debugging a remote JSP on an Apache/Jserv
    installation involves a couple extra steps that were not covered in the JDeveloper
    3.2 documentation. </p>
    <strong>Introduction</strong></p>
    You use JDeveloper to debug JavaServer Pages (JSP) deployed and running on
    a server that includes a JSP container, such as Apache Jserv. Your JSP container
    will need to be configured to enable remote JSP debugging using JDeveloper.</p>
    JDeveloper allows you to use one of two protocols for JSP debugging - the
    Oracle Java Virtual Machine (OJVM) debugging protocol or the Sun Java Platform
    Debugging Architecture (JPDA). Before you start your remote debugging session,
    you will have to choose which method to use. If you use the OJVM protocol, your
    debugging session will run more quickly and you will have some additional features
    to assist you. You can only use OJVM on a Windows NT system. If your server
    is running UNIX or another operating system, you <strong>must</strong> use the
    &quot;classic&quot; JVM.</p>
    <strong>Setting up your project for remote JSP debugging</strong></p>
    Once you have created a JSP project, you need to set your project options
    so that remote debugging is enabled: </p>
    <ol>
    From the <strong><u>P</u>roject</strong> menu, select <strong><u>P</u>roject
    Properties</strong>. </p>
    </li>
    Click the <strong>Run/Debug</strong> tab.</p>
    </li>
    From <strong><u>D</u>ebug Files As:</strong> dropdown list, select <strong>Remote
    Debugging</strong>. </p>
    </li>
    Click <strong>OK</strong>. </p>
    </li>
    </ol>
    <strong>Configuring the Remote Server</strong></p>
    The following options must be changed on the host running the Apache/Jserv
    server. These instructions assume the server is running Windows NT: </p>
    <strong>Changes to jserv.properties</strong></p>
    These options control which Java Virtual Machine is used and how it is loaded.
    </p>
    <ol>
    For <em>The Java Virtual Machine interpreter</em> parameter <tt>wrapper.bin</tt>:
    </p>
    </li>
    <ul>
    [*]Comment out any existing entries by putting a <tt>#</tt> at the beginning
    of the line.
    <blockquote>
    <pre>#wrapper.bin=C:\java1.1.8\bin\java.exe</pre>
    </blockquote>
    </li>
    [*]Add a new entry with the full path of the <tt>java.exe</tt> that you want
    to use. To use the JDeveloper 1.3 OJVM, put
    <blockquote>
    <pre>wrapper.bin=C:\Program Files\Oracle\JDeveloper 3.2\java1.2\bin\java.exe</pre>
    </blockquote>
    </li>
    </ul>
    For the <em>Arguments passed to Java interpreter</em> parameter <tt>wrapper.bin.parameters</tt>:
    The value you put for this parameter depends on which Debugging Protocol
    you will choose in the <strong>Remote Debugging Dialog</strong> in JDeveloper
    when you start debugging.</p>
    </li>
    <ul>
    [*] If you want to use the JDeveloper 3.2 OJVM, put </li>
    <blockquote>
    <pre>wrapper.bin.parameters=-ferrari -XXdebugondemandquietport4000</pre>
    </blockquote>
    [*]If you want to use Java Platform Debugging Architecture, put
    <blockquote>
    <pre>wrapper.bin.parameters=-classic -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Xdebug -Xnoagent -Djava.compiler=NONE</pre>
    </blockquote>
    The <tt>4000</tt> parameter defines the port number which the JDeveloper
    debugger will use to communicate with the server. You can specify a different
    port number, but it must match the port which you will enter in the <strong>Remote
    Debugging Dialog</strong> in JDeveloper when you start debugging. </p>
    </li>
    </ul>
    [*] For the <em>PATH environment value passed to the JVM</em> parameter <tt>wrapper.path</tt>
    enter the location of <tt>jdwp.dll</tt>, which is part of the <em>Java Platform
    Debugging Architecture</em>.
    This parameter is only necessary if you will choose the <em>Java Platform
    Debugging Architecture</em> debugging protocol:</p>
    <blockquote>
    <pre>wrapper.path=C:\jpda\bin</pre>
    </blockquote>
    </li>
    For the <em>CLASSPATH environment value passed to the JVM</em> parameter
    <tt>wrapper.classpath</tt>: </p>
    <ul>
    Keep the location of <tt>ApacheJServ.jar</tt>. If it is not already
    there, add it. </p>
    <blockquote>
    <pre>wrapper.classpath=C:\Program Files\Apache\JServ\ApacheJServ.jar</pre>
    </blockquote>
    </li>
    Comment out the location of <tt>jsdk.jar</tt>. </p>
    <blockquote>
    <pre>#wrapper.classpath=C:\jsdk2.0\lib\jsdk.jar</pre>
    </blockquote>
    </li>
    [*]Add the location of <tt>servlet.jar</tt> from JDeveloper 3.2.
    <blockquote>
    <pre>wrapper.classpath=C:\Program Files\Oracle\JDeveloper 3.2\lib\servlet.jar</pre>
    </blockquote>
    </li>
    [*] Add the locations of <code>jdeveloper.zip</code> and <code>ojsp.jar</code>
    from JDeveloper.
    <blockquote>
    <pre>
    wrapper.classpath=C:\Program Files\Oracle\JDeveloper 3.2\lib\jdeveloper.zip
    wrapper.classpath=C:\Program Files\Oracle\JDeveloper 3.2\lib\ojsp.jar
    </pre>
    </blockquote>
    </ul>
    </ol>
    <strong>Changes to jserv.conf</strong></p>
    <ol>
    For the <em>ApJServAction</em> parameter: </p>
    <ul>
    [*] Comment out any existing <tt>ApJServAction .jsp</tt> entries by putting
    a <tt>#</tt> at the beginning of the line. </li>
    <blockquote>
    <pre>
    #ApJServAction .jsp /servlets/org.gjt.jsp.JSPServlet
    </pre>
    </blockquote>
    [*]Add a new <tt>ApJServAction .jsp</tt> entry like this.
    <blockquote>
    <pre>
    ApJServAction .jsp /servlets/oracle.jsp.JspServlet
    </pre>
    </blockquote>
    </li>
    </ul>
    </li>
    </ol>
    <strong>Changes to zone.properties</strong></p>
    <ol>
    In the <em>Servlet Init Parameters</em> section: </p>
    </li>
    <ul>
    Add the following lines. </p>
    <pre>
    servlet.oracle.jsp.JspServlet.initArgs=emit_debuginfo=true
    servlet.oracle.jsp.JspServlet.initArgs=jspcompiler=oracle.jdeveloper.jsp.JspOjcCompiler
    servlet.oracle.jsp.JspServlet.initArgs=classpath=C:\Program Files\Oracle\JDeveloper 3.2\java1.3\jre\lib\rt.jar
    </pre>
    </li>
    </ul>
    </ol>
    <strong>Copying the JSP to the Apache/Jserv Server</strong></p>
    Once you have restarted the server with the modified parameters, you need to
    copy your JSP to the server's HTML root directory. For most Apache installations
    this is <tt>C:\Program Files\Apache\htdocs</tt>. </p>
    You also need to make sure the JSP is in your HTML directory in the JDeveloper
    tree, typically <tt>C:\Program Files\Oracle\JDeveloper 3.2\myHTML</tt>. The
    reason for this is JDeveloper uses the folder name as its package name.</p>
    <strong>Debugging a JSP</strong></p>
    Debugging a JSP is very similar to debugging any other Java program.</p>
    <ol>
    From the <strong><u>R</u>un</strong> menu, select <strong><u>D</u>ebug
    "<em>filename</em>.jsp"</strong>. </p>
    Start the JSP running (for example, start your web browser and open a
    connection to the JSP). </p>
    Debug as normal. </p>
    </ol>
    If you are using the JDeveloper OJVM debugging protocol, you will be able
    to disconnect from the JSP container. This allows you to stop debugging, but
    leave the JSP container running. In addition, you will be able to use two extra
    debugging functions that are not available using the JDPA protocol - <strong>Run
    to End of Method</strong> and <strong>Set Next Statement</strong>.</p>
    If you using JPDA, you must use <strong>Stop</strong> to end your debugging.
    Using this method will also stop the JSP container.</p>
    <blockquote>
    <strong></strong></p>
    </blockquote>
    null

    Hi,
    It again same as you do in your local server...You can monitor the BPEL process flow in the em console and debug..if its not sufficient....u can also monitor the logs located at
    <SOA_Home>\user_projects\domains\domain1\servers\soa_server1\logs to debug.

  • Compiled Tomcat Servlet Example & got JAR, not WAR?

    Is there a basic reference on how to create a simple servlet with NetBeans 4.1 and deploy it to Tomcat?
    When I created the project I chose Samples->Web->Tomcat Servlet Example, and yet it does not create a WAR file on compilation.
    And of course once I'm past that I have to figure out how to edit the XML file, I gather.
    I need a reference that will hold me by the hand and walk me through it once to kick start me.
    After that I think I can make it without having to ask such newbie questions.

    Hi,
    not sure to what extent you are clear in build.xml file (done thru ant).
    what i can tell you is, ant creates any archive file (be it .jar, .war, .ear) with the tasks named "jar" (<jar jarfile="yourfilename.jar"..>), "war" and "ear". But both war and ear are the extensions of the jar only.
    You can achieve creation of any archive file with the jar task itself.
    you need to take care of the following...
    (1) you can /should edit the extension of the files at every stage.. first .jar and then .war and then .ear (if necessary) => basic flow
    (2) at every step, you have to have a file inclusion inside the corresponding archive file..
    say for example, for a .jar file you should include all the compiled .class files, and ejb-jar.xml (incase you use ejbs) and other built-in jar files....
    In case of .war files (web archive) you should include the web.xml file, any static files (html, jsp etc), any tld files - it goes with your application's nature and requirement.....
    fyi, i m including a sample build.xml file which i use for a webapplication, so it deals with war...
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="ServletsReqDispFwd" default="deploy">
         <property name="top" value="."/>
         <property name="webinf" value="${top}/WEB-INF"/>
         <property name="lib" value="${webinf}/lib"></property>
         <property name="classes" value="WEB-INF/classes"/>
         <property name="jboss.dir" value="D:\jboss-3.2.2RC3\server\default\deploy"></property>
         <property name="tomcat.dir" value="D:\jakarta-tomcat-4.1.27\webapps"></property>
         <property name="warfile" value="ServletsReqDispFwd.war"></property>
         <property name="src" value="${top}/src"/>
         <property name="web.xml" value="WEB-INF/web.xml"/>
         <target name="package">
              <javac srcdir="${src}" destdir="${classes}"
                     listfiles="true" debug="true"  verbose="true"
                          classpath="${lib}/*.jar"/>
              <war warfile="${warfile}" webxml="${web.xml}">
                   <webinf dir="${top}">
                        <include name="**/*web*.xml"/>
                        <include name="**/*application*.xml"/>
                        <exclude name="src/**/*.xml"/>
                   </webinf>
                   <lib dir="${lib}">
                        <include name="*.jar"/>
                   </lib>
                   <fileset dir="." includes="**/*.html"/>                    
                   <classes dir="${classes}" includes="**/*.class"></classes>                         
              </war>
         </target>
         <target name="deploy" depends="clean,package">
              <copy file="${warfile}" todir="${tomcat.dir}" overwrite="true"></copy>
         </target>
         <target name="clean">
                <delete dir="${classes}">
                     <filename name="*.class"/>
              </delete>
              <delete>
                   <fileset dir="${top}" includes="${warfile}"/>
              </delete>
              <delete>
                   <fileset dir="${tomcat.dir}" includes="${warfile}"/>
              </delete>
         </target>
    </project>hope this contribues to a certain extent to help you edit the buildfile (xml file as you go) to meet your requirement.....

  • Tomcat servlet respond with "302 Moved Temporarily" to HTTP GET requests

    I started Tomcat (4.1.31) on a Unix machine (SunOS 5.8)
    I tested the tomcat servlet using the following commands:
    telnet 0 80
    Trying 0.0.0.0...
    Connected to 0.
    Escape character is '^]'.
    GET /index.html HTTP/1.0
    HTTP/1.1 302 Moved Temporarily
    Location: http://localhost/
    Content-Length: 0
    Date: Mon, 17 Oct 2005 18:09:15 GMT
    Server: Apache-Coyote/1.1
    Connection: close
    Any other servlet that I test responses with the same result
    Tomcat version 4.1.31
    SDK build 1.3.1_02-b02
    Solaris SunOS 5.8

    "302 Moved Temporarily" is a web server error (I googled it - see e.g. http://www.checkupdown.com/status/E302.html)
    Two recommendations that you can try:
    - do not use 'localhost' - use computer assigned name, or at worst IP address
    - in my system, Server URL is set to http://ecm-base:16200/cs/idcplg (from ODC). Try to modify yours accordingly.

  • Tomcat Servlet - TCP Port Already in Use?

    My problem is that tomcat/servlet is not releasing its TCP port after my servlet closes the port. Next time a servlet tries to use the port it gets an error "Port already in use". Using netstat I can see the port is still in use. If I stop tomcat and restart it, the port is released. I have not had this sort of problem writing C programs that use sockets.
    My setup is Fedora Core 6 with JDK1.5_14 and Tomcat 5.5.26. I know it's not the latest, but sockets and streams have been around for a long time.
    Actual implementation uses a trivial javaserver page to instantiate a class to create/accept connection from a client (JApplet). After connection, it starts a thread to receive data. I am using ServerSocket(), InputStreamReader(), and OutputStreamWriter(). On ServerSocket I set ReuseAddress to true.
    I have try/catch on all my I/O and use tomcat context log for error and OK messages. Data transfer is perfect. Detect close by client works. In the context log I see close of streams and ServerSocket occur with no exceptions. Then, I manually close the jsp window. No indication of any problems. If I use different port 2nd time (e.g. 50001) it all works perfect. If I use my default (50000) again, servlet gets an error during bind, "Port already in use".
    2.5 years with Java. 5 years with Linux and C.
    Please advise or refer

    rwengr wrote:
    My problem is that tomcat/servlet is not releasing its TCP port after my servlet closes the port. Next time a servlet tries to use the port it gets an error "Port already in use". Using netstat I can see the port is still in use. If I stop tomcat and restart it, the port is released. I have not had this sort of problem writing C programs that use sockets.Nice.... Not sure that matters though.
    >
    My setup is Fedora Core 6 with JDK1.5_14 and Tomcat 5.5.26. I know it's not the latest, but sockets and streams have been around for a long time.
    Actual implementation uses a trivial javaserver page to instantiate a class to create/accept connection from a client (JApplet). Bleah! Don't use a JSP for that. Use a servlet at worst. At best use a Servlet to start some other socket manager class which you can/have tested outside the Servlet Container environment.
    After connection, it starts a thread to receive data. I am using ServerSocket(), InputStreamReader(), and OutputStreamWriter(). On ServerSocket I set ReuseAddress to true.
    I have try/catch on all my I/O and use tomcat context log for error and OK messages. Data transfer is perfect. Detect close by client works. In the context log I see close of streams and ServerSocket occur with no exceptions. Then, I manually close the jsp window. Closing the browser window has no affect on the server.
    No indication of any problems. If I use different port 2nd time (e.g. 50001) it all works perfect. If I use my default (50000) again, servlet gets an error during bind, "Port already in use".
    2.5 years with Java. 5 years with Linux and C.
    Please advise or referShow some code. If you just want some generic advice it would be to close the port, as soon as you don't need it anymore. But you know that. Without any further code I think that is about all that can be said.
    P.S. Make the code as small as possible, compilable, but still demonstrating the problem. Also see: [this tutorial as an example...|http://www.javaworld.com/javaworld/jw-12-1996/jw-12-sockets.html?page=1]

  • Tomcat servlet/JSP container default files on 10gAS(10.1.2.0.2)

    Hi Friends,
    I am using Oracle Application Server 10g (10.1.2.0.2) on windows
    I have the Vulnerability: Apache Tomcat servlet/JSP container default files.
    and the fix is Review the files and delete those that are not needed.
    i would like to know the location of the files to review and delete.Please suggest?
    Regards,
    DB

    Apache/Tomcat is not related to OAS, where did you get this info? OAS is based in a Orion Web Server and Apache HTTP Server, not Tomcat.
    For this kind of problems there are the CPU you may want to check in Metalink for them.
    Can you clarify also what default files?
    Greetings.

  • Should I install Apache Web server to use Jakarta Tomcat Servlet engine?

    Hello,
    I have some problems and now have a question:
    Should I install Apache Web server to use Jakarta Tomcat Servlet engine?
    JTK home page is available via http://localhost:8080
    Tomcat ver 3.1.3
    Thanks.

    No, you don't need to run Apache webserver (httpd) to run Tomcat. Tomcat by default runs on port 8080, but you can set it to any port, including 80, if you have permission to do so (on *nix systems, you need root permissions to run services on any port below 1024).
    Tomcat is a webserver as well, just one that includes a servlet container and JSP processor. So it will serve your html files, images, etc (aka static content), just as well as Apache httpd, in addition to being able to run servlets and JSPs.
    Apache httpd has more options for serving static content than Tomcat, so many people prefer to use it as their main webserver and only use Tomcat as a sort of "plugin" to handle servlets and JSPs. This can be achieved through a connector. Instructions on how to set this up are on the Jakarta website.
    So you could use Apache and Tomcat combined, next to each other, or totally separated. In many cases, just Tomcat will do.

  • Calling remote machine servlet from applet

    I got an error when I calling a remote machines servlet. I am calling from applet which is downladed by pluggin.
    can any body tell me what is the reason the applet is not calling this servlet ?
    what do i do to solve this problem ?
    Dinesh

    Dinesh
    Enable the Java console (Control Panel, Java Plug-In, Basic, Show Java Console, Apply)
    The error message might give you some help.
    Regards

  • Remote tomcat start in java

    I am trying to make an application to start an stop remote tomcat in java.
    Edited by: vikas.j20 on Oct 9, 2008 5:33 AM

    Chicon wrote:
    Buongiorno www.viabonanno24.it,
    I suggest you to provide an applet to your authenticated clients. For example, if a client wants to view an image, just make the applet downloading and decrypting the file, loading the file into a BufferedImage and displaying the image in a Icon enclosed into a JLabel; there will leave no cache among the Internet temporary files as the whole process will be executed in memory.
    BTW, whatever the way you're using, it won't prevent the user of doing a screen capture.Don't you think it is hopeless to attempt to provide a Java applet version of every conceivable application, like PDF viewers, BMP viewer, MS office viewers, etc.? Maybe you are suggesting that the application be executed on the server side, and just the rendered image is sent over the channel and displayed on the client. I don't think many of these applications support that kind mode. Almost all of them expect to commanded through a mouse and keyboard. What you'd want them all to support is a command-line option to "print" the document to a file or stream in a standard image format supported by Java.

  • Tomcat, servlet, cacerts, client authentication and Thawte...

    Hello all,
    the steps and code samples below (well known to you) work fine for a VeriSign Personal Digital Id trial and a GlobalSign PersonalSign demo certificate. However:
    1) how can I make Tomcat or JSSE use both my default keystore and the cacerts file?
    The VeriSign class 1 root is in this cacerts file, but still I need to import the very same root into my own keystore to accept the client certificate. Also, importing the GlobalSign root into cacerts does not help me; instead I am required to import it into my default keystore.
    I know I can set the keystore parameter in the Tomcat server.xml -- but that does not feel right... When I import a cert using "keytool -trustcacerts" then I get "Certificate already exists in system-wide CA keystore under alias <verisignclass1ca> Do you still want to add it to your own keystore?" This gives me the feeling that the system knows where to find the cacerts file, but Tomcat somehow does not use it...
    2) anyone used Thawte Personal Freemail with Tomcat?
    Even when I import the Thawte root certificate into my own keystore, a Thawte Personal Freemail cert is never accepted. In Internet Explorer, although having three certificates installed, the popup dialog that prompts me to choose one only shows the VeriSign and GlobalSign things. When using "TOMCAT_OPTS=-Djavax.net.debug=all" I see that Tomcat "proposes" all three roots to the client browser:
      *** CertificateRequest
      Cert Types: DSS, RSA,
      Cert Authorities:
      <CN=GlobalSign Root CA, OU=Root CA,
         O=GlobalSign nv-sa, C=BE>
      <OU=Class 1 Public Primary Certification Authority,
         O="VeriSign, Inc.", C=US>
      <[email protected],
         CN=Thawte Personal Freemail CA,
         OU=Certification Services Division,
         O=Thawte Consulting, L=Cape Town,
         ST=Western Cape, C=ZA>
      *** ServerHelloDoneAll details below.
    Thanks,
    Arjan.
    - JDK 1.4 beta. I also have 1.3 installed; I did not try 1.3 with the JSSE extension available at http://java.sun.com/products/jsse/index-102.html
    - JAVA_HOME and PATH are set allright.
    - Tomcat 3.2.1
    Steps taken:
    VeriSign
    - free trial at http://www.verisign.com/client/enrollment
    - export the VeriSign root certificate from the global CA certificates. The password defaults to changeit
    - import the exported root into the default key store
      cd /jdk1.4/jre/lib/security
      keytool -export -keystore cacerts -alias verisignclass1ca -file myverisignroot.cer
      keytool -import -alias myverisignroot -trustcacerts -file myverisignroot.cerAbove, the -trustcacerts is only added to show you the warning I mentioned above...
    GlobalSign
    - free trial at http://www.globalsign.com/secure_demo.cfm
    - get the root certificate at http://secure.globalsign.net/en/trust
    - import the root certificate into the default keystore
      keytool -import -alias myglobalsignroot -file root.cacert
    Thawte
    - free certificate at http://thawte.com/getinfo/products/personal
    - the Personal Freemail root certificate at http://www.thawte.com/certs/trustmap.html
    - import the Personal Freemail root certificate into the default keystore
      keytool -import -alias mythawteroot -file persfree.crt
    Tomcat
    - uncomment the SSL Connector section in server.xml, except for keystore and keypass (the password is still the default, being changeit)
    - to the very same Connector section, add
      <Parameter name="clientAuth" value="true"/>- create a security certificate, as mentioned in server.xml as well. When using JDK 1.4, one does not need to set the classpath or change java.security. So:
      keytool -genkey -alias tomcat -validity 180 -keyalg RSA- to see debug info:
      set TOMCAT_OPTS=-Djavax.net.debug=all- make sure the VeriSign etc. roots are imported
    - restart Tomcat
    - connect to the servlet at port 8443, using https. You will see security warnings because your browser does not know the Tomcat certificate.
    Servlet
    Finally the code, as you may know it:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    // For Tomcat: javax.security, not java.security
    import javax.security.cert.X509Certificate;
    import javax.security.cert.Certificate;
    import java.security.Principal;
    // JSSE classes
    import javax.net.*;
    import javax.net.ssl.*;
    public class sslTest extends HttpServlet
      private static final String CONTENT_TYPE = "text/html";
      public void init(ServletConfig config) throws ServletException
        super.init(config);
      private void printCert(PrintWriter pw, Object obj)
        if(obj instanceof Certificate)
          pw.println("<>---------------------------------------<>");
          if(obj instanceof X509Certificate)
            X509Certificate cert = (X509Certificate)obj;
            Principal principal = cert.getIssuerDN();
            pw.println("  Principal Name : " + principal.getName());
            pw.println("  Version        : " + cert.getVersion());
            pw.println("  Serial Number  : " + cert.getSerialNumber());
            pw.println("  Issue DN       : " + cert.getIssuerDN());
            pw.println("  Subject DN     : " + cert.getSubjectDN());
            pw.println("  Not Before     : " + cert.getNotBefore());
            pw.println("  Not After      : " + cert.getNotAfter());
            pw.println("<>---------------------------------------<>");
            pw.println(cert.toString());
          else
            Certificate cert = (Certificate)obj;
            pw.println(cert.toString());
      private void printCertificateDetails(String attributeName,
        HttpServletRequest req, PrintWriter pw)
        Object obj=req.getAttribute(attributeName);
        if(obj instanceof Certificate[])
          if(obj instanceof X509Certificate[])
            pw.println("<h1>Client X509Certificate Chain</h1>");
          else
            pw.println("<h1>Client Certificate Chain</h1>");
          Certificate[] array = (Certificate[])obj;
          for (int x=0; x < array.length; x++)
            printCert(pw, array[x]);
        else if(obj instanceof Certificate)
          if(obj instanceof X509Certificate)
            pw.println("<h1>Client X509Certificate</h1>");
          else
            pw.println("<h1>Client Certificate</h1>");
          printCert(pw, obj);
        else
          if (obj != null)
            pw.println("Client Certificate Attribute "
              + attributeName
              + ", type \""
              + obj.getClass().getName()
              + "\":\n" + obj);
          else
            pw.println (attributeName + " attribute not set");
      /**Process the HTTP Get request*/
      public void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException
        PrintWriter pw = resp.getWriter();
        pw.println("<html><head><title>SSL Details</title></head><body><pre>");
        if (req.isSecure())
          pw.println("Got a secure connection.");
        else
          pw.println("This connection is not secure.");
        pw.println("IP address: " + req.getRemoteAddr());
        pw.println("User: " + req.getRemoteUser());
        pw.println("Subject: " + req.getHeader("CERT_SUBJECT")); // null for Tomcat
        pw.println("Issuer: " + req.getHeader("CERT_ISSUER"));   // null for Tomcat
        pw.println("\nAvailable attributes:");
        Enumeration attributeNames = req.getAttributeNames();
        while(attributeNames.hasMoreElements())
          pw.println("  " + attributeNames.nextElement().toString());
        pw.println("\n");
        Object obj;
        obj = req.getAttribute("javax.net.ssl.cipher_suite");
        if(obj instanceof String)
          pw.println("Cipher Suite: " + obj);
        else
          if(obj instanceof String[])
            pw.print("Cipher Suite: { ");
            String[] otherArray= (String[])obj;
            for (int x=0; x<otherArray.length; x++)
              pw.print(otherArray[x].toString() + " ");
            pw.println("}");
          else
            if (obj != null)
              pw.println("SSL Session Attribute javax.net.ssl.cipher_suite, type \""
                + obj.getClass().getName() + "\":\n" + obj.toString() );
            else
              pw.println ("javax.net.ssl.cipher_suite attribute not set");
        obj = req.getAttribute("javax.net.ssl.session");
        if(obj instanceof SSLSession)
          pw.println("SSL session:");
          SSLSession session = (SSLSession)obj;
          pw.println("Cipher Suite: " + session.getCipherSuite());
          pw.println("Peer Host: " + session.getPeerHost());
          pw.println("ID: " + new String(session.getId()));
        else
          if (obj != null)
            pw.println("SSL Session Attribute javax.net.ssl.session, type \""
              + obj.getClass().getName() + "\":\n" + obj);
          else
            pw.println ("javax.net.ssl.session attribute not set");
        // JSSE recommends �javax.net.ssl.peer_certificates� as the attribute name.
        // However, some web servers do not support these generic names. Like the
        // "javax.net.ssl.peer_certificates" is said to work for WebSphere 3.5 but
        // not for Tomcat 3.2.1.
        // "The javax.security.cert.X509Certificate class is similar to the newer
        // java.security.cert.X509Certificate. New applications should use the newer
        // java.security version". However, Tomcat does not support that:
        printCertificateDetails("javax.net.ssl.peer_certificates", req, pw);
        printCertificateDetails("javax.servlet.request.X509Certificate", req, pw);
        printCertificateDetails("tomcat.request.X509CertificateChain", req, pw);
        pw.println("</pre></body></html>");
      /**Clean up resources*/
      public void destroy()
    }

    Heya,
    Well, this is a pretty complete description of the problem, unfortunately I am not able to comment on the Tomcat side of things, but this makes for interesting reading nonetheless.
    One thing I must mention is that the Thawte Personal certs are indeed chained, and the Personal Freemail cert is the intermediate root CA which is in turn signed by the Personal Basic root (the link I have posted to you in your trouble ticket with us.)
    What may be happening is that the Personal Freemail cert is not completing the chain back to the Personal Basic root, and any cert signed with this may not be displayed as the Issuer is in doubt.
    If your Personal Cert has been issued within the last few months it has ben signed by the Personal Freemail 08.03.2000, and many versions of browsers have not got this particular root installed, could you verify that pls? I can send this particular root to you if you would like to test this theory out.
    There should bo no problems with using a Thawte certificate with your particular software, so we should hopefulyy be able to figure somehting out.
    Regards,

  • How to configure eclipse to debug while running tomcat

    Hi
    I using Eclipse 3.1, jdk 1.5 and tomcat 5.5 in my project
    how shall i configure eclipse, so that i can debug while tomcat is running in eclipse.
    it is not remote debugging, i want to debug it my PC.
    when i click Run->Dedug, i get a options window
    I will create new java application
    Now, What shall i specify for:
    Main class: (is it org.apache.catalina.startup.Bootstrap, but it is not working)
    Program arguments:
    VM Arguments:
    Regards
    Syed

    Have you installed the Tomcat plugin for Eclipse? http://www.sysdeo.com/eclipse/tomcatplugin
    If so, you need to create a new Tomcat project using the wizard:
    File->New->Project... then choose Java->Tomcat Project
    In the wizard, choose a project name, then uncheck the 'use default' checkbox in project contents and browse to your webapp's directory (within Tomcat/webapps). Then finish the wizard.
    Start Tomcat from within Eclipse - you can then add breakpoints etc to debug
    Regards,
    Martin

Maybe you are looking for

  • Error while transfering the data from local to master repository

    Hi , Iam Working on SAP Learning Solution Implementation,we are using LSOAE200 as a Authoring Tool. When i am  Transfering the Learning Net from the authoring tool to the master repository which is in portal, I am facing the following error: <b>Type=

  • 50% Packet Loss on VoIP/Video calls

    HI, When making VoIP or video calls I'm getting up to 50% packet loss. I'm struggling to find out what is causing the problem. When I make a video call I have, at the same time, run speedtest.net and it is still providing adequate bandwidth so I know

  • Webview 7 Questions

    We run two separate Webview reporting servers and on one of the servers Jaquar constantly needs resetting and sometimes causes the necessity of a reboot of the server.   We have been told that too many users are accessing the server at one time.  My

  • Java editor for Linux

    Which is the best java editor for Linux ?? in the Win plataform I'm using the JCreator ... and now I'm migrating to the linux plataform... please tell me the name of the editor you are using if you use Linux... (Red Hat 7.1 here...)

  • My PS CS6 is not responding

    My PS CS6 is not responding upon opening on my mac and I have to force quit every time. I have the creative cloud and I have plenty of memory left so I'm unsure what's happening - it was working perfectly fine this morning