DATABASE BC - exception thrown during binary data insert

5 messages Options
Embed this post
Permalink
Marian B

DATABASE BC - exception thrown during binary data insert

Reply Threaded More More options
Print post
Permalink
Hi,

I have a problem with inserting binary data into database using database bc. I created bpel process with database-bc binding in Netbeans. First, binary file is readed using file-bc, then assigned to input variable for invoked db binding.

Netbeans generated xsd schema of table for me. There was used symple type <xsd:simpleType name="LONGVARBINARY"> for binary column.
My xml schema:

<?xml version="1.0" encoding="UTF-8"?>
  <xsd:schema elementFormDefault="qualified" targetNamespace="http://j2ee.netbeans.org/xsd/tableSchema" xmlns="http://j2ee.netbeans.org/xsd/tableSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="EInvoice" type="EInvoice"></xsd:element>
    <xsd:complexType name="EInvoice">
      <xsd:sequence>
        <xsd:element maxOccurs="unbounded" ref="EInvoice_Record"></xsd:element>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="LONGVARBINARY">
      <xsd:restriction base="xsd:base64Binary">
        <xsd:maxLength value="1073741824"></xsd:maxLength>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:element name="EInvoice_Record">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="content">
            <xsd:complexType>
              <xsd:simpleContent>
                <xsd:extension base="LONGVARBINARY">
                  <xsd:attribute name="isNull" type="xsd:boolean"></xsd:attribute>
                </xsd:extension>
              </xsd:simpleContent>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="fileName">
            <xsd:complexType>
              <xsd:simpleContent>
                <xsd:extension base="xsd:string">
                  <xsd:attribute name="isNull" type="xsd:boolean"></xsd:attribute>
                </xsd:extension>
              </xsd:simpleContent>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="invoiceNo">
            <xsd:complexType>
              <xsd:simpleContent>
                <xsd:extension base="xsd:string">
                  <xsd:attribute name="isNull" type="xsd:boolean"></xsd:attribute>
                </xsd:extension>
              </xsd:simpleContent>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>

However it did not work so I searched forums and found this thread: http://n2.nabble.com/Error-with-the-databaseBC-from-new-gfesb-RC2-td3029280.html experiencing same exception:

javax.jbi.messaging.MessagingException: Unable to convert normalized message content to prepared statement, Error occured during populating PreparedStatement.Reason: null

So I tried to rewrite the type LONGVARBINARY first to CLOB, which caused an exception: javax.sql.rowset.serial.SerialException: Invalid position in BLOB object set.
Then I tried to rewrite the type to BLOB, but now I am getting javax.sql.rowset.serial.SerialException: Invalid arguments: position cannot be less that 1.

I studied source code of datbase bc, especially source of method org.glassfish.openesb.databasebc.JDBCDenormalizer.denormalizeOutbound(JDBCDenormalizer.java:120)
which is the place the exception comes from, did not figured out nothing.

Please could you give me a hint what to do?

Thanks.

Marian
Kevan Moran

Re: DATABASE BC - exception thrown during binary data insert

Reply Threaded More More options
Print post
Permalink
I understand that the Database BC does not support BLOBs. We had a similar issue with MySql TEXT fields

Marian B wrote:
Hi,

I have a problem with inserting binary data into database using database bc. I created bpel process with database-bc binding in Netbeans. First, binary file is readed using file-bc, then assigned to input variable for invoked db binding.

Netbeans generated xsd schema of table for me. There was used symple type <xsd:simpleType name="LONGVARBINARY"> for binary column.
My xml schema:

