Problem inserting Blob through Oracle 9iAs

Hai Everybody,
I got a unique problem , i am trying to insert a blob object to the blob column. This is working fine when i am using JDeveloper 9.0.3 , but when i am using the same on 9iAS , the data is not evening inserting to the database. Please can any body help me how to solve this problem.
This is the code used to insert into the database.
if (resSet.next()) {
oracle.sql.BLOB bCol = ((OracleResultSet)resSet).getBLOB(1);
blobOutputStream = bCol.getBinaryOutputStream();
byte[] bBuffer = new byte[bCol.getBufferSize()];
int intBytesRead = 0;
ByteArrayInputStream fis = new ByteArrayInputStream(byteValues);
ErrorLog.log(" before the while loop ");
while ((intBytesRead = fis.read(bBuffer)) != -1) {
blobOutputStream.write(bBuffer,0,intBytesRead);
blobOutputStream.close();
// i am commiting the connection here
conn.commit();
conn.setAutoCommit(true);

Hi !, you can find response of this answer in Oracle forums...
http://forums.oracle.com/forums/forum.jsp?forum=99

Similar Messages

  • RegisterOutParameter - setBinaryStream - Problems inserting Blob - setRAW

    As posted in metalink (was: "Problems inserting BLOB/InputStream with ojdbc14.jar for 10g - Data size bigger than max size for this type"):
    Using setBinaryStream for large Blobs works as long as I don't register outParameters.
    Query that works: "INSERT INTO blobtest (attachment_id,name,data) VALUES(blobtest_SEQ.nextval,?,?)";
    Query that fails = "BEGIN INSERT INTO blobtest (attachment_id,name,data) VALUES( blobtest_SEQ.nextval,?,?) RETURN attachment_id INTO ? ; END;"
    The necessary tables were created by hand:
    CREATE TABLE blobtest ( NAME CHAR(255), data BLOB, attachment_id NUMBER(38))
    And
    CREATE SEQUENCE TBL_ATTACHMENT_SEQ
    The output was: <<user: SEE
    pw: QD
    instantiating oracle driver
    query: INSERT INTO blobtest (attachment_id,name,data) VALUES(TBL_ATTACHMENT_SEQ.nextval,?,?)
    uploaded no Return Parameter blob of size: 256809
    query: BEGIN INSERT INTO blobtest (attachment_id,name,data) VALUES(TBL_ATTACHMENT_SEQ.nextval,?,?) RETURN attachment_id INTO ? ; END;
    java.sql.SQLException: Datengr÷&#9600;e gr÷&#9600;er als max. Gr÷&#9600;e f³r diesen Typ: 256809
    at
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :125)
    at
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :162)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setRAW(OraclePreparedState
    ment.java:5342)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setBinaryStreamInternal(Or
    aclePreparedStatement.java:6885)
    at
    oracle.jdbc.driver.OracleCallableStatement.setBinaryStream(OracleCall
    ableStatement.java:4489)
    at BlobTest.writeBlob(BlobTest.java:161)
    at BlobTest.testBlob(BlobTest.java:118)
    at BlobTest.main(BlobTest.java:92)
    error: Datengr÷&#9600;e gr÷&#9600;er als max. Gr÷&#9600;e f³r diesen Typ:
    256809>>
    here the java test case:
    * Created on 25.08.2004 $Id: BlobTest.java,v 1.4 2005/04/22 11:21:11 hauser Exp $
    * as posted in metalink jdbc forum 050405 and responses by
    * [email protected]
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.InputStream;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.Types;
    public class BlobTest {
    private static String FILE_NAME = "c:/temp/veryLargeFile.pdf";
    public BlobTest() {
    final static int ORACLE = 1;
    final static int MYSQL = 2;
    private String jdbcUrl = "jdbc:mysql://localhost/test?user=monty&password=greatsqldb";
    private int dbType = ORACLE;
    private Driver driver = null;
    private String user = "";
    private String pw = "";
    public static String SCHEME = "";
    public static void main(String[] args) {
    BlobTest bt = new BlobTest();
    if (args[0] != null) {
    System.out.println("dbType: " + args[0]);
    if (args[0].toLowerCase().indexOf("oracle") != -1) {
    bt.dbType = ORACLE;
    if (args[0].toLowerCase().indexOf("mysql") != -1) {
    bt.dbType = MYSQL;
    } else {
    System.out.println("not yet supported db type: " + args[0]);
    System.exit(99);
    if (args[1] != null) {
    System.out.println("jdbcUrl: " + args[1]);
    if (args[1].trim().length() != 0) {
    bt.jdbcUrl = args[1].trim();
    } else {
    System.out.println("not yet supported jdbcUrl : " + args[1]);
    System.exit(99);
    if (args.length > 2 && args[2] != null) {
    System.out.println("user: " + args[2]);
    if (args[2].trim().length() != 0) {
    bt.user = args[2].trim();
    } else {
    System.out.println("invalid user: " + args[2]);
    System.exit(99);
    if (args.length > 3 && args[3] != null) {
    System.out.println("pw: " + args[3].substring(0, 2));
    if (args[3].trim().length() != 0) {
    bt.pw = args[3].trim();
    } else {
    System.out.println("invalid filename: " + args[3]);
    System.exit(99);
    if (args.length > 4 && args[4] != null) {
    System.out.println("filename: " + args[4]);
    if (args[4].trim().length() != 0) {
    FILE_NAME = args[4].trim();
    } else {
    System.out.println("invalid filename: " + args[4]);
    System.exit(99);
    bt.setUp();
    bt.testBlob();
    public void setUp() {
    try {
    if (this.dbType == ORACLE) {
    System.out.println("instantiating oracle driver ");
    this.driver = (Driver) Class.forName(
    "oracle.jdbc.driver.OracleDriver").newInstance();
    } else {
    this.driver = (Driver) Class.forName("com.mysql.jdbc.Driver")
    .newInstance();
    if (this.driver == null) {
    System.out.println("oracle driver is null");
    System.exit(88);
    DriverManager.registerDriver(this.driver);
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println("error: " + e.getMessage());
    public void testBlob() {
    try {
    this.writeBlob();
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println("error: " + e.getMessage());
    * testfunction
    private void writeBlob() throws Exception {
    Connection conn = null;
    PreparedStatement pStmt = null;
    CallableStatement cStmt, cStmt2 = null;
    InputStream in = null;
    try {
    File file = new File(BlobTest.FILE_NAME);
    in = new FileInputStream(file);
    conn = DriverManager.getConnection("jdbc:" + this.jdbcUrl,
    this.user, this.pw);
    conn.setAutoCommit(false);
    String queryWorks = "INSERT INTO " + SCHEME
    + "blobtest (attachment_id,name,data) VALUES(" + SCHEME
    + "TBL_ATTACHMENT_SEQ.nextval,?,?)";
    cStmt = conn.prepareCall(queryWorks);
    System.out.println("query: " + queryWorks);
    cStmt.setString(1, file.getAbsolutePath());
    in = new FileInputStream(file);
    cStmt.setBinaryStream(2, in, (int) file.length());
    cStmt.execute();
    System.out.println("uploaded no Return Parameter blob of size: "
    + file.length());
    conn.commit();
    String queryFails = "BEGIN INSERT INTO " + SCHEME
    + "blobtest (attachment_id,name,data) VALUES(" + SCHEME
    + "TBL_ATTACHMENT_SEQ.nextval,?,?)"
    + " RETURN attachment_id INTO ? ; END;";
    cStmt2 = conn.prepareCall(queryFails);
    System.out.println("query: " + queryFails);
    cStmt2.setString(1, file.getAbsolutePath());
    in = new FileInputStream(file);
    cStmt2.setBinaryStream(2, in, (int) file.length());
    cStmt2.registerOutParameter(3, Types.INTEGER);
    cStmt2.execute();
    System.out.println("uploaded blob of size: " + file.length()
    + " - id: " + cStmt2.getInt(3));
    conn.commit();
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println("error: " + e.getMessage() + "\nname: "
    + BlobTest.FILE_NAME);
    if (conn != null) {
    try {
    conn.rollback();
    } catch (Exception e1) {
    throw e;
    } finally {
    if (in != null) {
    try {
    in.close();
    } catch (Exception e) {
    if (pStmt != null) {
    try {
    pStmt.close();
    } catch (Exception e) {
    if (conn != null) {
    try {
    conn.close();
    } catch (Exception e) {
    and the batch file I use to start:
    @setlocal
    @echo off
    rem $Id: runBlobTest.bat,v 1.2 2005/04/21 15:06:22 hauser Exp $
    set classpath=../WEB-INF/classes;../WEB-INF/lib/ojdbc14.jar;
    echo JAVA_HOME: %JAVA_HOME%
    set JAVA_HOME=C:\PROGRA~1\Java\j2re1.4.1_02\
    echo classpath: %classpath%
    set javaCmd=C:\PROGRA~1\Java\j2re1.4.1_02\bin\java
    %javaCmd% -version
    %javaCmd% BlobTest "oracle" "oracle:thin://@ORADB.yourdomain.COM:1521:t300" "username" "password" "C:\Temp\veryLargeFile.pdf"
    endlocal

    Apparently, this is partially known - with a different stacktrace though:
    <<From: Oracle, Anupama Srinivasan 25-Apr-05 07:15
    Can you please check on Bug:4083226?
    Using the RETURNING Clause is not supported with JDBC. You could embed the statement in PL/SQL Block as in Metalink Note 124268.1 - JDBC Support for DML Returning Clause.
    The Enhancement Request filed on this issue is being considered for Release 10.2
    >>
    And my answer to it.
    Using the RETURNING Clause is not supported with JDBC.This is strange, with just "emptyblob()", it DOES work.
    I guess, our work-around that hopefully is more portable than embedding a "PL/SQL Block" will be to
    1) create the record with an empty blob,
    2) update the blob in a second statement (now, a RETURNING statement is no longer needed)

  • Please HELP!!! I try to insert BLOB to Oracle

    Please help, I try to insert BLOB to Oracle.
    Here is my sample code. Basically what i tried to do is to to try to insert an image file to Oracle.
    But it did not work. If you have a sample code that works, please give me.
    Thanks,
    Tom
    try
    out.println ("Done");
    dbCon=trans.getConnection();
    dbCon.setAutoCommit(false);
    stmt1.execute ("update emorytest.PHYSICIANFOTO set FOTO=empty_blob() where name = 'foobar'");
    stmt = dbCon.prepareCall("SELECT FOTO from emorytest.PHYSICIANFOTO where name='foobar' for update");
    stmt.execute();
    rset = (OracleResultSet)stmt.getResultSet();
    rset.next();
    BLOB bdata = rset.getBLOB("test.jpg");
    os = bdata.getBinaryOutputStream();
    os.write(bdata);
    os.flush();
    os.close();
    dbCon.commit();
    dbCon.close();
    catch (Exception ex)
    ex.printStackTrace();

    Well, the obvious problem is that your "getBLOB" call ought to access the field by the field name "FOTO" not by a file name. Then you need to open an FileInputStream for the image before copying it to the blob's output stream.
    In my opinion BLOB and CLOB handling is jdbc is a confusing mess.

  • Problem loading Blobs to Oracle DB

    Hi folks,
    I am indeed stuck. I wrote a stored procedure, compiled it to byte-code, jarred it, used load java to load it into the Oracle 9i DB and wrapped it in a PL/SQL wrapper. It worked. simply calling it as:
    select
        f_loadBlob('100')
      from dual... produced a return of 1 - that's what the function returns - which is the count of inserted DB rows.
    Now, I altered the java code to load several Blobs instead of just one. I did not change any other code so far as checking and re-checking over and over again brings to my attention. I went through all the same steps - altering the PL/SQL wrapper to to suit.
    But I can't get rid of the following error from the call:
      1  select
      2      f_loadPix('100','200')
      3*   from dual
    11:05:55 SQL>
    11:05:56 SQL> /
      from dual
    ERROR at line 3:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NullPointerException... where 100 and 200 are VARCHAR2 file-names, in the file system where the jpeg files exist.
    I am willing to post the code, but just don't want to overwhelm any who might be inclined to help me out. So if you want to see the class file code, please just ask.
    Thanks in advance,
    ~Bill
    PS: Oh BTW - I neglected to tell that the java code works just fine when run through the command line as a class file and accesses the DB through JDBC.
    I also have try/catches up to wazzu.

    Ok ... I noticed a few checked this thread out, and so here's the answer:
    1. I must be mistaken that the single load worked, because having discussed the problem with our DBA, I am assured that no permissions were changed on the file that I am accessing ... or was attempting to access.
    2. Our DBA made the correct determination that - even though the message did not indicate the file could not be accessed, this was indeed the problem. It seems that even though I placated Oracle with the proper Grant, Unix still controled file access.
    3. After Oracle was granted rights to the directory containing the files, it is now working for both single and batch Blob loads.
    Now I just need to write the routine to get the Blobs out of the table and onto the web-page ... always fun.
    Thanks everyone who took the time to give this a look, and I hope if anyone was interested, I might have in turn helped you. Best regards,
    ~Bill
    PS: I also learned that
    select
        f_loadBlob('100')
      from dualis not the correct way to run this function. Running it as:
    variable x number;
    call f_loadBlob('100') into :x;... is the correct way for testing.

  • Problem inserting date in oracle forms

    I have a data block called CUSTOMER and a TEXT ITEM called
    DOB which is used to enter the Date of birth (date).
    I have a SAVE button, on its trigger WHEN-BUTTON-PRESSED,
    I have the following code
    insert into test values
    (to_date(:customer.dob,'dd-mon-yyyy'));
    commit;
    When i run the form it gives the error
    FRM-40508: Oracle error: unable to INSERT record
    But when i run the same trigger with sysdate (as shown below)
    it runs perfectly, i mean the row is inserted into the database.
    insert into test values
    (to_date(sysdate,'dd-mon-yyyy'));
    commit;
    If someone can offer some assistance regarding this problem,
    I will appreciate that.
    Dalbir

    Whenever you get an "Oracle Error" it means the form is happy but the database is complaining about something. You can select help > display error from the menu to see the sql it is trying to run and what the problem is.
    Incidentally, why are you going to the trouble of trying to write code to do something which a forms block does automatically ?

  • Auto Datababase Export Problem - On lunix Through Oracle Database Sheduler

    All Expert,
    I am new in Linux, at windows i am running oracle database 10.2.0 and auto shudule data export job for every day at morning and evening time
    I create export.bat file which invoke oracle data export utility exp.exe such as
    exp.exe userid=system/pass file= d:\backup\date.dmp , log=d:\backup\date.log.
    How i can create export.bat alternative for linux plateform (redhat 4.7)
    How i can creat dump..zip file on linux redhat4.7
    How I can access linux folder /oradisk/backup from windows operting system.
    How i can access linux drives on windows operting system.
    Thanks in Advance
    Edited by: Naeem Sheeraz on Apr 13, 2009 5:54 PM

    Naeem Sheeraz wrote:
    All Expert,
    I am new in Linux, at windows i am running oracle database 10.2.0 and auto shudule data export job for every day at morning and evening time
    I create export.bat file which invoke oracle data export utility exp.exe such as
    exp.exe userid=system/pass file= d:\backup\date.dmp , log=d:\backup\date.log.
    How i can create export.bat alternative for linux plateform (redhat 4.7) 'exp' in oracle linux is equivalent to 'exp.exe' in windows +(but for both you should normally be using datadump expdp)+
    userid is best placed in a .par file for security reasons. .... having password on command line is not good.
    How i can creat dump..zip file on linux redhat4.7zip dump unzipedfile
    man zip tells you more.
    How I can access linux folder /oradisk/backup from windows operting system.samba, ftp, sftp ...
    How i can access linux drives on windows operting system.
    samba, ftp, sftp....
    In general for occasional use a client such as coreftp is useful (check licensing); filezilla is also possible.
    Setting up the linux to share folder using samba is perhaps a longer term solution but requires more expertise to set up and requires managment. Poor setups could compromise security.
    Could also be done via apache web server, again one step away from compromised security.
    Thanks in Advance
    Edited by: Naeem Sheeraz on Apr 13, 2009 5:54 PMYou should best probally seek some linux fundamentals training
    Best Regards - bigdelboy.
    Edited by: bigdelboy on 13-Apr-2009 10:35 (didnt realised tommy had answered this better already)

  • Installation problems with oracle 9iAS v1.0.2.2.2a

    Dear all, i had been having a problem to install oracle 9iAS v1.0.2.2.2a on Windows 2000 Service Pack 2 edition for the past 5 days.
    I had read through the installation guide and follow steps by steps instructions. but the installer would just stop at 100% "Copying welcome.html or Copying demo.gif". It only leave with a step that it would reach the configuration setup. I am wondering anyone encounter this problem.
    I had tried to install on notebook and desktop with the same platform. On the notebook, i have oracle 9i database release 2 installed on it. Thinking it might be a compatibility problem, i tried installing oracle 9iAS on a desktop with a oracle 9i database client. But i would want the application server and database to run on the same machine. Should I wait for the oracle 9iAS release 2 for NT or anyone have any advise on my problem.
    i would appreicate if anyone can help. thank you.

    Maybe this is a bit of a simple question. But, do you remember how long you waited, when the progress bar indicated 100%? The installation progress status does indicate "100%" for a while, doing some "last minute" stuff, before moving on to the "Configuration Tools" phase.
    Yes, as Ashesh stated, Oracle9iAS 10222a and Oracle9i Database can co-exist on the same machine, as long as they are in separate ORACLE_HOMEs. And, yes, the structure you described (\oracle\database and \oracle\iASHome) does qualify as "separate ORACLE_HOMEs".
    Cheers!

  • Facing Proble while installing Oracle 9iAS

    Hi All,
    I am facing a problem while installing the Oracle 9iAS software..I have Windows NT Service Pack 6a .. When I am installing the Oracle 9iAS the installer showing an error "Windows Systems File has not been run on this system. One or more Operating System Files currently use need to be updated".
    What could be the proble.. Could u please help me out regarding this..
    Thanx in Advance,
    Satheesh

    you have to have some system files in winnt system by oracle installer.
    you can do this by ..
    1)remove all ias installed products and its services from thet host.
    2)run "wfs.exe" from 9iAS disk1.
    3)reboot your host computer.
    4)install iAS .

  • Oracle 9iAS Interconnect Message Limits

    What is the message saturation point for Oracle 9iAS Interconnect? In other words, is there a known upper limit for the number of messages per second/minute/hour/day or whatever that you can safely push through Oracle 9iAS Interconnect? In the absense of hard data, has anybody out there reached a point beyond which it does not make sense to push more messages through the system?

    Bump

  • Importing oracle.sql.BLOB through SQL Loader

    Hello,
    Currently the system we have creates .sql files and executes them. This takes a long time, so we're attempting to change to using SQL Loader. The one problem I'm having that I can't seem to fix is finding out how to imitate the behavior of this SQL statement through SQL Loader:
    INSERT INTO KRSB_QRTZ_BLOB_TRIGGERS (BLOB_DATA,TRIGGER_GROUP,TRIGGER_NAME)
    VALUES (oracle.sql.BLOB@515263,'KCB-Delivery','PeriodicMessageProcessingTrigger')
    I tried creating a lobfile and placing the text oracle.sql.BLOB@515263 within it this way
    INTO TABLE KRSB_QRTZ_BLOB_TRIGGERS
    WHEN tablename = 'KRSB_QRTZ_BLOB_TRIGGERS'
    FIELDS TERMINATED BY ',' ENCLOSED BY '##'
    TRAILING NULLCOLS
    tablename FILLER POSITION(1),
    TRIGGER_NAME CHAR(80),
    TRIGGER_GROUP CHAR(80),
    ext_fname FILLER,
    BLOB_DATA LOBFILE(ext_fname) TERMINATED BY EOF
    However, as expected, it merely loaded the text "oracle.sql.BLOB@515263" into the database. So does anyone have any ideas of how to imitate that insert statement through SQL Loader? The only information I have available is the string "oracle.sql.BLOB@515263", no other files or anything to aid with actually getting the binary data.
    When the .sql file is run with that insert statement in it, a 1.2kb BLOB is inserted into the database versus a 22 byte BLOB that contains nothing useful when done through SQL Loader.
    Alex

    My preference is DBMS_LOB.LOADFROMFILE
    http://www.morganslibrary.org/reference/dbms_lob.html
    did you try it?

  • Oracle error ORA-01461when trying to insert into an ORACLE BLOB field

    I am getting Oracle error ‘ORA-01461: can bind a LONG value only  for insert into a LONG column' when trying to insert into an ORACLE BLOB field. The error occurs when trying to insert a large BLOB (JPG), but does not occur when inserting a small (<1K) picture BLOB.(JPG). Any ideas?
    BTW, when using a SQL Server datasource using the same code.... everything works with no problems.
    ORACLE version is 11.2.0.1
    The ORACLE datasource is JDBC using Oracle's JDBC driver ojdbc6.jar v11.2.0.1 (I also have tried ojdbc5.jar v11.2.0.1; ojdbc5.jar v11.2.0.4; and ojdbc6.jar v11.2.0.4 with the same error result.)
    Here is my code:
    <cfset file_mime = Lcase(Right(postedXMLRoot.objname.XmlText, 3))>
    <cfif file_mime EQ 'jpg'><cfset file_mime = 'jpeg'></cfif>
    <cfset file_mime = 'data:image/' & file_mime & ';base64,'>
    <cfset image64 = ImageReadBase64("#file_mime##postedXMLRoot.objbase64.XmlText#")>
    <cfset ramfile = "ram://" & postedXMLRoot.objname.XmlText>
    <cfimage action="write" source="#image64#" destination="#ramfile#" overwrite="true">
    <cffile action="readbinary" file="#ramfile#" variable="image_bin">
    <cffile action="delete" file="#ramfile#">
    <cfquery name="InsertImage" datasource="#datasource#">
    INSERT INTO test_images
    image_blob
    SELECT
    <cfqueryparam value="#image_bin#" cfsqltype="CF_SQL_BLOB">
    FROM          dual
    </cfquery>

    Can't you use "alter index <shema.spatial_index_name> rebuild ONLINE" ? Thanks. I could switch to "rebuild ONLINE" and see if that helps. Are there any potential adverse effects going forward, e.g. significantly longer rebuild than not using the ONLINE keyword, etc? Also wondering if spatial index operations (index type = DOMAIN) obey all the typical things you'd expect with "regular" indexes, e.g. B-TREE, etc.

  • How to insert data into Oracle db from MySQL db through PHP?

    Hi,
    I want to insert my MySQL data into Oracle database through PHP.
    I can access Mysql database using mysql_conect() & Oracle database using oci_connect() through PHP.
    Now How can I insert my data which is in MySQL into Oracle table. Both table structure are exactly same.
    So I can use
    insert into Oracle_Table(Oracle_columns....) values(Select * from MySQL_Table);
    But again problem is I can't open both connections at the same time.
    So has anyone done this before or anyone having any other idea..
    Plz guide me...

    You can do it if you setup a ODBC Gateway between MYSQL and Oracle DB. Then you can directly read from MySQL table using DB links and insert into Oracle table in one single SQL Statement.
    Otherwise you need to fetch the data from MySQL Into variables in your PHP Program and then insert into Oracle after binding the variables to the insert statement for Oracle. Hope that is clear enough.
    Regards
    Prakash

  • Problems with url-bindings when redeploying on Oracle 9iAS

    Hello!
    I'm working on a project where we're having a development server that runs Oracle 9iAS (9.03). This server is used both for system-testing and for continuous integration using Cruisecontrol. The application that we deploy is an ear-application with several web-applications and ejb-components. We have in order to make these two deployments work together defined two different application servers on the console and deployed on both of them. We have also specified prefixes, like /cc/ on the url-bindings so that we can access all the web-applications.
    Our problems usually arise when Cruisecontrol does a redeploy of what it has built before it's going to test it. It uses dcmctl for this and it usually runs successfully, but sometimes the application server resets the url-bindings so that all the web-applications go to the root. Other times it removes the whole application and I've even seen it show out-of-memory errors even though it still has about a gigabyte of memory available. I don't think this is related to that single server because I've seen the same thing happening on our production-server the first time I was going to redeploy through the console-application.
    Have anyone else had the same problem? (...and hopefully found a solution to it?)
    It's quite annoying for us because this screws up Cruisecontrol for us at least once a day and I'm not sure how good this is for a production environment.
    Regards,
    Bjorn Vidar Boe

    Does anybody know if Financial Brokerage Service(FBS) can be deployed on Oracle 9iAS using OEM. I got the following error when I tried to deploy the ear file:
    Deployment failed: Nested exception Root Cause: Error loading web-app 'ibfbs-web' at C:\Ora9ias\j2ee\FBS\applications\ibfbs\ibfbs-web: Unknown assembly tag in file:/C:/Ora9ias/j2ee/FBS/applications/ibfbs/ibfbs-web/: <ejb-local-ref>; nested exception is: java.lang.InstantiationException: Error loading web-app 'ibfbs-web' at C:\Ora9ias\j2ee\FBS\applications\ibfbs\ibfbs-web: Unknown assembly tag in file:/C:/Ora9ias/j2ee/FBS/applications/ibfbs/ibfbs-web/: <ejb-local-ref>. Error loading web-app 'ibfbs-web' at C:\Ora9ias\j2ee\FBS\applications\ibfbs\ibfbs-web: Unknown assembly tag in file:/C:/Ora9ias/j2ee/FBS/applications/ibfbs/ibfbs-web/: <ejb-local-ref>; nested exception is: java.lang.InstantiationException: Error loading web-app 'ibfbs-web' at C:\Ora9ias\j2ee\FBS\applications\ibfbs\ibfbs-web: Unknown assembly tag in file:/C:/Ora9ias/j2ee/FBS/applications/ibfbs/ibfbs-web/: <ejb-local-ref>
    Thanks ! Hi -
    Can you check and see what version of 9iAS are you using?
    The ejb-local-ref tag is a new tag introduced in the J2EE 1.3 specification - so you will need to be using the Oracle9iAS v9.0.3 release which is J2EE 1.3 compatible.
    If you are using the v9.0.2 release then you will need to upgrade to v9.0.3
    cheers
    -steve-

  • Insert Blob column in the client errors ClassCastException: oracle.sql.BLOB

    Hi,
    When I try to insert and commit a Blob column(picture) I am getting the following exception.
    Is there any jar I need to add or any other setup I need to do to accept the BLOB column in the olite client database.
    500 Internal Server Error
    javax.faces.FacesException: #{backing_XXPBWorkOrderResultsCreatePGBean.saveButton_action}: javax.faces.el.EvaluationException: java.lang.ClassCastException: oracle.sql.BLOB
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
         at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)
    Caused by: java.lang.ClassCastException: oracle.sql.BLOB
         at oracle.lite.poljdbc.LiteEmbPreparedStmt.setVal(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.web.JupPreparedStatement.setObject(Unknown Source)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindUpdateStatement(BaseSQLBuilderImpl.java:1765)
         at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:7345)
    With regareds,
    Kali.
    OSSI.

    Here are examples if inserting into a Blob from text, file, and retrieving a blob.
    Insert into a Blob (Text)
    import java.io.FileNotFoundException;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    public class InsertBlob {
        public static void main(String[] args) throws FileNotFoundException {
            Connection con = null;
            PreparedStatement stmt = null;
            ResultSet rs = null;
            String letterText = "some letter text";
            long id = 100;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("INSERT INTO BLOB_TABLE (BLOB_ID, BLOB_DATA) VALUES (?, EMPTY_BLOB())");
                stmt.setLong(1, id);
                stmt.executeUpdate();
                stmt = con.prepareStatement("SELECT BLOB_DATA FROM BLOB_TABLE WHERE BLOB_ID = ? FOR UPDATE");
                stmt.setLong(1, id);
                rs = stmt.executeQuery();
                if (rs.next()) {
                    try {
                        oracle.lite.poljdbc.BLOB oliteBlob = null;
                        oliteBlob = ((oracle.lite.poljdbc.OracleResultSet) rs).getBLOB(1);
                        byte[] byteLetterText = letterText.getBytes();
                        oliteBlob.putBytes(1, byteLetterText);
                        con.commit();
                    } catch (ClassCastException e) {
                        e.printStackTrace();
                    } finally {
                        rs = null;
                        stmt = null;
                        con.rollback();
                        con = null;
            } catch (SQLException e) {
                e.printStackTrace();
    }Insert Into a Blob (File)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    public class InsertBlobFile {
        public static void main(String[] args) throws FileNotFoundException {
            Connection con = null;
            PreparedStatement stmt = null;
            long id = 200;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("INSERT INTO BLOB_TABLE (BLOB_ID, BLOB_DATA) VALUES (?, ?)");
                stmt.setLong(1, id);
                File fBlob = new File ( "C:\\BLOB_TEST_FILE.TXT" );
                FileInputStream is = new FileInputStream ( fBlob );
                stmt.setBinaryStream (2, is, (int) fBlob.length() );
                stmt.executeUpdate();
                con.commit();
            } catch (SQLException e) {
                e.printStackTrace();
    }Retrieve from Blob (Write to file)
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    public class RetrieveBlob {
        final static int bBufLen = 32 * 1024;
        final static String outFile = "C:\\BLOB_OUTPUT_FILE.TXT";
        public static void main(String[] args) throws IOException {
            Connection con = null;
            PreparedStatement stmt = null;
            ResultSet rs = null;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("SELECT * FROM BLOB_TABLE");
                rs = stmt.executeQuery();
                while(rs.next()) {
                    int id = rs.getInt(1);
                    Blob value = rs.getBlob(2);
                    System.out.println(id + " | " + value);
                    writeBlobToFile(value);
            } catch (SQLException e) {
                e.printStackTrace();
        public static long readFromBlob(Blob blob, OutputStream out)
          throws SQLException, IOException {
            InputStream in = blob.getBinaryStream();
            int length = -1;
            long read = 0;
            byte[] buf = new byte[bBufLen];
            while ((length = in.read(buf)) > 0) {
                out.write(buf, 0, length);
                read += length;
            in.close();
            return read;
        public static long writeBlobToFile(Blob blob)
          throws IOException, SQLException {
            long wrote = 0;
            OutputStream fwriter = new FileOutputStream(outFile);
            wrote = readFromBlob(blob, fwriter);
            fwriter.close();
            return wrote;
    }

  • Oracle 9iAS MapViewer 9.0.4 image problem

    I've just installed Oracle 9iAS MapViewer 9.0.4 preview version.
    I am using:
    Oracle 9iAS MapViewer 9.0.4 Preview Version
    Oracle9iAS (1.0.2.2.1) Containers for J2EE
    When i receive picture of map there is no objects on it. On J2ee console i can see following error:
    Image is not in 8.1 format
    Copy of console report is:
    D:\Oracle\iSuites\j2ee\home>java.exe -jar orion.jar -config config\server.xml
    A nonfatal internal JIT (3.10.107(x)) error 'Relocation error: NULL relocation target' has occurred
    in :
    'org/apache/crimson/parser/Parser2.maybeComment (Z)Z': Interpreting method.
    Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cgi
    Warning: Error reading transaction-log file (/D:/Oracle/iSuites/j2ee/home/persistence/transaction.st
    ate) for recovery: premature end of file
    Forced or abrubt (crash etc) server shutdown detected, starting recovery process...
    Recovery completed, 0 connections committed and 0 rolled back...
    [oracle.lbs.mapserver.oms, INFO] oms servlet document-root path: D:\Oracle\iSuites\lbs\mapviewer\we
    b\
    [oracle.lbs.mapserver.oms, INFO] No init parameter "oms_config". Will use default.
    Oracle9iAS (1.0.2.2.1) Containers for J2EE initialized
    [oracle.lbs.mapserver.core.MapperConfig, INFO] using default config file: D:\Oracle\iSuites\lbs\mapv
    iewer\conf\mapViewerConfig.xml
    [oracle.lbs.mapserver.core.MapperPool, WARN] destroying ALL mapmaker instances.
    [oracle.lbs.mapserver.core.MapperConfig, INFO] Map Recycling thread started.
    [oracle.lbs.mapserver.oms, INFO] *** Oracle Map Viewer is successfully started. ***
    [oracle.lbs.mapserver.MapServerImpl, INFO] adding a map data src [name=mvdemo]
    [oracle.sdovis.CacheMgr, INFO] Setting disk path for cache to: C:\WINNT\TEMP\1\
    [oracle.sdovis.CacheMgr, INFO] Java Object Cache opened. Region=Oracle SDOVIS Cache.
    [oracle.sdovis.CacheMgr, INFO] max_cache_size=64 M, max_disk_cache_size=512 M.
    [oracle.sdovis.ImageCacheMgr, INFO] Setting disk path for image cache to: C:\WINNT\TEMP\1\
    [oracle.sdovis.ImageCacheMgr, INFO] MapViewer Image Cache opened. Region=Oracle SDOVIS IMG Cache.
    [oracle.sdovis.ImageCacheMgr, INFO] max_cache_size=64 M, max_disk_cache_size=1024 M.
    [oracle.lbs.mapserver.core.MapperPool, INFO] added a mapper instance to the pool [data src=mvdemo]
    [oracle.lbs.mapserver.core.MapperPool, INFO] added a mapper instance to the pool [data src=mvdemo]
    [oracle.lbs.mapserver.core.MapperPool, INFO] added a mapper instance to the pool [data src=mvdemo]
    [oracle.sdovis.PredefinedThemeQuery, INFO] Connection is a pre-9i database
    [oracle.sdovis.PredefinedThemeQuery, INFO] Connection is a pre-9i database
    [oracle.sdovis.PredefinedThemeQuery, INFO] Connection is a pre-9i database
    [oracle.sdovis.PredefinedThemeQuery, INFO] Connection is a pre-9i database
    [oracle.sdovis.CacheMgr, WARN] oracle.ias.cache.CacheException:
    null CacheAccess.get
    null exception loading geometry from database: errCount = 1
    null
    Image is not in 8.1 format
    at oracle.ias.cache.CacheInternal.exceptionHandler(Unknown Source)
    at oracle.ias.cache.CacheLoader.exceptionHandler(Unknown Source)
    at oracle.sdovis.CacheGeometryLoader.load(CacheGeometryLoader.java:79)
    at oracle.ias.cache.CacheHandle.findObject(Unknown Source)
    at oracle.ias.cache.CacheHandle.locateObject(Unknown Source)
    at oracle.ias.cache.CacheAccess.get(Unknown Source)
    at oracle.sdovis.CacheMgr.get(CacheMgr.java:182)
    at oracle.sdovis.JDBCDataSource4PT.loadFeaturesInWindow(JDBCDataSource4PT.java, Compiled Code)
    at oracle.sdovis.JDBCDataSource4PT.prepareFeatures(JDBCDataSource4PT.java:184)
    at oracle.sdovis.PredefinedTheme.prepareData(PredefinedTheme.java:79)
    at oracle.sdovis.DBMapMaker$LoadThemeData.run(DBMapMaker.java:1143)
    [oracle.sdovis.CacheMgr, WARN] oracle.ias.cache.CacheException:
    null CacheAccess.get
    null exception loading geometry from database: errCount = 8
    null
    Image is not in 8.1 format
    at oracle.ias.cache.CacheInternal.exceptionHandler(Unknown Source)
    at oracle.ias.cache.CacheLoader.exceptionHandler(Unknown Source)
    at oracle.sdovis.CacheGeometryLoader.load(CacheGeometryLoader.java:79)
    at oracle.ias.cache.CacheHandle.findObject(Unknown Source)
    at oracle.ias.cache.CacheHandle.locateObject(Unknown Source)
    at oracle.ias.cache.CacheAccess.get(Unknown Source)
    at oracle.sdovis.CacheMgr.get(CacheMgr.java:182)
    at oracle.sdovis.JDBCDataSource4PT.loadFeaturesInWindow(JDBCDataSource4PT.java, Compiled Code)
    at oracle.sdovis.JDBCDataSource4PT.prepareFeatures(JDBCDataSource4PT.java:184)
    at oracle.sdovis.PredefinedTheme.prepareData(PredefinedTheme.java:79)
    at oracle.sdovis.DBMapMaker$LoadThemeData.run(DBMapMaker.java:1143)
    [oracle.sdovis.DBMapMaker, INFO] **** time spent on loading features: 10047ms.
    [oracle.sdovis.DBMapMaker, INFO] **** time spent on rendering: 343ms
    Is anybody acquainted with sollution to this problem?
    regards
    Joze Miklavcic

    Are you using an old database, like 8.1.5 or 8.1.6? If you cannot upgrade to 9i, here is the workaround.
    In the mapViewerConfig.xml, add the following line to
    the <global_map_config> section:
    <performance no_unpickler="true" />
    So that it looks like:
    <global_map_config>
    <performance no_unpickler="true" />
    </global_map_config>
    Then restart oc4j. By the way, you seem to be using oc4j
    1.0.2.2, which is too old for mapviewer to work properly (but it is not the cause for the above issue). Please
    upgrade to at lease oc4j 9.0.2.
    thanks,
    lj

Maybe you are looking for