7 Replies Latest reply on Nov 17, 2002 7:16 PM by scoy

    Problem with 3.0.4 and Oracle 9: invalid column name

    haslbeck

      Hello.

      I have been using JBoss 3.0.0, 3.0.2 and 3.0.3 all successfully with both Oracle 8i and 9. I have changed the BLOB mapping to LONG RAW in standardjbosscmp and standardjaws and everything worked fine.

      After upgrading to JBoss 3.0.4 I always receive "invalid column name" for all java.lang.objects which need to be passivated to/from a BLOB.

      What has changed in Jboss 3.0.4? Are there any work-arounds?

      Thanks in advance.

        • 1. Re: Problem with 3.0.4 and Oracle 9: invalid column name
          scoy

          The binary data handling, and in particular BLOBs was overhauled in 3.0.4.

          Can you be more specific about what you are doing and exactly how you changed standardjbosscmp?

          In particular, LONG RAW should have a JDBC type of LONGVARBINARY.

          If you really want BLOBs (which work now btw), then use a JDBC type of BLOB and SQL type BLOB.

          Steve

          • 2. Re: Problem with 3.0.4 and Oracle 9: invalid column name
            haslbeck

            Thanks for offering your help. Here is some additional information:


            standardjaws was modified like this:
            (relevant section only)

            <java-type>java.lang.Object</java-type>
            <jdbc-type>JAVA_OBJECT</jdbc-type>
            <sql-type>LONG RAW</sql-type>

            standardjbosscmp-jdbc was modified like this:
            (relevant section only)

            <java-type>java.lang.Object</java-type>
            <jdbc-type>JAVA_OBJECT</jdbc-type>
            <sql-type>LONG RAW</sql-type>


            I'm using the latest Oracle driver. Here is the manifest of the driver file:

            Manifest-Version: 1.0
            Specification-Title: "Oracle JDBC driver classes for use with JDK1.4"
            Specification-Version: "Oracle JDBC Driver version - 9.0.2.0.0"
            Specification-Vendor: "Oracle Corporation" .
            Implementation-Title: "ojdbc14.jar"
            Implementation-Version: "Oracle JDBC Driver version - 9.0.2.0.0"
            Implementation-Vendor: "Oracle Corporation"
            Implementation-Time: "Thu Apr 25 23:14:02 2002"


            Here is the relevant section form the sever-log:

            2002-11-14 14:24:49,850 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.measrmnt_conf_global] Executing SQL: INSERT INTO MEASRMNT_CONF_GLOBAL (obid, name, description, type, creatorID, creationDate, controller, interval, startTime, endTime, permanent, parameters, active, measrmnt_conf_saa_confGlobal, measrmnt_conf_snmp_confGlobal, measrmnt_conf_ping_confGlobal) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
            2002-11-14 14:24:49,882 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.measrmnt_conf_global] Could not create entity
            javax.ejb.EJBException: Internal error setting parameters for field parameters; CausedByException is:
            Invalid column type
            at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgumentParameters(JDBCAbstractCMPFieldBridge.java:297)
            at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setInstanceParameters(JDBCAbstractCMPFieldBridge.java:270)
            at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.java:192)
            at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:131)
            at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:527)
            at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:253)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270)

            • 3. Re: Problem with 3.0.4 and Oracle 9: invalid column name
              scoy

              Use this:

              <java-type>java.lang.Object</java-type>
              <jdbc-type>BLOB</jdbc-type>
              <sql-type>BLOB</sql-type>

              or this:

              <java-type>java.lang.Object</java-type>
              <jdbc-type>LONGVARBINARY</jdbc-type>
              <sql-type>LONG RAW</sql-type>

              Oracle would prefer that you use BLOBs. You can have only one LONG column per table.

              Do not use JAVA_OBJECT for this purpose. JAVA_OBJECT is intended to be mapped to custom database types.

              JBoss takes care of automatically serialising/deserialising your object to/from the database column.

              Steve

              • 4. Re: Problem with 3.0.4 and Oracle 9: invalid column name
                haslbeck

                Thanks mate, got it to work now!

                The BLOB/BLOB setting (which is the default) didn't work (invalid column type, again) but the second mapping with LONGVARBINARY did do the trick.

                After two days fiddling around with that stuff, I'm off for a beer or two ...

                • 5. Re: Problem with 3.0.4 and Oracle 9: invalid column name
                  scoy

                  Probably because the table was already in existence with a LONG RAW column.

                  You need to drop the table and get JBoss to recreate it for you.

                  Steve

                  • 6. Re: Problem with 3.0.4 and Oracle 9: invalid column name
                    haslbeck

                    No, I did remove the table. When using the mapping BLOB, oracle shows the column type as "OTHER".

                    • 7. Re: Problem with 3.0.4 and Oracle 9: invalid column name
                      scoy

                      G'Day again,

                      This is a bit odd. Can you turn on debugging in the server log and have a look at the generated "CREATE TABLE" command?

                      Steve