Load on startup servlet and references

          Weblogic 6.1 SP2
          No jars specified in the classpath. A Singleton is located in a utility.jar file
          inside a .ear file.
          If I create a Singleton from a load on startup servlet, how long will the singleton
          be around? I know that if I undeploy the application, the singleton will be destroyed
          since the classloader is unloaded. However, if I never undeploy my application,
          will the Singleton always be around? Does Weblogic keep a reference alive to
          this Singleton forever?
          Please provide some more details on this!
          Thanks.
          Dan
          

          Dan Baumbach wrote:
          > So, because the startup servlet has a static reference to the singleton, the servlet
          > will never be garbage collected?
          Correct.
          >
          >
          > What if there's a class that is not a singleton, but there are static methods.
          > How would garbage collection work in this case?
          >
          A class object is not an instance object. If the class object has been loaded by the
          classloader, it will not be unloaded or garbage collected, regardless of whether or not
          it has static methods. If an instance of a class is instatiated on the heap, and a
          reference to that object is placed in a static member of its associated class object,
          also referred to as a class member, then the instance will not be garbage collected.
          >
          > Thanks.
          > Dan
          >
          > William Kemp <[email protected]> wrote:
          > >The jvm will not garbage collect an object that has a static reference
          > >to it. Which is how
          > >I am assuming you have implemented the singleton.
          > >
          > >Bill
          > >
          > >Dan Baumbach wrote:
          > >
          > >> Weblogic 6.1 SP2
          > >> No jars specified in the classpath. A Singleton is located in a utility.jar
          > >file
          > >> inside a .ear file.
          > >>
          > >> If I create a Singleton from a load on startup servlet, how long will
          > >the singleton
          > >> be around? I know that if I undeploy the application, the singleton
          > >will be destroyed
          > >> since the classloader is unloaded. However, if I never undeploy my
          > >application,
          > >> will the Singleton always be around? Does Weblogic keep a reference
          > >alive to
          > >> this Singleton forever?
          > >>
          > >> Please provide some more details on this!
          > >> Thanks.
          > >> Dan
          > >
          

