• Post Reply Bookmark Topic Watch Topic
  • New Topic

Speed EJB component development with XDoclet

 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Speed J2EE component development with XDoclet
This tutorial shows J2EE developers how to use XDoclet to speed development. XDoclet simplifies continuous integration between components using attribute-oriented programming. It allows you to radically reduce development time by generating deployment descriptors and support code, allowing you to focus on application logic code. Register for this tutorial
XDoclet tutorial
This tutorial consists of three step by step examples using Servlets, Custom Tags, EntityBeans (CMP CMR 2.0) and SessionBeans.
XDoclet tutorial
Prerequisites

This tutorial assumes you have a working knowledge of Java technology and XML. Knowledge of J2EE technology and Ant are helpful but not required to understand the key concepts. Ant is used to build, and deploy the example applications. Links to introductory material on Ant, Java technology, J2EE , XML, and EJB technology are provided in the references section at the end of this tutorial.

System requirements
You will need a current version of the JDK. All the examples in this tutorial use J2SE SDK 1.4.1.
All of the examples use Ant build scripts to build and deploy the Web applications that contain the examples. The examples use Ant 1.5.3.
You will need XDoclet The examples in this tutorial use version XDoclet 1.2 beta 2.
Eclipse or WebSphere Studio Application Developer (WebSphere Studio) is not required, but can be found at the Eclipse Web Site and at WebSphere Studio trial download respectively.
XDoclet tutorial
Related content

Tomcat
Resin EE
Mastering Tomcat on Developing Web Components with Ant
IBM WebSphere Application Server

Tutorial length: Under two hours
Formats: HTML, PDF, Zip
XDoclet tutorial
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The initial response from readers is very positive. Let me know what you think.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very good article.. I wish I had a tutorial like this one when I started using it, specially with ant and EJBDoclet. I had so much problems getting xdoclet to work and I still think the generated errors are not as descriptive as you might want. Some errors you get when running ant, for instance, tell you very minimal things about the actual problem...
--> Good Stuff..
cheers
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd really like to know how companies or the community in general are adopting a technology like XDoclet, knowing that there are excellent tools out there that automate most of the tasks of generating xml descriptors, interfaces, etc..
For example, JDeveloper and its Business Components for Java (BC4J) speed up the process as well, generating all these *extra* deployment files as well... pretty much doing the same job that XDoclet does..
But I still like the idea of having a single place (the bean class) that has all the information you need..
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only a matter of time....
I think all IDE will support XDOclet just like all IDE's support Ant....
it will happen....
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rick,
URL in the section, Installing XDoclet in the PDF version to download the code: ws-j2xcode.zip is invalid.
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rick,
Thank you for writing the tutorial. When I try to run "ant deploy" for webdoclet, I get exception below in an infinite loop.
My JAVA_HOME is \jdk1.4.1_02 and ANT_HOME is \apache-ant-1.5.3-1
Content of build.properties:



[ May 29, 2003: Message edited by: Sai Prasad ]
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do me a favor. Look at the depencies for deploy....
should be something like depends="clean,compile,xdoclet" (etc.)
run each task individually as the appear in the depends clause, i.e.,
ant clean
ant compile
ant xdoclet
etc.
find out exactly what target is failing, then.....

add echo statements to figure out which task is failing, e.g.,
<echo> about to war </echo>
<war ...>
<echo> about to copy</echo>
<copy ....>

etc. (also you could run ant in verbose mode)
send me your modified ant script and the complete output from your endeavors....
IMPORTANT I noticed that you put spaces between your properties
remove all space
e.g.,
src = ./src
becomes
src=./src
etc.
I know spaces are not allowed.
Lastly, please post your question on the xdoclet mailing list and go to www.jguru.com and post it to the xdoclet and ant forum. They might be able to help you faster than me.
Frankly, I don't know why it is not working on your box. It works on mine.
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now I see that it is happening when you call webdoclet....
too many sleepless nights...
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like it is happening in the log4j log manager.
What version of log4j are you running?
Make sure there is not an older copy of log4j on your classpath.
Blank out your classpath before you run the ant script.

[webdoclet] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:796)[webdoclet] at org.apache.log4j.helpers.Loader.getResource(Loader.java:91)[webdoclet] at org.apache.log4j.LogManager.<clinit>(LogManager.java:94)[webdoclet] at org.apache.log4j.Category.getInstance(Category.java:514)[webdoclet] at org.apache.commons.logging.impl.Log4jFactory.getInstance(Log4
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after you make sure that there is not other log4j on you classpath....
go to xdoclet/lib
ren log4j.jar to log4j.cantfindme so it does not load on the xdoclet classpath for the task...
then re-run the ant script
what happens?
 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently read an interview with someone from Sun that indicated that they think the XDoclet (embedded metadata) approach is a good one and that Sun might be considering doing supporting that concept.
XDoclet's biggest disadvantage is that you get so buried in bogus warnings thanks to forward references to things that haven't yet been generated that it's sometimes hard to find the REAL errors. There is work being done on that. One approach is to do their own custom JavaDoc engine, but what with Sun's interest, perhaps it'll eventually fold into the standard JavaDoc engine framework.
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rick,
Like you mentioned, I started renaming all the jars one by one and the exception keeps going to the next jar file in the xdoclet\lib folder. Do you think all the jar files in that folder are corrupt? I can open them in a winzip with out a problem. I downloaded them again from xdoclet.org.
I don't have anything in the CLASSPATH prior to running "ant deploy". Thanks again.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
I
XDoclet's biggest disadvantage is that you get so buried in bogus warnings thanks to forward references to things that haven't yet been generated that it's sometimes hard to find the REAL errors. There is work being done on that. One approach is to do their own custom JavaDoc engine, but what with Sun's interest, perhaps it'll eventually fold into the standard JavaDoc engine framework.

Agree 100%.. that's exactly what I posted...
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmmmmmmmmmmmmmm....
i agree but... the advantages outweigh the problems
i hate keeping files in sycn.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!