facebook

Bad generation of ejb-jar.xml [closed]

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #221853 Reply

    Erez
    Member

    Hi,

    My EJB project had an xdoclet-build.xml which worked fine.
    I tried to work with the using dynamic build specifcation instead but
    I got errors in the produced ejb-jar.xml.

    The stuff that was missing is <assembly-descriptor> and
    all the ejb method permisission are not generated.

    Is there a way to get hold of the temporary xdoclet-buil.xml file?

    Please help.

    Erez

    #221854

    Erez
    Member

    OK, I narrowed it a bit more.

    I am working with MyEclipse 3.8.3/ Eclipse 3.0.1 / Windows XP.

    I think the problem lies in the generation of the xdoclet-build.xml but I haven’t figured yet what exactly.
    1. I went back to using xdoclet-build.xml (not auto) in the EJB module properties.
    2 I deleted the ejb-jar.xml
    3. ran xdoclet on the EJB module – still got a bad ejb-jar:

    [ejbdoclet] org.xml.sax.SAXParseException: Element "ejb-jar" does not allow "security-role" here.

    4. overwrite with an older version (original that worked before) of the xdoclet-build.xml
    5. ran xdoclet (using the menus of course)
    6. works! ejb-jar.xml is good as should!

    I’d be happy to supply more information because for now it means that I cannot change any of the settings in the XDoclet because I will get bad xdoclet-build.xml.

    Hope this helps.

    Erez

    #221855

    Erez
    Member

    One more thing – the original xdoclet-build.xml was generated while was working with 3.8.2 before upgrading to 3.8.3.

    Thanks in advance,

    Erez

    #221856

    Greg
    Member

    Can you compare the two xdoclet build files: the old one that worked and the new one generated in 3.8.3 using the manual (non-auto) mode? Are you sure your xdoclet configuration didn’t change between versions?

    #221857

    Erez
    Member

    It did not change a bit. I even brought back the project from yesterday where every thing worked fine.
    I played with just switching between the two mode and I got the error.

    sad but true 🙂

    #221858

    Erez
    Member

    I am working with JBoss and I use the assembly-descriptor merge dir file.
    Maybe that helps…

    Erez

    #221861

    Greg
    Member

    Can you compare the two xdoclet-build.xml files (old and new)? They will different to some degree because the 3.8.3 should point to the 3.8.3 xdoclet libraries.

    Is your assembly-descriptor.xml file getting merged with the new 3.8.3 project, either in manual or dynamic mode?

    #221862

    Erez
    Member

    I tried to compare and as you said there are 3.8.3 libraries that are pointed to. Other than than I don’t know to look into.
    I noticed that the <assembly-descirptor> part is not getting generated which includes among other stuff the EJB method permission. Without this part the application cannot run due to lack of permission.
    My assembly-descriptor.xml (which contains 3 <security-role> clauses) is getting merged into the ejb-jar.xml but the XML validator screams for bugs because the merged <security-role>s are not inside
    a <assembly-descriptor> (as I said – not generated).

    Does it help?

    Erez

    #221867

    Greg
    Member

    Try putting the <assembly-descriptor> tag around the top of your assembly-descriptor.xml file because it seems the entire file is getting merged in. There actually maybe something different between xdoclet 1.2 and xdoclet 1.2.2 that changes how the assembly-descriptor.xml files are merged.

    #221872

    Erez
    Member

    I already did it before but the ejb-jar.xml I got was missing the ejb method pemission tags as should.

    #221879

    Greg
    Member

    If you are using the assembly-descriptor.xml merge file, then you are telling xdoclet that you want to manually add everything between the <assembly-descriptor></assembly-descriptor> tag. So it will not generate <method-permissions></method-permissions> for you since they are a child node of <assembly-descriptor>.

    I tested putting on @ejb.permission role-name=”employee” and it genreated the following <assembly-descriptor> section in ejb-jar.xml.

    
    <assembly-descriptor >
         <!--
           To specify additional security-role elements, add a file in the merge
           directory called ejb-security-roles.xml that contains them.
         -->
          <security-role>
             <description><![CDATA[description not supported yet by ejbdoclet]]></description>
             <role-name>employee</role-name>
          </security-role>
    
       <!-- method permissions -->
         <!--
           To specify additional method-permission elements, add a file in the merge
           directory called ejb-method-permissions.ent that contains them.
         -->
    
       <method-permission >
          <description><![CDATA[description not supported yet by ejbdoclet]]></description>
             <role-name>employee</role-name>
          <method >
             <description><![CDATA[An example business method]]></description>
             <ejb-name>TestSession</ejb-name>
             <method-intf>Remote</method-intf>
             <method-name>replaceWithRealBusinessMethod</method-name>
             <method-params>
             </method-params>
          </method>
       </method-permission>
    
       <!-- finder permissions -->
    
       <!-- transactions -->
         <!--
           To specify additional container-transaction elements, add a file in the merge
           directory called ejb-container-transaction.ent that contains them.
         -->
    
       <!-- finder transactions -->
    
         <!--
           To specify an exclude-list element, add a file in the merge directory
           called ejb-exclude-list.xml that contains it.
         -->
       </assembly-descriptor>

    Try not using a assembly-descriptor.xml merge file at all. Specify your @ejb.permissions on your methods. And if you need other security-roles and permissions that aren’t being generated from your xdoclet tags use the ejb-security-roles.xml and ejb-method-permissions.ent merge files.

    #221880

    Erez
    Member

    Thanks Greg I will go and try it!

    #221882

    Erez
    Member

    Greg, you’re the man 🙂

    It worked… no I can smile again..

    #221885

    Greg
    Member

    Good deal, probably something changed in ejbdoclet between version 1.2 and 1.2.2 of the EJB module. I’m glad your back up and running.

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: Bad generation of ejb-jar.xml [closed]

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