How to Compile servlet files in weblogic

Hi,
I would like to know how i can compile the servlet files to deploy in weblogic.
I searched for servlet.jar or servlet-api.jar files in my weblogic 8.1 installed folder. Could not find it to set the classpath.
Please help.

You need to use weblogic.jar for Weblogic 8.1. It should be present under server\lib subdirectory in Weblogic installation directory.

Similar Messages

  • How to Compile Servlet Java Files

    hello ...
    i am a beginner at JSPs and java servlets ... i have been searchin' hopelessly for the past couple of days. Could someone please guide me on how to compile source files for servlets ... namely how can i include the packages javax.servlet.* since the compiler gives me an error that there is no class name ... I am using jdk1.3
    Do I need to get the java server development kit ... but i cant seem to find it any where on the sun's site ... and do i need to download the j2ee sdk too ...
    As you can gather that i am completely comfused and lost ... After doing programmin with asps and previous java experience, i had thought that the migration to a java platform on would be a breeze but the lack of any solid documentation which addresses the above questions is dampenin my spirits ... and the cryptic documentation with tomcat doesnt help either. :)
    pleaze reply soon ... i have to implement a project for my company ... otherwise i would have to put servlets and jsp back in the closet and return back to asp.

    Try http://java.sun.com/j2ee/docs.html specifically, the links on that page called Download Instructions, Installation Instructions, Java Servlets Tutorial and JavaServer Pages QuickStart Guide
    By the way, J2EE SDK's reference implementation is based on Tomcat itself but is more than a web container.

  • Newbie question: how to compile servlet using tomcat?? Thank you

    How to set classpath? How to compile servlet.java?

    jsp is also converted into a servlet .java nd then into a class file
    this is index.jsp
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <title>untitled</title>
      </head>
      <body>
      </body>
    </html>this is _index.java
    /*@lineinfo:filename=/index.jsp*/
      /*@lineinfo:generated-code*/
    import oracle.jsp.runtime.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    public class _index extends com.orionserver.http.OrionHttpJspPage {
      public final String _globalsClassName = null;
      // ** Begin Declarations
      // ** End Declarations
      public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException {
        response.setContentType( "text/html;charset=windows-1252");
        /* set up the intrinsic variables using the pageContext goober:
        ** session = HttpSession
        ** application = ServletContext
        ** out = JspWriter
        ** page = this
        ** config = ServletConfig
        ** all session/app beans declared in globals.jsa
        PageContext pageContext = JspFactory.getDefaultFactory().getPageContext( this, request, response, null, true, JspWriter.DEFAULT_BUFFER, true);
        // Note: this is not emitted if the session directive == false
        HttpSession session = pageContext.getSession();
        if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) {
          pageContext.setAttribute(OracleJspRuntime.JSP_PAGE_DONTNOTIFY, "true", PageContext.PAGE_SCOPE);
          JspFactory.getDefaultFactory().releasePageContext(pageContext);
          return;
        int __jsp_tag_starteval;
        ServletContext application = pageContext.getServletContext();
        JspWriter out = pageContext.getOut();
        _index page = this;
        ServletConfig config = pageContext.getServletConfig();
        try {
          // global beans
          // end global beans
          out.write(__oracle_jsp_text[0]);
        catch( Throwable e) {
          try {
            if (out != null) out.clear();
          catch( Exception clearException) {
          pageContext.handlePageException( e);
        finally {
          OracleJspRuntime.extraHandlePCFinally(pageContext,false);
          JspFactory.getDefaultFactory().releasePageContext(pageContext);
      private static final char __oracle_jsp_text[][]=new char[1][];
      static {
        try {
        __oracle_jsp_text[0] =
        "\n<html>\n  <head>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">\n    <title>untitled</title>\n  </head>\n  <body>\n  </body>\n</html>\n".toCharArray();
        catch (Throwable th) {
          System.err.println(th);
    }as you can see.. my IDE converts it into a java class so it can be conpiled to a class file.. by the way i use Oracle Jdeveloper 10g for this pupose of showing you what is happening to your jsp

  • How to compile .pll files

    Hi all,
    Seems to be a trivial one but i guess this is the fastest way to get help on how to compile .pll files
    in unix shell. Additionally if someone can also tell how to convert the .pll to a readabe .pld file.
    Regards
    Shishir

    Hi,
    I haven't actually done this on UNIX but I imagine it should be the same as on a Windows PC.
    For Forms 9i/10g try this: ifcmp90 lib.pll user/passwd@db batch=yes module_type=library
    ifcmp90 (ifcmp60 for Forms 6i) is in the bin directory of the developer suite.
    Achim

  • Cannot compile servlet file

    I cannot compile Servlet files on my WinXP environment.
    my servlet.jar file is located at
    c:\tomcat\jakarta-tomcat-3.3.1\common\lib\servlet.jar
    what shall I do?
    The error messages are only for servlet portion of code?

    In XP you can set the path by rightclicking on my computer - then go to environment vairables and edit the path but I cannot see any for classpath???
    What is the easist way yo use the class path?

  • Pls help me on how to compile servlet

    pls i need the help of some kind one to assist me on how to compile and deploy servlet .I'm new to javaEE & am using the javaEE tutorial from sun site.In the first example servlet in d book, after compiling and deploying the greetingServlet and responseServlet and deployed it ,i was told to include a welcome jsp file in d war file. all these i have done but the server always complain of not been able locate d greetingServlet.
    i use the netbeans IDE and sun java application server.The greetingServlet & responseServlet codes are these; Pls I don't know what to put in the jsp file
    package servlets;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * This is a simple example of an HTTP Servlet.  It responds to the GET
    * method of the HTTP protocol.
    public class GreetingServlet extends HttpServlet {
        public void doGet(
            HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
            response.setContentType("text/html");
            response.setBufferSize(8192);
            PrintWriter out = response.getWriter();
            // then write the data of the response
            out.println("<html>" + "<head><title>Hello</title></head>");
            // then write the data of the response
            out.println(
                    "<body  bgcolor=\"#ffffff\">"
                    + "<img src=\"duke.waving.gif\" alt=\"Duke waving\">"
                    + "<h2>Hello, my name is Duke. What's yours?</h2>"
                    + "<form method=\"get\">"
                    + "<input type=\"text\" name=\"username\" size=\"25\">"
                    + "<p></p>" + "<input type=\"submit\" value=\"Submit\">"
                    + "<input type=\"reset\" value=\"Reset\">" + "</form>");
            String username = request.getParameter("username");
            if ((username != null) && (username.length() > 0)) {
                RequestDispatcher dispatcher = getServletContext()
                                                   .getRequestDispatcher(
                            "/response");
                if (dispatcher != null) {
                    dispatcher.include(request, response);
            out.println("</body></html>");
            out.close();
        public String getServletInfo() {
            return "The Hello servlet says hello.";
    package servlets;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * This is a simple example of an HTTP Servlet.  It responds to the GET
    * method of the HTTP protocol.
    public class ResponseServlet extends HttpServlet {
        public void doGet(
            HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
            PrintWriter out = response.getWriter();
            // then write the data of the response
            String username = request.getParameter("username");
            if ((username != null) && (username.length() > 0)) {
                out.println("<h2>Hello, " + username + "!</h2>");
        public String getServletInfo() {
            return "The Response servlet says hello.";
    }

    Here is what you will need to do.
    1. Compile the servlets by performing the following steps
    1.1 Open a command line in the directory where your servlets are located.
    1.2 Type the following commands
    1.2.1 javac GreetingServlet.java
    1.2.2 javac ResponseServlet.java
    Then you should see the .class files for these classes appear in the directory .
    Next you will put these class files in the WEB-INF/classes directory.
    Once you have done that you will edit your web.xml in the WEB-INF directory to include the two servlets. That code will look something like this
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
         <servlet>
              <servlet-name>GreetingServlet</servlet-name>
              <servlet-class>GreetingServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>GreetingServlet</servlet-name>
              <url-pattern>/GreetingServlet</url-pattern>
         </servlet-mapping>
         <servlet>
              <servlet-name>ResponseServlet</servlet-name>
              <servlet-class>ResponseServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>ResponseServlet</servlet-name>
              <url-pattern>/ResponseServlet</url-pattern>
         </servlet-mapping>
    </web-app>Once you have done this save the web.xml file and recompile the war file by following these steps
    1 open a commandline in the root directory where the servlets are
    2 type the following command jar -cvf warFileName.war .
    *Note the space and period at the end of the command are not a mistake the space . tells the jar tool to complie the war from the directory you are current in.
    Once this command is successfully ran you should see a .war file appear in the directory you are in. Then simply put the war file in your deploy directory of your server and you are finished.
    alternatly if you are just doing this for yourself to learn servlets and this is not going to be deployed anywhere then I would just use the W3C's Jigsaw server which does all the work for you all you have to do is compile the servlets and put the class files in the servlets directory and you are done.

  • How to deploy Servlet Application in Weblogic 8.1

    Hi,
    I am new to BEA Weblogic 8.1 .
    I was trying to create a sample application using InelliJ IDea 5.1 , and IntelliJIdea 10.5 . i configured weblogic with IDE , but now i do not know how to deploy my application in weblogic .
    I am new in IntelliJ also .
    So Can anyone tell me how can i deploy a servlet application in any IDE like i also have eclipse indigo.
    Thanks & Regards
    Komi

    Hi Komi
    Basically you deploy your Servlet as a WAR File. I am not familiar with IntellJ IDE. But it should have a provision to export/create a WAR file that has your Servlet. Also I hope you already have web.xml file with 2 sections like this: First you mention full package of your servlet and give it a name. Then enter a mapping url. You will use this url to run your servlet like http://weblogichost:weblogicport/yourWebappcontextroot/myservlet
    <servlet>
         <servlet-name>MyServlet</servlet-name>
         <servlet-class>com.abd.def.MyServlet</servlet-class>
    </servlet>
    <servlet-mapping>
         <servlet-name>MyServlet</servlet-name>
         <url-pattern>/myservlet</url-pattern>
    </servlet-mapping>
    Coming to deployment, I hope you already created a Weblogic Domain and have admin username/password. Start your domain. Login into weblogic console like http://host:port/console and use admin username/password. Then from Deployments section, deploy the above WAR file. In Weblogic you can deploy JAR (EJBs, java files), WAR (web jsp, html, webservices, servlets) or EAR (JAR + WAR). In your case its just a WAR file.
    Refer the online docs for more details on Deployments in Weblogic.
    http://docs.oracle.com/cd/E13196_01/platform/docs81/deploy/deploy.html
    Thanks
    Ravi Jegga

  • Unable to compile servlet files in javac

    i am unable to compile servlet *.java files in javac.as far as i can see my path is correct.
    Kindly provide a solution as soon as possible.
    My jdk1.3 is in my c drive and my tomcat in my d drive.
    if you are able to compile kindly let me know your path.
    it says symbol not resolved.i think that it is unable to import from javax

    Assuming that your jdk is in c drive as c:\jdk1.3 set the path and the classpath like as shown below. Remember that you have to set the classpath for the classes in the javax.servlet and javax.servlet.http packages. I know how to do it for JavaWebServer. JavaWebServer has a jar called servlet.jar that contains all these classes. What you need to do is to put this jar file in your classpath. There will be a similar jar file for Tomcat server also. You need to refer the Tomcat server documentation for that.
    The path and the classpath have to be set like this...
    d:\>path=%path%;.;c:\jdk1.3\bin;
    d:\>set classpath=%classpath%;.;c:\jdk1.3\lib;c:\JavaWebServer2.0\lib\servlet.jar;
    assuming tht JWS is installed in c:\JavaWebServer2.0
    Also note that there should be no spaces in between while setting the classpath. In your case you have to change the last part of the classpath to customize your requirement.
    Hope that will help.
    Regards
    Jaydeep

  • How to compile servlet with Edit Plus?

    Hi
    I am writing a Java servlet in EditPlus and am wondering how to include the servlet.jar file so that EditPlus knows where the javax.servlet.*, etc classes are. I suppose this is an EditPlus specific question so sorry about that but I didn't know who else to ask other than EditPlus themselves of course and I think I have tried that once.
    I have read replies on this forum about changing the classpath but I dont think that that is what I need to do here and if it is I dont know what I should be writing as I am not using the jdk.
    If anyone can help me at all I would be very grateful.
    Thanks

    Yes, I have also compiled Java files from EditPlus. Using the facilities for configuring 'User Tools' in EditPlus.
    EditPlus runts programs(javac in the current context) in a separate environment(separate DOS command).
    I just compiled, from EditPlus, some Java file of mine that uses something from the servlet API. It compiled just fine. I did not do any classpath or other setup on classpath lines inside EditPlus. I guess, EditPlus inherits the existing CLASSPATH(all environment settings in fact) setting from your environment and thereafter aslo passes it along to the separate command prompt it opens to run user configured tools to run.

  • How to compile Java files using Ant in Eclipse

    Hi All ,
    I would like to compile all Java files using Ant in Eclipse.Since am very new to Ant and Eclipse can someone help me to create a build.xml file and let me know how to compile all the java files.
    For ex , I have placed my java files inside the path C:\HEC\Terab.Initially the Terab folder holds 7 jar files which i had decompiled using JD compiler and placed the unzipped 7 folders (which contains the java files ).Now i have imported the HEC project into Eclipse using New ->Project ->Java Project.after importig it throwed me an error saying missing jar files.again i copied the jar files and placed inside Terab folder with other 7 folder.
    Now How i can compile the java files and convert in to class files.Then after compiling the files i will again need to jar all the 7 folder.
    Please tell me the steps i need to follow.How to write an build.xml file ? where i should keep it ? only one build.xml file is enough or should i write 7 build.xml file for each folder ? Please help me out...
    Thanks & Regards
    Kar1983

    put it another way, what I am trying to do is to compile David Brackeen's ch 18 code from his book. The java sourse files can be downloaded here:
    http://www.brackeen.com/javagamebook/
    my question is that how would I complie all of these file so that I can get the program in ch18src\src\com\brackeen\javagamebook\test\ to run?

  • How to Compile Jsp File in Class File , Protect my JSP from outworld

    Hello Friends
    My name is chandra prakash, I'm new for u. I've develop a web based software completely in JSP, some files are also written in Java Script. This software have aprox. 40 files --> 30 in JSP + 2 in Java Script + 8 image files .
    Each JSP calls another. and run this on 58 clints machine simultaneusly. we used Oracle 9iAS as back end and Oracle9iAS web Server . Where we found less clients like 20-30 we use Tomcat 5.0 web server .Sir problem is this we don't wan't to leave our jsp source code on server.
    Is any method or third party tool by which we can convert our JSP source file in CLASS file as like real class files provide by javac.
    For this perpose we make a folder and put all files in it. Create a context on Tomcat for this folder.Create a data source for this in tomcat. Bcase this program uses Data source and connect many times to database & fetches many type of data from database. We use servlet files of tomcat for this context in WORK folder of Tomcat. and after that rename our Source file Folder. and again run our program through batch file i'm strange program runs 2-3 steps, after few times it start producing errors.
    Sir do u hava work on this field can u help me to protect this JSP source code.
    I've Use Jikes.com compiler but not get any succes, It may be i'm not using correctly .
    Pls sir give me any suggesition.
    Chandra prakash

    1. Highlight your web project or the individual file
    2. Right click
    3. Select Rebuild to build all jsp files or Make to rebuilt only changed files

  • How to compile .ejb files

    Hi,
    I want to compile .ejb files generated through weblogic workshop 8.1, jar it and need to deploy it through Ant scripts(all three tasks). Can anyone help me in doing that?
    Thanks,
    Adwitiya Nigam...

    Compile with javac task.
    <javac classpath="" destdir="" includes="" srcdir=""/>
    Create a jar file with the jar task.
    <jar basedir="${build}" includes="" jarfile="ejb.jar"/>
    Copy jar file to the deploy directoy applications.
    <copy file="${dist}/ejb.jar" todir="${weblogic.deploy.dir}"/>

  • How to deploy mar file in weblogic

    Hi,
    I have a mar file present in an ear file.
    This mar file is used by ESS ( enterprise scheduler service ) . It has some xml files which defines the job/job definitions which we can schedule.
    I try to deploy the ear having mar file to weblogic.
    But it seems that weblogic is not picking up the mar file for deployment. I get an exception ( job definition files not found ) , when i try to use ess service.
    Regards,
    Harsha

    I think a .MAR file is not a deployment file supported by WebLogic Server

  • How to compile source file for CUPS ?

    Basicly im trying to install a POS printer in the imac we use with clients. The printer model is ct-s300 .I got this http://www.citizen-systems.co.jp/support/download/printer/driver/cups/ from citizen but i need to compile a file to be able to install it into CUPS. I downloaded Xcode to be able to use gcc but still not working .
    Linux command is gcc -Wl,-rpath,/usr/lib -Wall -fPIC -O2 -o rastertocbm1k rastertocbm1k.c -lcupsimage -lcups
    i tried changing -rpath to -B but still not working and i know nothing about compiling .Any help will be appreciate.
    Thanks

    Thanks a lot , now i got my compiled file but i got another problem . The steps to install this printer are
    Copy the CTS300.ppd file to /usr/share/cups/model/ directory.
    Execute the following command.
    cp CTS300.ppd /usr/share/cups/model
    Copy the rastertocbm1k file to /usr/lib/cups/filter/ directory.
    Execute the following command.
    cp rastertocbm1k /usr/lib/cups/filter
    Add a execute permission to the copied rastertocbm1k file in the /usr/lib/cups/filter/ directory.
    Execute the following command.
    chmod +x /usr/lib/cups/filter/rastertocbm1k
    Restart CUPS to recognize files.
    Execute the following command.
    /etc/rc.d/init.d/cups restart
    I did the first step but on the second the folder /usr/lib/cups/filter dont exist. I´ve been looking for it without look. Any clue on this one?

  • How to compile servlets

    well,actually the problem arises this way.i have installed the new version j2ee sdk which even contains j2se1.5.now when i compile the servlet program it says the package import http.servlet.*; does not exists.i even had set the classpath as C:\Sun\AppServer\jdk\lib\dt.jar;C:\Sun\AppServer\jdk\lib\tools.jar;C:\bea\weblogic81\server\lib\weblogic.jar;C:\bea\weblogic81\server\lib\webservices.jar;.;
    b'coz i m using web-server as weblogic so i even included it in the classpath.now wats the problem for compilation ,i tried all sorts of things but unable to solve.so plz some1 do post the solution as i m preparing for SWCD.

    well,actually the problem arises this way.i have
    installed the new version j2ee sdk which even
    contains j2se1.5.of course - jee cannot exist without jse.
    now when i compile the servlet
    program it says the package import http.servlet.*;
    does not exists.Because you need that package in your CLASSPATH and it's not, according to the compiler.
    i even had set the classpath as
    C:\Sun\AppServer\jdk\lib\dt.jar;C:\Sun\AppServer\jdk\l
    ib\tools.jar;C:\bea\weblogic81\server\lib\weblogic.jar
    ;C:\bea\weblogic81\server\lib\webservices.jar;.;I'm confused - you have WebLogic 8.1 as your JEE server. Why do you need the one from Sun? (Answer: You don't.)
    b'coz i m using web-server as weblogic so i even
    included it in the classpath.now wats the problem for
    compilation ,i tried all sorts of things but unable
    to solve.so plz some1 do post the solution as i m
    preparing for SWCD.You're preparing for SWCD and you don't know how CLASSPATH works? Oh, my.
    You should not use a system environment variable CLASSPATH. (I don't have one.) Use the -classpath option on javac.exe and java.exe when you compile and run, respectively. You should set the CLASSPATH each and every time you compile and run, because it changes with every application you write.
    If this becomes tedious, either put it in a script or learn how to use Ant.
    %

Maybe you are looking for

  • AMD AM2 P-states?

    Hello, doesn someone here has an AMD AM2 X2-cpu (preferably 65W, but maybe it doesn't matter). Please mention which one you have: 3600, 3800, 4200, ... Could you tell me how many P-states, and which ones, your processor has? I'm looking for this info

  • Multiple users on 1 Apple ID

    Please bear with me as I am new to all of this! I have moved in with my partner and we both have apple products. I know we can't combine our Apple ID accounts, so will have to lose lots of paid for music and apps, but at the same time we often buy th

  • My phone isn't being recognized by itunes, It is stuck in loading.

    and I am not able to click on any options in the device drop down menu. I just want to sync some new music to my phone.

  • How to pass parameter to LOV through program

    Hi, I have a requirement where an lov should be populated depending on the parameter passed. I have gone through the dev guide and lot of threads in forum but i didnt get a suitable solution for this. My LOV Query is: select distinct pg.name grade_na

  • Cant log into box? will not authorise (thunderbird)

    My connection to my box account in Thunderbird seems to have been lost? And now will not authorise? Everything on the Box web site seems correct and I have not changed anything? I frequently send multiple or large attachments so this functionality is