<?xml version="1.0" encoding="UTF-8"?>
  <xsd:schema elementFormDefault="qualified" targetNamespace="http://j2ee.netbeans.org/xsd/tableSchema" xmlns="http://j2ee.netbeans.org/xsd/tableSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="EInvoice" type="EInvoice"></xsd:element>
    <xsd:complexType name="EInvoice">
      <xsd:sequence>
        <xsd:element maxOccurs="unbounded" ref="EInvoice_Record"></xsd:element>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="LONGVARBINARY">
      <xsd:restriction base="xsd:base64Binary">
        <xsd:maxLength value="1073741824"></xsd:maxLength>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:element name="EInvoice_Record">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="content">
            <xsd:complexType>
              <xsd:simpleContent>
                <xsd:extension base="LONGVARBINARY">
                  <xsd:attribute name="isNull" type="xsd:boolean"></xsd:attribute>
                </xsd:extension>
              </xsd:simpleContent>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="fileName">
            <xsd:complexType>
              <xsd:simpleContent>
                <xsd:extension base="xsd:string">
                  <xsd:attribute name="isNull" type="xsd:boolean"></xsd:attribute>
                </xsd:extension>
              </xsd:simpleContent>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="invoiceNo">
            <xsd:complexType>
              <xsd:simpleContent>
                <xsd:extension base="xsd:string">
                  <xsd:attribute name="isNull" type="xsd:boolean"></xsd:attribute>
                </xsd:extension>
              </xsd:simpleContent>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>

However it did not work so I searched forums and found this thread: http://n2.nabble.com/Error-with-the-databaseBC-from-new-gfesb-RC2-td3029280.html experiencing same exception:

javax.jbi.messaging.MessagingException: Unable to convert normalized message content to prepared statement, Error occured during populating PreparedStatement.Reason: null

So I tried to rewrite the type LONGVARBINARY first to CLOB, which caused an exception: javax.sql.rowset.serial.SerialException: Invalid position in BLOB object set.
Then I tried to rewrite the type to BLOB, but now I am getting javax.sql.rowset.serial.SerialException: Invalid arguments: position cannot be less that 1.

I studied source code of datbase bc, especially source of method org.glassfish.openesb.databasebc.JDBCDenormalizer.denormalizeOutbound(JDBCDenormalizer.java:120)
which is the place the exception comes from, did not figured out nothing.

Please could you give me a hint what to do?

Thanks.

Marian
Andy Knight

Re: DATABASE BC - exception thrown during binary data insert

Reply Threaded More More options
Print post
Permalink
If LOBs are not supported then this should be highlighted at design  
time.

         Andy Knight
Principal Engineer,
Sun Microsystems, Inc.
Java House, Guillemont Park, Minley Road,
Camberley, Surrey GU17 9QG United Kingdom
Home office: +44 1494 462438
Mobile: +44 7775 583415
Skype: aprknight
Email: [hidden email]
Blog: http://blogs.sun.com/andky

On 10 Nov 2009, at 00:52, Kevan Moran wrote:

