1 Reply Latest reply on Jan 18, 2005 3:41 PM by lafr

    Invalid DOCTYPE error (by using XDoclet ejbspec="2.1")

    jlegeny

      Hello,

      I'm using JBoss 3.2.6 (also JBoss 4.0) and XDoclet 1.2.2. I have generated
      particular EJB stuff by XDoclet (home and remote interfaces + deployment descriptor).
      But when I used ejbspec="2.1" there was following error occured when I have try
      to deploy application:

      org.jboss.deployment.DeploymentException: ejb-jar.xml must define a valid DOCTYPE!

      But when I used ejbspec="2.0", deploying of the application passed.

      I have write to XDoclet mailing list and here is theyr answer:

      **************************************************************************

      My question:
      ============

      I have a problem XDoclet does not generate me DOCTYPE into the ejb-jar.xml file.

      Here is my ant task that I use:
      ===============================

      <!-- Generate ejb classes -->
      < ejbdoclet ejbspec="2.1" ejbClassNameSuffix="Impl"
      destdir="${generated_home}/${projectname}/${build_home}/generated-ejb/"
      excludedtags="@version,@author"
      addedtags="@xdoclet-generated at ${TODAY}">

      < fileset dir="${generated_home}/${projectname}/${buildsrc_home}/${code_home}">

      </ fileset>

      < remoteinterface pattern="{0}Remote"/>
      < homeinterface pattern="{0}RemoteHome"/>
      < localhomeinterface pattern="{0}Home"/>
      < deploymentdescriptor validateXML="true"/>


      </ ejbdoclet>


      Here is generated ejb-jar.xml file:
      ===================================

      <?xml version="1.0" encoding="UTF-8"?>
      ### HERE IS MISSING <!DOCTYPE ejb-jar PUBLIC ... ###
      <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">

      [CDATA[No Description.]]
      <display-name>Generated by XDoclet</display-name>

      ... other stuff

      </ejb-jar>


      But when I change <ejbdoclet ejbspec="2.1" ...> to
      <ejbdoclet ejbspec="2.0" ...> (I have changed only ejbcpec from
      2.1 to 2.0) it already generates doctype.

      Is it ok ?

      -------------------------------------------------------------------------

      Answer to my question:
      ======================

      There's no DOCTYPE missing, as that's only used if there's a DTD. From
      EJB 2.1/J2EE 1.4, Sun have switched to using an XML Schema to validate
      the deployment descriptors (hence all that xmlns namespace stuff that's
      on the ejb-jar element) instead of a DTD, and so there's no DOCTYPE

      **************************************************************************

      Is there possibility to deploy application using JBoss by defining ejbspec="2.1" within the XDoclet ?
      Is it neccessary to set up some extra parameters for this case ?

      Thank you for your answer,
      with best regards,

      Julian Legeny