1 Reply Latest reply on Sep 13, 2002 11:24 PM by Dain Sundstrom

    Need help setting up Oracle Datasource, CMP1.1

    Steve Reynolds Newbie

      I am porting an EJB 1.1 Application from Weblogic to JBoss 3.0.2/Tomcat4. I need some help setting up the DataSource for this project, I am using JBuilder 6 Enterprise. First, here is my oracle-service.xml:

      <!-- ==================================================================== -->
      <!-- ConnectionManager setup for Oracle dbs -->
      <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
      <!-- Thanks to Steven Coy -->
      <!-- ==================================================================== -->

      <!-- Include a login module configuration named OracleDbRealm.
      Update your login-conf.xml, here is an example for a

      <application-policy name = "OracleDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">yourprincipal</module-option>
      <module-option name = "userName">yourusername</module-option>
      <module-option name = "password">yourpassword</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=PCNPool</module-option>


      NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
      module-option name = "managedConnectionFactoryName"
      must match the object name of the ConnectionManager you are configuring here.

      <!--uncomment out this line if you are using the OracleDbRealm above

      <depends optional-attribute-name="ManagedConnectionFactoryName">
      <!--embedded mbean-->


      <config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@kirk:1521:mscdb</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">username</config-property>
      <config-property name="Password" type="java.lang.String">password</config-property>

      <!--Below here are advanced properties -->
      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper

      <depends optional-attribute-name="ManagedConnectionPool">
      <!--embedded mbean-->

      <!--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

      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager

      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager


      <!--make the rar deploy! hack till better deployment-->

      I have a bean called ReqBean. Under the Resource References Tab, I have a resource named jdbc/DefaultDS and in the deployment settings I set the JNDI name to DefaultDS. Should the CMP button be checked? This is a CMP 1.1.

      I am getting some database errors such as invalid column name.
      2002-09-13 13:17:01,010 DEBUG [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] findByReqId command executing: SELECT TREQ_AREAS.REQ_ID,TREQ_AREAS.AREA_ID FROM TREQ_AREAS where reqId = ?
      2002-09-13 13:17:01,020 DEBUG [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] Set parameter: idx=1, jdbcType=VARCHAR, value=REQ1
      2002-09-13 13:17:01,271 ERROR [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] Exception caught executing SQL
      java.sql.SQLException: ORA-00904: invalid column name

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
      at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
      at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)

      From what I have read, it sounds like JBoss is not picking up the cmp-field settings in jaws.xml.

      I have also got an inconsistent data type sql error. This error appears to be due to JBoss not picking up the data type mapping in the standardjaws.xml.

      I am almost certain that my problems are caused because I don't have oracle-service.xml or maybe standardjaws.xml configured properly.

      I would appreciate it if anyone could point me in the right direction on this. Or if someone could send me a working example of oracle-service.xml for this situation. Also, is there anything I need to change in standardjaws.xml or any other file?

      All of this worked under weblogic.

      Any help would be appreciated. Thanks.