User: starksm
Date: 01/06/25 09:37:19
Modified: src/main/org/jboss/metadata ApplicationMetaData.java
Log:
The existence of a DOCTYPE does not mean there is a public ID so check
that the id string is not null before invoking methods on it.
Revision Changes Path
1.20 +17 -12 jboss/src/main/org/jboss/metadata/ApplicationMetaData.java
Index: ApplicationMetaData.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/ApplicationMetaData.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ApplicationMetaData.java 2001/06/24 00:46:34 1.19
+++ ApplicationMetaData.java 2001/06/25 16:37:19 1.20
@@ -28,7 +28,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Antman</a>.
* @author <a href="mailto:[EMAIL PROTECTED]">Scott Stark</a>.
- * @version $Revision: 1.19 $
+ * @version $Revision: 1.20 $
*/
public class ApplicationMetaData extends MetaData
{
@@ -125,23 +125,28 @@
return enforceEjbRestrictions;
}
- public void importEjbJarXml (Element element) throws DeploymentException {
-
- // EJB version is determined by the doc type that
- // was used to verify the ejb-jar.xml.
- DocumentType docType = element.getOwnerDocument().getDoctype();
- if(docType!=null && docType.getPublicId().startsWith(
- "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0")) {
+ public void importEjbJarXml (Element element) throws DeploymentException
+ {
+ // EJB version is determined by the doc type that
+ // was used to verify the ejb-jar.xml.
+ DocumentType docType = element.getOwnerDocument().getDoctype();
+ String publicID = null;
+ if( docType != null )
+ publicID = docType.getPublicId();
+ if( publicID != null && publicID.startsWith("-//Sun Microsystems, Inc.//DTD
Enterprise JavaBeans 2.0") )
+ {
// 2.0 dtd
ejbVersion = 2;
- } else {
+ }
+ else
+ {
// default is 1.x DTD
ejbVersion = 1;
- }
+ }
- // find the beans
+ // find the beans
Element enterpriseBeans = getUniqueChild(element, "enterprise-beans");
-
+
// entities
Iterator iterator = getChildrenByTagName(enterpriseBeans, "entity");
while (iterator.hasNext()) {
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development