Insert failed in Java Proc

Here is my class
public static String OnlyInsert(
int v_AccommodationVendorID,
int v_AccommodationTypeID,
int v_AccommodationRateTypeID,
int v_PeakPrice
) throws SQLException
String val = "yes";
String x = "";
String insSql = "";
String tDate = "TO_DATE('02/02/2001', 'MM/DD/YYYY')";
OracleDriver ora = new OracleDriver();
conn = ora.defaultConnection();
//insSql = "INSERT INTO Accommodation_Rate_Schedule (AccommodationVendorID, AccommodationTypeID, AccommodationRateTypeID, StartDate, Price) Values (" + v_AccommodationVendorID + "," + v_AccommodationTypeID + "," + v_AccommodationRateTypeID + ",TO_DATE('02/15/2001', 'MM/DD/YYYY')," + v_PeakPrice +")";
try
PreparedStatement pstmt = conn.prepareStatement
("INSERT INTO Accommodation_Rate_Schedule (AccommodationVendorID, AccommodationTypeID, AccommodationRateTypeID, StartDate, Price) Values "
+ "(?, ?, ?, ?, ?)");
pstmt.setInt(1, v_AccommodationVendorID);
pstmt.setInt(2, v_AccommodationTypeID);
pstmt.setInt(3, v_AccommodationRateTypeID);
pstmt.setString(4, tDate);
pstmt.setInt(5, v_PeakPrice);
pstmt.execute();
if(! success)
System.err.println("Insert failed");
x = x + "failed sql" + insSql;
else
System.err.println("Insert is gooooooooood");
x = x + "good sql" + insSql;
catch (Exception e)
System.err.println("exception caught" + e);
x = x + "2" + e;
return(val + "and " + x);
Here is my function
CREATE OR REPLACE FUNCTION ins_acc
(id1 NUMBER,
id2 NUMBER,
id3 NUMBER,
id4 NUMBER
RETURN VARCHAR2
AS
LANGUAGE JAVA
NAME 'Accommodation.OnlyInsert(int, int, int, int)
return java.lang.String';
Every thing is fine till i use the following command
select ins_acc(5, 1, 1, 100) from dual;
I get the following error
oracle.jdbc.driver.OracleSQLException: ORA-14551: cannot perform a DML operation inside a query
Any one please
Thanks
null

Dear Sir/Madam,
Hi. I had a problem exactly like you.
Your problem is for the following statement:
select ... into ... from dual
Here you are performing a select and then
in your stored function you want to perform
an insert. Oracle can not do such a thing.
So you should convert your stored function
to a stored procedure with an out parameter.
Sincerely,
Kaveh Mahdian

Similar Messages

  • Error while Shell executing from Oracle Using java proc

    Hi All,
    After a long time I'm here again.
    I'm facing one strange problem.
    SQL>
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    Elapsed: 00:00:00.01
    SQL>
    SQL>And, the purpose of this procedure is to execute shell command from PL/SQL application.
    It seems that this procedure is able to execute shell commands like *'pwd'*.
    But, when it comes to other commands like *'ls -lrt'* or *'sqlldr'* it throws error.
    Kindly find the following details -
    SQL> declare
      2    err_cd   number;
      3    err_desc varchar2(500);
      4  begin
      5   dbms_java.set_output(1000000);
      6   host(p_command => '/a/mis/Sqlloader_script/loader_command/ST_det.sh');
      7   dbms_output.put_line('Successfully Executed SQL Loader Command');
      8  exception
      9      when others then
    10        err_cd := 1;
    11        err_desc := substr(sqlerrm,1,500);
    12        dbms_output.put_line(err_desc);
    13  end;
    14  /
    Process err :/a/mis/Sqlloader_script/loader_command/ST_det.sh: line 19: sqlldr: No such file or directory
    Successfully Executed SQL Loader Command
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.11
    SQL>
    SQL> declare
      2    err_cd   number;
      3    err_desc varchar2(500);
      4  begin
      5   dbms_java.set_output(1000000);
      6   host(p_command => 'pwd');
      7   dbms_output.put_line('Successfully Executed SQL Loader Command');
      8  exception
      9      when others then
    10        err_cd := 1;
    11        err_desc := substr(sqlerrm,1,500);
    12        dbms_output.put_line(err_desc);
    13  end;
    14  /
    Process out :/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs
    Successfully Executed SQL Loader Command
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.11
    SQL>But, the file exists in the following path -
    SQL> !ls -lrt /a/mis/Sqlloader_script/loader_command/ST_det.sh
    -rwxrwxr-x 1 oracle root 1315 Apr 13 13:40 /a/mis/Sqlloader_script/loader_command/ST_det.shAny idea?
    Where is the privileges that i need to give to the current user?
    When i directly execute the Sql Loader from the oracle o/s - it ran successfully.
    [oracle@pult loader_command]$ /a/mis/Sqlloader_script/loader_command/ST_det.sh
    SQL*Loader: Release 11.2.0.1.0 - Production on Fri Apr 13 14:59:19 2012
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 64
    Commit point reached - logical record count 128
    Commit point reached - logical record count 192
    Commit point reached - logical record count 256
    Commit point reached - logical record count 320
    Commit point reached - logical record count 384
    Commit point reached - logical record count 448
    Commit point reached - logical record count 512
    Commit point reached - logical record count 576
    Commit point reached - logical record count 640
    Commit point reached - logical record count 704
    Commit point reached - logical record count 732
    Succesful execution of Loading.
    [oracle@pult loader_command]$
    [oracle@pult loader_command]$Thanks in advance.

    This is a generic java proc.
    It works well with windows.
    But, facing this problem in Linux.
    Procedure looks like -
    create or replace and compile java source named host as
    import java.io.*;
    public class Host {
      public static void executeCommand(String command) {
        try {
          String[] finalCommand;
          if (isWindows()) {
            finalCommand = new String[4];
            finalCommand[0] = "C:\\windows\\system32\\cmd.exe";  // Windows XP/2003
            finalCommand[1] = "/y";
            finalCommand[2] = "/c";
            finalCommand[3] = command;
          else {
            finalCommand = new String[3];
            finalCommand[0] = "/bin/bash";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
          new Thread(new Runnable(){
            public void run() {
              BufferedReader br_in = null;
              try {
                br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                String buff = null;
                while ((buff = br_in.readLine()) != null) {
                  System.out.println("Process out :" + buff);
                  try {Thread.sleep(100); } catch(Exception e) {}
                br_in.close();
              catch (IOException ioe) {
                System.out.println("Failed to print.");
                ioe.printStackTrace();
              finally {
                try {
                  br_in.close();
                } catch (Exception ex) {}
          }).start();
          new Thread(new Runnable(){
            public void run() {
              BufferedReader br_err = null;
              try {
                br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
                String buff = null;
                while ((buff = br_err.readLine()) != null) {
                  System.out.println("Process err :" + buff);
                  try {Thread.sleep(100); } catch(Exception e) {}
                br_err.close();
              catch (IOException ioe) {
                System.out.println("Process error.");
                ioe.printStackTrace();
              finally {
                try {
                  br_err.close();
                } catch (Exception ex) {}
          }).start();
        catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
      public static boolean isWindows() {
        if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
          return true;
        else
          return false;
    };Looking for your reply.

  • INSERT statement in Java and MS Access

    Hi all,
    can anyone please tell me how to insert data to an MS Access table using JSP i tried INSERT statement of java but it is getting errors saying INSERT statement is wrong. I have no idea about MS access insert statement. i am totally tired of this. Please someone help me.

    Hello,
    MS Sql can cause problems where it goes off standard, however I dont think insert is any different.
    INSERT INTO table_name (column1, column2) VALUES (variable1, variable2)
    Make sure your table and column names are exactly right, Java is case sensitive, so make sure the case is correct also.
    The other common error is if you have a required field in the database that is not populated by your program, so, if for instance there was a column3 in the table for the above example, which was a required field, the sql would fail as there is no data being entered for column3.

  • DBAdapter insert failing in Fusion Middleware SOA Suite 11g

    Hi,
    I am trying a simple example of inserting into database using DBAdapter. Here is the log message and am unable to figure out the problem it says log at DBAdapter logs can someone tell me where does DBAdapter logs exists. I tried the select and it works fine some how insert is failing.
    Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [InsertNewEmployee.Emp].
    Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
    oracle.fabric.common.FabricInvocationException: BINDING.JCA-12563
    Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [InsertNewEmployee.Emp].
    Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.EndpointInteractionException.getFabricInvocationException(EndpointInteractionException.java:75)
         at oracle.integration.platform.blocks.adapter.AdapterReference.getFabricInvocationException(AdapterReference.java:287)
         at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:273)
         at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:142)
         at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:194)
         at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:204)
         at sun.reflect.GeneratedMethodAccessor771.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
         at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:71)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy210.post(Unknown Source)
         at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post2Mesh(MediatorServiceEngine.java:871)
         at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:200)
         at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:94)
         at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:74)
         at oracle.tip.mediator.service.OneWayActionHandler.process(OneWayActionHandler.java:47)
         at oracle.tip.mediator.service.ActionProcessor.onMessage(ActionProcessor.java:64)
         at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase(MessageDispatcher.java:121)
         at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase(InitialMessageDispatcher.java:467)
         at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases(InitialMessageDispatcher.java:366)
         at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases(InitialMessageDispatcher.java:272)
         at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch(InitialMessageDispatcher.java:138)
         at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process(MediatorServiceEngine.java:656)
         at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post(MediatorServiceEngine.java:482)
         at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:142)
         at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:194)
         at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:204)
         at sun.reflect.GeneratedMethodAccessor771.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
         at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy210.post(Unknown Source)
         at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage(AdapterServiceMDB.java:511)
         at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:376)
         at oracle.tip.adapter.file.inbound.Publisher.publishMessage(Publisher.java:377)
         at oracle.tip.adapter.file.inbound.InboundTranslatorDelegate.xlate(InboundTranslatorDelegate.java:455)
         at oracle.tip.adapter.file.inbound.InboundTranslatorDelegate.doXlate(InboundTranslatorDelegate.java:116)
         at oracle.tip.adapter.file.inbound.ProcessorDelegate.doXlate(ProcessorDelegate.java:252)
         at oracle.tip.adapter.file.inbound.ProcessorDelegate.process(ProcessorDelegate.java:157)
         at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:349)
         at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:77)
         at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:171)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: BINDING.JCA-12563
    Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [InsertNewEmployee.Emp].
    Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:427)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeJcaReference(JCAInteractionInvoker.java:510)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeAsyncJcaReference(JCAInteractionInvoker.java:494)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAEndpointInteraction.performAsynchronousInteraction(JCAEndpointInteraction.java:463)
         at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:236)
         ... 50 more
    Caused by: BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [InsertNewEmployee.Emp].
    Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions.
    Please see the logs for the full DBAdapter logging output prior to this exception.  This exception is considered retriable, likely due to a communication failure.  To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml).  To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff.  All properties are integers.
         at oracle.tip.adapter.db.exceptions.DBResourceException.createRetriableException(DBResourceException.java:641)
         at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:610)
         at oracle.tip.adapter.db.exceptions.DBResourceException.outboundWriteException(DBResourceException.java:661)
         at oracle.tip.adapter.db.transaction.DBTransaction.commit(DBTransaction.java:255)
         at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:310)
         ... 54 more
    Caused by: java.sql.SQLException: Cannot call rollback when using distributed transactions
         at weblogic.jdbc.wrapper.JTAConnection.rollback(JTAConnection.java:379)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicRollbackTransaction(DatabaseAccessor.java:1410)
         at oracle.toplink.internal.databaseaccess.DatasourceAccessor.rollbackTransaction(DatasourceAccessor.java:581)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.rollbackTransaction(DatabaseAccessor.java:1401)
         at oracle.toplink.internal.sessions.AbstractSession.basicRollbackTransaction(AbstractSession.java:369)
         at oracle.toplink.threetier.ClientSession.basicRollbackTransaction(ClientSession.java:135)
         at oracle.toplink.internal.sessions.AbstractSession.rollbackTransaction(AbstractSession.java:3003)
         at oracle.toplink.internal.sessions.UnitOfWorkImpl.rollbackTransaction(UnitOfWorkImpl.java:4405)
         at oracle.toplink.internal.sessions.UnitOfWorkImpl.rollbackTransaction(UnitOfWorkImpl.java:4426)
         at oracle.toplink.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1374)
         at oracle.toplink.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1417)
         at oracle.toplink.internal.sessions.UnitOfWorkImpl.commitRootUnitOfWork(UnitOfWorkImpl.java:1167)
         at oracle.toplink.internal.sessions.UnitOfWorkImpl.commit(UnitOfWorkImpl.java:939)
         at oracle.tip.adapter.db.transaction.DBTransaction.commit(DBTransaction.java:203)
         ... 55 moreThanks

    CHeck this thread:
    BINDING.JCA-12510 JCA Resource Adapter location error in SOA 11g Suite
    Did you have set the correct parameters to the DBAdpater; it look lik it can not bind the parameters (BINDING JCA-12563).
    Marc

  • Row Insert Failed - Column name or number of supplied values does not match

    Hi ,
    I am trying add a new field to an existing table in MSSQL and access it in portlets,
    I added the new field in the table, and making necessary updations to the accessing java code seems to look fine. but when i insert the new rwo, fails with exception listed below.
    My code tidbits is as follows.
                   System.out.println("Column Location of outsidePhysician"+ aResultSet.findColumn("outsidePhysician")); // works and returns 24
                   if (anIntake.getOutsidePhysician() != null && !(anIntake.getOutsidePhysician().equals("")))
                        System.out.println("Now Alternate Physician will be added to resultset");
                        aResultSet.updateString(24, anIntake.getOutsidePhysician());
                        aResultSet.updateString("outsidePhysician",anIntake.getOutsidePhysician());
                        System.out.println("Now Alternate Physician already added to resultset"); // also printed
                   }else{
                        aResultSet.updateString(24, "new Physician");
                        aResultSet.updateString("outsidePhysician","new Physician");
                   //NOT NULL
                   aResultSet.insertRow(); // fails here
                   System.out.println("Inserted");
    The table has the right field name too, which is proved when i retrieve the fieldno, based on field name. I tried to delete the field and removing these changes work ok..
    Any ideas would be of help
    Thanks in Advance
    Usha
    [Microsoft][SQLServer 2000 Driver for JDBC]Row insert failed. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseImplUpdatableResultSet.executeStatement(Unknown Source) at com.microsoft.jdbc.base.BaseImplUpdatableResultSet.insertRow(Unknown Source) at com.microsoft.jdbc.base.BaseResultSet.insertRow(Unknown Source) at com.microsoft.jdbcx.base.BaseResultSetWrapper.insertRow(Unknown Source) at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.insertRow(WSJdbcResultSet.java:2181) ... 14 more Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Insert Error: Column name or number of supplied values does not match table definition. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExce

    I haven't ever used that method of inserting rows, but from the example in the API documentation it looks to me like you have to callaResultSet.moveToInsertRow();before you callaResultSet.insertRow();Or are you just "inserting" the physician's name into existing rows of the database? If that's what you are doing then you need to callaResultSet.updateRow();Message was edited by:
    DrClap

  • XML Publisher report failing with java.lang.outofmemoryerror.

    Hi,
    We have developed a custom Oracle report that produces an XML output file that is about 13M in size (about 18K rows from the database). When running report as concurrent request, post processing fails with java.lang.outofmemoryerror. The failure occurs when specifying output format as Excel, RTF or HTML. However, the process completes successfully when specifying output format as PDF. We have also noticed that Excel, RTF and HTML will complete successfully if the XML data file is smaller (around 3M).
    Is anyone aware of a restriction on the size of the XML data file when specifying output formats Excel, RTF or HTML? We have tried setting temp directory but that has not helped.
    Thanks.

    Hi
    I found this at metalink [Note:390968.1].. hope it helps =)
    Symptoms: When attempting to run an XML Publisher concurrent program the following error occurs:
    ERROR: Warning!!! Got out of memory exception, retrying with scalable option..
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    Oracle.apps.xdo.oa.cp.JCP4XDODataEngine
    Program exited with status 1
    Solution: To implement the solution, please execute the following steps:
    1. Login select the responsibility: System Administrator.
    2. Navigate to Concurrent > Program > Define.
    3. Query for concurrent program that is receiving the error.
    4. In the 'Options' field please enter -Xmx512M.
    5. Save the change and retest the issue.
    6. If the report still fails with the option set to -Xmx512M change the value to -Xmx1024M, save and try again
    7. Migrate the solution as appropriate to other environments.

  • File processing failed with java.lang.StringIndexOutOfBoundsException:

    Hi
    I´m reading and sending files to an FTP server using SAP PI. I use file content conversion.
    Everything has been working fine for months - but now the server was changes to a new host. The only thing changed was the host/user and pass.
    But sending too the server fails with this error:
    File processing failed with java.lang.StringIndexOutOfBoundsException: String index out of range: -27
    Any body who has a clue??
    Reading files works ok. And i can transfer files to the FTP server with FileZilla without problems.

    In the file transfer by ftp:
    2011-10-03 17:27:08     Information     Transfer: "BIN" mode, size 737 bytes, encoding -.
    2011-10-03 17:27:08     Error     File processing failed with java.lang.StringIndexOutOfBoundsException: String index out of range: -27
    2011-10-03 17:27:08     Error     Adapter Framework caught exception: String index out of range: -27
    2011-10-03 17:27:08     Error     Delivering the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error occurred while connecting to the FTP server "nnn.nn.nnn.nnn:21": java.lang.StringIndexOutOfBoundsException: String index out of range: -27.
    Its on the adapter level. All mappings etc are fine. And as i write has been for months. The only thing changed are the FTP server

  • Insert data from java to oracle object created

    Hi
    How can i insert data from java to table test with column LIST_QRY_RES_DN_MEMBER_INFO as below after create object type
    CREATE OR REPLACE TYPE QRY_RES_SERVICE_VALUES AS OBJECT (
      PARAMETER_CODE            VARCHAR2(60),
      PARAMETER_VALUE           VARCHAR2(60)
    CREATE OR REPLACE TYPE LIST_QRY_RES_SERVICE_VALUES AS TABLE OF QRY_RES_SERVICE_VALUES;
    CREATE OR REPLACE TYPE QRY_RES_OPTIONS AS OBJECT (
      SERVICE_CODE            VARCHAR2(60),
      SERVICE_VALUE           LIST_QRY_RES_SERVICE_VALUES 
    CREATE OR REPLACE TYPE LIST_QRY_RES_OPTIONS AS TABLE OF QRY_RES_OPTIONS;
    CREATE OR REPLACE TYPE QRY_RES_MEMBER_INFO AS OBJECT (
      VARIABLE_CODE            VARCHAR2(60),
      VARIABLE_VALUE           VARCHAR2(120)
    CREATE OR REPLACE TYPE LIST_QRY_RES_MEMBER_INFO AS TABLE OF QRY_RES_MEMBER_INFO;
    CREATE OR REPLACE TYPE QRY_RES_DN_MEMBER_INFO AS OBJECT (
      DN                       VARCHAR2(60),
      MEMBER_INFO              LIST_QRY_RES_MEMBER_INFO,
      OPTIONS                  LIST_QRY_RES_OPTIONS
    CREATE OR REPLACE TYPE LIST_QRY_RES_DN_MEMBER_INFO AS TABLE OF QRY_RES_DN_MEMBER_INFO;
    CREATE TABLE test(
    DN_MEMBER_INFO          LIST_QRY_RES_DN_MEMBER_INFO,
    NESTED TABLE DN_MEMBER_INFO STORE AS LIST_QRY_RES_DN_MEMBER_TAB
        (NESTED TABLE MEMBER_INFO STORE AS MEMBER_INFO_TAB,
         NESTED TABLE OPTIONS STORE AS LIST_QRY_RES_OPTIONS_TAB
            (NESTED TABLE SERVICE_VALUE STORE AS SERVICE_VALUE_TAB));

    It appears you are trying to store java objects (types) in a database rather than raw data (string, int, date types) that the object contains. If so, I don't think that ever really caught on. Most programmers store the raw data, then pull it out and populate a class. The problem with storing the object is that new versions of classes come out and your old version is stored in the database. If you just store the data, you don't have to worry about what version is in the database. You can populate the new version of the class with the same data.
    Also, others can use sql to query your data and use it for their own use independent of what you intended it for. I think most people use the (browser) based utility that comes with the database to create the tables, normalize them, set up primary keys, set up foreign keys, etc rather then run an sql statement as you did above.

  • Attempt to process file failed with java.lang.StringIndexOutOfBoundsExcep..

    Hello All,
       I am implementing file2file with file going from shared folder to FTPS server.
    I am using TLS and X.509 certificate in file receiver communication channel.
    when I implemented my scenario, this is the error its throwing :
    Success : Connect to FTP server "my ftp address", directory "/TEST/"
    Error : Attempt to process file failed with java.lang.StringIndexOutOfBoundsException: String index out of range: 3
    I know this error is caused when java expects the 3 character length string and if its getting more than that... Does any faced this kindaa problem before...Any help is greatly appreciated....Obviously even points....
    Thanks,
    Ravi

    There is no custom code at all? No mappings, no custom modules, no pre/post processing commands?
    Also, check if you get this error when sending to ftps server without certificate (or with another certificate). It may be an incompatibility issue with certificate.
    Did you import the .pfx (or .p12) file in KeyStorage Service?
    Regards,
    Henrique.

  • Attempt to process file failed with java.io.IOException

    Hi,
    The scenario is from Idoc to flat file and messages are getting processed successfully in XI. but in receiver communication channel error is coming:
    Attempt to process file failed with java.io.IOException: Error during STOR/APPE epilogue: com.sap.aii.adapter.file.ftp.FTPEx: 426 Connection closed; transfer aborted.
    MP: exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error during STOR/APPE epilogue: com.sap.aii.adapter.file.ftp.FTPEx: 426 Connection closed; transfer aborted.: java.io.IOException: Error during STOR/APPE epilogue: com.sap.aii.adapter.file.ftp.FTPEx: 426 Connection closed; transfer aborted.

    Hi,
    If you are using FTP then,
    1. Make sure that the FTP sever does not have issues with Firewall or a Proxy server access.
    2. Also verify that the specified FTP user ID has the necessary WRITE or overwrite authorization?
    Regards,
    Sarvesh
    ***Reward points, if it helped you.

  • Hashtable insert failed. Load factor too high : Dot net 4.5

    I'm getting an exception “System.InvalidOperationException: Hashtable insert failed. Load factor too high.”
    My application is developed in VS2010 with 4.0 framework and it is working fine in our development environment (4.0 version ) (for 4.0 framework I'm able to find the hotfix and I've installed it in my development environment). In production environment
    framework is upgraded to 4.5 version and we often getting the mentioned exception.
    Application developed : windws 7 - 32 bit OS / vb.net 4.0
    Development environment (hotfix installed) :  windows server 2008 - 64 bit  / dotnet FW 4.0
    Prod Environment : windows server 2008 - 64 bit / dotnet FW 4.5 
    Kindly help me resolving this issue.
    Thanks.

    Hello,
    For this issue, we will focus on your new posted thread:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/a3feddfd-ff21-438c-9704-661375f096af/is-that-the-hot-fix-kb2803754-included-in-net-framework-451-version-4550938?forum=clr#a3feddfd-ff21-438c-9704-661375f096af
    >>Can you conform that the hot fix KB2803754 available in the version
    4.5.50938 (.NET Framework 4.5.1) ?
    You could do a test in the link above to check if the .NET 4.5.1 contians this KB(currently I do not have  an proper environment to test it).
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Failed to get proc address for GetLogicalProcessor...

    hi everyone whenever i try to open the skype after instalation it show me this error"Failed to get proc address for GetLogicalProcessorInformation (KERNEL32.dll."please help me to solve this problem.i will be very thankfull to you for this favour.thank you.

    Hi, i think that the application server part is looking for a /etc/hosts entry
    in this format:
    127.0.0.1 localhost
    As i noticed, this is used for internal communication.
    Try this entry as is, without a domain...

  • Failed to get procs for sound track -2126

    What is the meaning of the error message of "Failed to get procs for sound track -2126"? I am attempting to convert a Quicktime movie file that uses Sorenson Video & QDesign Music 2 codecs.

    Certainly someone must know the meaning for this error message. Is there a list of error messages for compressor and QT??

  • SQLException: Insert failed

    Hi,
    I am facing problem with inserting values into table.I am using Weblogic 8.1 sever with Oracle at backend.I have written 2 JSP's one is simple registeration form containing 48 values filled by the user.After filling values ,on click of Save button my second jsp comes up with JDBC connection & PreparedStatement.But, my SQL insert fails due to not connected with DB.I am putting some code of JSP,Plz,go through it & help me.
    <%
    String error;
    String forbazaar = request.getParameter("forbazaar");
    String section = request.getParameter("section");
    String region = request.getParameter("region");
    try
    Connection con =
    DriverManager.getConnection("weblogic.jdbc.oracle.OracleDriver:B2B ConnectionPool"); String sql = ("INSERT INTO PANT_VENDOR_APPLICATION VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
    PreparedStatement ps = con.prepareStatement(sql);
    ps.setString(1,forbazaar);
    ps.setString(2,section);
    ps.setString(3,region);
    ps.executeUpdate();
    ps.close();
    con.close();
    catch(SQLException sqle)
              error = "SQLException: Insert failed";
              throw new SQLException(error);
    %>
    Thanks.
    Vaish...

    Assuming that that is a proper URL, for your weblogic connection pool, your problem is not in this code. It's either in the place you set up the connection pool, the network (your program can't connect to the database), or the database itself (not running, for example).

  • "ASSERT FAILED" when java.exe ends

    What kind of error message is this:
    ASSERT FAILED:
    Executable: java.exe PID 218 Tid b04 Module kswdmcap.ax, 4 objects left active at line blablablablabla
    This happens when my java class ends from where I called a c++ method (that controls the windows media encoder sdk). It return without an error message from the c++ part, but when java.exe tries to end the class does this error message appear on the screen (Windows XP). Does anybody have a clue what that might be?

    I wouldn't say problem.
    Presumably the library you call does something. While doing that it creates "resources" of some sort. It could be a socket. Or a memory allocation. Or something else.
    But it expects you to tell it when you are done. Either with the library or with some specific aspect of the library. And you are not doing that before you exit.
    Keep in mind that I am only guessing. There could certainly be other explainations - like a bug in the library.

Maybe you are looking for