Using Eclipse with Tomcat

I'm trying to get eclipse to work correctly with tomcat server. but when i create a project it creates it in my workspace folder and i can't run it on the server.
I assume it has to create the project in the tomcat root directory in order for it to run properly but i don't know how to get eclipse to do this.
Any help would be appreciated.

What I use to do is
File -> Export -> War File and it generates a war file. You set that war file in the webapps directory of tomcat and it self extracts the files in order to be used from the navigator

Similar Messages

  • Adv. of using apache with tomcat??

    can anyone pl tell me the advantages of using Apache with Tomcat in comarison to other web servers?
    Thanks

    The biggest advantages are that they are open source, so you don't have to pay a huge licence fee, and they are very stable. I don't know how they compare for speed - I know Apache is lightning when it comes to serving flat pages, there are no benchmarks yet for the new Tomcat because it was only released last monday. You can run them on linux or another unix variant, so they are more likely to be secure (windows servers are horrendously open to attack) and stable.

  • How can i intergarate eclipse with tomcat using windows 2000?

    i'm using Eclipse 3.0 with sdk 1.4, i downloaded Tomcat and configured it for plugin to Eclipse. But yet i can't start the Tomcat server.
    if any one can help me please of how to configure tomcat or the proper installation in windows 2000.

    Well whebn i start the server this is the what happens:
    H:\>%CATALINA_HOME%\bin\startup
    Using CATALINA_BASE: H:\Eclipse\eclipse\tomcat\jakarta-tomcat-4.1.31\
    Using CATALINA_HOME: H:\Eclipse\eclipse\tomcat\jakarta-tomcat-4.1.31\
    Using CATALINA_TMPDIR: H:\Eclipse\eclipse\tomcat\jakarta-tomcat-4.1.31\\temp
    Using JAVA_HOME: C:\j2sdk1.4.2_10
    H:\>
    =================================
    i don't see any error during the start up,but i soon as i shut it down this is what happens:
    H:\>%CATALINA_HOME%\bin\shutdown
    Using CATALINA_BASE: H:\Eclipse\eclipse\tomcat\jakarta-tomcat-4.1.31\
    Using CATALINA_HOME: H:\Eclipse\eclipse\tomcat\jakarta-tomcat-4.1.31\
    Using CATALINA_TMPDIR: H:\Eclipse\eclipse\tomcat\jakarta-tomcat-4.1.31\\temp
    Using JAVA_HOME: C:\j2sdk1.4.2_10
    Exception during startup processing
    java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
    at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClas
    sLoader.java:945)
    at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClas
    sLoader.java:810)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:129)
    H:\>

  • Does anyone here use Eclipse with OSX

    I have recently graduated from a simple text editor and command line to trying to use an IDE, mostly because I'm using WSAD at work and want a similar environment at home. I've installed Eclipse 3.0, Tomcat 5.0.27 and the sysdeo tomcat plugin all on an imac running OSX Panther. I'm able to start and stop Tomcat from within Eclipse with the help of the plug-in, but I can't get Eclipse to open a JSP. I know Eclipse doesn't support JSPs but I thought the plug-in would help with that. I set my JRE to a JDK (I think), but with the way java is built into OSX and the naming scheme being used it's difficult to determine rather it really is pointing to a JDK. Has anyone else managed to get Eclipse to open JSPs and if so can you give me any words of enlightenment? Or am I better off just using XCode and starting and stopping tomcat from the terminal?
    Thanks for any help that might be given.

    I'm sorry I did mean "edit" a JSP. My xcode and terminal comment was meant to say editing with xcode and then starting and stopping tomcat with the terminal. I fully understand that I'll be viewing the results from a browser.
    I tried installing Lomboz last night but it didn't seem to help or really have any affect on Eclipse, I still couldn't edit a JSP. I'll work on it some more tonight.
    Not sure what the EMF plugin is, though I do understand the "Unbelievable" reference (so at least I have that going for me).
    If you can offer any more insight into things now that I've cleared up the "edit vs open" thing please pass then along. I'm just trying to set up a learning environment where I can use JSPs, struts, tiles, EJBs and servlets. It's simple here at work using WSAD but I'm trying to learn more and getting hung up on just getting my testing environment going.
    thanks the responses.

  • How to use JMS with tomcat and Axis

    Hello
    I'm new in ii, so i'm still a little bit lost. I have been implementing web services with tomcat and Axis. However, these services are synchronous and I would like that some services were asynchronous.
    I've been reading about the topic and I've found that JMS is a good solution for it. I have already downloaded JMS in my computer but now I don't know what else to do. I've been trying to run the SimpleQueueSender.java example but I get the error:
    JNDI API lookup failed: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    But I have attached all .jar from F:\Sun\MessageQueue\lib
    In addition to this, for my first webservices I used the Java2WSDL, WSDL2Java and AdminClient (axis tool) to create my web services bindings, stubs and skeletons and to deploy the web service on the server. Do I have to use them now with JMS? or now the deployment must be performed in a different way?
    Thank you in advanced,

    The error means that you have to specify the type and location of your jndi store. You could create a jndi.properties file and put two properties in it:
    java.naming.provider.url=file\\\:////var/jndi
    java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
    for a file based jndi store. Then you have to make sure your jndi.properties file is in your CLASSPATH. Then you have to use something like imqadmin to create your jndi store and store in it your administrative objects like Queues and QueueConnectionFactories.

  • Problem when using Logger with Tomcat and eclipse

    Hi, Iam using Tomcat 5.5.7 and my IDE is eclipse.Iam using java.util.logging.Logger class for logging.Iam putting the properties file in Appname/WEB-INF directory.The properties file is not identified.The error Iam getting is Error initialising log file java.lang.NullPointerException and java.io.FileNot FoundException
    The content of my logging.properties file is
    java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=SEVERE java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
    java.util.logging.FileHandler.level=ALL java.util.logging.FileHandler.pattern=%h/javalogs%u.log java.util.logging.FileHandler.append=true java.util.logging.FileHandler.count=1
    My servlet is
    import java.io.*;
    import java.util.logging.*;
    import java.util.logging.Logger;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorldServlet extends HttpServlet
          public void init(ServletConfig config) throws ServletException
               try
                         String file=getServletConfig().getInitParameter("java.util.logging.config.file");
                        InputStream is = getServletContext().getResourceAsStream(file);
                        LogManager.getLogManager().reset();
                          LogManager.getLogManager().readConfiguration(is);
               catch(Exception e)
                    System.out.println("Error initialising log file"+e);
          public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException 
                   final Logger fLogger =
                 Logger.getLogger(HelloWorldServlet.class.getName());
                 PrintWriter  out; 
                 String title = "Simple Servlet Output";
                // set content type and other response header fields first                                   
                // then write the data of the response
                 response.setContentType("text/html");
                 fLogger.finest("this is finest");
                 fLogger.finer("this is finer");
                 fLogger.fine("this is fine");
                 fLogger.config("this is config");
                 fLogger.info("this is info");
                 fLogger.warning("this is a warning");
                 fLogger.severe("this is severe");
                 out = response.getWriter();
                out.println("<P>This is output from SimpleServlet!!!!!!!!.");  
    }My web.xml file is
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <servlet>
        <init-param>
         <param-name>java.util.logging.config.file</param-name>
         <param-value>/WEB-INF/classes/logging1.properties</param-value>
        </init-param>
        <servlet-name>HelloServlet</servlet-name>
        <servlet-class>HelloWorldServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>HelloServlet</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
    </web-app>Can anybody help me out.

    Hi, Iam using Tomcat 5.5.7 and my IDE is eclipse.Iam using java.util.logging.Logger class for logging.Iam putting the properties file in Appname/WEB-INF directory.The properties file is not identified.The error Iam getting is Error initialising log file java.lang.NullPointerException and java.io.FileNot FoundException
    The content of my logging.properties file is
    java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=SEVERE java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
    java.util.logging.FileHandler.level=ALL java.util.logging.FileHandler.pattern=%h/javalogs%u.log java.util.logging.FileHandler.append=true java.util.logging.FileHandler.count=1
    My servlet is
    import java.io.*;
    import java.util.logging.*;
    import java.util.logging.Logger;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorldServlet extends HttpServlet
          public void init(ServletConfig config) throws ServletException
               try
                         String file=getServletConfig().getInitParameter("java.util.logging.config.file");
                        InputStream is = getServletContext().getResourceAsStream(file);
                        LogManager.getLogManager().reset();
                          LogManager.getLogManager().readConfiguration(is);
               catch(Exception e)
                    System.out.println("Error initialising log file"+e);
          public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException 
                   final Logger fLogger =
                 Logger.getLogger(HelloWorldServlet.class.getName());
                 PrintWriter  out; 
                 String title = "Simple Servlet Output";
                // set content type and other response header fields first                                   
                // then write the data of the response
                 response.setContentType("text/html");
                 fLogger.finest("this is finest");
                 fLogger.finer("this is finer");
                 fLogger.fine("this is fine");
                 fLogger.config("this is config");
                 fLogger.info("this is info");
                 fLogger.warning("this is a warning");
                 fLogger.severe("this is severe");
                 out = response.getWriter();
                out.println("<P>This is output from SimpleServlet!!!!!!!!.");  
    }My web.xml file is
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <servlet>
        <init-param>
         <param-name>java.util.logging.config.file</param-name>
         <param-value>/WEB-INF/classes/logging1.properties</param-value>
        </init-param>
        <servlet-name>HelloServlet</servlet-name>
        <servlet-class>HelloWorldServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>HelloServlet</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
    </web-app>Can anybody help me out.

  • Eclipse with Tomcat 6 Problem

    Hello,
    When I try to start Tomcat 6 in Eclipse, I get the following error message:
    Publishing failed
    Could not load the Tomcat server configuration at \Servers\Tomcat v6.0 Server at localhost-config. The configuration may be corrupt or incomplete.
    Resource is out of sync with the file system: '/Servers/Tomcat v6.0 Server at localhost-config/web.xml'.
    In the beginning I thought the problem might be caused by me inserting a few changes to the web.xml global file and maybe corrupting it in the process. However, I restored the original file and the problem still persists. I have no problem starting Tomcat using the standard start-up script, which indicates web.xml is actually valid, it fails just when starting from Eclipse.
    Does anyone have an idea what the problem is?
    Thanks.

    Bug 228039 from Eclipse MIGHT help, but I'm not sure.
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=228039
    It says to manually refresh the file in Eclipse explorer.
    Bug 107386 from Eclipse MIGHT also help.
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=107386
    No workaround yet.

  • Eclipse with Tomcat

    I am trying to get eclipse set for making my web app. i installed the mod i needed and followed instructions on a tutorial. Everything went fine untill i tried to view a page and i got 404 error. In eclipse it says the server is running but i when i try to access it with my browser or within eclipse browser it gives me the 404.
    I know it is blocking the port ( i couldnt start tomcat manually while it is running in eclipse) which would suggest it is running. Anyone got any experience with this problem?

    Jahvah wrote:
    Ah i get it now. No wonder i was really tired when i was setting all this up. The problem was i had no index page for when i launched the application. And i was thinking the resources in my tomcat folder would still work.Glad you got it to work.
    So eclipse changes the web application root folder of tomcat? how does it do this?Eclipse is written in Java and it is open source. Take a look yourself.
    is there a command switch when running tomcat to set this or something?I don´t understand what you need.

  • Use JSTL with Tomcat 4.1.x

    Hi,
    I've had a look at various tutorials and documentation and must be missing something obvious.
    I haven't been using them before so what do I need to add to Tomcat to make it work.
    So far I've put a JSP file in with this:
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <c:redirect url="welcome.html"/>
    When I run it I get this error:
    org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application
    I expect I have to put a JAR or a TLD file somewhere. If so, could someone tell me what and where.
    Thanks

    Download the source from the link that you got the jar from. The tld's are in there. What I do is put the tld's in a tld folder in WEB-INF. Then I change the web.xml file to reflect this.
    <taglib>
        <taglib-uri>/tags/core</taglib-uri>
        <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
    </taglib>Then I change the uri to point to the tld's on my server instead of sun's server in my jsp, like this:
    <%@ taglib uri="/tags/core" prefix="c" %>it points to the uri in my web xml

  • ClassCastException using HttpsURLConnection with Tomcat 4.1.27

    Hi,
    I try to open an SSL connection using HttpsURLConnection that works fine with a standalone application (see code fragment):
    import javax.net.ssl.HttpsURLConnection;
    import java.net.*;
    import java.io.*;
    URL website = new URL( "https://aSampleSSLSite" );
    HttpsURLConnection connection = ( HttpsURLConnection ) website.openConnection();
    Using the same code in Tomcat 4.1.27 and Struts 1.1 throws a java.lang.ClassCastException while trying to use website.openConnection().
    What is the difference?

    Hi,
    I'm using JDK 1.4.2 and haven't installed JSSE separately at all. Actually I really use javax.net.ssl.HttpsURLConnection. However, I tried com.sun.net.ssl.HttpsURLConnection as well and got a 'java.net.SocketException: Default SSL context init failed' instead of.
    Oddly enough the code works fine in a standalone application.

  • Using ADF with Tomcat - A total beginner, lost

    Hi all,
    I am a complete beginner in Java using jDevaloper and java for web. I have being a desktop programmer. So I followed the jdeveloper tutorial Developing Rich Web Applications With Oracle ADF up to here . The small deference in my project is that it uses a mySQL database. When I tried to Run the project the Java SE crashed and the weblogic domain was not built. I tried many methods mentioned in the web but the Java keeps on crashing. I tried using both bundled JDK and JDK avilable in my machine but the crash continuous. So I decided to use tomcat.
    So I have came up to creating the .war file. But when I started the tomcat I got this error;
    SEVERE: Error configuring application listener of class oracle.adf.mbean.share.config.ADFConfigLifeCycleCallBack
    I have gone out of choices. How should I correct this.
    Thanks [Dana Singleterry|https://blogs.oracle.com/dana/entry/how_to_deploy_a_11g_adf_applic_1] , [Terry Cho|http://javamaster.wordpress.com/category/java-programming/] and many others for their knowledge sharing.

    hi manjulapra
    manjulapra wrote:
    ... So I decided to use tomcat. ...The "Application Servers " section of the "Certification and Support Matrix " for "Oracle JDeveloper and Application Development Framework 11g Release 2 "
    at http://www.oracle.com/technetwork/developer-tools/jdev/jdev11gr2-cert-405181.html#Application_Servers
    currently has for "Tomcat 6 " and "ADF " the value "Not Supported ".
    regards
    Jan Vervecken

  • Problem exporting JAR using Eclipse with JNIlib

    Hi all,
    I have a java application that is using an external JAR. The external JAR is coupling with a JNIlib.
    When I 'export' my application to a runnable JAR in Eclipse, the external JAR is extracted and included in my runnable JAR. However, when I execute the runnable JAR, some functions of the application is not working due to missing library. After I put JNIlib into my Java/Extension, the runnable JAR then works fine.
    I want to distribute the JAR to other people, but I can't ask them all to put JNIlib in their Java/Extension.
    Does anyone have an idea? I am a novice to Java, it took me awhile to figure out how to create a runnable JAR.
    Thank you very much.
    Eagle.

    first , it says unable to access jar file .
    upon deeper inspection i found that background processes is created behind thus the jar file been activated but the UI doesnt show up? any more idea of where my codes gone wrong? which seems perfect for me
    anyway thanks but i still .. it says unable to access jar file

  • Using JavaMail with Tomcat and JNDI

    I have a web application and I want to make use of JNDI Mail Sessions for sending email in my Web Appln.
    I am using Tomcat4.0.1
    In my server.xml file I declared a resource as follows:
    <Resource name="mail/Session" auth="Container" type="javax.mail.Session"/>
    <ResourceParams name="mail/Session">
         <parameter>
         <name>mail.smtp.host</name>
         <value>mail.abc.com</value>
         </parameter>
    </ResourceParams>
    Now Inside my jsp/servlet code i can use something like this:=
    // Acquire our JavaMail session object
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    Session session = (Session) envCtx.lookup("mail/Session");
    // Prepare our mail message
    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    InternetAddress dests[] = new InternetAddress[]
    { new InternetAddress(to) };
    message.setRecipients(Message.RecipientType.TO, dests);
    message.setSubject(subject);
    message.setContent(content, "text/plain");
    // Send our mail message
    Transport.send(message);
    But my smtp mail provider uses Authentication.
    So I am looking of some way wherein I can provide the user and password information in the server.xml file itself along with smtp provider.
    My Query is How to do this as i dont see any references for using JavaMail sessions using Authentication
    Any Help highly appreciated
    Thanks
    Raj

    Isnt there anyone who can answer this question or its not a question worthwile
    Awaiting reply
    ...

  • Problem launching a jsp page with eclipse and tomcat

    Hi,
    I have just started using eclipse and tomcat for creating dynamic web pages. I tried to launch a jsp page after starting the tomcat server with the URL: http://locahost:8080/HelloWorld/, an error page was displayed as below:
    HTTP Status 404 -/
    type Status report
    message /_
    description The requested resource (-) is not available
    Apache Tomcat/5.5.17
    I didn't get any error at the console and when i just typed http://localhost, a pop up menu saying that the connection was refused when attempting to contact localhost.
    I'm not sure what is the problem here. Could it be the permssion to the localhost is not granted by the system as the eclipse IDE is running using linux?
    Hope someone can help.
    Thanks.

    http://www-128.ibm.com/developerworks/library/os-ectom/

  • Help on creating a ServerSession in Eclipse with XML file

    Hi,
    I am using Toplink in Eclipse with Tomcat/Apache (or at least trying to :)
    I am trying to make the following code work:
    Project myProject = XMLProjectReader.read("myproject.xml");
    Server serverSession = myProject.createServerSession();
    but I get an exception:
    {color:#ff0000} +"7099", "The deployment project xml resource {0} was not found on the resource path. Check that the resource name/path and classloader passed to the XMLProjectReader are correct. The project xml should be included in the root of the application's deployed jar, if the project xml is deployed in a sub-directory in the application's jar ensure that the correct resource path using \"/\" not \"\\" is used."+ {color}
    - I think the project cannot find the xml file in my project - but I was never sure where this should go in any case - I put it in the META-INF folder but made no difference. Where should I put these xml files?
    Any help much appreciated

    Simon,
    Hi, I assume you are deploying a WAR to Tomcat. The following tutorial on running TopLink using the org.eclipse.persistence.jpa.PersistenceProvider is pure JPA but deals with the same deployment issues.
    In particular note that there are two META-INF directories - we want to use only the one off of src.
    "Make sure that your persistence.xml (and optionaly orm.xml) file is placed off of the src/META-INF directory and not the default WebContent/META-INF dir so that it gets picked up by the servlet classloader from the classes directory."
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/Tomcat_Web_Tutorial#persistence.xml
    thank you
    /michael
    http://www.eclipselink.org

Maybe you are looking for