Problems reloading  class

Hi,
I'm working with two spark solaris 9 servers in cluster running sun one 6.1 web servers. The servelets/jsp applications have problems reloading a changed class. The java applications are in a storage engine connected by nfs to the servers. We Ussually work in the master server that it's similar to the slave in its java and webserver configuration. there isn't any difference beetwen the servers in the java applications enviroment. But always we compile in the master server. The changed class loads correctly and quickly (few seconds) in the master server but the slave fails to load it. For the second server we must reload all the application trought the administration server, "load configuration files".
In the server log file i can see the following lines:
WebModule[dataj_dev]: WEB2680: Exception starting filter ControllerFilter java.lang.ClassFormatError: com/huji/data/system/RegularDataSystem (Extra bytes at the end of the class file) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:537) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1717) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:983) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1431) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1301) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at com.huji.data.ControllerFilter.class$(ControllerFilter.java:34) at com.huji.data.ControllerFilter.<clinit>(ControllerFilter.java:34) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:308) at java.lang.Class.newInstance(Class.java:261) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:261) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:322) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3271) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3747) at com.iplanet.ias.web.WebModule.start(WebModule.java:251) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardHost.start(StandardHost.java:652) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355) at org.apache.catalina.startup.Embedded.start(Embedded.java:995) at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431) at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500) at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161) [03/Sep/2007:14:41:13] failure (11314): WebModule[dataj_dev]: WEB2705: Context startup failed due to previous errors
what's wrong? why it happens?

The servers don't share the same instance dir, each webserver is locally installed. They only share the content directory: java classes , html files and cgi programs. Anyway may be that the secondary server has problem loading the class from the storage. I changed the parameter dynamicreloadinterval to make a bigest delay in this server. Before this change almost in the same time both the servers tryed to load the same class. I didn't test , i hope it works.
The issue is that if this true, i should see the same fenomena with other files types, not only with classes and it doesn't happen.

