- This topic has 3 replies, 2 voices, and was last updated 19 years, 5 months ago by
Greg.
-
AuthorPosts
-
james_render50MemberHi,
bit of an xdoclet / jboss n00b so excuse my ignorance.
I’ve got a simple web application that I want to deploy to jboss 3.2, when I did this manually, to set up a datasource, I create a jboss-web.xml that looks like the following…
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd"> <jboss-web> <resource-ref> <res-ref-name>jdbc/myoracle_devuk</res-ref-name> <jndi-name>java:myoracle_devuk</jndi-name> </resource-ref> </jboss-web>
I was thinking that it would have been nice to get xdoclet to generate this for me. So I added the standard web configuration using the MyEclipse-XDoclet dialog, then I rclicked the webdoclet and added jbosswebxml.
But when I look in the properties, I expected to see a resource-ref entry… there was none…
Does this functionality exist… if it doesn’t, how hard is it to add..
thanks.
james_render50Memberoh.. and when I went to run xdoclet I got this:
Buildfile: C:\Projects\MyWebApp\.xdoclet-build.tmp.xml N65540: BUILD FAILED java.lang.UnsupportedClassVersionError: xjavadoc/ant/XJavadocTask (Unsupported major.minor version 49.0) Total time: 1 second
james_render50MemberAhh okay, the error was due to me running it with jdk5 option whilst using jdk1.4.2
GregMemberResource ref entries can be generated by Xdoclet if you define them using @jboss.resource-ref xdoclet tags in your java source.
http://xdoclet.sourceforge.net/xdoclet/tags/jboss-tags.html#@jboss_resource-ref__0____
However, the @jboss.resource-ref is only supported in EJB classes no in a web application.To add <resource-ref> entries into your jboss-web.xml file you must use a merge file called jbossweb-resource-ref.xml. I am getting the name of this merge file from the following location.
http://xdoclet.sourceforge.net/xdoclet/ant/xdoclet/modules/jboss/web/JBossWebXmlSubTask.html
Then go down to the section titled “Merge files”.Now just setup the merge file so it contains the <resource-ref> entry that you want, then configure the jbosswebxml subtask to point out to the mergeDir where you have the merge file located. Make sure you have the Version and destDir properties set correctly as well. Then just run XDoclet and when it creates the jboss-web.xml file, it will just copy the contents of the merge file straight into the jboss-web.xml file.
Hope this helps. If you have trouble getting the merge file to work, let us know.
-
AuthorPosts