facebook

EJB & MyEclipse doubts (dtds and xdoclet)

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #218321 Reply

    oguadilla
    Member

    Dear Sir/Madam,

    I am evaluating MyEclipse to buy it and I think it is a really good product.

    I have made some 2.0 EJBs for weblogic 8.1 and I have the following doubts:
    1.- Using the weblogic XDoclet the generated xmls (ejb-jar.xml, weblogic-ejb-jar.xml, weblogic-cmp-rdbms-jar.xml…) use the DTDs of Weblogic 6.0 (e.g <!DOCTYPE ejb-jar PUBLIC “-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN” “http://java.sun.com/dtd/ejb-jar_2_0.dtd”&gt;). ¿Is it possible to set up MyEclipse to use the DTDs of Weblogic 8.1? Note: I have configured WLS 8.1 as Server.
    2.- Some weblogic dtds like weblogic-ejb-jar.xml are not generated in the META-INF folder (they are in the root folder of the project) so they must be moved manually. Is it a bug or do I have to set up something in MyEclipse to generate them inside META-INF?
    3.- Some weblogic dtds like weblogic-cmp-rdbms.xml are not included with MyEclipse so the xml plugin fails when it tries to check the structure. What should I do to include them? Might it be enough if I copy them inside plugins\com.genuitec.eclipse.xmen_3.8.1\dtd folder?
    4.- When I build an EJB I would like to be able to set up the file name of the generated bean? MyEclipse generates a field named xxxxSession and I would like it to be xxxxBean instead.

    Best Regards,
    Oscar

    #218345 Reply

    Riyad Kalla
    Member

    Oscar,
    I’ve asked our XDoclet guy to have a look at this for you.

    #218352 Reply

    @oguadilla wrote:

    ¿Is it possible to set up MyEclipse to use the DTDs of Weblogic 8.1? Note: I have configured WLS 8.1 as Server.

    Yes you can. Add the xdoclet tasks for ejbs , weblogic and the configure the version attribute on the weblogic doclet
    @oguadilla wrote:

    2.- Some weblogic dtds like weblogic-ejb-jar.xml are not generated in the META-INF folder (they are in the root folder of the project) so they must be moved manually. Is it a bug or do I have to set up something in MyEclipse to generate them inside META-INF?

    You have to set the srcdir on the ejb and weblogic doclet

    I hope this will once be solved by the ejb wizards. They should/could detect you configured a weblogic server and are creating an ejb and set the xdoclet config accordingly. Since these wizards are not OS, I cannot even try to help. Although 29,95 is a pretty amazing price for such a good product isnt’t it

    #218387 Reply

    Greg
    Member

    Oscar,
    @oguadilla wrote:

    1.- Using the weblogic XDoclet the generated xmls (ejb-jar.xml, weblogic-ejb-jar.xml, weblogic-cmp-rdbms-jar.xml…) use the DTDs of Weblogic 6.0 (e.g <!DOCTYPE ejb-jar PUBLIC “-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN” “http://java.sun.com/dtd/ejb-jar_2_0.dtd”&gt;). ¿Is it possible to set up MyEclipse to use the DTDs of Weblogic 8.1? Note: I have configured WLS 8.1 as Server.

    The current version of xdoclet libraries that are included with MyEclipse is 1.2 which doesn’t contain weblogic 8.1 support. You can upgrade your xdoclet support in MyEclipse by doing the following:

    1) Download the new xdoclet-lib-1.2.2.zip file from the [URL=http://sourceforge.net/project/showfiles.php?group_id=31602]XDoclet Sourceforge website[/URL].
    2) Backup this directory: <MYECLIPSE_INSTALL_DIR>/eclipse/plugins/com.genuitec.jboss.ide.eclipse..xdoclet.core_3.8.2/
    3) Remove all xdoclet files: xdoclet-*-module-1.2.jar files, xdoclet-1.2.jar, and xjavadoc-1.0.2.jar
    4) Extract all files from xdoclet-lib-1.2.2 and copy into this directory. You will be asked if you want to over some files, say yes
    5) Bring up MyElcipse and go to Window > Preferences > MyEclipse > XDoclet
    6) Click “Refresh XDoclet Modules”
    7) Expand XDoclet page and click on Code Assist
    8) Click “Refresh XDoclet Data”

    Now you should have xdoclet support for weblogic 8.1. Since xdoclet 1.2.2 was recently released, we will be including xdoclet 1.2.2 support in our next version 3.8.3.

    @oguadilla wrote:

    2.- Some weblogic dtds like weblogic-ejb-jar.xml are not generated in the META-INF folder (they are in the root folder of the project) so they must be moved manually. Is it a bug or do I have to set up something in MyEclipse to generate them inside META-INF?

    First, you can look at the [URL=http://www.myeclipseide.com/images/tutorials/quickstarts/firstejb/]EJB Development Quickstart[/URL] which explains this process.

    As Ronald correctly stated, you have to add a weblogic subdoclet to the Standard EJB configuration. On the weblogic doclet you have to set three attributes: Version=8.1, destDir=src/META-INF, and createTables must be set to one of {Disabled|CreateOnly|DropAndCreate|DropAndCreateAlways|AlterOrCreate). After you save this configuration, when you run XDoclet the correct files will get generated.

    @oguadilla wrote:

    3.- Some weblogic dtds like weblogic-cmp-rdbms.xml are not included with MyEclipse so the xml plugin fails when it tries to check the structure. What should I do to include them? Might it be enough if I copy them inside plugins\com.genuitec.eclipse.xmen_3.8.1\dtd folder?

    I am not seeing this behavior, I was able to edit that file and the validation works correctly. What version of MyEclipse are you using? If you aren’t using 3.8.2, it would be a good idea to upgrade.

    @oguadilla wrote:

    4.- When I build an EJB I would like to be able to set up the file name of the generated bean? MyEclipse generates a field named xxxxSession and I would like it to be xxxxBean instead.

    Honestly, I’m not sure on this one. There might be a way to configure subtasks to specify the file names. You can visit the ejbdoclet task documentation at the xdoclet site.

    #218410 Reply

    Robert Varga
    Participant

    Actually, are there 8.1 dtds and is there full 8.1 support in any version of xdoclet?

    #218418 Reply

    Greg
    Member

    The latest xdoclet-bea-module-1.2.2.jar contains weblogic 8.1 dtds for both weblogic810-ejb-jar and weblogic-rdbms20-persistence-810. So I was assuming there was support for weblogic 8.1 in xdoclet 1.2.2. But I can’t same for sure there is *full* weblogic 8.1 support.

    #218443 Reply

    oguadilla
    Member

    Hello,

    First of all thank you very much for your quick response.

    In reference to the questions:
    (ok) 1.- Generated WLS 8.1 XMLs
    – I downloaded the xdoclet-lib-1.2.2.zip as you suggested, set the three attributes and now the referenced dtd are from WLS 8.1

    (ok) 2.- META-INF folder
    – After using the destDir now the xml is generated in the META-INF folder

    (not working) 3.- weblogic-cmp-rdbms.xml
    – We are using MyEclipse 3.8.2
    – When we open the generated weblogic-cmp-rdbms.xml using the xml editor (xmen) it shows an error in the DOCTYPE tag. It do

    (pending) 4.- generated EJB bean file name
    – I will look it up in the suggested url

    Best Regards,
    Oscar

    #218467 Reply

    oguadilla
    Member

    In reference to:

    1.- weblogic-rdbms20-persistence-810.dtd
    – I have found in the MyEclipse configuration the possibility to register external DTDs and I have tried to register the weblogic-rdbms20-persistence-810.dtd.
    – The problemm is that after registering the new DTD the XML Editor still doesn’t recognize the dtd registered by me. The unique way to go through error thrown by XML Editor is to desactivate the “Validation of the XML Editor”

    2.- After look up in the XDoclet information I have not found the possibility to generate the following filenames format:
    – xxxxxHome, for the Home Interface of the EJB
    – xxxxx, for the Remote Interface of the EJB
    – xxxxxBean, for the Bean Implementation class (instead of the xxxxxSession generated by MyEclipse-XDoclet)

    – This filename format is the one suggested by Sun and so we would like to follow it. Any ideas to solve it?

    Best Regards,
    Oscar

    #218558 Reply

    Greg
    Member

    Oscar,
    @oguadilla wrote:

    1.- weblogic-rdbms20-persistence-810.dtd
    – I have found in the MyEclipse configuration the possibility to register external DTDs and I have tried to register the weblogic-rdbms20-persistence-810.dtd.
    – The problemm is that after registering the new DTD the XML Editor still doesn’t recognize the dtd registered by me. The unique way to go through error thrown by XML Editor is to desactivate the “Validation of the XML Editor”

    Are you sure the xml that is getting generated is valid according to the dtd. When I generated the weblogic xml file it validated fine for me. I also opened it in the xml editor changed a couple of tags, saved it, I saw the validation errors, then changed it back the way xdoclet generated it and the errors went away when I saved it. Post your weblogic xml here and I willl test your file if your not seeing this behavior.

    @oguadilla wrote:

    2.- After look up in the XDoclet information I have not found the possibility to generate the following filenames format:
    – xxxxxHome, for the Home Interface of the EJB
    – xxxxx, for the Remote Interface of the EJB
    – xxxxxBean, for the Bean Implementation class (instead of the xxxxxSession generated by MyEclipse-XDoclet)

    – This filename format is the one suggested by Sun and so we would like to follow it. Any ideas to solve it?

    My only advice would be to post something to the XDoclet user list. It is a active list and you should be able to get some answers.

    #218680 Reply

    Greg
    Member

    I looked at your second issue again. For the Home and Remote interface xdoclet should do exactly as you would like assuming that you have the xxxx value set in your @ejb.bean name=”” property. For the session class, you will need to set the Pattern attribute for the session ejb subtask. Set the pattern to {0}Session. XDoclet will expand the {0} keyword out to the value of your @ejb.bean name=”” property.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: EJB & MyEclipse doubts (dtds and xdoclet)

You must be logged in to post in the forum log in