How to deploy a simple class in Tomcat 5

Hi All,
Need your help...
I have just started learning Java and JSP.
I was trying to write a simple Shopping Cart program in JSP. I have created a directory under my root context directory. But while I am invoking the JSP, I am getting a error like this:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 18 in the jsp file: /JspSessionCart/build/carts.jsp
Generated servlet error:
    [javac] Compiling 1 source file
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\mycontext\org\apache\jsp\JspSessionCart\build\carts_jsp.java:64: package sessions does not exist
      sessions.DummyCart cart = null;
              ^
An error occurred at line: 18 in the jsp file: /JspSessionCart/build/carts.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\mycontext\org\apache\jsp\JspSessionCart\build\carts_jsp.java:66: package sessions does not exist
        cart = (sessions.DummyCart) _jspx_page_context.getAttribute("cart", PageContext.SESSION_SCOPE);
                        ^
An error occurred at line: 18 in the jsp file: /JspSessionCart/build/carts.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\mycontext\org\apache\jsp\JspSessionCart\build\carts_jsp.java:68: package sessions does not exist
          cart = new sessions.DummyCart();
                             ^
An error occurred at line: 33 in the jsp file: /JspSessionCart/build/carts.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\mycontext\org\apache\jsp\JspSessionCart\build\carts_jsp.java:92: package util does not exist
out.print(util.HTMLFilter.filter(items));
^
An error occurred at line: 33 in the jsp file: /JspSessionCart/build/carts.jsp
Generated servlet error:
Note: C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\mycontext\org\apache\jsp\JspSessionCart\build\carts_jsp.java uses unchecked or unsafe operations.
An error occurred at line: 33 in the jsp file: /JspSessionCart/build/carts.jsp
Generated servlet error:
Note: Recompile with -Xlint:unchecked for details.
4 errors
     org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
     org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
     org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
I am not able to understand what to do? Do I need to set any CLASSPATH? If yes, kindly tell me what would the path for CLASSPATH.
Kindly help me....
Thanks.,
Ujjal                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Ujjal wrote:
Hi All,
Need your help...
I have just started learning Java and JSP.
I was trying to write a simple Shopping Cart program in JSP. I have created a directory under my root context directory. But while I am invoking the JSP, I am getting a error like this:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 18 in the jsp file: /JspSessionCart/build/carts.jspMaybe you should look at that JSP. It's incorrect, obviously.
Look, here's a hint:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\mycontext\org\apache\jsp\JspSessionCart\build\carts_jsp.java:66: package sessions does not exist
cart = (sessions.DummyCart) jspxpage_context.getAttribute("cart", PageContext.SESSION_SCOPE);Why isn't this a good enough guide?

