oracle-service.xml and ejb-jar.xml
cdmdev Jul 1, 2002 5:49 PMI am having an issue deploying my bean managed entity bean. It seems the deployment is not working. It says that it is deploying the bean, then states it is deployed properly, but it does not register the bean...
I am trying to have my entity bean connect to Oracle, I do not know how the mapping works between oracle-service.xml (similar to the JBoss supplied example but modified for my env.) and the ejb-jar.xml file. Can anyone explain it to me? Thanks, the following are my 2 files and the code I use to look it up.
Also I am using JBoss 3.0...
********************************************************
oracle-service.xml:
<depends optional-attribute-name="ManagedConnectionFactoryName">
<!--embedded mbean-->
OracleDS
<config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@box1:1521:ASID</config-property>
<config-property name="DriverClass" type="java.lang.String">oracle.jdbc.driver.OracleDriver</config-property>
<!--set these only if you want only default logins, not through JAAS -->
<config-property name="UserName" type="java.lang.String">billy</config-property>
<config-property name="Password" type="java.lang.String">bob</config-property>
<!--Below here are advanced properties -->
<!--hack-->
<depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
<depends optional-attribute-name="ManagedConnectionPool">
<!--embedded mbean-->
0
50
5000
15
<!--criteria indicates if Subject (from security domain) or app supplied
parameters (such as from getConnection(user, pw)) are used to distinguish
connections in the pool. Choices are
ByContainerAndApplication (use both),
ByContainer (use Subject),
ByApplication (use app supplied params only),
ByNothing (all connections are equivalent, usually if adapter supports
reauthentication)-->
ByContainer
<depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
<depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager
java:/TransactionManager
<!--make the rar deploy! hack till better deployment-->
jboss.jca:service=RARDeployer
********************************************************
Here is my ejb-jar.xml:
<?xml version="1.0"?>
<ejb-jar>
<enterprise-beans>
<ejb-name>hdt</ejb-name>
entitybeanexample.HdtHome
entitybeanexample.HdtRemote
<local-home>entitybeanexample.HdtLocalHome</local-home>
entitybeanexample.HdtLocal
<ejb-class>entitybeanexample.HdtBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>entitybeanexample.HdtPK</prim-key-class>
False
<resource-ref>
<res-ref-name>jdbc/ejbPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<ejb-name>hdt</ejb-name>
<method-intf>Local</method-intf>
<method-name>*</method-name>
<ejb-name>hdt</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<assembly-descriptor>
</ejb-jar>
********************************************************
Here is the code I use to get a connection:
Context ctx = new InitialContext();
DataSource ds = (javax.sql.DataSource)ctx.lookup("java:comp/env/jdbc/ejbPool");
retVal = ds.getConnection();
********************************************************
Any help would be greatly appreciated. Thanks much!!
Brent