Order of class loading in a Web Application

Hi,
I have been trying to find out if there is a defined order in which classes contained in WEB-INF/classes
and/or WEB-INF/lib should be loaded.
There doesn't appear to be any mention of class loading order in either the J2EE 1.3 or J2EE 1.4
specifications. That does not mean that there isn't a defined class load order, it just means I haven't found one.
Typical behaviour from servers such as Tomcat (reference implementation of the Servlet Engine) show
that classes in WEB-INF/classes are loaded before classes contained in jars under WEB-INF/lib.
Because there doesn't appear to be a mandated class load order I cannot assume that the same
behaviour holds for all servers, unless someone here knows better of course.
The reason for the question is that relying on the exhibited class load order means we can patch web applications by simply putting the patch under the WEB-INF/classes directory.
If this should not be relied upon then patches will have to be applied directly to the affected jar files,
this is not a problem in itself however it is nice to be able to keep the patches out of the jars for
ease of rolling back patches without having to copy jar files all over the place.
Any insights would be welcome.
Thanks

If you say that it is server specific i don't find
that to be the correct answer b'cozI didn't give an answer, I am looking for one. I gave an example of the behaviour that Tomcat 4.1.x
exhibits, one that we currently make use of for patching web applications. My question was about
whether or not this behaviour can be relied upon.
the class files are depended on the jar files which
need to checked in first before getting loaded b'coz
it should check for dependent files before only while
getting deployed.This is why the class load order is important.
Is the Web Application Classloader going to look in WEB-INF/classes first every time followed
by WEB-INF/lib everytime, is the order undefined, or is it reversed?
More over if you just think of class loading mechanism
of classes folder only then it is loaded in the order
specified in the web.xml file.
in this we specify the order of loading.As far as I know web.xml does not allow you to specify where classes should be loaded from and in
which classpath order, you define which classes should be used for application components.
The only load order you can specify is the load order of servlets on startup.
If you know different I would love to know how you would configure web.xml to specify the classpath order
in which classes are loaded.