Similar Messages

  • How to deploy a simple servlet in EP?

    Hi,
    I am new to this portal.
    Is it possible to deploy a simple servlet which extends a HttpServlet?if yes what modification i need to make for the portalapp.xml?
    Thanks
    Deepak

    hi deepak,
       it is possible to deploy servlets in AbstratPortalComponent.
      check this link ..
      http://help.sap.com/saphelp_nw2004s/helpdata/en/0a/fd2c41cf358839e10000000a1550b0/frameset.htm
       you will find example in this thread .
    thanks..
    rajesh

  • How to deploy a simple .jar (containing Helper classes) in Weblogic?

    Hi,
    I have created multiple .jar files.
    1) MDB.jar containing all my MDB classes.
    2) Bean.jar containing all my Session Bean classes.
    3) Utility.jar containing remaining Helper,utility classes.
    I had deployed MDB.jar, Bean.jar by using Weblogic Console, under 'Deployments'-> 'EJB Module'. How can i deploy Utility.jar ? First of all, do i need to deploy Utility.jar? Only EJB JARs need to be deployed?
    If we do not deploy a non-EJB JARs, how this code will be available and is executed?
    Thanks in advance.

    I'd recommend you deploy these 3 components together in an EAR file. THe utility jar file could go in APP-INF/lib, or you could reference it via manifest class-path entries.
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • How to deploy a single class to the web portal?

    EDIT: I've been able to create the deployment file. I found an older copy of NWDS and the old project folders are working perfectly again. I'll cross that bridge with the new version another time.
    Firstly, sorry if this post is in the wrong section ... I looked around and couldn't find a section that I thought fitted.
    A while back my company created a simple login module to similate a single sign on for our network. The module worked perfectly for a few months, then about a months ago it started rejecting logins for no apparent reason. I've asked all involved with the system and everyone claims that they haven't touched anything and that the problem must be within the Java class.
    Due to recent workstation upgrades, I now have the latest version of NetWeaver Development Studio installed (SDN_Preview_SR_5_IDECE71). This new version does not like the old project that was created for this task, and I am struggling to create a new project which will do what I need.
    Can someone point me to up-to-date documentation that explains how I can create a project which contains only a single java class that is to be deployed to a web portal? The class that is created extends the SAP class; com.sap.engine.interfaces.security.auth.AbstractLoginModule.
    Please note that I have already look at some of the online documentation, for example: http://help.sap.com/saphelp_nw70ehp1/helpdata/en/e1/8e51341a06084de10000009b38f83b/frameset.htm
    And that was of no help as it seems the documentation is no longer up-to-date with the current version ... or am I looking at the wrong documentation?
    Another possibility is to install the older NetWeaver Development Studio, the problem here is I do not know where I can download a copy for Windows? I can only find the latest version for Windows online.
    Thanks in advance for any and all assistance,
    Edited by: Markus Schönenberger on Sep 30, 2010 3:07 PM

    Hi Andreas,
    You need to do the following:
    - Upload the text file as a local configuration file in the "Local Content":
    http://wikis.sun.com/display/OC2dot5/Uploading+a+Local+Configuration+File
    - Create an OS Update Profile for the configuration file:
    http://wikis.sun.com/display/OC2dot5/Creating+an+OS+Update+Profile
    - Create a job and select the profile you have created as well as the servers you want to deploy the text file on:
    http://wikis.sun.com/display/OC2dot5/Updating+From+a+Solaris+OS+Profile
    Regards,
    [email protected]

  • How to Deploy a Simple Java Web service in Oracle E Business Suite Server

    Hi,
    I have created a simple Java webservice using Jdev11g.
    I am able to Test the Webservice using Jdev11g itself.
    How Can i migrate the same to Oracle E Busienss Suite( - 9iAS ) so that webservice clients connect to 9iAS instead of my local machine
    Thanks,
    Gowtam.

    Hi Sudhakar,
    If you are used to working with ant then you can very well use eclipse to deploy your web service.
    You would usually have the ant script in the source root working directory. From eclipse if you select the build file from the navigator view and right click you will see a run ant option in the pop up menu.
    Select that option and you would be able to see each targets with a checkbox select option. So define each target maybe one for wsdl2java conversion, one for compilation and one for deploying your web services. You can either make all of them run by having depends option on or you can run them individually as it takes your fancy.
    I am not sure about debugging a web service yet.
    Hope this helps
    Aviroop
    The truth is out there? Does anyone know the URL?

  • How to deploy jfxpanel with applet to Tomcat.....

    I want to deploy jfxpanel with in a panel in applet. But a message appear that jfxpanel class not found. when i include the jar file jfxrt.jar, tomcat isn't loaded this file. After that i use the environment varibale and set the class path in javafx runtime lib. but still unable the same exception appeared. I want your help to solve this issue..

    Thank you igor. Your reply resolve most of the issues.. of my application. when i installed javafx runtime alone . the application link http://javafx.com/about-javafx/ that you have given me works fine but it changes the jre or something else... that my own developed application not able to make connection with the tomcat server. when i reinstalled jdk6u29 my application works fine and the link above is not working.
    After that without installing the runtime of javafx 2.0 i install the javafx sdk 2.0.1 the runtime installed by itself. but the same link throws the same exception the exception as after launching my own client application.
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
         at java.lang.Class.getConstructor0(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
         at java.awt.EventQueue.access$000(Unknown Source)
         at java.awt.EventQueue$1.run(Unknown Source)
         at java.awt.EventQueue$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: javafx.embed.swing.JFXPanel
         at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
         at sun.plugin2.applet.JNLP2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         ... 20 more
    Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
    After installing the runtime of javafx again the link worked successfully and my client application application didn't able to make connection with tomcat.
    is there any way to merge jre with javafx runtime. and with loading of jre , javafx runtime loaded by itself.????

  • How to deploy war file in embedded Tomcat in UCM

    Hi ,
    Can anyone please share the steps to configure embedded Tomcat in UCM, And steps to deploy individual JSP and War file.
    thanks,
    Edited by: user4884609 on Feb 13, 2012 4:23 PM

    one more question :
    The Url to access war file is something like this :
    http://localhost/idc/groups/jsp/documents/webapps/testwar/test.jsp
    Can we have friendly URL for war file ? something like http://localhost/testwar/test.jsp or may be http://localhost/idc/testwar/test.jsp ?

  • How to deploy signed jars/classes in Java Stored Procedure

    I am using java encryption API in my java application that I want to deploy as java stored procedure. The API is kept in the signed jar files.
    The Application is running in the MS-DOS environment but not in Oracle8i.
    It gives me following error.
    java.lang.ExceptionInInitializerError: java.lang.SecurityException: Cannot set
    up certs for trusted CAs
    at javax.crypto.b.<clinit>([DashoPro-V1.2-120198])
    at javax.crypto.KeyGenerator.getInstance([DashoPro-V1.2-120198])
    at DesKey.GenerateKey(DesKey.java:63)
    declare
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.ExceptionInInitializerError
    ORA-06512: at line 4
    (Note: I have enabled the java output in SQL Plus editor otherwise it will give only the second part of error that starts from ERROR at line 1:)
    please guide me how to solve this problem.
    Salman Hameed
    null

    Salman,
    If you do not get a reply on this forum, I recommend you post this question on the Oracle JVM discussion forum as well.
    In addition, I would recommend checking the documentation for Oracle8i. The Oracle8i Java Developer's Guide, the Java Stored Procedures Guide, and the JDBC Developer's guide may have some information on this topic. You can get to this doc from the OTN Documentation page. Click on Oracle8i, then General Documentation, Release 2 (8.1.6), then scroll down to see the link for the Oracle8i Java Developer's documetation. All of the books mentioned above are available from that link.

  • How to deploy the .war to tomcat

    Hello All,
                 How to deploy the war file into tomcat server & work? Can any body enlighten me how to proceed and test the application?

    Hi,
    assumed you talk about Tomcat in general.
    Simply copy you archive (xyz.war) into the subdir \webapps of your tomcat installation.
    Invocation: http://hostname:port/xyz/resource
    -> where xyz is the name of your archive and
    -> resource is what you have specified within web.xml (<servlet-mapping> - tag) or a jsp / html you have in your archive.
    -> host is your machine (try localhost for instance)
    -> port usually is 8080
    Hope that helps
    M.

  • How to deploy mapviewer.ear at tomcat

    Hi,
    I have read the thread "how to deploy mapviewer at tomcat" and I understand which jar files I have to add to tomcat to have meet the requirements of oracle, but I am still confused how to deploy mapviewer.ear file at tomcat. Can somebody tell me how to do it step by step or give me some useful links about this topic?
    Your generous help will be appreciated!
    Peifang

    Hi Andrejus,
    In our department, we have oracle application server licence. I am trying to do as you told me, but I still have a question. I extracted mapviewer.ear file which includes a file named web.war. Is it right that I copy this war file directly into /webapps of TOMCAT or do I have to change something in this war file? In this procedure when can I provide the licence of oracle application server?
    Thank you and Best Regards!
    Peifang

  • How to deploy JSPs in Tomcat 5.5

    hello all
    i am Mayuresh Trivedi. i don't know how to Deploy Jsps in Tomcat 5.5. i m using MYSql as Backend. i m trying to use "import" command in Jsp so it shows me error like under :
    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
    Generated servlet error:
    Syntax error on token "import", delete this token
    Generated servlet error:
    Syntax error on token "import", delete this token
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.7 logs.
    so , can any body help me please ?

    hi
    first create a arbitrary folder in \webapp folder in tomcat home foder.
    for instance \webapp\myJSP
    second you must create a folder with this name : \WEB-INF under myJSP folder
    then make a web.xml in that
    so write in web.xml this :
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
    <description>
    myJSP
    </description>
    <display-name>JSP 2.0 Examples</display-name>

  • How to create and deploy a simple jstl applicaton in weblogic 10.3.3

    How to create and deploy a simple jstl applicaton in weblogic 10.3.3

    1) Since JSTL libraries are provided as Web application libraries, they must be deployed before the Web application that is using JSTL functionality is deployed. The libraries can be deployed using the Administration Console or with the command-line weblogic.Deployer tool.
    Here’s an example of deploying a JSTL 1.2 library using the weblogic.Deployer command-line:
    java weblogic.Deployer -adminurl t3://localhost:7001
    -user weblogic -password weblogic
    -deploy -library
    d:/beahome/wlserver_10.3/common/deployable-libraries/jstl-1.2.war
    This command deploys the JSTL 1.2 library using the default library-name, specification-version and implementation-version defined by the MANIFEST.MF in the library.
    After a library is deployed, the extension-name, specification-version and implementation-version of the library can be found in Administration console. This information can also be found in the MANIFEST.MF file of the library WAR file.
    For more information on deploying a Web module refer below URL
    http://docs.oracle.com/cd/E15051_01/wls/docs103/deployment/deployunits.html
    2) To reference a JSF or JSTL library, a standard web application can define a <library-ref> descriptor in the application’s weblogic.xml file. Here is an example:
    <library-ref>
    <library-name>jsf</library-name>
    <specification-version>1.2</specification-version>
    <implementation-version>1.2.0</implementation-version>
    <exact-match>false</exact-match>
    </library-ref>
    For more information on referencing a Web application library refer below URL
    http://docs.oracle.com/cd/E15051_01/wls/docs103/programming/libraries.html
    3) Create a sample JSP in your application and JSP should look as shown below
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <html>
    <head>
    <title>TestJSTL</title>
    </head>
    <body>
    <c:set var="topic" value="JSTL" />     
    <c:out value="${topic}" />
    </body>
    </html>
    4) Create WAR and deploy and test.
    Edited by: Murali Veligeti on Jul 26, 2012 9:00 AM

  • How to deploy WAR file in tomcat.?

    Can anybody please provide step by step information of deploying war file to Jakarta tomcat without IDE.
    I am working on Windows XP with jakarta tomcat 4.1.30.
    Thanks in advance.
    Regards,
    Aman Aggarwal

    See if tomcat runs as a service in your operating system. If you can locate it, you can set the start type to automatic. A very crud way is to run the tomcat startup file from autoexe.bat.
    I don't know how to do this in Linux. Here is a link for tomcat 6. Maybe it is the same in tomcat 4
    [http://tomcat.apache.org/tomcat-6.0-doc/setup.html]
    Edited by: nirvan on Dec 29, 2008 9:15 AM

  • Problems trying to "hot-deploy" class files in iPlanet. Want to deploy a compiled class (i.e. servlet, jsp) without having to bounce the server. Known issue in iPlanet? How can I get around?

    Currently iPlanet is not allowing us to hot deploy a modified class file(i.e., servlet) as it advertises. It doesn't seem to have a problem with jsp's however. But everytime we modify a servlet(say in an emergency), and wish to deploy, we still have to bounce the KJS. We would like to avoid this if possible. How? I heard this might be a known issue in iPlanet.

    I apologize but this is a clarification of this problem. We are having a problem dynamically reloading java classes that are referenced by jsp's and servlets. The problem DOES NOT exist when trying to reload jsps or servlets themselves. We would like to reload these classes without having to restart the processes. Any thoughts would be helpful. Thanks.

  • How to run class after Tomcat starts?

    Hello!,
    I want to run a class after Tomcat start.
    How can I achieve?
    Reg,
    Chetan

    Well the official way to do it it to create a class which implements org.apache.catalina.LifecycleListener. Then you can name the class in a <Listener> element in server.xml. It can appear at various levels e.g. inside the Engine block, and it will receive notification when that level starts and stops.

Maybe you are looking for