• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Rick's Resin/XDoclet tutorial

 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been trying to work through Rick Hightower's Resin/CDoclet tutorial, and mostly it seems to make sense (thanks Rick!) Unfortunately, I still have a problem with finally getting it to work.
After installing the various jars and configuring the build.properties file, everything seems to build fine, and deposits a war file in my Resin webapps directory. Even the "preparedb" target works and builds a Hypersonic SQL database.
The problem occurs when I start Resin, and try and access the new web application. I get:

Is there another configuration step I am missing ?
All help appreciated.
 
Author
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry that I have been so long in responding. I was in NY then Chicago (see blog).
The answer is yes. There is something that you are missing. You need to declare the pool in the Resin conf file.
I ship a sample Resin conf file with the example.
You can look at that then copy the resource ref out of there into the real resin.conf file.
 
Rick Hightower
Author
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay... I had to double check and make sure I had it in the tutorial.
It was there. It may not be clear, but it is there.
Here is what is says about this... (I think you skipped this step)


Setting up the Resin conf and web.xml file for the ejb server...

Once you have generated the files you will need to configure Resin. You need to configure a data source as described in the following listing.
resin.conf partial listing
--------------------------------------------------------------------------------
<caucho.com>
...
<resource-ref>
<res-ref-name>jdbc/user</res-ref-name>
<res-type>javax.sql.DataSource?</res-type>
<init-param driver-name="org.hsqldb.jdbcDriver"/>
<init-param url="jdbc:hsqldb:/hsql/db/user"/>
<init-param user="sa"/>
<init-param password=""/>
<init-param max-connections="20"/>
<init-param max-idle-time="30"/>
</resource-ref>
...
</caucho.com>

 
Frank Carver
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rick. I did do that in the end.
I think what confused me was actually the example config file! I seem to remember that I looked at it and said to myself "ah, that's done then", without making the connection that I also needed to update the "real" resin.conf.
I've now worked through all the tutorial which is there. I've had lots of fun adapting my generic ant build tools to support an optional ejbdoclet processing step and built a little book-keeping program which hangs together quite nicely. Once I got up to speed xdoclet sure seemed to make EJB simpler to work with.
I couldn't work out how to use xdoclet with compound public keys, though, so my example application still uses a slightly clunky build-a-string-and-use-the-hashcode method to generate "unique" integer ids. Any suggestions ?
Thanks for the tutorial, anyway!
 
Rick Hightower
Author
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The code at this link
http://www.rickhightower.com/ejbqlresin.zip
has examples that generate primary key classes.
just mark the cmp fields involved and they become part of the key.
 
Rick Hightower
Author
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added more sample source code to the example.
It now has examples on how to use Hessian and Burlap.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic