Matt Harrah

Ranch Hand
+ Follow
since Aug 05, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Matt Harrah

Personally, I would never *store* the data in GEDCOM format, but you'd want to be able to read/write it. I've done a lot of work with the GEDCOM format and it's lousy, but the previous poster was absolutely correct about it being the lingua franca of genealogical data interchange. A genealogy program that can't handle GEDCOMs is severely crippled.
11 years ago
This topic is past dead (nearly 3yo) but I thought I'd mention that there is a library called gedcom4j that does this kind of work.

http://gedcom4j.org

In interests of full disclosure, I am the author of that library, and am not an impartial endorser.
11 years ago
You may want to look at how you are doing String stuff. If you do a lot of String manipulation (and I mean very large amounts in high volume) you can run into this when the string pool gets too big.

From Sun's site:

Interned java.lang.String objects are also stored in the permanent generation. The java.lang.String class maintains a pool of strings. When the intern method is invoked, the method checks the pool to see if an equal string is already in the pool. If there is, then the intern method returns it; otherwise it adds the string to the pool. In more precise terms, the java.lang.String.intern method is used to obtain the canonical representation of the string; the result is a reference to the same class instance that would be returned if that string appeared as a literal. If an application interns a huge number of strings, the permanent generation might need to be increased from its default setting.



One thing you look at is using StringBuffers or StringBuilders to concatenate series of strings, rather using + or +=, particularly inside loops.
15 years ago
  • Make sure ant-launcher.jar, which can be found in your ANT_HOME/lib directory, is in your classpath
  • Set the ant.home system property to your ANT_HOME - that is, System.setProperty("ant.home","wherever/your/ant/is/installed");
  • Call org.apache.tools.ant.launch.Launcher.main(), passing all the options and the targets to run as an array of String


  • Details can be found in the online Ant documentation under "Running Ant", "Running Ant from Java"
    17 years ago
    Just curious --

    If you're in Eclipse, why are you using Ant to start/stop Tomcat? Is that a requirement for your project?

    Why don't you use the Servers view and define a Tomcat instance in that and use that to stop and start Tomcat? It's far easier and allows you to stop/start/restart it in either debug or normal mode on demand independantly of your Ant script.
    17 years ago
    A really good page to look at is the "library dependancies" page under "optional tasks" in the online docs, which has complete information, but to summarize:

    ftp, rexec and telnet tasks all require both jakarta-oro 2.0.1 or later and commons-net in the classpath

    Get jakarta-oro here
    Get commons-net here
    17 years ago
    I don't know of any Ant task that will do it. But if <exec> can spawn a thread, <exec> can also run a process killer...

    Running regular old "kill" probably wont work because Ant wont give you a process id to pass to kill...

    Again, I don't know much about web start. You might be out of luck on that. But when I think about web servers like Tomcat, for example, they provide commands that start the server, and another that will stop the server. Maybe there's something you can do like that???
    17 years ago
    First, let me say I don't have a definite answer, but here's some things that might help.

    The docs for the <parallel> task say that with the failonany="true" attribute set, the main thread ends as soon as any of the child threads fail, and the child threads will stop running. However, I have a hunch that when one of the child threads is doing an <exec> task, things are a little different since <exec> itself spawns another process.

    So, could you possibly invoke your web start through some means other than an <exec> task? (Here's where my knowledge of web start is next to nothing) Does web start really just run a Java class? If so, you can try using the <java> task to invoke it.

    Another idea is that maybe the ant-contrib library could help (http://ant-contrib.sourceforge.net/). They have a <try><catch><finally> construct that could possibly kill your web start process in the catch block if your parallel task fails.

    Good luck!
    17 years ago
    I would have thought that the documentation http://xdoclet.sourceforge.net would have had what you need...

    But from a 30,000 foot view:

  • Put the xdoclet @jsp.tag and @jsp.variable tags in your tag implementation classes
  • Define the webdoclet task in ant using a taskdef
  • In you Ant script, in some target, invoke the webdoclet task, and inside that use the jsptaglib subtask, telling it where to find your tag classes, etc., and where to spit out the .tld file


  • If you are using any of the JDK 5.0 features (such as generics, enums, static imports, etc) I recommend you use XDoclet2 rather than XDoclet - XDoclet out of the box does not work with JDK5 unless patched.

    XDoclet2 is still in beta but is pretty stable. The process is slightly different, but from the Ant side of things, so the differences aren't far reaching.
    [ September 07, 2006: Message edited by: Matt Harrah ]
    17 years ago
    It's funny you say that, Mike. I've never really seen many (any?) books on Ant that were A) really good; B) current; and C) complete (i.e., includes the more obscure or lesser-used tasks, like presetdef)

    I've gotten to the point where I don't look for books anymore and I just use the online Ant manual...
    17 years ago
    The Southeast Virginia Java Users Group is proud to announce that our September 19 meeting will feature Andy Glover, president of Stelligent Incorporated, co-author of Java Testing Patterns from Wiley Press and the soon-to-be-released Groovy in Action from Manning Publications, and speaker for the No Fluff Just Stuff symposiums.

    Andy will be talking about Unit Testing Best Practices at 7pm on September
    19 in the Chesapeake Room at the Lake Wright Hotel in Norfolk, VA.

    For more information, please visit the SEVAJUG website.
    17 years ago
    Assuming you're using Eclipse---

    Eclipse puts JUnit in the classpath for you for free. Ant does not -- see Ant's documentation about library dependancies and optional tasks (of which the junit task is one).

    The short answer solution is probably to put junit.jar in ANT_HOME/lib.
    17 years ago
    Ant is not necessary but will almost certainly help you
  • if you are working in a team
  • if you need reproducible build processes
  • if you need to have builds do many things at one time (such as compile, make documentation, run unit tests, and package into war/ear/jar)
  • if you need to build outside of eclipse, particularly if you want an automated nightly build or continuous integration builds


  • Ant is not the only way to achieve these things, of course, but is possibly/probably the most common way, and it integrates nicely with Eclipse.
    17 years ago
    Personally, I'd rather hire the people who are giving the answers. If I were the hiring manager I'd be looking for the people who actually understand the difference between a checked an unchecked exception rather than need to get an answer to repeat at an interview.

    And if I were the candidate, I'd be looking for actual understanding and work experience with Exception classes, rather than a canned answer.
    17 years ago
    The war task is really designed to assemble a war file when you don't already have a directory that represents the contents of your war.

    If you already have a directory that contains the contents of your exploded war file, with a WEB-INF and everything, the jar task is more appropriate.

    If, however, you have classes in one place, and libraries in another, and a manifest somewhere else, and none of it is organized anything like a war file, the war task will put them all in the right place on-the-fly inside the war file without disrupting where they are in their original locations.
    17 years ago