In openejb-jar.xml file for a cmp entity bean if the cmp-connection-factory element contains a name tag instead of a resource-link tag the deployer deploys the ejb.
<cmp-connection-factory>
<name>DefaultDatasource</name>
</cmp-connection-factory>
This is correct as per the schema but it gives a null pointer exception on trying to call the EJB.The correct syntax from geronimo wiki is
<cmp-connection-factory>
<application>null</application>
<module>org/apache/geronimo/DefaultDatabase</module>
<name>DefaultDatasource</name>
</cmp-connection-factory>
The schema is as follows
<xsd:element name="cmp-connection-factory" type="gernaming:resource-locatorType"/>
<xsd:complexType name="resource-locatorType">
<xsd:sequence>
<xsd:choice>
<xsd:group ref="gernaming:objectNameGroup"/>
<xsd:element name="resource-link" type="xsd:string"/>
<xsd:element name="target-name" type="xsd:string"/>
<xsd:element name="url" type="xsd:string"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
<xsd:group name="objectNameGroup">
<xsd:annotation>
<xsd:documentation>This group contains the components of a jsr-77 object name</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="domain" type="xsd:string" minOccurs="0"/>
<xsd:element name="server" type="xsd:string" minOccurs="0"/>
<xsd:element name="application" type="xsd:string" minOccurs="0"/>
<xsd:element name="module" type="xsd:string" minOccurs="0"/>
<xsd:element name="type" type="xsd:string" minOccurs="0"/>
<xsd:element name="name" type="xsd:string"/>
</xsd:sequence>
</xsd:group>
Since application an module has minOccurs as 0 only the name attribute is required.
My question is whether the syntax given below is valid? If so there is some problem with the code .On the other hand if the syntax is invalid then the schema needs to be modified.
<cmp-connection-factory>
<name>DefaultDatasource</name>
</cmp-connection-factory>
Thanks and Regards
Manu