Similar Messages

  • Having problems reloading iTunes.

    Having problems reloading iTunes. Selecting 'download' brings up the 'save file' box then the process skips to the 'Thank you for downloading' screen.  Running windows 7. What do i do ?

    hiya!
    also check to make sure that the .itl library file itself has not been set to "read only":
    What are the iTunes Library files?
    love, b (channelling Buegie)

  • Reloading classes in WebLogic Server 6.1

    Hello all,
    We are developing applications for wlserver6.1 on JDK 1.3 and the development
    proccess is slow due to the fact that every time that we modify a class (not servlets
    or JSP´s) we have to restart the server o redeploy the application in order to
    reload the new version of the class. I understand that this is because the JVM
    does not support Hot Code Replace and the Server classloaders do not check for
    changes in classes only in Servlets (we are running the server in development
    mode).
    Is there a work around for this? A custom classloader perhaps? Third party tools?
    All replies welcome
    Thanks
    Max

    Thanks, that's very helpful.
    In 7.0/8.1, you could use weblogic.Deployer to redeploy just the webapp
    module without bouncing the rest of the app. In your common case of
    changing classes which are only in the webapp, this would be very fast.
    You might save yourself some time by just developing on 8.1. java
    weblogic.Deployer -examples will show you how to redeploy just the
    webapp. Assuming your app didn't use any new 8.1 features, then it
    should run fine on 6.1 as well.
    I don't honestly remember whether 6.1 offered this functionality or not.
    weblogic.Deployer was not added until 7.0 so you would have to check
    the weblogic.deploy command.
    -- Rob
    Max wrote:
    To answer your questions...
    1) Hardware: Pentium II, 512Mb RAM
    2) Redeploy: From console by unmarking the deployed check for the webapp box applying
    the changes and remarking the deployed checkbox. For this to work i must put all
    my classes in web-inf i would prefer it if i could put my classes elsewhere on
    the classpath. If there are other better ways to redeploy i would be gratefull
    for any advice, the applications directory and weblogic.Deployer sound interesting,
    is it worth me looking at these possibilities?
    3) The application consists of:
    - 1 web application with around 50 Servlets and 2500 JSPs
    - 45 EJB´s
    Unfortunately the application is not mine, i´ve been contracted to add a new module
    to it and do not have control over the applications architecture. The elements
    that i want to reload are typically Java classes that at the moment are inside
    the web app. Ideally i´d like to be able to put them anywhere on the classpath
    and reload them.
    Hope that this info is of some interest to you, should need anything else let
    me know
    max
    Rob Woollen <[email protected]> wrote:
    Yes, 4 minutes is too long.
    I actually own this problem for our next release so I'm pretty
    interested to hear more about your situation.
    In particular:
    1) What hardware is this on?
    2) How are you redeploying the application?
    a) through the console
    b) through the applications directory
    c) weblogic.Deployer
    d) wldeploy ant task
    e) in your IDE (if so, which one?)
    3) Can you give me more details on your application size? (How many
    EJBs/webapps etc)
    4) What are you typically changing during development? java classes,
    ejb implementations, ejb interfaces, web content etc...
    If you (or anyone else) wants to give this information privately, you
    could email me by removing the please.noemail.com and replacing it with
    bea.com
    Anyway, in the current world, I usually suggest that people consider
    breaking their app up into smaller sub-applications which will redeploy
    faster. It's a bit of work and in no way ideal, but I don't have any
    better answers, yet...
    -- Rob
    Max wrote:
    It takes about 4 minutes to redeploy which is more or less the sameas restarting
    the server. Its the only application deployed on the server but asapplications
    go i think that its quite large.
    max
    Rob Woollen <[email protected]> wrote:
    You should almost never need to restart a server during development.
    However, you will need to redeploy your application to pick-up class
    changes.
    How slow is redeploying your application?
    -- Rob
    Max wrote:
    Hello all,
    We are developing applications for wlserver6.1 on JDK 1.3 and the
    development
    proccess is slow due to the fact that every time that we modify aclass
    (not servlets
    or JSP´s) we have to restart the server o redeploy the applicationin order to
    reload the new version of the class. I understand that this is becausethe JVM
    does not support Hot Code Replace and the Server classloaders do notcheck for
    changes in classes only in Servlets (we are running the server in
    development
    mode).
    Is there a work around for this? A custom classloader perhaps? Thirdparty tools?
    All replies welcome
    Thanks
    Max

  • How to reload classes on redeploy

    I want to reload the classes of an EJB every time I redeploy it without restart the server (I use JBoss).

    well actually I use two different versions of JBoss.
    - At work I use Jboss 4.2.2GA, using hot deployment (files are deployed to a directory app.ear in stead of deploying an actual ear file). For this type of deployment to work, the application.xml file MUST be modified before the server will see that the application is changed
    - at home I use JBoss 5.01GA and just deploy the ear file from netbeans, which works perfectly.
    From what you say, I gather you are deploying just the EJB jar, not an EAR. Perhaps you should try it like that.
    Also: I believe there were many problems with JBoss 5.0 that were fixed in JBoss 5.01, so I would verify the version that your host is running.

  • Reloading classes repeatedly

    My problem is to reload a class with the same name but
    with different definitions. This is necessary if you
    hove long running servers and want to replace with new class definition
    without restarting Java Runtime. Old class definition
    hopefully garbage collected afterwards. Anyone has information on this?

    Read about class loaders and take a look if you have the time for it at the source code for Tomcat or Jetty, which are two small servlet containers. They use a class loader hierarchy to enable run-time reloading.
    There's a little bit in here:
    http://java.sun.com/products/jndi/tutorial/beyond/misc/classloader.html
    There some more in the security specs:
    http://java.sun.com/j2se/1.4.2/docs/guide/security/spec/security-spec.doc5.html
    This is actuall a product, but uses the same technology:
    http://docs.sun.com/source/816-5777-10/jpgapxre.htm
    A javaworld article:
    http://www.javaworld.com/javaworld/javaqa/2003-06/01-qa-0606-load.html
    An easy (and not so correct) way to look at the class loader is that it performs a chroot combined with the rebinding of several folders of the original filesystem.

  • Reloading classes on the fly?

    Is there a convenient way to reload changed classes without shutting down and restarting the cluster nodes? I would like to just do cache.clear() then reload the class files and begin populating the cache with the new objects.
    Thanks,
    Andrew

    That depends on how the classes are loaded.
    You probably used the CLASSPATH environment variable to load classes into classpath.
    In this case you have to restart your nodes in order for new classes to be loaded by the JVM.
    To my knowledge, Coherence does not provide any separate classloading features as, for example, an application server does
    where each deployed application gets its own classloader on top of the system classloader defined by CLASSPATH.
    In order to provide this same functionality you have to write a separate classloader that loads the classes of the types
    you load in the cache. In this case the coherence.jar etcetera are in the system classloader (CLASSPATH), while your
    application classes are loaded by a custom classloader.
    ConfigurablePofContext is ClassLoaderAware (http://download.oracle.com/docs/cd/E18686_01/coh.37/e18683/com/tangosol/io/ClassLoaderAware.html)
    From the ConfigurablePofContext API (http://download.oracle.com/docs/cd/E18686_01/coh.37/e18683/com/tangosol/io/pof/ConfigurablePofContext.html):
    "It is conceivable that the ConfigurablePofContext is loaded by the system ClassLoader (or some other relatively global ClassLoader), while the objects
    deserialized by the PofContext are loaded by an application-specific ClassLoader, such as is typical within an application server. The ConfigurablePofContext
    is designed to load the configuration, the POF-able object classes and the PofSerializer classes from within a specified ClassLoader context, and to pass
    the ClassLoader information on to the PofSerializer instances, just in case they are not loaded from within the application's ClassLoader context.
    In other words, the ConfigurablePofContext, its configuration, the PofSerializer classes and the POF-able classes can all be loaded by the same ClassLoader,
    or they can all be loaded by different ClassLoaders, so long as the configuration, the POF-able classes and the PofSerializer classes can be loaded by either
    the specified ClassLoader or by the ClassLoader that loaded the ConfigurablePofContext itself."
    The problem is (with most classloading) how to unload the classes that are referenced in a runtime environment. This usually means, in the case of an
    application server, to delete a certain deployment and redeploy again.
    Hope it makes a little sense.
    An example of a custom classloader and same more background on classloading can be found here: http://middlewaremagic.com/weblogic/?p=6725

  • How to reload class or redifince class in spring

    hi buddy.
    i have a problem when load beans in spring
    <bean id="load" class="com.example.Load" init-method="init"></bean>
    <bean id="work" class= "com.example.Work" depends-on="load"></bean>the Load#init will use ASM to write the byteCode to the Work.class
    However, when spring starts, the Work.class loaded in the spring container is not the new one.
    so what should do??
    i don't know how to change the bean 's class in spring..

    Hi shiva
    Thanks for your help,
    Can you check this coding and revert me back ASAP Please.
    REPORT BDS_GOS_CONNECTION.
    DATA : logical_system LIKE BAPIBDS01-log_system.
           CLASSNAME LIKE BAPIBDS01-CLASSNAME
           OBJKEY LIKE SWOTOBJID-objkey.
    PARAMETERS: pa_lo_sys BAPIBDS01-log_system,
                pa_class like BPIBDS01-CLASSNAME,
                pa_objkey like swotobjidobjkey.
    AT SELECTION-SCREEN.
    CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'
             EXPORTING
                  bor_id             = bor_id
             IMPORTING
                  logical_sytem      = pa_lo_sys.
                  classname          = pa_class.
                  objkey            = pa_objkey.
             EXCEPTIONS
                  no_objects_found     = 1
                  internal_error       = 2
                  internal_gos_error   = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    clear v_attno1.
    i_object1-typeid = 'BUS2012'.
    i_object1-catid  = 'BO'.
    i_object1-instid = i_yItem-docno.
    call method cl_gos_attachment_query=>count_for_object
       exporting
        is_object = i_object1
        ip_arl    = space
       receiving
        rt_stat   = i_stat1.
    read table i_stat1 into wa_stat1 index 1.
    if sy-subrc eq c_0.
        move wa_stat1-counter to v_attno1.
    endif.             
    CALL METHOD cl_gos_attachment_query=>count_for_object
    EXPORTING
    is_object = object
    ip_arl =    space
    RECEIVING
    rt_stat = lt_stat.
    READ TABLE lt_stat INDEX 1 into ls_stat.
    count = ls_stat-counter.
    *The object has to be a concatenation of your document, like this:
    CONCATENATE object-instid tab-gjahr INTO object-instid.
    ELSE.
    CONCATENATE tab-bukrs tab-belnr tab-gjahr INTO
    object-instid.
    ENDIF.

  • Problem in Class Loading

    I am using Sun implementation of JAXB(jaxb-api.jar) for java-to-xml binding in my web application deployed in the latest version of oracle app server(10g release 3). The web server is loading Oracle implementation of JAXB from the shared archive xml.jar. To direct the web server to load application specific JAXB classes, I have used the property(<web-app-class-loader search-local-classes-first="true" include-war-manifest-class-path="false" />) in the deployment description - orion.xml file. But it does not solve the problem!
    Thanks & regards

    Hi,
    Refer to this link on OC4J's Classloading Framework... http://download-east.oracle.com/docs/cd/B25221_04/web.1013/b14433/classload.htm#sthref58 there are a couple of options you may be able to employ, including overriding the shared library - there is an example of doing this with the Oracle XML parser and Xerces.
    I'm guessing you're on the right track, but you may want to try include-war-manifest-class-path="true". Also, are you sure that you've got your deployment descriptor file defined correctly? Its normally called orion-application.xml, and that particular element isn't defined in the documentation (http://download-east.oracle.com/docs/cd/B25221_04/web.1013/b14433/descriptors.htm#sthref337). You could always try configuring it through the administration console.

  • Problem - different classes in a custom list

    Hi,
    Im making a school project and must use this List-class, written by some of our teachers.
    The problem is, the nodes in the list are type of Objects, and i must store multiple types of classes in the list.
    Storing works fine, but when i want to do something with a specific item in the list, i cannot use it's methods since its now type Object. So everytime I want to use it, i have to cast the Object back to the class it was originally, and there are like 20 of them so thats hell of a lot if-clauses to check which type must i cast it to, and thats in every place that does something with the list.
    Am I being extremely dumb here? Whats the proper way to do this?

    ju551 wrote:
    All the objects are kind of creatures that are inherited from the same abstract class.
    Hmm did i get this right now... So if i make that ancestor class into an interface, I can just cast them everytime to that class and when i call its (abstract) methods it will invoke the real methods in the subclasses?Ah, you don't need an interface in that case. You can just cast all instances to the base class and call the methods that are available there. The methods in the subclasses will be called if they are overridden.
    Kaj

  • Problem in class moving to next method

    thank you to all those who helped me with dealing with time in my Movie class. My other problem is I can't return the charges (val) once a movie is hired. I need my Movie class to output the following when applied to the TestMovie class.
    Movie MOV456 is hired to PC00034
    Movie MOV456 cannot be hired to PC10101
    Movie MOV456 is returned by PC00034
    Total Charges = 16.5
    Movie MOV456 cannot be hired to PC98456
    Movie MOV456 is hired to PC99999
    Movie: MOV456
    Description: The Fellowship of the ring
    Classification: PG
    Status: H
    Rate per day: 5.5
    Hirer=PC99999
    Date/time of hire: 2007/3/19 - 18:30
    Here is my Movie class:
    //CPT12 - Assignment2
    //Written by Suzanne Howarth, 88886, Tutor - Clemens Meyr
    //This is the class of an object orientated programme to manage the hiring of movies
    import java.util.*;
    import java.text.*;
    //Defined instance variables set to private
    public class Movie {
    //Defined constuctor for the Movie class
        public Movie(String movieID, String description, String classification, float dailyRate) {
            ID = movieID;
            this.description = description;
            this.classification = classification;
            status = 'A';
            this.dailyRate = dailyRate;       
             private String ID;
             private String description;
             private String classification;
             private float dailyRate;
             private char status;
             private String hirer;
             private String s;
             private GregorianCalendar dob;
             private GregorianCalendar d;
             private GregorianCalendar dC;
             private double val;
             private long daysHired;
             private long age;
             private boolean valid;
    //Defined accessors for the Movie class
        public String getID() {
            return ID;
        public String getDescription() {
            return description;
        public String getClassification() {
            return classification;
        public float getDailyRate() {
            return dailyRate;
        public char getStatus() {
            return status;
        public boolean hire(String hirerID, GregorianCalendar hirerDOB, GregorianCalendar dateTime) {
            hirer = hirerID;
            dob = hirerDOB;
            d = dateTime;
            boolean valid = false;
        if (status == 'A') {
                if (classification.equals("PG")) {
             valid = true;
            else {
             if (age<18) {
                valid = true;
        if (valid) {
         status = 'H';
        return valid;
        public String getHirer() {
            return hirer;
        public GregorianCalendar getDob() {
            return dob;
        public GregorianCalendar getD() {   
            return d;        
        public String getS() {
            Date date = d.getTime();
            DateFormat df = DateFormat.getDateTimeInstance();
            s = df.format(date);
            return s;
        public long getAge() {
            age = (d.getTimeInMillis() - dob.getTimeInMillis())/(365*24*60*60*1000);
            return age;
        public double hireComplete(GregorianCalendar date_time2) {
            dC = date_time2;
            if ((status == 'H') && (val > 0.0))
                return val;
            else
                return val = -1.0;
        public long getDaysHired() {
            daysHired = (dC.getTimeInMillis() - d.getTimeInMillis())/(24*60*60*1000);
            return daysHired;
        public GregorianCalendar getDC() {
            return dC;
        public double getVal() {
            val = daysHired * dailyRate;       
            return val;
        public void print() {  
            System.out.println("Movie ID - " + ID);
            System.out.println("Movie - " + description);
            System.out.println("Classification - " + classification);
            System.out.println("Status - " + status);
            System.out.println("Daily Rate - " + dailyRate);
            System.out.println("Hirer ID - " + hirer);
            System.out.println("Date and Time of hire - " + s);
    }and here is the MovieTest class:
    import java.util.GregorianCalendar;
    public class TestMovie
       public static void main(String args[])
          Movie mov = new Movie("MOV456", "The Fellowship of the ring", "PG", 5.50f);     
          String hirer1ID = "PC00034";     
          // GregorianCalendar date below correspond to 15th March 2007, 1.30 pm
          GregorianCalendar d1 = new GregorianCalendar(2007,3,15,13,30);
          GregorianCalendar dob1 = new GregorianCalendar(1989,01,22,15,15);
          if (mov.hire(hirer1ID, dob1, d1) == true)
             System.out.println("Movie " + mov.getID() + " is hired to " + mov.getHirer());  
          else
             System.out.println("Movie " + mov.getID() + " could not be hired to " + hirer1ID);
          // Another attempt to hire the movie (after the movie has already been hired)
          GregorianCalendar d2 = new GregorianCalendar(2007,3,15,15,30);
          GregorianCalendar dob2 = new GregorianCalendar(1989,12,20,10,12);
          String hirer2ID = "PC10101";
          if (mov.hire(hirer2ID, dob2, d2) == true)
             System.out.println("Movie " + mov.getID() + " is hired to " + mov.getHirer());  
          else
             System.out.println("Movie " + mov.getID() + " cannot be hired to " + hirer2ID);
          // Completing the hiring of the movie
          GregorianCalendar d1C = new GregorianCalendar(2007,3,18,10,30);
          double val = mov.hireComplete(d1C);
          if ( val > 0.0 )
             System.out.println("Movie " + mov.getID() + " is returned by " + mov.getHirer());  
             System.out.println("Total Charges = " + val);  
          Another attempt to hire the movie (after earlier hire is completed,
          but with hirer too young to hire a PG rated movie)
          GregorianCalendar d3 = new GregorianCalendar(2007,3,19,16,30);
          GregorianCalendar dob3 = new GregorianCalendar(1995,12,20,10,12);
          String hirer3ID = "PC98456";
          if (mov.hire(hirer3ID, dob3, d3) == true)
             System.out.println("Movie " + mov.getID() + " is hired to " + mov.getHirer());  
          else
             System.out.println("Movie " + mov.getID() + " cannot be hired to " + hirer3ID);
          // Hiring the movie with the correct age again        
          GregorianCalendar d4 = new GregorianCalendar(2007,3,19,18,30);
          GregorianCalendar dob4 = new GregorianCalendar(1985,12,20,10,12);
          String hirer4ID = "PC99999";
          if (mov.hire(hirer4ID, dob4, d4) == true)
             System.out.println("Movie " + mov.getID() + " is hired to " + mov.getHirer());  
          else
             System.out.println("Movie " + mov.getID() + " cannot be hired to " + hirer4ID);  
          // Printing the details of Movie object referred by mov  
          mov.print();          
    }The problem must be with how I coded my Movie class. It just won't output that the movie has been returned and the total charges.
    Any help would be very much appreciated.

    Do u mean to put it like this:
    //CPT12 - Assignment2
    //Written by Suzanne Howarth, 88886, Tutor - Clemens Meyr
    //This is the class of an object orientated programme to manage the hiring of movies
    import java.util.*;
    import java.text.*;
    //Defined instance variables set to private
    public class Movie {
    //Defined constuctor for the Movie class
        public Movie(String movieID, String description, String classification, float dailyRate) {
            ID = movieID;
            this.description = description;
            this.classification = classification;
            status = 'A';
            this.dailyRate = dailyRate;       
             private String ID;
             private String description;
             private String classification;
             private float dailyRate;
             private char status;
             private String hirer;
             private String s;
             private GregorianCalendar dob;
             private GregorianCalendar d;
             private GregorianCalendar dC;
             private double val;
             private long daysHired;
             private long age;
             private boolean valid;
    //Defined accessors for the Movie class
        public String getID() {
            return ID;
        public String getDescription() {
            return description;
        public String getClassification() {
            return classification;
        public float getDailyRate() {
            return dailyRate;
        public char getStatus() {
            return status;
        public boolean hire(String hirerID, GregorianCalendar hirerDOB, GregorianCalendar dateTime) {
            hirer = hirerID;
            dob = hirerDOB;
            d = dateTime;
            boolean valid = false;
        if (status == 'A') {
                if (classification.equals("PG")) {
             valid = true;
            else {
             if (age<18) {
                valid = true;
        if (valid) {
         status = 'H';
        return valid;
        public String getHirer() {
            return hirer;
        public GregorianCalendar getDob() {
            return dob;
        public GregorianCalendar getD() {   
            return d;        
        public String getS() {
            SimpleDateFormat formatter = new SimpleDateFormat("d");
            GregorianCalendar d = new GregorianCalendar();
            s = formatter.format(d.getTime());
            return s;
        public long getAge() {
            age = (d.getTimeInMillis() - dob.getTimeInMillis())/(365*24*60*60*1000);
            return age;
        public double hireComplete(GregorianCalendar date_time2) {
            dC = date_time2;
            if ((status == 'H') && (val > 0.0)) {
                val = daysHired * dailyRate;
                return val;
            else
                return val = -1.0;
        public long getDaysHired() {
            daysHired = (dC.getTimeInMillis() - d.getTimeInMillis())/(24*60*60*1000);
            return daysHired;
        public GregorianCalendar getDC() {
            return dC;
        public double getVal() {            
            return val;
        public void print() {  
            System.out.println("Movie ID - " + ID);
            System.out.println("Movie - " + description);
            System.out.println("Classification - " + classification);
            System.out.println("Status - " + status);
            System.out.println("Daily Rate - " + dailyRate);
            System.out.println("Hirer ID - " + hirer);
            System.out.println("Date and Time of hire - " + s);
    }I must be wrong because I am still not getting the desired output.

  • XML mapping inheritance problem; missing class indicator field

    Hi!
    I am currently working on a project which involves mapping a large domain model on a XSD schema. For this we use Toplink 10.1.3.1 which is mostly great. But now I have a problem while wanting to use class inheritance.
    In my XSD I have the following defined
    <xs:complexType name="Traject">
         <xs:sequence>
              <xs:element name="SoortTraject" type="SoortTraject"/>
         </xs:sequence>
    </xs:complexType>
    <xs:complexType name="SpecialTraject">
         <xs:complexContent>
              <xs:extension base="Traject">
                   <xs:sequence>
                                 [some elements] 
                   </xs:sequence>
              </xs:extension>
         </xs:complexContent>
    </xs:complexType>My XML is an implementation of this XSD and looks like this
    <Trajecten>
            <Traject xsi:type="SpecialTraject">
                     [implementation of the elements]
             </Traject>
    </Trajecten>My domain model corresponts to the XSD, so there is a Traject object and an inherited SpecialTraject object.
    In the mapping I used the Advanced properties->inheritance on both descriptors telling the Traject descriptor that it was the 'Root Parent Descriptor' ('Use class indicator field' -> 'use XML Schema Type attribute', 'Use class indicator dictionary') and the SpecialTraject what it Child Descriptor was ('Traject').
    When I test my mapping it always results in the same error (no matter how I configure this inheritance mapping). It says :
    [TOPLINK-44] missing class indicator field
    Descriptor: XMLDescriptor(Traject --> [])What am I doing wrong? Does anybody know a sollution?
    Best regards,
    Jouke Stoel
    Developer

    This is the changed XML descriptor file. When I deploy the file it automaticly overrides the old file so it ain't possible that I was still using the wrong file
    <toplink:class-indicator-mappings>
        <toplink:class-indicator-mapping>
            <toplink:class>Traject</toplink:class>
            <toplink:class-indicator xsi:type="xsd:string">Traject</toplink:class-indicator>
        </toplink:class-indicator-mapping>
        <toplink:class-indicator-mapping>
            <toplink:class>SpecialTraject</toplink:class>
            <toplink:class-indicator xsi:type="xsd:string">SpecialTraject</toplink:class-indicator>
        </toplink:class-indicator-mapping>
    </toplink:class-indicator-mappings>I have posted the stacktrace but I had to translate a bit because my exception was in Dutch :)
    Locale is a great invention
    Exception [TOPLINK-44] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DescriptorException
    Exception description: Missing class indicator field of database row [UnmarshalRecord()].
    Descriptor: XMLDescriptor(Traject --> [])
         at oracle.toplink.exceptions.DescriptorException.missingClassIndicatorField(DescriptorException.java:887)
         at oracle.toplink.internal.ox.QNameInheritancePolicy.classFromRow(QNameInheritancePolicy.java:84)
         at oracle.toplink.internal.ox.XMLRelationshipMappingNodeValue.processChild(XMLRelationshipMappingNodeValue.java:13)
         at oracle.toplink.internal.ox.XMLCompositeCollectionMappingNodeValue.startElement(XMLCompositeCollectionMappingNodeValue.java:62)
         at oracle.toplink.ox.record.UnmarshalRecord.startElement(UnmarshalRecord.java:352)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1288)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:205)
         at oracle.toplink.internal.ox.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:189)
         at oracle.toplink.internal.ox.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:147)
         at oracle.toplink.ox.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:228)
    .

  • Problem accessing class in jar file

    Hello. I am trying to create a jar file from my already compiled classes. I have around 5 packages, and my programs' entry point is in one of the packages, we'll call package A. Each package has its own purpose and package A calls any needed package to perform their task. This works well when I compile, run and all. However, when I create a jar file, it only works with the local package and any calls to another package do not work. How can I get around this? any help will be appreciated

    This is the output..
    05/05/2010  10:19 AM        10,946,787 MYJAR.jar
                   1 File(s)     10,946,787 bytes
                   0 Dir(s)   1,434,251,264 bytes freeMy manifest file contains
    Manifest-Version: 1.0
    Class-Path: .
    Main-Class: Login.loginMain
    AndrewThompson64 wrote:Is the code [swallowing exceptions|http://pscode.org/javafaq.html#stacktrace] at any point?
    Nope..
    AndrewThompson64 wrote:
    How do you know that if there is absolutely no error output?The when I ran the code from my compiler, it has no errors, and it works smoothly. I have used a JAR for a single package program before and it worked well but this multiple package program is giving me the problem and I don't want to put all the files in a single package

  • Problem importing classes and beans

    Hey there. Im having one major fustrating problem! When I code supporting classes and beans for my JSPs I get a code 500 internal server error when trying to import (via <%@ page import="class" %> and <jsp:useBean/>) Im storing my classes and beans in the WEB-INF folder and the calling JSPs are located in /ROOT/tests/8/jsp.jsp. Im using the following to import a class or bean:
    <%@ import="aClass" %>
    Seen as tho its in the WEB-INF folder I won't have to explicitly refer to where the class is located, just the class name.
    I never had this problem when I was using my hosting service. Its only on my localhost server in which I get the Internal Server error.
    Help appreciated, thx.
    PS: Im quite new to JSP/Java Servlet.

    import (via <%@ page import="class" %> and
    <jsp:useBean/>) Im storing my classes and beans in the
    WEB-INF folder try put your class file in WEB-INF/classes.
    or first put bean in the package, like WEB-INF/classes/packagename/beanclass
    in jsp page:
    <jsp:useBean id="Mybean" class="packagename.beanclass" scope="request" />
    Question: is /ROOT a context entry in your server.xml?
    Which JSP Container (version) you use? Maybe your localhost server's set up is different with your hosting.

  • Problem with Class.getResource()

    I am trying to load a jar file dynamicaly like,
    ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
    URLClassLoader m_ClassLoader = new URLClassLoader(new URL[] {new URL(sV1JarPath)}, prevClassLoader);
    But after doing this if I try to load a resource from the "prevClassLoader " like,
    MyClass.class.getResource("path"); where MyClass is loaded by prevClassLoader, it is not working. It fails to load the resource.
    Can anyone help me correct this issue?
    Thanks
    Unni

    try "/path".I am giving it like
    MyClass.class.getResource("images/" + name); where there is an images packages in side the package where MyClass resides.
    But here the problem is as MyClass is in the prevClassLoader and it is not able to find it when we call Class.getResource()

  • IWS 6.1 SP6 - problem reloading *vsclassobj.conf files

    Hi, I hope someone can point me in the right direction as this is starting to drive me round the bend :-(
    In my configuration I require approx 80 virtual servers - one for each of the stores I support. When I am installing/configuring a new web server this creates a significant overhead.
    I use the command line "HttpServerAdmin create" first to create a class then a virtual server both based on an input file.
    Following that I have scripted the editing of those files to enable the multiple changes that are required.
    EG adding 'Service method="(GET|HEAD)" type="magnus-internal/directory" fn="send-error" path="error.html" '
    However when I enter the admin GUI, click manage server for the relevant server, click 'apply' then 'apply changes' to activate the changes, they are not reflected in the GUI.
    Each time I go back to the web server the familiar "Warning: manual edits not loaded" pop up appears, and I perform the actions above again. Each time to no avail?
    Any ideas anyone ?
    Cheers
    Chris

    Hi,
    I think the /config files are overwritten with the /conf_bk files when doing an apply/restart from the admin GUI - are your changes still in the /config files after the apply/restart? ...is there a file permissions problem - perhaps the admin GUI cannot write the changes to the /config files?
    I could be missing the point altogether though...

Maybe you are looking for

  • Two apple products using one itunes account

    Hi, i have just bought an ipod touch for my son and want us to have the same itunes account but i dont want him to receive my messages or facetime calls, is there a way that the two can be separated?

  • How to change the datasource from one server to another server?

    i need to change the datasource from development environment to production server. i had configured the JNDI informations like the following in the 'context.xml': <Context path="/RFT" docBase="RFT" reloadable="true"> <Resource auth="Container" type="

  • [svn:fx-trunk] 11171: Add overlay property to GroupBase.

    Revision: 11171 Author:   [email protected] Date:     2009-10-26 16:24:13 -0700 (Mon, 26 Oct 2009) Log Message: Add overlay property to GroupBase. Note, names of class and APIs will change, since it's still in review. QE notes: Ready testing, names w

  • Wrong alignment in nested GridbagLayout

    Hi! I'd like to nest one Panel to another both using GridbagLayout. In the inner panel, which is streched over the complete frame, I want to add a Label, which should align to the left side. However, the following code results in a centered Label. Wh

  • Importing wma music files?!?!?!

    So all of my cd's are ripped into windows media player and are therefore in wma format. I just got an ipod touch so I tried to import them into itunes but everytime I do it says that they are in protected wma format and itunes can only convert unprot