>
> I understand that the Database BC does not support BLOBs. We had a  
> similar
> issue with MySql TEXT fields
>
>
> Marian B wrote:
>>
>> Hi,
>>
>> I have a problem with inserting binary data into database using  
>> database
>> bc. I created bpel process with database-bc binding in Netbeans.  
>> First,
>> binary file is readed using file-bc, then assigned to input  
>> variable for
>> invoked db binding.
>>
>> Netbeans generated xsd schema of table for me. There was used  
>> symple type
>> <xsd:simpleType name="LONGVARBINARY"> for binary column.
>> My xml schema:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>  <xsd:schema elementFormDefault="qualified"
>> targetNamespace="http://j2ee.netbeans.org/xsd/tableSchema"
>> xmlns="http://j2ee.netbeans.org/xsd/tableSchema"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>>    <xsd:element name="EInvoice" type="EInvoice"></xsd:element>
>>    <xsd:complexType name="EInvoice">
>>      <xsd:sequence>
>>        <xsd:element maxOccurs="unbounded"
>> ref="EInvoice_Record"></xsd:element>
>>      </xsd:sequence>
>>    </xsd:complexType>
>>    <xsd:simpleType name="LONGVARBINARY">
>>      <xsd:restriction base="xsd:base64Binary">
>>        <xsd:maxLength value="1073741824"></xsd:maxLength>
>>      </xsd:restriction>
>>    </xsd:simpleType>
>>    <xsd:element name="EInvoice_Record">
>>      <xsd:complexType>
>>        <xsd:sequence>
>>          <xsd:element name="content">
>>            <xsd:complexType>
>>              <xsd:simpleContent>
>>                <xsd:extension base="LONGVARBINARY">
>>                  <xsd:attribute name="isNull"
>> type="xsd:boolean"></xsd:attribute>
>>                </xsd:extension>
>>              </xsd:simpleContent>
>>            </xsd:complexType>
>>          </xsd:element>
>>          <xsd:element name="fileName">
>>            <xsd:complexType>
>>              <xsd:simpleContent>
>>                <xsd:extension base="xsd:string">
>>                  <xsd:attribute name="isNull"
>> type="xsd:boolean"></xsd:attribute>
>>                </xsd:extension>
>>              </xsd:simpleContent>
>>            </xsd:complexType>
>>          </xsd:element>
>>          <xsd:element name="invoiceNo">
>>            <xsd:complexType>
>>              <xsd:simpleContent>
>>                <xsd:extension base="xsd:string">
>>                  <xsd:attribute name="isNull"
>> type="xsd:boolean"></xsd:attribute>
>>                </xsd:extension>
>>              </xsd:simpleContent>
>>            </xsd:complexType>
>>          </xsd:element>
>>        </xsd:sequence>
>>      </xsd:complexType>
>>    </xsd:element>
>>  </xsd:schema>
>>
>> However it did not work so I searched forums and found this thread:
>> http://n2.nabble.com/Error-with-the-databaseBC-from-new-gfesb-RC2-td3029280.html
>> experiencing same exception:
>>
>> javax.jbi.messaging.MessagingException: Unable to convert normalized
>> message content to prepared statement, Error occured during  
>> populating
>> PreparedStatement.Reason: null
>>
>> So I tried to rewrite the type LONGVARBINARY first to CLOB, which  
>> caused
>> an exception: javax.sql.rowset.serial.SerialException: Invalid  
>> position in
>> BLOB object set.
>> Then I tried to rewrite the type to BLOB, but now I am getting
>> javax.sql.rowset.serial.SerialException: Invalid arguments: position
>> cannot be less that 1.
>>
>> I studied source code of datbase bc, especially source of method
>> org.glassfish.openesb.databasebc.JDBCDenormalizer.denormalizeOutbound
>> (JDBCDenormalizer.java:120)
>> which is the place the exception comes from, did not figured out  
>> nothing.
>>
>> Please could you give me a hint what to do?
>>
>> Thanks.
>>
>> Marian
>>
>>
>
> --
> View this message in context: http://n2.nabble.com/DATABASE-BC-exception-thrown-during-binary-data-insert-tp3969256p3976981.html
> Sent from the OpenESB Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Marian B

Re: DATABASE BC - exception thrown during binary data insert

Reply Threaded More More options
Print post
Permalink
I believe that BLOB should be supported. I already raised a bug. Now I can see that similar bug is listed
as https://open-esb.dev.java.net/issues/show_bug.cgi?id=1087 with issues 432 and 1534  closed as duplicates.

I am confused now because I really do not know what state it is in.

I think the developers should write something about this blob support onto project's website next to features.

Marian

Andy Knight wrote:
If LOBs are not supported then this should be highlighted at design  
time.

         Andy Knight
Principal Engineer,
Sun Microsystems, Inc.
Java House, Guillemont Park, Minley Road,
Camberley, Surrey GU17 9QG United Kingdom
Home office: +44 1494 462438
Mobile: +44 7775 583415
Skype: aprknight
Email: Andy.Knight@Sun.COM
Blog: http://blogs.sun.com/andky

On 10 Nov 2009, at 00:52, Kevan Moran wrote:

