Servlet caching in oc4j/orion

I'm making changes to my servlet yet they do not seem to be getting picked up, even when I restart orion. I have my classes, jsp etc in a war file under applications. Is there a servlet caching issue here and if so how do i solve it. I noticed an earlier posting about classes needing to be in a jar file to get reloaded, is something similar required for servlets?
Neil W.

Neil,
If you are in the development stage of your application probably you will not like to go thru the hastle of building the WAR each time your servlet or JSP is changed. Please look at the following link to how to deploy apps with Exploded Directory Format http://otn.oracle.com/docs/tech/java/oc4j/htdocs/getstart.htm#1027810. In this case each time your apps is changed you just change the timestamp on web.xml by either UNIX touch command or some other mechanism and OC4J will redeploy your new apps.
regards
Debu Panda
Oracle

Similar Messages

  • How to attach a new servlet on my OC4J instance ?

    Hi there
    How to attach a new servlet on my OC4J instance ?
    Regards
    Den

    You can deploy your using JDeveloper:
    http://download.oracle.com/otndocs/tech/ias/portal/files/RG/OBE/deployToAppServer/lesson_Deployment.htm
    Or you can use the Application Server Control:
    http://download.oracle.com/docs/cd/B31017_01/core.1013/b28764/deploy_em003.htm
    Maurits

  • Servlet caching ????

    I input a name to a servlet and try to print out something with that name.Say , for ex. I enter "Bryan" and the output wud be "Bryan belongs to section C"
    when 2 or more users enter names from different machines using the same servlet at the same time..sometimes it happens that they dont get the result with what they gave in, instead one gets output with the name another enterted.
    To make it more clear..
    Suppose C1 enters "Adam" as input to the servlet to get an output "Adam belongs to Section C "
    C2 enters "Lisa" as input to the servlet to get an output "Lisa belongs to Section C "
    C3 enters "Ted" as input to the servlet to get an output "Ted belongs to Section C "
    What happens sometimes is that when C1, C2,C3 enter their value at the same time, C2 and C3 get "Adam belongs to Section C " instead of "Lisa belongs to Section C " and "Ted belongs to Section C "
    When can such a thing happen?? Does servlet cache in the server??
    How come the value gets passed on to the other requests as well..
    Any help is appreciated..

    Are you using class level or object level variables in your Servlet class to store the user entered values? (Use only local variables unless you really know what you are doing).
    Are you using ServletContext attributes?
    As far as I know, except for these two scenarios, there is no other way that requests will share values.

  • Prevent servlet caching

    I am having problem with servlet caching. My Servlet keeps displaying
    previously cached image instead of an updated image. I tried out the
    following workarounds and was not successful.
    1. Set the following Response headers
    res.setDateHeader("Expires", 0);
    res.setHeader("Cache-Control", "no-store, no-cache, must-revalidate,
    post-
    check=0, pre-check=0");
    res.setHeader("Pragma", "no-cache");
    2. Set HTML META TAG:
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    Has anyone experienced a similar issue and can you share your
    worarounds. I even tried setting DateHeader as follows but no luck.
    res.setDateHeader("expires", System.currentTimeMillis()).
    thanks in advace

    And is this servlet actually sending the image itself, or it is sending some HTML that contains a link to the image? If it's the latter, then no amount of saying not to cache the HTML will have any effect on whether browsers cache the linked image.
    Actually now that I read your post more carefully, I see that you are sending HTML which presumably has an <img> tag referring to the image. The browser will download that image as a separate transaction. But if you change the date on the image file to something later, the browser should stop caching it.

  • Standard Servlet caching mechanism

    Gurus,
    Is there any standards on caching servlet reponse. Most of the application servers provide their own mechanism to cache servlet response.
    I am looking for application server netural standards for caching servlet resposne. If there is no standards for caching available in any of the servlet > 2 releases, probably i would send an email to servlet specification guys to think on something like this.
    Its lot of pain when you write code in some server and deploy it on some other server where the servlet caching response caching is suported.
    Any help in this will be appreciated

    Here is more explanation...
    Suppose for an example, a servlet that accepts parameter(s) and queries the database and displays a html text, may be around 100 records. ok?
    Next time when you make the same request with same set of parameters, the servlet excecutes the db query again and display the same result when it was intially called.
    Now my question, is there standard mechanism to cache the servlet reponse at server side and when the request is made with same set of parameters, it would be served from the cache instead of making db call.
    In addition to that, it should work under all the application server when you deploy
    Let me know if this clear enough, or i can add more stuff in here.

  • Null query string in servlet filter with OC4J 10.1.3.1.0

    I have a strange problem with OC4J 10.1.3.1.0. In the servlet filter, while requesting the querystring with HttpServletRequest.getQueryString the result is null, even if it is verified with a sniffer that that query string is there. This happens only with certain requests. The query string is long but nothing very special otherwise.
    Any ideas what might be wrong?
    Thanks,
    Mika

    I got the same problem. I tried in others application servers alternatives and it works. By now i have to change links like this "http://localhost:8888/SIVIUQ/LoadIndex.portal?test=1" for forms using javaScript to send the parameters corresponding to the button pressed. To use buttons instead links is not the better solution due to usability. Any suggestion to solve this problem?
    Thanks
    Javier Murcia
    Yo tengo el mismo problema. He intentado con otros servidores de aplicaciones y funciona. Por ahora tengo que cambiar links como "http://localhost:8888/SIVIUQ/LoadIndex.portal?test=1" por formularios, usando javaScript para enviar los parametros correspondientes al boton presionado. Usar botones en vez de links no es la mejor solucion debido a usabilidad. ¿Alguna sugerencia para resolver este problema?
    Gracias
    Javier Murcia

  • Servlet deployment in oc4j

    How do you define system property with OC4J. OAS versions allow you to do that. I have servlet 2.1 compatible application that I want to deploy into oc4j without code changes. Any ideas?

    Or if you don't want to use property files you can use the ServletContext class which has two methods:
    public String ServletContext.getInitParameter(String name)
    public Enumaration ServletContext.getInitParameterNames()
    The init parameters for a context are specified in the web.xml deployment descriptor for the context using the <context-param> tag. Example:
    <web-app>
    <context-param>
    <param-name>rmihost</param-name>
    <param-value>localhost</param-value>
    </context-param>
    <context-param>
    <param-name>rmiport</param-name>
    <param-value>1099</param-value>
    </context-param>
    </web-app>
    To find the context init parameters in a servlet you can do:
    try {
    ServletContext context = getServletContext();
    String rmihost = context.getInitParameters("rmihost");
    int rmiport = Integer.parseInt(context.getInitParameter("rmiport"));
    } catch (Exception e) {
    }

  • Where Can I Find the JSP Class files on OC4J (Orion server)

    I am using Oracle J2EE Container (OC4J 1.0.2.2 aka Orion server) and I need to find the ".class" file generated for each JSP I created. I've looked under the "WEB-INF" directory under the "application" directory and the "persistence" directory under application-deployments and didn't find them. Any help would be appreciated. Thank you.

    hi
    Just check in _pages directory
    regds

  • Remote servlet debugging using OC4J

    Hi there,
    can anybody help me with remote debugging servlets and JSP running inside OC4J with JDeveloper 3.2.3? (JDK Version 1.3.1).
    Any help would be very welcome!
    Thanks in advance!
    Stefan

    I have posted a reply in OC4J forum
    check out http://technet.oracle.com:89/ubb/Forum99/HTML/000166.html
    raghu

  • How to clear cache on oc4j standalone?

    I have the 9.0.3 oc4j standalone running under solaris and for the life of me cannot figure out how to clear the cache. I run a jsp script then delete the jsp script and it still runs. Even if I restart the oc4j standalone and the jsp is deleted it still runs!!
    It is not a browser cache thing it must be the oc4j cache. Is there a way to clear this cache? This is a vanilla install of the oc4j standalone, no special webcache or anything. Thanks. -quinn

    A JSP is typically compiled and run from the j2ee\home\application-deployments directory. Delete everything in there to remove the cache.

  • Servlet debug in OC4J

    I running the OC4J in debug mode, i can set up the breakpoint to debug the Java code like session bean.
    I want to debug the servelt but does't work.
    What's the problem? Any link to help on this?
    Thanks a lot!

    Basically,
    1) start oc4j in debug mode
    2) set your source path to include your servlet code
    3) attach your debugger to the running oc4j
    4) set the break points of your servlet code in the debugger.
    5) hit the url
    Happy debugging then!
    Make sure that you can reach the url if you start oc4j normally.
    If you are using Jdeveloper, you may use its online help. You may find something like the following:
    http://www.oracle.com/technology/products/jdev/htdocs/j2eedev.html

  • Servlet cacheing issue?

    hi
    i'm having a slight problem i believe may be due to cacheing.
    i'm calling a servlet within a frame that displays a generated pdf file using certain values and so forth.
    the problem is that it appears to be chacheing the servlet and never reloading it as it should given values change etc.
    i'm using tomcat 3.3.1 and apache web server. i tried adding the following :
    response.addHeader("Pragma", "No-cache");
    response.addHeader("Cache-Control", "no-cache");
    response.addDateHeader("Expires", 1);
    to my servlet but that had no effect. adding the http meta equivalents to the frame-set page, also had no effect.
    another interesting point is that this only occurs using the apache and tomcat combination. it doesn't happen using IIS and tomcat. could there be a setting in tomcat or apache i've neglected?? perhaps some other code to avoid this?
    any help would be greatly appreciated.
    thanks
    Takis

    use:
    response.addHeader("Expires", 1);
    instead of:
    response.addDateHeader("Expires", 1);

  • Flushing the Servlet Cache or buffer(maybe) ^o^

    Hi,
    I wrote a few JSPs that use servlets and scriplets using import and include attributes to extract data from a database table. Everything works fine, except when I refresh the page the results are shown multiple times.
    That is to say, the servlets seem to remember the previously generated values from the table and calculations, and displays it before showing the new results. I tried using the flush="true" attribute, but to no avail. After about 10 mins or if i restart Tomcat the servlets would clear the cache.
    I am writing these JSp for a school assignment, and so far this is the part that I am having trouble dealing with. Is there a workaround for this? or is this an implementation error in my part? Any help would be appreciated. Thanks in advance!
    Cheers,
    -Shawn

    Well thats interesting. I wrote a test Servlet program to see the newsbean output and I get the same problem now and It appends the old result. I realize that the trouble is not in the include statement, rather in the servlet itself.
    I looked over the code to see what it could be, but couldn't catch it. But maybe you might see something different. So I will include the code for the TestServlet and the dependat classes. And Philip I appreciate your effort trying to help me out with this! : )
    test Servlet class
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.ListIterator;
    import java.sql.*;
    public class NewsServlet
    extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    NewsBean NewsPiece = null;
    try
    staffMembers = new NewsBean();
    catch (SQLException ex)
    //iterating through news list
    ListIterator li = null;
    try
    li = NewsPiece.getNewsItem().listIterator();
    catch (SQLException ex1)
    String myNews="";
    while(li.hasNext()){
    NewsItem news = (NewsItem) li.next();
    myNews += news.getTitle()+" \t"
    news.getDescription()" \t"
    + news.getSubmitdate() +" \t"
    news.getEndDate()" \t"
    news.getAuthor()"<p>";
    String docType =
    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
    "Transitional//EN\">\n";
    out.println(docType +
    "<HTML>\n" +
    "<HEAD><TITLE>News</TITLE></HEAD>\n" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1>News</H1>\n" +
    myNews+
    "</BODY></HTML>");
    This is the newsbean class
    import package.name.sqlAdapter; //This is used to simplify database connections
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.LinkedList;
    public class NewsBean{
    private static ResultSet results;
    private static LinkedList newsItems = new LinkedList();
    public NewsBean() throws SQLException{
    //connect to DB
    sqlAdapter sqlConnection = new sqlAdapter();
    //Get Staff list
    String query = "SELECT * FROM `news` ";
    results = (ResultSet) sqlConnection.runCustomQuery(query);
    public LinkedList getNewsItem()throws SQLException{
    while(results.next()) {
    //read in columns
    String description = results.getString("description");
    String title = results.getString("title");
    String submitDate = results.getString("submit_date");
    String endDate = results.getString("end_date");
    //String author = results.getString("author");
    String picture = results.getString("picture");
    String id = results.getString("id");
    //create NewsItem object and add to list
    NewsItem news = new NewsItem(title, description, submitDate, endDate, picture, id);
    newsItems.add(news);
    return newsItems;
    Here is the NewsItem Class
    public class NewsItem
    private String title;
    private String description;
    private String submitDate;
    private String endDate;
    private String author;
    private String picture;
    private String id;
    public NewsItem(String Title, String Description, String SubmitDate, String EndDate,String Picture, String ID){
    this.title = Title;
    this.description = Description;
    this.submitDate = SubmitDate;
    this.endDate = EndDate;
    //this.author = Author;
    this.picture = Picture;
    this.id = ID;
    public static void main(String[] args) {
    //test code here
    public String getDescription(){
    return this.description;
    public String getTitle(){
    return this.title;
    public String getSubmitdate(){
    return this.submitDate;
    public String getEndDate(){
    return this.endDate;
    public String getAuthor(){
    return this.author;
    public String getPicture(){
    return this.picture;
    public String getNewsID(){
    return this.id;

  • Mapviewer servlet crash on OC4J 11g TP4

    Hi!
    Is it normal or not? If I try to deploy mapviewer.ear (10 or 11 pre) on OC4J 11G TP4 it make exception on
    http://.../mapviewer/faces/home.jspx
    Is it planing compatibility for these Oracle products? And on which release?

    Mapviewer is not supported on OC4J 11g TP4.
    Please note that the going forward position for Oracle Fusion Middleware R11 is that OC4J is being replaced with WebLogic Server.
    -steve-

  • OC4J orion-application.xml - elements and attributes

    Hi. i read in oracle docs sentense like this: "Each property maps to an element attribute in the orion-application.xml descriptor." These properties are from deployment plan and i need to know what is the name of the element in orion-application.xml wich is mapped to webSiteBinding property (from deployment plan).

    I just did a quick test of this, and it seems to work for me.
    I used the following XML:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <Employees xmlns="
    http://www.foo.com/Employees">
    <Employee Id="001">
    <LastName>Davis</LastName>
    <FirstName>Kirk</FirstName>
    </Employee>
    <Employee Id="002">
    <LastName></LastName>
    <FirstName>James</FirstName>
    </Employee>
    <Employee Id="003">
    <FirstName>Anthony</FirstName>
    </Employee>
    <Employee>
    </Employee>
    </Employees>
    With the XPath "/Employees/Employee" I got rows in the data
    set and things displayed fine in my page. Changing it to
    "/employees/employee" caused the data set to have no rows which I
    would expect since things should be case sensitive.
    Can you provide me with some sample XML and XPath that
    doesn't work?
    Thanks!
    --== Kin ==--

Maybe you are looking for