Eclipse JSP .war package

Hi,
I have developed a JSP app, which uses a couple of external jars. While developing this app, I simply copied the external jars into the shared/lib directory of Tomcat.
Now I want to package and distribute this app as a .war file, as Eclipse has an easy utility for creating the .war file.
Is there an way of including the external jar files with my .war package, or do i have to tell each user to copy the external jars into the shared/lib directory of Tomcat???
Thanks in advance,
Aidan

U need MyEclipse plugin for eclipse for J2EE projects which is available at
http://www.myeclipseide.com/
You can create a war file aswell using ANT build scripts...I dont have that at the moment

Similar Messages

  • Replacing class file instead of redeploying whole WAR package

    Hi,
    This may sound very silly question, but I thought to post it just as to confirm.
    I have an application deployed in websphere ver 5. Usually when there are any changes to any class files, we rebuild the entire package, and then redeploy it using the admin console.
    Now, this time I've got only a couple of classes modified...my question is that can I just replace the modified classes directly instead of rebuilding the entire package and redeploying it?
    I'd assume that this is different from hot deployment, as I am prepared to start the server again if needed be. Please advise folks.
    Thanks

    The problem is that this particular class (servlet) can run only in production environment...there is no test environment to run it..but thanks...I did see IBM's take on this.
    http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/trun_app_hotupgrade_war.html
    I think it does answer the question, I can replace the .class file directly in the expanded version of the war package, and then restart the application. It should be picked up automatically.
    Thanks for your response.

  • Jdeveloper 9.0.3 support for a standard WAR / package issues

    We are being pitched on how wonderful the JDeveloper IDE is and how our days will be enlightened by it (the same folks that sold our company on o-apps 11i)... so I've been tryin' it out only to hit a MAJOR roadblock.
    Basically, we need CVS development across IDE's... which shouldn't be a problem if the non-proprietary stuff all works as planned. I've used forte' in the past with success.
    I am new to the JDeveloper environment. I have used Forte' before and the Sun J2EE dev. kit for deploying WARs and EAR's.. Using the tutorials provided by Sun, I found NO easy way to develop against the directory structure provided. I would also like to have ant build scripts exist in my project.. and the ability to define a source directory '/WEB-INF/src' which is my source package root, that builds to /WEB-INF/classes. NONE of this seems to be part of the 'web tier' in JDev. I've scoured the help even for the keyword 'package', and it has proven useless. And how do I specify package/folder structure in the workspace? It seems that JDev is so catered to Oracle and uneducated users that the 'more advanced' features.. (such as Java PACKAGE management.. (been there for awhile now :-} )) should be an essential feature. Help somebody!!!!
    PS... my ideal experience is:
    Me: Hi, Jdeveloper.. i want a project that will contain some WAR and/or ear development.
    JDev: Okay, where would you like the dev. root to go?
    Me: How about here, where I've already got something started (written per J2EE spec)
    JDev: Okay... hmm .looks like a WEB-INF folder exists with a web.xml IN it... do you want me to recognize it as a web app?
    me: sure
    Jdev: I see stuff in classes... shall i maintain them as servlets?... Oh by the way,,, i see your folders and package structure.
    you get the idea.
    what happened to WEB-INF?... any WAR packaging?.. not oo impressed yet.

    Yes, I examined the attribute settings and manually adjusted them in the entities and views. They are now updateable. Using Jdeveloper with SAPDB would be very tedious. Jdeveloper did not recognize foreign key constrains, primary keys, nor that attributes were updateable.
    Is there a way to include SAPDB in the testing? It is trivial to install and run and would make Jdeveloper a more robust tool. I do not like Jbuilder's approach to master-detail client screens and would recommend using Jdeveloper for this type of work if it could handle more databases like SapDb.

  • Unable to compile class for JSP.       package not found

    Hello folks,
    I was trying to build a simple web application using Eclipse IDE, tomcat 5.x server and ant to build and deploy the application.
    I referenced the following tutorial:
    http://www.onjava.com/pub/a/onjava/2003/01/08/tomcat4.html
    I was able to create a war file, deploy it in tomcat. When i invoke a simple jsp it works fine. However if I try to import any source pkg into jsp it throws error. Below is stack trace.
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    C:\tomcat\work\Catalina\localhost\aweb\org\apache\jsp\web\Home_jsp.java:6:
    package com.ak.test does not exist
    import com.ak.test.*;
    ^
    1 error
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
         org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
         org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:994)
         org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:343)
         org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:553)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:211)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
         org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Any clue what is the issue?

    Additional Info:
    Location of files
    ==================
    My jsp file is located at:
    C:\eclipse\workspace\aweb\web\Home.jsp
    my class is located in:
    C:\eclipse\workspace\aweb\WEB-INF\classes\com\ak\test
    Webapplication Dir Structure:C:\eclipse\workspace:
    aweb(webapplication name)
    +web
    -----+Home.jsp
    +src
    ------+com.ak.test.MyJava.java
    +WEB-INF
    ------+Classes
    --------+com.ak.test.MyJava.class
    ------+lib
    ----------struts.jar
    ------+web.xml
    ------+struts-config.xml
    -aweb.war(build.xml creates war file as per WAR format)
    Ant task which installs the webapplication in Tomcat:
    <target name="install" description="Installs the Web Application" depends="package">
    <echo message="Installing ${app.name} ..."/>
    <install url="${manager.url}" username="${username}" password="${password}" path="/${app.name}"
    config="file:${basedir}/war/META-INF/context.xml" war="file:${basedir}/${app.name}.war"/>
    </target>
    build.properties file
    app.name=aweb
    manager.url=http://localhost:8080/manager
    tomcat.home=C:/tomcat
    username=user
    password=user
    Contents of the jsp file
    =======================
    <%@ page import="com.ak.test.MyJava" %>
    <html>
    <head>
    <title>Home Page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    </body>
    </html>

  • Jsp import package error after upgrading to jdk1.4.2_08 and tomcat 5.0

    I am trying to upgrade the jdk and tomcat from 1.3/3.3 to 1.4/5.0.
    My jsp imports worked fine prior to the upgrade, but now I get the following:
    Jun 6, 2005 10:01:17 AM org.apache.jasper.compiler.Compiler generateClass
    SEVERE: Error compiling file: /C:/Tomcat/work/Catalina/localhost/Print//org/apac
    he/jsp\BillingPrompt_jsp.java [javac] Compiling 1 source file
    C:\Tomcat\work\Catalina\localhost\Print\org\apache\jsp\BillingPrompt_jsp.java:11
    : package com.adware.print.database.inquire does not exist
    import com.adware.print.database.inquire.*;
    ^
    1 error
    A fatal error has occured for user: Unable to compile class for JSP
    Generated servlet error:
    C:\Tomcat\work\Catalina\localhost\Print\org\apache\jsp\BillingPrompt_jsp.java:11
    : package com.adware.print.database.inquire does not exist
    import com.adware.print.database.inquire.*;
    The package in the import statement "import com.adware.print.database.inquire.*" actually has no classes in it. The classes are contained in "import com.adware.print.database.inquire.controller.*". If I change the import statement everything works. The problem is that I have 100s of jsps. If there is a work-around outside of changing the import statements, that would be best.
    Can anyone help? Thanks.

    do you know what url is being looked up? the message is complaining that the url is starting with the string "an]", which seems pretty bogus.

  • JSP & User Package

    Hi guys, I've a problem using a package built by me in a jsp file...
    I've copied the jar file pack.jar in the WEB-INF\lib dir, and when I try to import the file with <%@ page import="pack.db.*" %> it don't give to me any error, but if I write: ServerMySql server = new ServerMySql(url, db_name, user, pass); t give to me this error:
    An error occurred at line: 3 in the jsp file: /login.jsp
    Generated servlet error:
    ServerMySql cannot be resolved (or is not a valid type) for the field login_jsp.server
    An error occurred at line: 3 in the jsp file: /login.jsp
    Generated servlet error:
    ServerMySql cannot be resolved or is not a typeWhat can I do?

    You have a class pack.db.ServerMySql (exact spelling)
    It is bundled in your file pack.jar, in an appropriate folder within the zip file?
    ie if you expand the zip file it produces the structure pack/db/ServerMySql.classYes
    Also do you have the MySQL driver in the web-inf/lib directory?I don't think that it could make my application not to work, but I've done it too
    You did restart your app server after deploying the jar file into the lib directory?Yes, I've tryed to restart my computer too...

  • JSP .war file deployment in LAN/Internet

    I have done one project in JSP and wants to deploy it in Tomcat 5.5 server
    and make it able to run on the internet like www.yourdomain.com.
    I heared that by making .war file we can deploy the JSP project. I made it as .war file in my prjoect.
    How do I configure it to access www.yourdomain.com ?
    Incase in LAN/Intranet I have server how do I configure there?
    Please guide me on this
    Thanking you in anticipation

    Is this what you are looking for?
    http://www.aprelium.com/abyssws/articles/access-test.html

  • Jboss ide jboss eclipse jsp compile problem

    Hi i downlaoded eclipse with jboss ide plugin for jsp support.
    now configuration is jboos server + eclipse + jboss ide but i am not able to cmpile jsp pages.even though jboss server is running on eclipse no problem in that.
    thanxs in advance

    Do I have to use JBoss with Tomcat or am I missing
    something at configuration?You're missing something. I'll bet the problem's in your JSP file, not JBoss/Jetty - unless you've dorked with the default settings and done something to make it not work. And you don't need the j2ee12.jar in your CLASSPATH - it's already there, otherwise JBoss/Jetty wouldn't run.

  • Looking for Eclipse/JSP tutorial

    Anyone know of any good web tutorial on JSP/Servlets using Eclipse? This will save me from asking a ton of simple questions. In my initial google search I did not find anything all that good.
    TIA!

    njb7ty wrote:
    Install java jdk, install tomcat, search for 'Eclipse Europa', download and configure it to use the jdk and tomcat per its instructions (its on the same web site somewhere).
    Then create a new tomcat project (its in the Eclipse menu). After reading a book on JSP, get a JSP page to display in a brower by launching tomcat via the eclipse menu. Then get a servlet to work. That's the rough procedure to get you started.Zombie antics aside, why would a JDK be necessary if he's using Eclipse? It only needs a runtime

  • JSP and package deployment problem in Tomcat 5

    Hi,
    I tried very simple exercise that includes JSP and javabean (from package), but I have the following error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error ()
    that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    [javac] C:\jwsdp\work\Catalina\localhost\exercises\org\apache\jsp\ex01\ex01_jsp.java:10:
    package pack01 does not exist
    [javac] import pack01.ex01;
    [javac] ^
    Bellow are all my sources
    1. directory structure
    ========================
    C:\jwsdp\webapps\exercises
    index.html
    C:\jwsdp\webapps\exercises\ex01
    build.bat
    ex01.jsp
    C:\jwsdp\webapps\exercises\ex01\WEB-INF
    web.xml
    C:\jwsdp\webapps\exercises\ex01\WEB-INF\classes
    C:\jwsdp\webapps\exercises\ex01\WEB-INF\classes\pack01
    ex01.class
    ex01.java
    C:\jwsdp\webapps\exercises\ex01\WEB-INF\lib
    pack01.jar
    2. sources
    ==========
    << ex01.jsp >>
    <HTML> <HEAD> <TITLE>Ex01</TITLE> </HEAD>
    <BODY>
    <FORM METHOD="GET" ACTION="ex01.jsp">
    <%@ page import = "pack01.ex01" %>
    <H2>Ex01</H2>
    <jsp:useBean id = "x" class = "ex01" scope="application"/>
    </FORM>
    </BODY> </HTML>
    << ex01.java >>
    package pack01;
    import java.io.*;
    public class ex01 implements Serializable {
    private String value;
    public ex01() {
    value = "EX01";
    public void setValue(String s) {
    value = s;
    public String getValue() {
    return value;
    << build.bat >>
    cd WEB-INF\classes\
    cd
    del ex01.jar
    javac -deprecation -verbose pack01\ex01.java
    jar cvf ..\lib\pack01.jar pack01\ex01.class
    << C:\jwsdp\webapps\exercises.xml >>
    <Context className="org.apache.catalina.core.StandardContext"
         cachingAllowed="true"
         charsetMapperClass="org.apache.catalina.util.CharsetMapper"
         configFile="webapps\exercises.xml"
         cookies="true"
         crossContext="false"
         debug="0"
         displayName="Exercises"
         docBase="C:\jwsdp\webapps\exercises"
         domain="Catalina"
         engineName="Catalina"
         j2EEApplication="none"
         j2EEServer="none"
         lazy="true"
         mapperClass="org.apache.catalina.core.StandardContextMapper"
         path="/exercises"
         privileged="false"
         reloadable="true"
         startupTime="30"
         swallowOutput="true"
         useNaming="true"
         wrapperClass="org.apache.catalina.core.StandardWrapper" >
    </Context>
    What is wrong ?
    I have Windows NT and Tomcat 5 (from jwsdp 1.2).
    Thank you,
    Alex.

    I just tried to reproduce the problem with old version of Tomcat (4.0.2) and ... it works. It is definitely specific for Tomcat 5 (or may be one of the late Tomcat 4 as well). There is another related difference:
    With Tomcat 4 I could create javabean in class subdirectory (default package) and use
    <%@ page import="ex01" %>
    Now with Tomcat 5 I have syntax error in this line.
    This syntax error disappeared when I moved javabean into package pack01.

  • How to set Tomcat's JSP compilation package

    Is it possible to configure what root package name Tomcat uses when creating .java files from JSPs? I've searched Google, this forum, and the Tomcat JSP documentation (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper-howto.html) and cannot find any indication that it is. I found the description of all the JSP compiler servlet options, both in web.xml and on the Jakarta site, but it doesn't list any option for this. I know it's possible with Ant's JSPC task, so it's tempting to think the same can be done with Jasper, but maybe not.

    You're running Jasper by running "jspc.bat" (or "jspc.sh") from Tomcat's bin directory, yes?
    If so, it's
    jspc.bar -p <package> ...
    Usage: jspc <options> [--] <jsp files>
    where jsp files is any number of:
        <file>         A file to be parsed as a jsp page
        -webapp <dir>  A directory containing a web-app, all jsp pages
                       will recursivly be parsed
    where options include:
        -q          Quite mode (same as -v0)
        -v[#]       Verbose mode (optional number is level, default is 2)
        -d <dir>    Output Directory
        -dd <dir>   Literal Output Directory.  (package dirs will not be made)
        -l          Outputs the name of the JSP page upon failure
        -s          Outputs the name of the JSP page upon success
        -p <name>   Name of target package
        -c <name>   Name of target class name
                    (only applies to first JSP page)
        -mapped     Generate separate write() calls for each HTML line in the JSP
        -die[#]     Generate an error return code (#) on fatal errors.
                    If the number is absent or unparsable it defaults to 1.
        -uribase <dir>  The uri directory compilations shoule be relative to
                        (Default is "/")
        -uriroot <dir>  The root directory that uri files should be resolved
                        against, (Default is the directory jspc is invoked from)
        -webinc <file>  Creates partial servlet mapings for the -webapp option
        -webxml <file>  Creates a complete web.xml when using the -webapp option.
        -ieplugin <clsid>  Java Plugin classid for Internet Explorer
        -sax2 <driverclassname>  Driver class name for the SAX 2.0 parser to be used

  • How to set up multiple log4j configurations for multiple WAR packages?

    hi all,
    the EAR that i am trying to deploy has multiple WARs.
    I need to configure separate loggers for each these WARs.
    Could any of experts can help me out.

    Hi
    Depending on your needs, you may find that Set level offers the best approach:
    Within a Set you have the Playbacks (Set Level, so they work for the entire set) with individual patches in the set "live" for the EWI etc as needed.
    You need only map one set of controls for all the Playbacks since only 1 set can run at a time.
    CCT

  • EAR / WAR Packaging

    Dear Expert,
    Do you know whether there is any guildline for packing EAR/WAR according to the J2EE standard?
    For example, whether
    several projects should be packed into the same EAR/WAR in order to reduce the overhead of starting up the applications (ie, one EAR containning several WAR of different projects), or
    each project should be packed in a standalone EAR and WAR (ie, one EAR containing one WAR for a single project), or
    all projects should be packed in the same EAR/WAR (ie, one EAR containing one WAR for multiple projects)
    Many thanks.

    hi,
    Have a look at http://java.sun.com/blueprints/guidelines/designing_enterprise_applications/packaging_deployment/applications/
    -Amol

  • Package not found when importing in JSP

              I'm now using Weblogic 6.0 SP 2 for development. I did a test application, containing
              EJBs, and a JSP. Package the applications to an EAR file. Then I deploy the test
              application using hot-deploy - just drop the EAR into the domain\application folder.
              When I call the JSP page, I get an error saying that the package I'm importing
              is not found. What is wrong?? The test application works on Weblogic 5.1
              My WAR file contains only the JSP and XML descriptor. Do I need to include classes
              inside??? Don't think that is correct.
              Please advise.
              

              It was a bad mistake. Made an error in the application.xml, which refer to an invalid
              JAR file. Made the correction and it works like magic.
              Thanks :)
              "Cameron Purdy" <[email protected]> wrote:
              >WL 60 is tolerant of class location in that you can put all classes in
              >the
              >EJB JAR inside the EAR and it will work as well (sometimes better if
              >there
              >are xrefs) as carefully splitting classes between JAR and WAR.
              >
              >Chances are your context is not set up correctly. What is the web.xml?
              >What
              >is the URL you used? In WL 51 you provided the context in the "register"
              >line in the weblogic.properties. Now that info is self-contained in the
              >app
              >itself.
              >
              >Peace,
              >
              >--
              >Cameron Purdy
              >Tangosol Inc.
              ><< Tangosol Server: How Weblogic applications are customized >>
              ><< Download now from http://www.tangosol.com/registration.jsp >>
              >
              >
              >"Moong" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> I'm now using Weblogic 6.0 SP 2 for development. I did a test application,
              >containing
              >> EJBs, and a JSP. Package the applications to an EAR file. Then I deploy
              >the test
              >> application using hot-deploy - just drop the EAR into the
              >domain\application folder.
              >>
              >> When I call the JSP page, I get an error saying that the package I'm
              >importing
              >> is not found. What is wrong?? The test application works on Weblogic
              >5.1
              >>
              >> My WAR file contains only the JSP and XML descriptor. Do I need to
              >include
              >classes
              >> inside??? Don't think that is correct.
              >>
              >> Please advise.
              >>
              >
              >
              

  • JSP compile for WARs...

    Hi
    If I wanted to precompile my JSPs and package them into a WAR where would I put them???
    Under WEB-INF/generated/jsp???? Will this work regardless of the app server vendor?
    I tried to look through the JSP spec to find some info on this but couldn't find any (or I may have missed it)
    Is precompiling JSPs and packaging them into a WAR considered a good practice?
    Thanks
    Z

    Well my reasoning was that /WEB-INF/classes is packaged.....and when JSPs are compiled they are compiled into a servlet (if I am not mistaken) which is just another Java class....So it should be vendor neutral...
    On Sun's App Server you can choose precompile at deployment time, but I was wondering if there is a more direct approach...
    I don't think precomilation works like that. Imagine
    compiling jsps for tomcat, and trying to run them in
    websphere.
    As far as I know precompilation is done by calling the
    jsp with a request parameter called
    jsp_precompile and a value of true.

Maybe you are looking for