>
> I understand that the Database BC does not support BLOBs. We had a  
> similar
> issue with MySql TEXT fields
>
>
> Marian B wrote:
>>
>> Hi,
>>
>> I have a problem with inserting binary data into database using  
>> database
>> bc. I created bpel process with database-bc binding in Netbeans.  
>> First,
>> binary file is readed using file-bc, then assigned to input  
>> variable for
>> invoked db binding.
>>
>> Netbeans generated xsd schema of table for me. There was used  
>> symple type
>> <xsd:simpleType name="LONGVARBINARY"> for binary column.
>> My xml schema:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>  <xsd:schema elementFormDefault="qualified"
>> targetNamespace="http://j2ee.netbeans.org/xsd/tableSchema"
>> xmlns="http://j2ee.netbeans.org/xsd/tableSchema"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>>    <xsd:element name="EInvoice" type="EInvoice"></xsd:element>
>>    <xsd:complexType name="EInvoice">
>>      <xsd:sequence>
>>        <xsd:element maxOccurs="unbounded"
>> ref="EInvoice_Record"></xsd:element>
>>      </xsd:sequence>
>>    </xsd:complexType>
>>    <xsd:simpleType name="LONGVARBINARY">
>>      <xsd:restriction base="xsd:base64Binary">
>>        <xsd:maxLength value="1073741824"></xsd:maxLength>
>>      </xsd:restriction>
>>    </xsd:simpleType>
>>    <xsd:element name="EInvoice_Record">
>>      <xsd:complexType>
>>        <xsd:sequence>
>>          <xsd:element name="content">
>>            <xsd:complexType>
>>              <xsd:simpleContent>
>>                <xsd:extension base="LONGVARBINARY">
>>                  <xsd:attribute name="isNull"
>> type="xsd:boolean"></xsd:attribute>
>>                </xsd:extension>
>>              </xsd:simpleContent>
>>            </xsd:complexType>
>>          </xsd:element>
>>          <xsd:element name="fileName">
>>            <xsd:complexType>
>>              <xsd:simpleContent>
>>                <xsd:extension base="xsd:string">
>>                  <xsd:attribute name="isNull"
>> type="xsd:boolean"></xsd:attribute>
>>                </xsd:extension>
>>              </xsd:simpleContent>
>>            </xsd:complexType>
>>          </xsd:element>
>>          <xsd:element name="invoiceNo">
>>            <xsd:complexType>
>>              <xsd:simpleContent>
>>                <xsd:extension base="xsd:string">
>>                  <xsd:attribute name="isNull"
>> type="xsd:boolean"></xsd:attribute>
>>                </xsd:extension>
>>              </xsd:simpleContent>
>>            </xsd:complexType>
>>          </xsd:element>
>>        </xsd:sequence>
>>      </xsd:complexType>
>>    </xsd:element>
>>  </xsd:schema>
>>
>> However it did not work so I searched forums and found this thread:
>> http://n2.nabble.com/Error-with-the-databaseBC-from-new-gfesb-RC2-td3029280.html
>> experiencing same exception:
>>
>> javax.jbi.messaging.MessagingException: Unable to convert normalized
>> message content to prepared statement, Error occured during  
>> populating
>> PreparedStatement.Reason: null
>>
>> So I tried to rewrite the type LONGVARBINARY first to CLOB, which  
>> caused
>> an exception: javax.sql.rowset.serial.SerialException: Invalid  
>> position in
>> BLOB object set.
>> Then I tried to rewrite the type to BLOB, but now I am getting
>> javax.sql.rowset.serial.SerialException: Invalid arguments: position
>> cannot be less that 1.
>>
>> I studied source code of datbase bc, especially source of method
>> org.glassfish.openesb.databasebc.JDBCDenormalizer.denormalizeOutbound
>> (JDBCDenormalizer.java:120)
>> which is the place the exception comes from, did not figured out  
>> nothing.
>>
>> Please could you give me a hint what to do?
>>
>> Thanks.
>>
>> Marian
>>
>>
>
> --
> View this message in context: http://n2.nabble.com/DATABASE-BC-exception-thrown-during-binary-data-insert-tp3969256p3976981.html
> Sent from the OpenESB Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@open-esb.dev.java.net
> For additional commands, e-mail: users-help@open-esb.dev.java.net
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@open-esb.dev.java.net
For additional commands, e-mail: users-help@open-esb.dev.java.net
stzhang

Re: DATABASE BC - exception thrown during binary data insert

Reply Threaded More More options
Print post
Permalink
hi Marian,

I had this issue couple of month ago as well, it doesn't look like to me the current stable release of Database DB support BLOB data type neither, according to mail-listing thread:http://n2.nabble.com/Database-BC-binding-error-td2951759.html#a2951759, and I also found out quite a few posts(#432, #1087, #1468, #1534, #2426, ) regards to this problem on issue-track-list(Database BC track list), which are mostly marked as "DUPL" rather than "FIXED".

btw, Andy Knight, if you do know any place documented what data types supported by Database DB specifically. please post a link back. much appreciated.

Regards
stzhang