Similar Messages

  • How long load-on-startup servlet stays in weblogic6.1 sp2

    does anybody know how long a load-on-startup servlet exists (before
              gets destroyed) in weblogic6.1 sp2. What i want is in load-on-startup
              servlet, I want to schedule a java.util.Timer and when application
              gets undeployed, i want to cancel that timer. if load-on-startup
              servlet exists for the whole application life span then i could do
              timer.cancel() on the destroy method of load-on-startup servlet.
              any suggestion?
              thanks in adv,
              soumik
              

    You can simply use ServletContextListener instead - that way you do not
              have to worry if (or when) WebLogic decides to destroy the servlet.
              soumik <[email protected]> wrote:
              > does anybody know how long a load-on-startup servlet exists (before
              > gets destroyed) in weblogic6.1 sp2. What i want is in load-on-startup
              > servlet, I want to schedule a java.util.Timer and when application
              > gets undeployed, i want to cancel that timer. if load-on-startup
              > servlet exists for the whole application life span then i could do
              > timer.cancel() on the destroy method of load-on-startup servlet.
              > any suggestion?
              > thanks in adv,
              > soumik
              Dimitri
              

  • "load-on-startup" servlet configuration

    Dear All,
    I am trying to load a servlet "SettingServlet" at the startup of the application, the configuration I am using inside the web.xml file is as following:
    <web-app>
         <servlet>
         <servlet-name>SettingsServlet</servlet-name>
         <servlet-class>com.myPack.SettingsServlet</servlet-class>
         <init-param>
         <param-name>fichierConfig</param-name>
         <param-value>D:/tomcat41/webapps/init.conf</param-value>
         </init-param>
         <load-on-startup>5</load-on-startup>
         </servlet>
    </web-app>
    It seems that the "SettingsServlet" servlet is not started at the startup.Even it's started in the tomcat window I am getting something like
    (SEVERE: Parse error at line......column...:Element type ....not declared ..)
    and that for the servlet-name, parma-name,servlet-class, init-param...etc
    Do I missed something in the configuration?, please tcheck the few lines above. because Simply I got stuck ! ,,,,,Please help me to fix it, I am waiting for you reply guys.
    Thanks and Regards,
    kifwet

    Take a look at the header of your web.xml file, the part about:<!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd"> And go check the dtd for your version.
    Some versions are very picky about the order of parameters.
    Hope this helps.

  • Can't get Servlet to Load On Startup

              I am trying to get a servlet to run at startup, and I have put the xml below in WEB-INF/web.xml to make this happen, but it is not working. The servlet does not run at startup.
              Anybody have any idea what the problem is?
              <servlet>
                   <servlet-name>Cocoon</servlet-name>
                   <servlet-class>org.apache.cocoon.Cocoon</servlet-class>
                   <init-param>
                        <param-name>properties</param-name>
                        <param-value>./WEB-INF/cocoon.properties</param-value>
                   </init-param>
                   <load-on-startup/>
              </servlet>
              <servlet-mapping>
                   <servlet-name>Cocoon</servlet-name>
                   <url-pattern>*.xml</url-pattern>
              </servlet-mapping>
              ALSO, The servlet in this case is the Cocoon servlet, and the reason I am trying to get it to run at startup is because in my application I am calling it from another servlet, instead of through a direct call to an *.xml file, and so it requires a direct call to Initialize the Cocoon Engine. So, if anyone knows anything about how to solve this problem, that would also be helpful.
              Thanks.
              Harris.
              

              Thank you!
              That worked.
              Ruslan Bilorusets <[email protected]> wrote:
              >Harris,
              >
              >Please, try to specify a value for the <load-on-startup> element. It looks like a bug in our code.
              >
              >So,
              ><load-on-startup>1</load-on-startup>
              >should do the trick.
              >
              >Thanks,
              >-ruslan
              >
              >harris wrote:
              >
              >> I am trying to get a servlet to run at startup, and I have put the xml below in WEB-INF/web.xml to make this happen, but it is not working. The servlet does not run at startup.
              >>
              >> Anybody have any idea what the problem is?
              >>
              >> <servlet>
              >> <servlet-name>Cocoon</servlet-name>
              >> <servlet-class>org.apache.cocoon.Cocoon</servlet-class>
              >> <init-param>
              >> <param-name>properties</param-name>
              >> <param-value>./WEB-INF/cocoon.properties</param-value>
              >> </init-param>
              >> <load-on-startup/>
              >> </servlet>
              >> <servlet-mapping>
              >> <servlet-name>Cocoon</servlet-name>
              >> <url-pattern>*.xml</url-pattern>
              >> </servlet-mapping>
              >>
              >> ALSO, The servlet in this case is the Cocoon servlet, and the reason I am trying to get it to run at startup is because in my application I am calling it from another servlet, instead of through a direct call to an *.xml file, and so it requires a direct call to Initialize the Cocoon Engine. So, if anyone knows anything about how to solve this problem, that would also be helpful.
              >>
              >> Thanks.
              >> Harris.
              >
              

  • Weblogic startup servlet load

              Hi,
              I am encountering problems in running a Servlet on Weblogic
              server startup.
              The steps to be followed to execute a servlet on webLogic
              Server startup are as follows
              Register the following in the Weblogic properties
              file.
              1.register the servlet
              weblogic.httpd.register.MyServlet=\
              examples.servlets.myservletclass
              2.weblogic.system.startupClass.StartMyServlet=\
              weblogic.servlet.utils.ServletStartup
              3.weblogic.system.startupArgs.StartMyServlet=\
              servlet=MyServlet
              where MyServlet is the synonym used for registering the
              servlet in the file and myservletclass is the Actual
              name of the servlet.
              I have followed the steps accordingly but the server
              is failing to execute my servlet on startup.
              Any suggestions,solutions for the above problem
              will be most welcome.
              Thanx
              Tapan.
              

    HOw did you specified the load-on-startup? and what error you get
              upon startup/deployment time?
              Kumar
              Giulia Esposito wrote:
              > I try to load my servlet on startup of Bea WebLogic Server 6.1 (SP 3) cluster.
              > This load failed.
              >
              > Can you help me?
              >
              > Tank's!
              >
              

  • Help With Integrating Servlet and JSP Page?

    Hello There
    --i made jsp page that contain name and description fields and add button
    --and i made servlet that contain the code to insert name and description in the database
    --and i want to make that when the user hit the add button
    -->the entered name and description is sent to the servlet
    and the servlet sent them to database?
    here's what i 've done:
    the jsp code:
    <html:html locale="true">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>
            Categories Page
           </title>
            <html:base/>
        </head>
        <body style="background-color: white">
        <form action="jpage.jsp" method="get">
            <h1>
                <center>
    categories Operations
                </center>
            </h1>
            <h3>
                 <label>Name</label>
            <input type="text" name="name" value="" size="10" />
                 <label>Description</label>
             <input type="text" name="description" value="" size="10" />
             <input type="submit" value="Add" name="button" />
           </h3>
       </form>
        </body>
    </html:html>the servlet code:
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.net.*;
    class NewServlet1 extends HttpServlet{
         Connection conn;
         private ServletConfig config;
    public void init(ServletConfig config)
      throws ServletException{
         this.config=config;
    public void service (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
       HttpSession session = req.getSession(true);
       res.setContentType("text/html");
    try{
         Class.forName("com.mysql.jdbc.Driver");
       conn = DriverManager.getConnection("jdbc:mysql://localhost/struts", "root", "");
         PreparedStatement ps;
       ps = conn.prepareStatement ("INSERT INTO categories (Name, Description) VALUES(?,?)");
          ps.setString (1, "aa");
          ps.setString (3, "bb");
          ps.executeUpdate();
          ps.close();
          conn.close();
      }catch(Exception e){ e.getMessage();}
      public void destroy(){}
    }

    The JSP Code:
    <html:html locale="true">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>
            Categories Page
           </title>
            <html:base/>
        </head>
        <body style="background-color: white">
        <form action="actionServlet.do?action=Additem" method="*post*">
            <h1>
                <center>
    categories Operations
                </center>
            </h1>
            <h3>
                 <label>Name</label>
            <input type="text" name="name" value="" size="10" />
                 <label>Description</label>
             <input type="text" name="description" value="" size="10" />
             <input type="button" value="Submit">
           </h3>
       </form>
        </body>
    </html:html>The Servlet Code:
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.net.*;
    public class NewServlet1 extends HttpServlet implements SingleThreadModel {
        public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException {
            doPost(request,response);
        public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException {
              String action = request.getParameter("action"); // action = "Additem"
              if (action.equals("Additem")) {
                   String name = request.getParameter("name");
                   String description = request.getParameter("description");
                         RequestDispatcher reqDisp = null;
                   try{
                  Connection conn;
                  PreparedStatement ps;
         Class.forName("com.mysql.jdbc.Driver");
       conn = DriverManager.getConnection("jdbc:mysql://localhost/struts", "root", "");
       ps = conn.prepareStatement ("INSERT INTO categories (Name, Description) VALUES(?,?)");
          ps.setString (1, name);
          ps.setString (3, description);
          ps.executeUpdate();
          ps.close();
          conn.close();
          reqDisp= request.getRequestDispatcher("./index.jsp");
          reqDisp.forward(request, response);
                   catch (Exception ex){
                        System.out.println("Error: "+ ex);
    }The web.xml code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>
            <init-param>
                <param-name>debug</param-name>
                <param-value>2</param-value>
            </init-param>
            <init-param>
                <param-name>detail</param-name>
                <param-value>2</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
            </servlet>
        <servlet>
            <servlet-name>NewServlet1</servlet-name>
            <servlet-class>NewServlet1</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>NewServlet1</servlet-name>
            <url-pattern>/NewServlet1</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
            </welcome-file-list>
            <servlet>
         <servlet-name>actionServlet</servlet-name>
         <servlet-class>com.test.servlet.NewServlet1</servlet-class>
    </servlet>
    <servlet-mapping>
         <servlet-name>actionServlet</servlet-name>
         <url-pattern>*.do</url-pattern>
    </servlet-mapping>
        </web-app>

  • load-on-startup is not working !!

    Hello all ... I have a servlet....CSVReaderServlet.java
    and following code in web.xml
    <web-app>
    <servlet>
    <servlet-name>
    CSVReader
    </servlet-name>
    <servlet-class>
    com.xpedion.CSVReaderServlet
    </servlet-class>
    <init-param>
    <param-name>root</param-name>
    <param-value>/app/agents</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    </web-app>
    having this all i expect when i start my weblogic ... servlet should run on start up, but it does not. If i make a call from browser then it runs perfect.
    Any clue.... ??
    Thanks
    Ajay

    Is there a particular reason you feel it necessary to post this over and over again?
    http://forum.java.sun.com/thread.jsp?forum=31&thread=428054

  • Extending EP6 with own Servlet and URL /irj/MyServlet

    Hello,
    I am working on a migration of a Servlet from IBM WebSphere Portal 5.0 to SAP EP6.0. The Servlet is an extension to the Portal and is manually deployd and not with an ear or war file.
    Is it possible to extend the portal with my own servlet accessible with "/irj/MyServlet"?
    I tried to copy the jars to one of the directories
    server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\lib
    server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\lib
    server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\system\lib
    and added my Servlet to the web deployment descripter
    server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\web.xml
         <servlet>
              <servlet-name>MyServlet</servlet-name>
              <display-name>MyServlet</display-name>
              <servlet-class>com.mycompany.MyServlet</servlet-class>
              <init-param>
                   <param-name>ServletMode</param-name>
                   <param-value>normal</param-value>
              </init-param>
            <load-on-startup>1</load-on-startup>
         </servlet>
          <servlet-mapping>
             <servlet-name>MyServlet</servlet-name>
             <url-pattern>/MyServlet/*</url-pattern>
          </servlet-mapping>
    I also tried to modify the jar file in the same manner
    server0\apps\sap.com\irj\servlet_jsp\irj\epbc.war
    All this does not work.
    Does somebody has experience with extending the SAP EP6 portal?
    Greetings, Bernd.

    Maybe its  possible, but it is not recommended to do so.
    However it does not make to much sense.
    Just run your servlet as a portal compoent with an entry as native-Servlet in the pc descriptor.
    Thats a 5 minute trip.

  • Startup servlet  problem in weblogic81

    Hi
    I created one web application in weblogic81 and it contains one servlet and act as startup servlet.When i m trying to get jndi context to connect to DataSource in init method, i m getting the following exception
    javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://16.138.181.88:7501: Dest
    ination unreachable; nested exception is:
            java.net.ConnectException: Connection refused; No available router to de
    stination]
    init method
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL,"t3://16.138.181.88:7501" );
    jndiContext = new InitialContext(env);
    web.xml
    <servlet>
    <servlet-name>MyServlet</servlet-name>
              <servlet-class>com.MyServlet</servlet-class>
              <load-on-startup>0</load-on-startup>
    </servlet>
    Please help me out.
    Regards
    Chandra

    To use the /servlet/ notaton you will need to enable the invoker servlet. To do this open the conf/web.xml and search on "invoker". Follow the directions.
    An alternative would be to map the servlet to a url and use that url to call the servlet
    <servlet>
    <servlet-name>TestServlet</servlet-name>
    <servlet-class>TestServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestServlet</servlet-name>
    <url-pattern>/TestServlet</url-pattern>
    </servlet-mapping>
    now you should be able to access the servlet with /Fortune/TestServlet

  • load-on-startup problem

    Hai all,
    I want to run a servlet on start up
    i did following
    1) Add following to web.xml
    <servlet>
    <servlet-name>Schedular</servlet-name>
    <servlet-class>com.abc.xyz.Schedular</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    2) copied the file to com.abc.xyz
    but when i restarting iam getting following errror
    Cannot load Servlet name
    my java files shown below....am around it
    import java.util.Timer;
    import java.util.TimerTask;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Schedular extends HttpServlet {
    Timer timer;
    public Schedular(int seconds) {
    timer = new Timer();
    timer.schedule(new RemindTask(), seconds*1000);
    class RemindTask extends TimerTask {
    public void run() {
    System.out.println("hai !");
    timer.cancel(); //Terminate the timer thread
    public void init(ServletConfig config) throws ServletException {
         super.init(config);
    System.out.println("About to schedule task.");
    new Schedular(5);
    System.out.println("Task scheduled.");
    public void service(HttpServletRequest request, HttpServletResponse response)
         throws IOException, ServletException
                   System.out.println("servee.");
    }

    In web.xml, you say the servlet class is com.abc.xyz.Schedular but your servlet isn't in the package.
    You need to add the following to your servlet...
    package com.abc.xyz;Hope this helps,
    JEB

  • Servlet failed to load on startup

    Hi all,
    I recently added a new servlet definition to my web.xml file, and specified a <load-on-startup> value of 1 for this servlet. Even though this works and the new servlet gets initialised properly, one of my old servlets with a <load-on-startup> value of 2 has stopped working. There were no changes to this old servlet, and it was working fine before. I get the following error from the weblogic logs. I have tried swapping the load order around but that doesn't make any difference. Any suggestions as to why this could happen?
    Thanks in advance
    <Nov 14, 2005 1:34:59 PM SGT> <Error> <HTTP> <BEA-101216> <Servlet: "action" failed to preload on startup in Web application: "/".
    javax.servlet.ServletException
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:884)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:848)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:787)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3260)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3205)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3182)
    at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:5663)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:869)
    at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2022)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2063)
    at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
    at weblogic.management.deploy.slave.SlaveDeployer.commitUpdate(SlaveDeployer.java:608)
    at weblogic.drs.internal.SlaveCallbackHandler$2.execute(SlaveCallbackHandler.java:35)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    I am running into the same error. Has anyone been able to find a solution?
    thanks.

  • Date/time icon and other movable icons on menu bar cannot be loaded on startup,but it works if manually loaded

    Strange things happened since my mbp 13' (MD-101) was upgraded to 10.8.4 ----------- time icon, battery icon,and language icon (these icons can be moved when held Command key and drag) cannot be loaded on startup, but they still can be loaded when you get into System Preferences and manually  turn them on, as well as iStat Menus
    However, some other icons didn't bother, things like BetterTouchTool, NewsBar. They are immovable!! I guess it is the key factor that the icon is movable or not making the difference.
    Someone please lend me a helping hand?
    I've attached some pictures in order to make my situation easier to be understood.
    these icons can't be loaded on my loggin in.
    but they can be loaded manually
    however, these icons will be loaded on startup
    I've almost despaired to resolve it . Thanks for your help!

    I have a similar issue. When the computer goes into "Hibernate" mode -- that is, it loses power while sleeping and it writes the contents of it's memory to disk in order to boot into that exact configuration when woken up -- many of my icons when Apple-Tab'ing to another application appear as static. They look like a slightly colorized version of the "static snow" you see when tuning into a station that doesn't exist on a UHF antenna television. Also, icons in Chrome such as web sites "favorite icons" or favicon.ico (the icons that appear in the URL bar and bookmarks) will be scrambled in the same fashion , at first , until the actual icon is loaded.
    Between this, my menu bar and finder icons not displaying, and being unable to boot into safe mode, I'm getting quite ******. I have no idea what the **** is going on with my Macbook Pro. The issue of the scrambled icons actually existed prior to installing an SSD and doing a fresh install of Mountain Lion. I may end up throwing in the towl and re-installing the operating system but I'm sure SOMETHING will happen. It seems the latest update, 10.8.2, is absolute garbage.
    What the ****, Apple? And I really don't want to take the computer to the morons at the Apple Store. They are not "geniuses" by any measure.

  • How do I stop Adobe Bridge, Excel, Word and Adobe Photo Downloader from loading at startup under Mac OS 10.7.1, they are not loaded in login items.

    How do I stop Adobe Bridge, Excel, Word and Adobe Photo Downloader from loading at startup under Mac OS 10.7.1, they are not loaded in login items.

    When you shut down this window appears.
    Uncheck the reopen box and it should stop this from happening

  • Load on Startup of my Servlet

    Hi All,
    I have a Java Program which needs to run whenever the Oracle Application Server's OC4J is started. For this, I can write a Servlet and its init() method, I can instantiate the Java Program and it will start running. Now I need to tell Oracle Application Server to load this servlet on start up. Can you please let me know the configuration files that needs to be changed along with the details of the changes. The Java program I have to start is a background process. There is no browser interaction. Also, I dont have any web application ( ear ) for that Java program. Please advise.
    Regards
    Ramesh

    Refer this:
    http://download.oracle.com/docs/cd/B32110_01/web.1013/b28959/invoke.htm#sthref71
    Thanks
    Shail

  • Servlets and Workspaces

    I have a named workspace which is created at startup of the server
              within a starup class.
              When the startup method is called, I instantiate and put an object
              called FooObject in the workspace.
              Then, in a servlet, called Dispatcher, in the service method, I
              retrieved my named workspace and the object
              FooObject which is in this workspace. At this time, I have a
              ClassCastException.
              To give you more details about my configuration, here is my directory
              configuration:
              weblogic
              |----------- serverclasses
              |------------- startupObject
              |------------- FooObject
              |----------- servletclasses
              |------------- myServlet
              |------------- FooObject (which is exactly
              the same of the serverclasses one)
              Do you have any ideas ? The idea is to instantiate a given object at the
              startup of the web server and to retrieve
              these objects within servlets and JSPs.
              Regards.
              Alexandre Aubry
              Consultant
              Fi System, The Web Agency
              http://www.fisystem.fr
              mailto:[email protected]
              Phone: +33 1 55 04 03 03 Fax: +33 1 55 04 03 04
              

    Do you have Service Pack 6. SP6 is supposed to fix this problem
              "Jon Armstrong" <[email protected]> wrote in message
              news:[email protected]...
              > Mark/All,
              >
              > As a recent member of the list, this is the only reference/post that
              seemed that
              > it might be related to the problem I'm seeing.
              >
              > I have a servlet that runs fine if I register it through the standard WLS
              httpd
              > servlet mechanism:
              >
              > weblogic.httpd.register.XE=appl.X.EServlet
              > weblogic.httpd.servlet.classpath=\
              > /weblogic/myserver/public_html/XE/myclasses.jar;\
              > ... etc.
              >
              > If I attempt to deploy the servlet as a WebApp:
              >
              > weblogic.httpd.webApp.XE=/C:/XE
              >
              > Where: C:/XE contains
              >
              > WEB-INF/web.xml
              > WEB-INF/lib/myclasses.jar (contains: appl.X.EServlet)
              > WEB-INF/lib/...
              > ...etc.
              >
              > I get the following ClassCast Exception when invoking the servlet:
              >
              > Fri Nov 10 15:14:08 EST 2000:<E> <ServletContext-XE> Error casting
              servlet:
              > appl.X.EServlet java.lang.ClassCastException: appl.X.EServlet
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java
              :382)
              >
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.ja
              va:349)
              >
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
              a:338)
              >
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:16
              4)
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :99)
              >
              > at
              >
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:742)
              >
              > at
              >
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:686)
              >
              > at
              >
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              Manager.java:247)
              >
              > at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
              > at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              > Fri Nov 10 15:14:08 EST 2000:<E> <ServletContext-XE> Servlet failed with
              > Exception
              > javax.servlet.ServletException: Servlet class: appl.X.EServlet does not
              > implement javax.servlet.Servlet
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java
              :385)
              >
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.ja
              va:349)
              >
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
              a:338)
              >
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:16
              4)
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :99)
              >
              > at
              >
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:742)
              >
              > at
              >
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:686)
              >
              > at
              >
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              Manager.java:247)
              >
              > at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
              > at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              > This class doesn't <implement> Servlet. It <extends> a class which
              eventually
              > <extends> HttpServlet... which should suffice, much like the typical
              HelloWorld
              > sample servlets.
              >
              > I have to remove the WEB-INF directory and register this as a standard
              httpd
              > servlet to get weblogic to run it properly.
              > This servlet deploys fine with Jakarta-Tomcat as a WebApp and the same
              web.xml
              > file. I can post that, if need be. I assume the classloader is somehow
              > confused.
              >
              > Is this the same problem discussed below? If so, there's no reference to
              the
              > version of WLS that will address this issue.
              >
              > I'm currently using WLS 5.1. <Fri Nov 10 13:48:48 EST 2000:<I>
              <WebLogicServer>
              > ************ WebLogic Server (5.1.0 04/03/2000 17:13:23 #66825)>
              >
              > Has this been fixed or is there a workaround that allows WebApp deployment
              to
              > succeed? I really would like to stay away from as much web/app server
              specific
              > configuration as possible before taking this into the field.
              >
              > Jon
              >
              > Mark Griffith wrote:
              >
              > > Alexandre:
              > >
              > > Although byte for byte the FooObject is the same, according to the VM
              they
              > > are different class. This is because a class's type distinctiveness is
              > > based not only its interfaces,methods,data members etc but ALSO on its
              > > classloader. There is a different classloader for the
              > > serversclasses_FooObject and the servletclasses_FooObject so they are
              > > considered different, so you get a CCE.
              > >
              >
              > etc...
              >
              > >
              > > This will be handled more elegantly in our next major release Spring
              2000,
              > > however note (and prepare by designing accordingly) the solution is to
              allow
              > > the Servlet to interact with interfaces not actual classes and these
              > > interfaces can be stuffed into system/server loaded classes such as
              > > workspaces and httpsessions, thus preventing CCE's.
              > >
              > > Cheers
              > > Mark G
              > >
              > > Alexandre Aubry wrote:
              > >
              > > > I have a named workspace which is created at startup of the server
              > > > within a starup class.
              > > > When the startup method is called, I instantiate and put an object
              > > > called FooObject in the workspace.
              > > >
              > > > Then, in a servlet, called Dispatcher, in the service method, I
              > > > retrieved my named workspace and the object
              > > > FooObject which is in this workspace. At this time, I have a
              > > > ClassCastException.
              > > >
              > > > To give you more details about my configuration, here is my directory
              > > > configuration:
              > > > weblogic
              > > > |----------- serverclasses
              > > > |------------- startupObject
              > > > |------------- FooObject
              > > > |----------- servletclasses
              > > > |------------- myServlet
              > > > |------------- FooObject (which is
              exactly
              > > > the same of the serverclasses one)
              > > >
              > > > Do you have any ideas ? The idea is to instantiate a given object at
              the
              > > > startup of the web server and to retrieve
              > > > these objects within servlets and JSPs.
              > > >
              > > > Regards.
              > > >
              > > > --
              > > > Alexandre Aubry
              > > > Consultant
              > > > Fi System, The Web Agency
              >
              > ---
              > Jon M. Armstrong
              > Senior Systems Consultant
              > Xelus, Inc.
              >
              > EMail: [email protected]
              > Phone: 716-419-3155
              > Fax: 716-248-9199
              >
              > Visit us online: http://www.xelus.com
              >
              >
              

Maybe you are looking for