Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4267420
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:53:49+00:00 2026-05-21T06:53:49+00:00

I have deployed a application on Tomcat 6 and after I deployed I wanted

  • 0

I have deployed a application on Tomcat 6 and after I deployed I wanted to do some changes on my constant class and I uploaded only the constant class (.class file) into exploded war file.

And even after I restart the server several times the changes I made wouldn’t show.

All I changed was some strings in constants. What would you suggest me to do other than uploading war file again?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:53:50+00:00Added an answer on May 21, 2026 at 6:53 am

    You will have to recompile all classes that reference those String constants.

    Note that a static final field of a primitive type or of type String that is initialized with a compile time constant value (a so called constant variable) will be inlined when they are used in other classes.

    In other words if you have these classes:

    public class Constants {
      public static final int FOO = 42;
    }
    
    public class Bar {
      public void frobnicate() {
        System.out.println(Constants.FOO);
      }
    }
    

    Then at compile time the value of FOO will be compiled into the .class file of Bar, meaning that Bar no longer references Constants at runtime!

    This also means that any change of FOO will have no effect on Bar until you re-compile Bar with the new Constants.class.

    This effect is discussed at length in JLS §13.4.9 final Fields and Constants.

    One way to avoid this problem in the future is to ensure that your “constants” are not interpreted as constant variables by the compiler. One way to do this is to move the assignment of a value from an initializer to a simple assignment via a static initializer block:

    public class Constants {
      public static final int FOO;
    
      static {
        FOO = 42;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application deployed into multiple zones and there are some issues with
I have two applications deployed on tomcat. For each application I have defined their
I have a web application deployed on path /var/lib/tomcat6/webapps/abc/</code> in server.xml on path /etc/tomcat/server.xml
We have an application deployed on Tomcat 6. It's built on Spring/Struts 2, and
I have developed a java 1.4 web application.Application is deployed on jboss(tomcat). suppose my
I have a application which is deployed in tomcat 6 In this application I
I have a web application deployed on tomcat. In this application are ExecutorService to
We have a web application deployed on a tomcat server. There are certain scheduled
I have a servlet application deployed on a tomcat 7.0 server (call it Server
I have developed an web application using JSP and deployed in tomcat server. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.