1

In the process of extending functionality of my application, I added injected few additional bean references into my existing bean definitions in applicationContext. I included their getters and setters in my java class. Class A refers to beans B and C newly now and in class A, I added getters and setter for B and C and used these getters in methods inside Class A. Beans B and C are nothing more than Maps and there is a class D in which I put values into these beans. Now, instead of generating a whole war file again in the production machine, I generated the war in my local copy. From this war I picked up classes A and D and replaced the ones on production machine with these new classes. Also, I replaced the applicationContext.xml. After restarting tomcat on the production machine, I get a NPE in Class A which is because of the getter of bean B. My values dont seem to be injected in the bean.

What can I do to solve this? I do not want to redeploy the whole war on my production machine.

user811433
  • 3,999
  • 13
  • 53
  • 76

1 Answers1

0

If you restart tomcat it will unpack any war file that is present, overwriting any changes you have done manually. If I understand correctly you are attempting to copy class files into your exploded war. Not a particularly good idea.

You don't have to gerenate a war file on the same machine it is deployed on (in fact that would be unusual). You may app specific settings to be aware of.

NimChimpsky
  • 46,453
  • 60
  • 198
  • 311
  • NimChimpsky, I am not generating war file on the same machine. I am generating war file on one machine and trying to copy specific files onto another. – user811433 Aug 14 '12 at 14:22
  • only include the changes you want released, use a source control system (git,mercurial, subversion) – NimChimpsky Aug 14 '12 at 14:25