cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

compiling java file in windchill shell won't take effect

ahsieh
1-Newbie

compiling java file in windchill shell won't take effect


As title, I typed a command like "javac xyz.java" in winchill shell, it showed no error,

the technical staff in retailer told me I should typed "windchill stop && windchill start" after that,

then the compiling took effect.

It really worked, but I could not do this in Office Hour, so please supplied me other ways to take effect immediately.

1 ACCEPTED SOLUTION

Accepted Solutions

Andy,

The other comment I can make on this, is why is there a restart restriction? Are you developing directly on a production box?  Normally you would want a couple of Windchill environments available - test/dev, integration, production at a minimum.  If you had a dev box to work with the running of Windchill in debug.  I know this may sound obvious to most of the people in the group, but I am constantly amazed at how many customer do not have good setups for on going support of the deployment.

--Bob

View solution in original post

13 REPLIES 13
BenPerry
13-Aquamarine
(To:ahsieh)

Andy,

The compiling actually does take effect right away.  The problem is that Windchill caches the executed code.  So the Windchill restart (and probably clearing caches) is a necessary step for newly-compiled code to execute.

You can test this.  For example, do a restart first, and execute javac before the code is executed.  You'll see the changes take effect immediately.  So the root of the problem is the cached executed code.

Ben,

Thank you for your  prompt reply. Is there any way to clear caches instead of restarting ?


satre-2
1-Newbie
(To:ahsieh)

You can set Windchill in debug mode with eclipse, so you don’t need to restart Windchill every time after code change . However setting Windchill in debug mode is not useful/ recommended  for production environment.

You can configure eclipse with Windchill for development and file sync plugin. see below link for more details about configuring eclipse with Windchill 

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS63697&art_lang=en&posno=2&q=eclipse_project&source=search

Hope it helps !!

Thanks

Shreyas

You could also use JRebel.  We use this on our sandboxes and one development box.  This will automatically redeploy new class files, and along with Tomcat in developer mode does most of what is necessary.  The only gotcha is to exclude PTC code from being reloaded by JRebel (done via an xconf setting).

Andy,

The other comment I can make on this, is why is there a restart restriction? Are you developing directly on a production box?  Normally you would want a couple of Windchill environments available - test/dev, integration, production at a minimum.  If you had a dev box to work with the running of Windchill in debug.  I know this may sound obvious to most of the people in the group, but I am constantly amazed at how many customer do not have good setups for on going support of the deployment.

--Bob

Bob,

Sorry, I'm not familiar with IT system construction, there are many concepts I must learn. Dose it work without restart windchill If I compile the java file into class file first in test/dev box, then copy class file to producntion box ?

Andy,

No worries - not everyone will agree with my opinions.  The point is, if you have a dev box you can start and stop it at will or run in debug mode while developing so that when your code moved to production you only have to stop the server once and you are reasonably sure the code will work.  Can I ask what exactly it is you are trying to do?  There may be other ways around your issue.

--Bob

Bob,

I just modify exist java file and recompile it into class file directly in production box and I know this action is not recommended.

All I want to do is make the change become effective without restart the production box.

I assume that compile the java file into class file first in test/dev box then copy class file to producntion box will take effect, I want to make sure that is true or not.

ChrisSpartz
12-Amethyst
(To:ahsieh)

Compiling on a different system and then copying to production will still require a restart. The problem is that when a class is first loaded by the JVM, the definition of the class is stored in the PermGen memory region. As long as that class definition still exists in memory, Java won't recognize any changes to the class file on disk.

Chris,

Thank you for your explanation.  If it's necessary to restart production box, I was wondering to know the exact steps for making recompile java file become effective.

1. modify java file in development box and restart the box.

2. test the function, if it has bug, repeat first step.

3. copy class file to production box and restart the box at Non Office Hour.

Is above steps correct ?

That's correct.

The best approach is to source control all your codes with revisions and change comments. This document here talks about some of the best practices, it is quite old but the points are still relevant - An Integrated Approach to Managing Windchill Customizations

Thanks

Binesh Kumar

Barry Wehmiller

A video was posted recently with info on best practices for Windchill customization: Video Link : 6258

Mary-Ann

BineshKumar1
12-Amethyst
(To:mmuth)

Thanks Mary-Ann for posting it. Great Presentation

Top Tags