Similar Messages

  • Dynamic class reloading in modular web application

    Hi.
    My web application has these requirements:
    A. Functional modularization (like plug-ins). Modules will be simple jars containing application logic classes: dto beans, business logic services, dao (jpa), framework stuff (Struts2), etc...
    B. At runtime and without restarting the application "class loading" must be aware of classes inside new, changed and removed modules.
    C. Some of these jars will be outside the web application folder (WEB-INF/lib), possibly outside the container itself too.
    My question:
    1. Can I achieve all or some of my requirements with a Java web application?
    2. How should I manage the modules?
    3. Do I need some special web container feature (maybe osgi)?
    4. Can I use a custom class loader in my application?
    The architecture objectives are:
    I. Provide scalability.
    II. Efficient development process (independent deployment and no application restart required).
    III. Better production support (no application restart required for changes).
    More on the architecture:
    a). Functional scalability, meaning this that my application may functionally grow up to an indeterminate number of small functional modules.
    b). Modules will be developed, deployed and maintained independently so the application discovers and loads classes on demand.
    c). Avoid a big .war file containing all the small modules because a small change in one module would involves deploying all the other modules (possibly hundreds o even thousands of them) and restarting the application.
    d). Above point involves dynamic class reloading.
    I guess this is addressed by OSGI (looks like heavy to deal with), Jigsaw (still under development) and maybe others. I think the key point is the class loader. I will develop a custom class loader but maybe you have some advice for me before starting to develop.
    Thanks and regards.

    Classes maintained by the container should not be loaded by an application. You want the container to read those classes and react accordingly. Most of those classes are read when the container starts up a container restart will be required. Trying to leverage another container within a container does not sound like it will be worth (if you can get it to work).
    Perhaps you should state the problem that you are trying to solve with these modules so that others may suggest more feasible solutions to achieve your target goals.

  • EP 6.20 Class loader issues with irj application

    Hi All,
    I have a servlet to interface with the SAP UM API.  I had deployed this as a WAR, but the SAP UM cannot be initialised outside of the irj application (SAP Support advised this it is abailable outside the irj application in 6.40).
    As a result, I tried to deploy it within the irj application - I copied my jars to the WEB-INF\lib directory, and modified the WEB-INF\web.xml to include a new servlet and servlet-mapping.
    I also had to copy some other SAP supporting jars into WEB-INF\lib (the XML parser impls).
    This works fine for the UM stuff.  Ideally I'd like to redeploy the irj application so I don't have to hack the files and it would allow me to specify the additional libaries required, however there is now way I've found in the Deploy Tool to do this (you need the WAR of the irj application, or the project file).  So this is problem 1.
    Problem 2.  The next extension included support for user mapping data.
    Using -
    IUserMapping iUserMapping = UMFactory.getUserMapping();
    iUserMapping.getUserMappingData(systemAlias, iUser, mapLogonData);
    I was able to read the mapping data, but this required knowing beforehand, all the system aliases.  With a response from SAP Security, it was suggested
    IUserMappingService iums = (IUserMappingService)PortalRuntime.getRuntimeResources().getService(IUserMappingService.KEY);
    IUserMappingData mappingData = iums.getMappingData (systemAlias, iUser);
    be used to obtain mapping data, and that
    com.sap.portal.pcm.system.ISystems sysSrv = (ISystems)PortalRuntime.getRuntimeResources().getService(ISystems.KEY);
    String[] systemAliases = sysSrv.getAliases();
    be used to obtain the system aliases.
    The problem is with the class loader.  If I copy the jars with the classes for the IUserMappingService and the ISystems, to the irj WEB-INF\lib I cause a class def not found with other EP6 applications.  This is also the case when I add them to the JVM classpath (I know this is bad - but it was a last resort!).
    Hoping someone can help me redeploy irj with my application that will resolve problem 2! If not, maybe some advice on problem 2?
    Cheers,
    Scott...

    Hi Scott,
    THis isnt an answer to ur Question, but could u tell me which jar files are needed for the packages:
    com.sap.portal.pcm.system.ISystems
    com.sap.portal.pcm.system.ISystem
    and under which path I coul dfind them.
    Thnx
    Regards
    Meesum.

  • Getting class cast exception in Web application.

    I have a web application deployed using standard specs for deployment. I
              have and web-inf directory with a web.xml file set up. All the servlet
              classes are in the classes sub-directory of web-inf.
              If I deploy this application using the Tomcat application server,
              everything works as expected. When I deploy this application using the
              Weblogic software, I can get to the initial page, put once I select a
              link that calls the main servlet, I get a classcast exception. Both the
              Tomcat and Weblogic software point to the same directory for the
              application.
              I double checked and made sure that no other instances of my servlet
              classes exist anywhere else in the class path.
              Any one have any thoughts or suggestions. I am perplexed that this web
              app runs fine under the Tomcat software and yet...
              Thanks.
              Paul Garduno
              

    Thanks for your reply. I am not using any EJBs. From what I have
              gathered since writing my message, this may be the "dreaded" class cast
              exception (although I don't know why since it runs under Tomcat).
              Basically, the initial page is displayed. When you select the SEARCH
              button (for example), the request goes to a servlet which puts a vector
              of custom classes into a session parameter. The request is then
              forwarded to the JSP page which uses the information in the classes to
              help build some information on the page. The first line in the JSP is
              processed (a simple output line to the system console) and then the
              classcast exception occurs.
              According to the info that I have seen, this shouldn't happen since I am
              not changing either the servlet or JSP files which would mean that
              nothing should be re-compiled.
              I have a call into tech support. I will post their answer and copy you
              on the message.
              Thanks.
              Paul
              Cameron Purdy wrote:
              >
              > Are you using EJBs hosted on the same instance of WebLogic? If so, delete
              > the home/remote interfaces from your web deployment. Otherwise, post the
              > exception listing ....
              >
              > Cameron Purdy, LiveWater
              >
              > "Paul Garduno" <[email protected]> wrote in message
              > news:[email protected]...
              > > I have a web application deployed using standard specs for deployment. I
              > > have and web-inf directory with a web.xml file set up. All the servlet
              > > classes are in the classes sub-directory of web-inf.
              > >
              > > If I deploy this application using the Tomcat application server,
              > > everything works as expected. When I deploy this application using the
              > > Weblogic software, I can get to the initial page, put once I select a
              > > link that calls the main servlet, I get a classcast exception. Both the
              > > Tomcat and Weblogic software point to the same directory for the
              > > application.
              > >
              > > I double checked and made sure that no other instances of my servlet
              > > classes exist anywhere else in the class path.
              > >
              > > Any one have any thoughts or suggestions. I am perplexed that this web
              > > app runs fine under the Tomcat software and yet...
              > >
              > > Thanks.
              > >
              > > Paul Garduno
              

  • Using a VB Class from a Java Web Application

    Hi,
    I need to instance a VB class, and then to invoke their methods, from a java web apllication. The code is:
    Set object = CreateObject("AS2.OBJECTS")
    If object.PutName(sCadenaError, sEntidad) Then
    Array1 = object.getData(sCadenaError, iEntorno, False)
    End if
    "AS2" is the VB dll library. "OBJECTS" is the class to instance. And "PutName" and "getData" are the methods that the web application has to call.
    Can I instance the class from Java, and use the methods with the same data types? What steps have I to do in JNI?
    Thanks in advance,
    Mary

    You are right, I guess my question is a good candidate for RTFM!
    I should have searched also on help.ondemand.com
    I just looked into SDN and ui5 sdk help.
    Thanks for your help
    Regards
    Vincenzo

  • Beans: class not found in web application of my own

    i am using tomcat 4.0 & j2sdk1.4.0
    i have path like
    c:\myjspapp\ourproject\WEB-INF\classes
    my .jsp,.html,.java file r in /ourproject folder
    i dont want to store my files in /webapps folder of tomcat
    i want to store them in folder as mentioned above
    i am displaying .jsp file contents in .html file in frames
    my .jsp file name is:ourmenu10.jsp
    my .html file name is:webmenu10.html
    my .java file name is:menuCreate.java
    i am using .java file as beans in my .jsp file
    i am getting error while accessing class file
    error trace is:::
    Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occurred at line: 9 in the jsp file: /ourproject/ourmenu10.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\jigishatest\ourproject\ourmenu10$jsp.java:72: Class org.apache.jsp.menuCreate not found.
    menuCreate createmenu = null;
    ^
    An error occurred at line: 9 in the jsp file: /ourproject/ourmenu10.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\jigishatest\ourproject\ourmenu10$jsp.java:75: Class org.apache.jsp.menuCreate not found.
    createmenu= (menuCreate)
    ^
    An error occurred at line: 9 in the jsp file: /ourproject/ourmenu10.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\jigishatest\ourproject\ourmenu10$jsp.java:80: Class org.apache.jsp.menuCreate not found.
    createmenu = (menuCreate) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "menuCreate");
    ^
    3 errors, 1 warning
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
         at java.lang.Thread.run(Thread.java:536)
    Please help me as early as possible
    thanks in advance

    Okay, first things first,
    You did put the class into a package? good.
    You did compile the class, so we no longer care about the .java file, only the .class file, right?
    You read documentation on deploying applications in tomcat? If not, do a google search.
    As was started earlier, keep things under Tomcat/webapps/yourapp at least until you get things up and working. Then worry about changing paths, mapped drives, and all those other things. Do this one step at a time and you will get there. Try to do too much at once and you will get lost and frustrated.
    If you find the documetnation about deplying your applications in tomcat, you will also find info on how to change the absolute path of the context and/or host
    A good place to start is: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/index.html

  • How to load objects in web application context during oc4j startup?

    Hi
    How I can put some objects in application context during oc4j application startup?
    I'm using oracle as10g j2ee and web cache edition.
    Thanks

    An idea would be to write your own OC4JStartup implementing class and have this thing create the objects you want and bind them to JNDI.

  • Web load balancer for web application server

    Hi.
    We are planning to very large system (6,000 users) and They will use BSP application.
    So, We need web load balancing method.
    I think We have two choice : L4 switch or SAP Web Dispacther.
    Is there any recommendation for web load balancing method ?
    Which one is better for large user load balancing ?
    Regards, Arnold.

    Another good advantage of Web dispatcher is web based monitoring, SSL config etc.
    http://help.sap.com/saphelp_erp2004/helpdata/en/05/ac923fa5e93c17e10000000a114084/frameset.htm
    Regards,
    siddhesh

  • Web Application and Custom JavaMail Providers

    We have a web application that uses custom JavaMail Providers on Weblogic 7.0.
    The structure of the WAR file is as follows:
    |-WEB-INF
    |-lib
    |-activation.jar
    |-mail.jar (as provided by Sun for JavaMail 1.2)
    |-custommail.jar (custom JavaMail providers)
    |-... (other jars for web application).
    Now the JavaMail Session object cannot find the custom providers as it appears the Web Container is loading the JavaMail classes (Session) from the WebLogic.jar instead of mail.jar from the web application's lib directory.
    How can I configure the web application to load classes from the mail.jar in the applications lib directory?.
    This configuration works on Tomcat 4.0.4.
    Vikash

    This is standard behavior in WebLogic - the child classloader (the
    classloader for the web applicaiton) will always
    delegate to the parent classloader (the system classloader), and so it will
    alwyas find the ones included in weblogic.jar
    first.
    You can get around this in two ways:
    a) Put the classes in weblogic's classpath (Before weblogic.jar)
    b) You can set the "Prefer Web-Inf Classes" attribute of a web application
    (see Admin console).
    In this case the web application classloader will not delegate, but
    always look locally first.
    Just be careful in this scenario not to pass an object created by the
    web applicatino classloader to say
    an EJB. ie. don't pass a mail session object, as then you'll get a
    classcastexception.
    Regards,
    Jon

  • Accessing web application JAR files from applet

    I've got an applet which is part of a web application.
    All the web application JARs are in the webapps/myappl/WEB-INF/lib directory, and I
    can't seem to place anything in that directory on the archive attribute of <OBJECT> tag.
    I'm running into trouble because I'm sending objects from the servlet to the applet and keep getting classnot found during deserialization because I've missed some jar file on the archive attribute. I've had to copy lots of jar files up to where the codebase in the HTML file is to make this run. My question is this.
    Is it better to just change the tomcat security policy file (catalina.policy in tomcat conf directory) so that the JARs are directly accessible and I don't have to copy them from WEB-INF/lib???? Has anyone done this before? What would the line look like?
    I'm assuming that I have to follow the instructions (THAT I DON'T UNDERSTAND)
    at the bottom of the policy file. Can someone help me out here????
    should I have something like
    grant codeBase "file:${catalina.home}/webapps/myappl/WEB-INF/classes/-"
    { permission java.security.AllPermission; };
    grant codeBase "file:${catalina.home}/webapps/myappl/WEB-INF/lib/-"
    { permission java.security.AllPermission; };
    Will this allow me to place references to jar files (and the classes directory) in the archive attribute, such as
    <OBJECT .....  >
        <param name="archive" value="../WEB-INF/lib/applet.jar,../WEB-INF/lib/someapp.jar,../WEB-INF/classes" />trailer for catalina.policy is
    // You can assign additional permissions to particular web applications by
    // adding additional "grant" entries here, based on the code base for that
    // application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
    // Different permissions can be granted to JSP pages, classes loaded from
    // the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
    // directory, or even to individual jar files in the /WEB-INF/lib/ directory.
    // For instance, assume that the standard "examples" application
    // included a JDBC driver that needed to establish a network connection to the
    // corresponding database and used the scrape taglib to get the weather from
    // the NOAA web server.  You might create a "grant" entries like this:
    // The permissions granted to the context root directory apply to JSP pages.
    // grant codeBase "file:${catalina.home}/webapps/examples/-" {
    //   permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
    //   permission java.net.SocketPermission "*.noaa.gov:80", "connect";
    // The permissions granted to the context WEB-INF/classes directory
    // grant codeBase "file:${catalina.home}/webapps/examples/WEB-INF/classes/-" {
    // The permission granted to your JDBC driver
    // grant codeBase "file:${catalina.home}/webapps/examples/WEB-INF/lib/driver.jar" {
    //   permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
    // The permission granted to the scrape taglib
    // grant codeBase "file:${catalina.home}/webapps/examples/WEB-INF/lib/scrape.jar" {
    //   permission java.net.SocketPermission "*.noaa.gov:80", "connect";
    // };

    Thank you for your reply.
    As I mentioned in my first post I had seen a couple of posts mentioning ServletContext before, but dismissed them as I am not using any servlets of my own. However, since you showed me exactly how it was used I realised I could probably just use a dummy servlet to get this information.
    The following page suggests a couple of techniques for doing just this.
    http://www.jguru.com/forums/view.jsp?EID=1087411
    So I think that's me sorted, cheers.

  • Sessions across Web Applications (WARs)

    I've heard that you can't share session information (http session) across web applications or war files in the j2ee framework. However, I haven't seen any proof of this? I'm struggling to find information telling that I can't do this. Can someone elaborate a bit?
    Thanks.

    Hi !
    It is TOTALLY WRONG that someone wrote here that a
    separate JVM is started for each web-app! No way. Run
    any appserver and do a 'ps -ef|grep java' and I bet
    you will see only one forever :-). Correct
    Steve, it is the classloader hierarchy in all
    appservers that prevents you from sharing sessions (i
    would say classes loaded by various web-apps). There
    is something called a web-app / WAR classloader, which
    is 4th in the hierarchy of JVm classloader hierarchy.
    Since all your web-app loaded classes are loaded by
    this classloader and since each web-app has a "peer"
    classloader at same level for its own web-app, you
    will never be able to share across web-apps. Incorrect, just because you can have separate classloaders for separate web applications does not mean that those web applications cannot share instances.
    It is also possible to have classes which are globally available to ALL web applications which are loaded as part of the servlet container. Tomcat versions 4+ have a common area where classes can be made available. These classes are not loaded within the Web Application classloader at all.
    Not only that but it is possible to configure web application contexts such that they can also share things like sessions. This feature is definitely part of the Apache Tomcat release and as this is taken by Sun to be the Reference Implementation of the Servlet Container I would assume that is also part of the J2EE Standard as well.
    YOu can always use the DB stuff that other genltmen
    has already suggested.

  • Integrated WL/Jdeveloper class loading issue

    Hello,
    I am trying to run a deployed project , getting into this class loading issue. Any idea?
    javax.security.auth.login.LoginException: java.lang.LinkageError: loader constraint violation: when resolving interface method "com.scat.util.identity.UserFactory.lookup(Ljava/lang/String;)Lcom/scat/domain/identity/User;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, com/scat/auth/authentication/login/UserLoginModule, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for resolved class, com/scatl/util/identity/UserFactory, have different Class objects for the type com/scat/domain/identity/User used in the signature
    Thanks
    Ram

    How many times are you loading the com/scat/domain/identity/User type?
    Is this in the system classloader and the application? and are you using class loading filtering in the application, for example,
    in weblogic.xml - prefer-web-inf-classes?

  • Web application can not find apphome /WEB-INF/lib/*.jar files in classpath?

    I need to add the jsse jars to one of my servlets. I do not want the jsse in the server classpath(jvm12.conf) however, because this screws with some credit card jar I am using. Can't I have a per application classpath with the /WEB-INF/lib directory? This is iWS 6.0.

    In iWS 6.0, the context information such as a context path of the web application and other properties are defined in web-apps.xml file.
    'class-loader' element in web-apps.xml file can be be used to specify the class path to a web application and customize how the application is serviced.
    Refer to example web-apps.xml file in Prog. guide to Servlets for more details.
    http://docs.iplanet.com/docs/manuals/enterprise/50/servlets/war.htm#33557

  • Web Application - Data caching of enterprise data

    Sorry in advance if this is off-topic but I can't find anywhere else to post this type of question.
    I am looking for information/suggestions such as books, technology or design methodology for my enterprise web applications. These sites are currently up and functional using only JSP, servlets and regular Java classes stored in a web application session to provide data caching and access. We are using Weblogic Server 6.1 running on an AIX Unix system at this time. I'm not sure that this is the best design architecture as our web sessions are getting too large but I can't think of any other Java technology to use and I need some help. Here's an overview of our environment and our needs.
    Our core data is held in a mainframe based IMS system. Some DB2 is also used. Access to this data is through IMS COBOL transactions which we can execute with IMS Connect. We also use some JDBC to get to the DB2 tables directly where available.
    Some overall application data is cached when the web application is deployed. We use singleton classes which are created and refreshed at deployment and they then refresh themselves from the sources every 24 hours.
    Each time a user logs in we execute several IMS transactions and JDBC calls to cache user specific data in regular Java classes which are then simply placed in the users web session where we access them from JSP, servlets and other Java classes. The fields in these Java classes range from any type of primitive field to TreeMaps of other Java classes. As the data is cached it is sorted and other fields are calculated and stored in these classes. As the user progresses through the system we then may have to do several other IMS transaction and JDBC calls to collect other types of data. All of this is then also added to the users session. Most of this in inquiry. We do allow transactions but those are built from user input and data already cached and are then we just execute the IMS transactions with the input.
    As our application has grown these Java classes have gotten larger and larger. And since these are simply stored in server memory in the web sessions then these are also getting huge. I'm concerned that this is not the best way for this application to be architected. Is there something else we should be doign? I simply don't understand how Entity Java Beans could be used but then again I don't know much about them. I wouldn't think that caching the data to a local database and accessing it from there would be any more efficient and would probably just slow down the system from all the I/O.
    Any help or direction would be greatly appreciated.

    The best book you can buy is 'Professional Java Server Programming, j2ee edition' by Wrox. It is by far the best reference I've used. Another quick reference consideration might be the j2ee book provided by codenotes... its quick and to the point.

  • InitialContext Class Loader

    Hi all,
    We are experiencing a strange behaviour of the Application Class Loader. Our main issue is that if we deploy 2 applications using our code, the first application is okay, and the second application fails its loading. During the loading, we instantiate a customized InitialContextFactory (two times at all: one time per application). As a result, we have a ClassCastException in our customized InitialContext. Above a more detailed explanation of what happen. To sum up, we think that our InitialContextFactory is loaded by a master class loader, only one time for the 2 applications, and that the second application reaches the customized InitialContextFactory instantiated for the first application, so the classes loaded for the second application are not compatible.
    Details:
    - Each Application create a new InitialContext with the parameter "java.naming.factory.initial" equals to "com.test.CustomInitialContextFactory".
    - In the class com.test.CustomInitialContextFactory we access to other code from our application, which are passed to the context factory by the environment hashtable. In the method public javax.naming.Context getInitialContext(java.util.Hashtable env), we get some parameters from the env parameter like that: CustomObject o = (CustomObject)env.get("com.test.customObject");
    When the first application launches, it works very well.
    When the second application launches, it fails with a ClassCastException on the class com.test.CustomObject. We think that the class com.test.CustomObject is not loaded by the good class loader so it throws a ClassCastException.
    Thank you for your help

    We have found how the JNDI layer builds the specified context factory:
              ClassLoader cl = (ClassLoader) AccessController.doPrivileged(
                   new PrivilegedAction() {
                   public Object run() {
                        return Thread.currentThread().getContextClassLoader();
    But OC4J has specific Thread ClassLoader: this is the cause of all our problem. So there is a solution: create a specific context factory which calls the good class loader to load the context factory.
    Bye

Maybe you are looking for

  • MacBook Pro SMS Not Working

    Lately on my MacBook Pro Retina Display my SMS is not working. It was working fine n smoothly when iOS 8 came out, but think between a month or two it hasn't been working properly. I can't recieve or send regular SMS. How could i fix this?  *Every so

  • Slideshow Madness

    I’m having such troubles exporting slideshows that I may go insane. I want to be able to do two things: 1. Export a slideshow to a file that I can burn on a CD or DVD and give to people to play on both Macs and PC’s. I would like this slideshow to ha

  • Confusing behaviour with layout managers.

    It appears that this page has become my favorite web page, having in mind all the questions I come up with. In the following page: http://java.sun.com/docs/books/tutorial/uiswing/layout/none.html a code example is given on how to use a null layout ma

  • E61 - "network not found" in Hotspot area?

    Hi, yesterday I was in a restaurant that had a sign saying "Free wireless Internet access". So I tried to connect using my E61. When I selected "search for WLAN" as the AP, it was found and displayed all right. But when I selected it, I got the messa

  • Collision related "urgent"

    I'm new to Java3D. I'm going to make the object move by a interpolator after collision. However, when run the code below, it always gives an exception: javax.media.j3d.RestrictedAccessException: Group: only a BranchGroup node may be added at javax.me