Finally found the problem. I was initially only using the user binaries, which I installed using the user installation guide (https://cwiki.apache.org/conf luence/display/CTAKES/cTAKES+4.0+User+Install+Guide) (which instructs setting the environment variable *CTAKES_HOME=<the extracted ctakes directory>*, maybe you see where this is going).
When later deciding that I wanted to experiment with the dev source code, I created a new directory $HOME/projects/ctakes as recommended by the dev install guide (https://cwiki.apache.org/confluence/display/CTAKES/cTAKES+ 4.0+Developer+Install+Guide) and set and requested environment variables (which did not include (in this case re-) setting the CTAKES_HOME env. variable that was pointing to the user binaries)). After building the project and extracting the trunk/ctakes-distribution/target binaries, trying to run the binaries in that folder seemed to be using the *exact same**code as the user binaries*. The problem was that, looking at the actual code in the extracted distribution's bin/runPiperCreator.sh, it could be seen that the java class-paths being used were pointing to the resources and jars in CTAKES_HOME, which at that point *still referred to the user binaries folder*. Resetting the env. variable CTAKES_HOME to point to the location of the extracted dev distribution binaries fixed the problem. *TLDR: extracted binaries from the dev distribution target was still using the resources and jars from a previous "user" installation for its class-paths.* Perhaps this caveat should be added to the documentation? On Tue, Mar 27, 2018 at 12:10 PM, Reed Villanueva <villanuevar...@gmail.com> wrote: > Hi Gandhi, > > Apologies for the confusion, I had though that it worked in the way you > described earlier, but had tried this before and it does not seem to have > any effect. > Eg. doing something like: > > edit > trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/pipeline/MainPanel2.java > to have the snippet > > 91 private JComponent createWestPanel() { >> 92 LOGGER.info( "creating fakeTable placeholder" ); >> 93 LOGGER.info( "creating fakeTable placeholder" ); >> 94 LOGGER.info( "creating fakeTable placeholder" ); >> 95 LOGGER.info( "creating fakeTable placeholder" ); >> 96 LOGGER.info( "creating fakeTable placeholder" ); >> 97 System.out.println( "This is a test" ); >> 98 final JTable fakeTable = new JTable(); >> 99 LOGGER.info( "generating fakeTable header" ); >> 100 final JTableHeader fakeHeader = fakeTable.getTableHeader(); >> 101 final Component header = fakeHeader.getDefaultRenderer() > > 102 > .getTableCellRendererComponent( >> fakeTable, "Available Pipe Bits", >> 103 >> false, false, -1, -1 ); > > > just to add some lines in comparison to the original file (for the purpose > of seeing change in a later error message, to be shown in a bit), then > > >> ➜ trunk $ cd ctakes-gui >> ➜ ctakes-gui $ mvn clean install >> .... >> [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ >> ctakes-gui --- >> [INFO] Installing >> /home/me/projects/ctakes/trunk/ctakes-gui/target/ctakes-gui-4.0.1-SNAPSHOT.jar >> to /home/reedv/.m2/repository/org/apache/ctakes/ctakes-gui/ >> 4.0.1-SNAPSHOT/ctakes-gui-4.0.1-SNAPSHOT.jar >> [INFO] Installing /home/me/projects/ctakes/trunk/ctakes-gui/pom.xml to >> /home/reedv/.m2/repository/org/apache/ctakes/ctakes-gui/ >> 4.0.1-SNAPSHOT/ctakes-gui-4.0.1-SNAPSHOT.pom >> [INFO] ------------------------------------------------------------ >> ------------ >> [INFO] BUILD SUCCESS >> [INFO] ------------------------------------------------------------ >> ------------ >> [INFO] Total time: 5.393 s >> [INFO] Finished at: 2018-03-27T10:06:57-10:00 >> [INFO] ------------------------------------------------------------ >> ------------ >> > > > >> ➜ >> ctakes-gui >> >> $ cd .. >> >> ➜ >> trunk >> >> $ >> cp ctakes-gui/target/ctakes-gui-4.0.1-SNAPSHOT.jar >> ../apache-ctakes-4.0.1-SNAPSHOT/lib/ >> > > (note that the apache-ctakes-4.0.1-SNAPSHOT folder was extracted to the > same directory level as trunk from trunk/ctakes-distribution/ > target/apache-ctakes-4.0.1-SNAPSHOT-bin.tar.gz from an earlier successful > build following the dev install guide (skipping the tests)), then doing > > >> ➜ >> trunk >> $ cd ../apache-ctakes-4.0.1-SNAPSHOT >> > >> >> ➜ apache-ctakes-4.0.1-SNAPSHOT >> $ >> ls -lhR lib | grep ctakes-gui >> >> > > -rw-r--r-- 1 reedv reedv 272K <current date> <current time> >> ctakes-gui-4.0.1-SNAPSHOT.jar >> > > > > ➜ apache-ctakes-4.0.1-SNAPSHOT >> $ >> ./bin/runPiperCreator.sh >> .... >> log4j: Setting property [conversionPattern] to [%d{dd MMM yyyy HH:mm:ss} >> %5p %c{1} - %m%n]. >> log4j: Adding appender named [consoleAppender] to category [root]. >> Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException >> at javax.swing.plaf.synth.SynthTableHeaderUI$HeaderRenderer. >> getTableCellRendererComponent(SynthTableHeaderUI.java:234) >> at org.apache.ctakes.gui.pipeline.MainPanel2.createWestPanel(MainPanel2. >> java:94) >> at org.apache.ctakes.gui.pipeline.MainPanel2.createMainPanel(MainPanel2. >> java:139) >> at org.apache.ctakes.gui.pipeline.MainPanel2.<init>(MainPanel2.java:76) >> at org.apache.ctakes.gui.pipeline.PiperCreator. >> createMainPanel(PiperCreator.java:40) >> at org.apache.ctakes.gui.pipeline.PiperCreator.lambda$ >> main$0(PiperCreator.java:53) >> .... > > > I see that *the error line number is unchanged and the error is the same > as in the original file*, which produced the similar error shown below: > > ➜ apache-ctakes-4.0.0 bin/runPiperCreator.sh >> .... >> log4j: Adding appender named [consoleAppender] to category [root]. >> Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException >> at javax.swing.plaf.synth.SynthTableHeaderUI$HeaderRenderer. >> getTableCellRendererComponent(SynthTableHeaderUI.java:234) >> at org.apache.ctakes.gui.pipeline.MainPanel2.createWestPanel(MainPanel2. >> java:94) >> at org.apache.ctakes.gui.pipeline.MainPanel2.createMainPanel(MainPanel2. >> java:139) >> at org.apache.ctakes.gui.pipeline.MainPanel2.<init>(MainPanel2.java:76) >> at org.apache.ctakes.gui.pipeline.PiperCreator. >> createMainPanel(PiperCreator.java:40) >> at org.apache.ctakes.gui.pipeline.PiperCreator.lambda$ >> main$0(PiperCreator.java:53) >> .... > > > which was supposedly fixed in 4.0.1 (https://issues.apache.org/ > jira/browse/CTAKES-442), the error that I was initially trying to > investigate (copying the 4.0.1 gui jar to this 4.0.0 binary download /lib > dir. under the original 4.0.0 name still generates this error). > > Could you let me know what I'm doing wrong here? > Would be interested in working with the code if I could just figure out > how to actually use and test changes. > Thank you. > > > > > > On Tue, Mar 27, 2018 at 5:29 AM, Gandhi Rajan Natarajan < > gandhi.natara...@arisglobal.com> wrote: > >> Hi Reed, >> >> If you make any changes in ctakes-gui module, you can build the >> ctakes-gui module using the following command: >> >> mvn clean install -Dmaven.test.skip=true >> >> Then you can pick up the updated ctakes-gui jar file from >> 'ctakes-gui\target' folder and replace the same in your project from where >> you are running cTAKES. >> >> Regards, >> Gandhi >> >> >> -----Original Message----- >> From: Reed Villanueva [mailto:villanuevar...@gmail.com] >> Sent: Tuesday, March 27, 2018 12:20 AM >> To: dev@ctakes.apache.org >> Subject: Re: How to change and build project source code? >> >> I see. I was looking in the "ctakes-distribution/target" because that >> seemed to be where the binary files where (which I assumed were the final >> product of the build, having initially experienced ctakes as a "user" and >> never worked on a maven project before). Would you be willing to please >> explain a bit more about how to run the project after building it >> (non-IDE-based install) for someone with less maven and java experience >> (which I think may be my main confusion)? >> >> On Mon, Mar 26, 2018 at 2:49 AM, Gandhi Rajan Natarajan < >> gandhi.natara...@arisglobal.com> wrote: >> >> > Hi Reed, >> > >> > I'm not sure whether I got your question right. But if you make any >> > changes in ctakes-gui module, the updated jar files will be available >> > under ' ctakes-gui\target' folder. >> > >> > Not sure what you are looking for under 'ctakes-distribution/target' >> > >> > Regards, >> > Gandhi >> > >> > -----Original Message----- >> > From: Reed Villanueva [mailto:villanuevar...@gmail.com] >> > Sent: Monday, March 26, 2018 3:02 AM >> > To: dev@ctakes.apache.org >> > Subject: How to change and build project source code? >> > >> > New user. Tried editing >> > ctakes-gui/src/main/java/org/apache/ctakes/gui/pipeline/MainPanel2.jav >> > a to look into potential bug that was supposedly resolved in >> > https://issues.apache.org/jira/browse/CTAKES-442 but appears to still >> > be causing error... >> > >> > >> > > log4j: Adding appender named [consoleAppender] to category [root]. >> > > >> > Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException >> > >> > at >> > > javax.swing.plaf.synth.SynthTableHeaderUI$HeaderRenderer.getTableCel >> > > lR >> > > endererComponent(SynthTableHeaderUI.java:234) >> > >> > at >> > > org.apache.ctakes.gui.pipeline.MainPanel2.createWestPanel(MainPanel2 >> > > .j >> > > ava:94) >> > >> > >> > > >> > > >> > in version 4.0.1. Yet when changing the code snippet to... >> > >> > >> > > >> > > >> > private JComponent createWestPanel() { >> > >> > final JTable fakeTable = new JTable(); >> > >> > LOGGER.info( "** DEBUG: fakeTable: " + fakeTable ); >> > >> > LOGGER.info( "** DEBUG: fakeTable: " + fakeTable ); >> > >> > final JTableHeader fakeHeader = fakeTable.getTableHeader(); >> > >> > LOGGER.info( "** DEBUG: fakeHeader: " + fakeHeader ); >> > >> > final Component header = fakeHeader.getDefaultRenderer() >> > >> > .getTableCellRendererComponent( >> > fakeTable, >> > > >> > > "Available Pipe Bits", false, false, -1, -1 ); >> > >> > >> > > >> > >> > >> > trying to build with... >> > >> > >> > > >> > mvn --fail-at-end --errors --update-snapshots clean install >> > sonar:sonar >> > > -DskipTests=true -Dsonar.scm.provider=svn -Dsonar.host.url= >> > > https://builds.apache.org/analysis >> > >> > >> > > >> > >> > >> > and extracting the binaries via... >> > >> > ➜ trunk cp >> > > ctakes-distribution/target/apache-ctakes-4.0.1-SNAPSHOT-bin.tar.gz >> > > ctakes-distribution/target/apache-ctakes-4.0.1-SNAPSHOT-bin.tar.gz.m >> > > d5 >> > > ../ >> > > >> > > >> > (by the way, I explicitly show the steps I took only because I have >> > never worked on a maven project before so giving a chance for someone >> > to point out if I'm doing something wrong here), yet still seeing >> > error >> > >> > log4j: Adding appender named [consoleAppender] to category [root]. >> > > >> > Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException >> > >> > at >> > > javax.swing.plaf.synth.SynthTableHeaderUI$HeaderRenderer.getTableCel >> > > lR >> > > endererComponent(SynthTableHeaderUI.java:234) >> > >> > at >> > > org.apache.ctakes.gui.pipeline.MainPanel2.createWestPanel(MainPanel2 >> > > .j >> > > ava:94) >> > >> > >> > > >> > >> > Notice it states the error is on line 94 as if the change that I >> > implemented is not actually affecting the code that is being used (yet >> > running >> > >> > >> > > >> > ➜ trunk find . -name 'MainPanel2.java' >> > > >> > >> > ./ctakes-gui/src/main/java/org/apache/ctakes/gui/pipeline/MainPanel2.j >> > ava >> > >> > >> > > >> > > >> > in the trunk directory shows that this is the only place that that >> > file exists). >> > >> > Am I missing something here (never worked on a maven project before, >> > so I'm thinking that I may not be changing the right file here)? How >> > can I change the code so that it actually gets used in the compiled >> binaries? >> > Thanks >> > This email and any files transmitted with it are confidential and >> > intended solely for the use of the individual or entity to whom they >> are addressed. >> > If you are not the named addressee you should not disseminate, >> > distribute or copy this e-mail. Please notify the sender or system >> > manager by email immediately if you have received this e-mail by >> > mistake and delete this e-mail from your system. If you are not the >> > intended recipient you are notified that disclosing, copying, >> > distributing or taking any action in reliance on the contents of this >> > information is strictly prohibited and against the law. >> > >> This email and any files transmitted with it are confidential and >> intended solely for the use of the individual or entity to whom they are >> addressed. If you are not the named addressee you should not disseminate, >> distribute or copy this e-mail. Please notify the sender or system manager >> by email immediately if you have received this e-mail by mistake and delete >> this e-mail from your system. If you are not the intended recipient you are >> notified that disclosing, copying, distributing or taking any action in >> reliance on the contents of this information is strictly prohibited and >> against the law. >> > >