Exception if you use Apache POI in ADF

Goodmorning;

I use jdev 11g, I'm trying to use Apache POI to import the content of Microsoft XL file in my database.

I already do this with success on netbeans. but not on jdev.

first of all, I have download the POI package on the site web apache, and I create a library and add the jdev jar files using tools-> manage libraries, this is the list of the jar file: poi - 3.6 - 20091214.jar, poi-contrib - 3.6 - 20091214.jar, poi-ooxml - 3.6 - 3-20091214.jar and poi-block-notes - 3.6 - 20091214.jar.

Create a page with a button jsf, then activate the link to this page using the design-> Page-> binding component properties-> check Auto link

in the action of the buton method, I put the following code:

public String cb1_action() throws FileNotFoundException, IOException {}

Connection Conn = null;
String url = "jdbc:mysql://localhost:3306";
String dbName = "test";
String driver = "com.mysql.jdbc.Driver";
String username = "root";
String userPassword = "";

try {}
InputStream fs = new FileInputStream("/home/Rachid/test1.xls");

HSSFWorkbook wb = new HSSFWorkbook (fs);

HSSFSheet sheet = wb.getSheetAt (0);
Line HSSFRow = null;
for (Iterator Tricard = sheet.rowIterator (); rowIt.hasNext ();) {

line = rowIt.next () (HSSFRow);
Code HSSFCell = row.getCell (0);
Name HSSFCell = row.getCell (1);
HSSFCell dt = row.getCell (2);
java.util.Date date = dt.getDateCellValue ();
System.out.println ("code" + code + "% name" + name + "% date" + date);


try {}
Class.forName (driver) .newInstance ();
} catch (ClassNotFoundException e) {}
} catch (InstantiationException e) {}
} catch (IllegalAccessException e) {}
}

try {}
Conn = DriverManager.getConnection (url + dbName, username, userPassword);
} catch (SQLException e) {}
}
Statement stmt = null;
try {}
stmt = conn.createStatement ();
} catch (SQLException e) {}
}
String strQuery = "insert into importxl values (" + code+",'"+nom+"','"+date.getDay()+"/"+date.getMonth()+"/"+date.getYear()+ "'" ");

System.out.println (strQuery);

try {}
stmt. Close();
} catch (SQLException e) {}
}
try {}
Conn.Close ();
} catch (SQLException e) {}
}


}
} catch (FileNotFoundException exception) e {}
e.printStackTrace ();
} catch (IOException e) {}
e.printStackTrace ();
}
Returns a null value.
}
}



and when I run my page and click on the button, this exception page appears:

Error 500 - Internal server error

javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/poi/rich/usermodel/HSSFWorkbook
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:94)
at java.security.AccessController.doPrivileged (Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.doIt (WebAppServletContext.java:3684)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: org/apache/poi/rich/usermodel/HSSFWorkbook
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
... 35 more
Caused by: java.lang.NoClassDefFoundError: org/apache/poi/rich/usermodel/HSSFWorkbook
at Mybean.bean1.wrc (bean1.java:23)
at Mybean.MybeanImport.cb1_action (MybeanImport.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
... more than 43
Caused by: java.lang.ClassNotFoundException: org.apache.poi.hssf.usermodel.HSSFWorkbook
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:280)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:253)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:177)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:37)
... 52 more

Have you checked "Deploy default" when you created the library?

John

Tags: Java

Similar Questions

  • [ADF, JDev12.1.3] Problem of formatting attribute VO MONEY when exports it as an Excel file using apache.poi

    Hallo,

    I have a VO with an attribute based on the field of database of MONEY.

    In the configuration of the VO for the attribute I put:

    • In the "Details" tab: Type = BigDecimal
    • In the "Indications of the UI" tab: Format type and Type like the image below

    Immagine.png

    These settings allow the value of the attribute (in the table, inputText) appears with thousands and decimal separator that according to my language - Italian - are. (point) and, (comma).

    For example. Silver number displayed correctly:

    10.123.000,37

    When I write the value of the attribute in an Excel cell using apache.poi...

    cell.setCellValue (attr.toString ());

    ... I see in the cell...

    10123000.3700

    ... Although I'd like to see what...

    10123000,37 (not thousands separator, the comma as separator decimal and only 2 decimal places)


    You could you kindly help me to get there?

    Thank you

    Federico

    Federico, this isn't really a question JDev or ADF. This can be solved by setting the cell format to the cell, you write the number. Like oyu would in excel

    style.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0.00"));

    more info on HSSFDataFormat (javadocexamples.COM JAVA DOC BY EXAMPLES) - API, usage, demonstrations and code examples

    Timo

  • NULL pointer exception when you use the tag ahref

    Hello
    I am writing a file html for the file adapter. Inside the transformation, if I understand ahref* tag, I still get null pointer exception and a 0 KB file is written.

    However, if I remove the < a href > tag from the code, the html file is generated correctly. But I need to use ahref* tag. Pls help me solve this.
    The details of the error are:

    < bindingFault xmlns = "http://schemas.oracle.com/bpel/extension" > < a name = "summary" part > < summary > file:/opt/aia/product/10.1.3.4/OracleAS_MW/bpel/domains/release2/tmp/.bpel_OA_OUT_BPEL_MiddlewareEmailProv_1.0_734ff6b91af23ed1de9191df79ca28b6.tmp/in_Confirmation_FileWrite.wsdl [Write_ptt::Write (ORDER)] - SISM JCA Execute of 'Write' failure due to operation: null; nested exception is:
    java.lang.NullPointerException < / summary >
    < / part > < part name = "detail" > < java.lang.NullPointerException detail > < / details >
    < / piece > < / bindingFault >

    Published by: user11119367 on February 9, 2010 21:23

    Hello
    The custom XSD file is not necessary.
    Looks like it's a bug in file 10.1.3.4/10.1.3.5 adapters - it works very well in 11g.

    Whenever there is "a href" tag in the xml support to write to the file, the file adapter tries to get the content of the url real in 'a href' and written to the output file. When I try with any url (say http://www.google.com), the content of google.com is written in the file. If this URL is not accessible (for example http://foo.bar), then you get the null pointer exception. In your case, I think the URL that you are using the payload, is not accessible from your box of soa, or is not a valid URL.

    As a work around 10.1.3.4, I was able to create the XHTML file as follows:
    1 change the link partner of file adapter to use opaque scheme.
    2. in an assign operation, affect the load XHTML to a string variable using ora:getContentAsString ().
    3. Add a java embedding base64 encode the string as follows and assign to the entrance of the file adapter invoke:
    (HTMLString is the string from step 1 variable, InvokeWriteHTML_InputVariable is the input variable to the call on the file adapter operation)

        
        
          
        
    

    4. call the file adapter using the input variable in which is written the value encoded in base64.

    you could use the workaround above or rethink your design (if you want to create the XHTML file using bpel only or other means).

    Hope this helps,
    Kind regards
    Yohanna.
    http://www.prshanmu.com/articles/

  • Difficulty facing export .xlsx by Apache POI

    I use Jdeveloper 11.1.1.7

    I need to export .xlsx file af:table using Apache POI. I have not used all the attributes of VO in my af:table. I need to export only the visible columns in the same order as in the user interface.  The user may change the order of the columns in the user interface, so I need to look at also.

    I followed http://www.techartifact.com/blogs/2013/08/generate-excel-file-in-oracle-adf-using-apache-poi.html#sthash.CaVkCeKl.dpbs for reference. Here, he is given to browse all attributes in VO and exported in excel via apache POI. So, I could not able to follow this approach. And I couldn't use the HeaderText property in af:column to match with the attributes of the VO, since we used a different name for HeaderText in the user interface.

    So please guide me to achieve the requirement.

    Thank you and best regards,

    Assia.

    There is a lot of work.

    For starters, take a look at:

    https://technology.AMIS.nl/2012/03/02/ADF-11g-programmatically-repositioning-columns-in-a-rich-table/#prettyPhoto

    and attention to

    reorganizeColumnsInTable()

    function

    In this way, you can browse columns of tables. Now, in general, inside the af: column, you have a few af:outputText, which tells you what attribute VO are displayed in this column.

    So download af:outputText (child column) and see what is the "value" property, for this you can use

    ValueExpression ve = outputText.getValueExpression("value");
    String valStr = ve.getExpressionString();
    

    the valStr will be something like:

    #{rank. EmpName}

    Parse this string to get the real name of the VO (EmpName in this case) displayed in this column attribute

    ... had a point?

  • Error occurs when you use SQL Server 2012 assessment vs window detail of the object in window 7 - KERNELBASE.dll exception 0xe0434352

    Hello

    Error occurs when you use SQL Server 2012 assessment vs window detail of the object in window 7.  I use the window of the object but the detail of the objects window arrives and immediately SQL Server stops with the error below and then opens again.  I didn't find any help with this specific error is but suspect there is a problem between SLQ Server 2012 et.NET Framework 4.  Unfortunately, I do not know what it takes in this regard.

    Thanks, Deb

    Event ID: 1000
    Task category: (100)
    Level: error
    Keywords: Classic
    User: n/a
    Computer: Deb - HP
    Description:
    Name of the failing application: Ssms.exe, version: 2011.110.3000.0, time stamp: 0x5081c1cd
    Name of the failed module: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b83c8a
    Exception code: 0xe0434352
    Offset: 0x0000c41f
    ID of the process failed: 0x13a8
    Start time of application vulnerabilities: 0x01ce609a6d3db991
    The failing application path: C:\tempSQLWOW\110\Tools\Binn\ManagementStudio\Ssms.exe
    Path of the failing module: C:\Windows\syswow64\KERNELBASE.dll
    Report ID: 1fb1cbfb-cc8e-11e2-b436-abd2bebb3f17

    Hi Claude,.

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the link below.

    http://social.technet.Microsoft.com/forums/en-us/category/SQLServer

    Good day!

    Answer please if you face concerns.

  • Could not test 12 c Application using Apache Jmeter 2.13 ADF

    @Hi I'm testing 12.1.3.0.0 Application using Apache Jmeter 2.13 Adf. I am trying to achieve using extractors of regular Expression for the following variables.

    Name:Variables of the ADF
    Name of the variable:afrLoop
    Name of the variable:afrWindowId
    Name of the variable:jsessionId
    Name of the variable:ADF. Control state
    Name of the variable:javax.faces.ViewState

    but I'm not getting viewStateExpiredException error wheres the same approach works fine for ADF 11 g R2 Applications.

    Please suggest a solution.

    Please also suggest that is it possible to load test a Adf Application using Apache Jmeter 12.1.3.0.0 2.13

    Also suggest some other test tool that is best suited to load and Stress Test of load Adf Application 12.1.3.0.0.

    Thanks in advance.

    Oracle Application Testing Suite works out-of-the-box.

  • Why Oracle ManagedDataAccess (4.121.1.0) throws a System.FormatException "first chance" exception to the debugger when you use OracleCommand.BindByName (on some machines, but not others)?

    Why Oracle ManagedDataAccess (4.121.1.0) throws a System.FormatException "first chance" exception to the debugger when you use OracleCommand.BindByName (on some machines, but not others)?

    This occurs when calling a ref cursor-returning packaged function stored with OracleCommand.BindByName set to true.

    When BindByName undefined, it works as expected.

    I've only been able to recreate this problem on a machine in my control. This issue has also reported to me by a customer.

    I tried to change the locale of the system of EN - UK EN-US, but I was not aware of any change in behavior.

    Similarly, I've tried explicitly overriding the default locale of the system with the OracleGlobalization parameters, and it also had no effect.

    Please see the example below.

    ---

    Environment (default):

    Windows 7 Professional 64-bit SP1

    Visual Studio 12.0.21005.1 REL / / CAN BE SIGNIFICANT

    .NET framework 4.5.51209

    Local system: EN - UK (but also does not, EN-US).

    Oracle.ManagedDataAccess 4.121.1.0

    "< supportedRuntime version ="v4.0"sku =". NETFramework,Version=v4.5.1"/ >

    Environment (base):

    Windows 7 Professional 64-bit SP1

    Updated Visual Studio 12.0.31101.00 //SEE above 4

    .NET framework 4.5.51209

    Local system: EN - UK

    Oracle.ManagedDataAccess 4.121.1.0

    "< supportedRuntime version ="v4.0"sku =". NETFramework,Version=v4.5.1"/ >

    Call stack:

    mscorlib.dll. Unknown System.Number.StringToNumber(string str, System.Globalization.NumberStyles options, ref System.Number.NumberBuffer number, System.Globalization.NumberFormatInfo info, bool parseDecimal)
    mscorlib.dll. Unknown System.Number.ParseInt32(string s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info)
    Oracle.ManagedDataAccess.dll! Oracle.ManagedDataAccess.Types.OracleRefCursor.OracleRefCursor (connection Oracle.ManagedDataAccess.Client.OracleConnection, OracleInternal.ServiceObjects.OracleRefCursorImpl refCursorImpl, Oracle.ManagedDataAccess.Types.OracleIntervalDS sessionTimeZone, string commandText, string paramPosOrName, long initialLongFS, long initialLobFS, long [] scnFromExecution) unknown
    Oracle.ManagedDataAccess.dll! OracleInternal.ServiceObjects.OracleParameterImpl.ExtractRefCursorFromAccessor (Oracle.ManagedDataAccess.Client.OracleConnection conn, accessor OracleInternal.TTC.Accessors.Accessor, long fetchSize, Oracle.ManagedDataAccess.Client.PrmEnumType enumType, Oracle.ManagedDataAccess.Types.OracleIntervalDS sessionTimeZone, string commandText, string paramPosOrName, long longFetchSize, long lobFetchSize, long [] scnFromExecution, int currentRow) unknown
    Oracle.ManagedDataAccess.dll! OracleInternal.ServiceObjects.OracleParameterImpl.GetRefCursorFromBytes unknown (Oracle.ManagedDataAccess.Client.OracleConnection conn, accessor OracleInternal.TTC.Accessors.Accessor, long fetchSize, Oracle.ManagedDataAccess.Client.PrmEnumType enumType, Oracle.ManagedDataAccess.Types.OracleIntervalDS sessionTimeZone, string commandText, string paramPosOrName, long longFetchSize, long lobFetchSize, long [] scnFromExecution)
    Oracle.ManagedDataAccess.dll! Oracle.ManagedDataAccess.Client.OracleParameter.PostBind_RefCursor (connection Oracle.ManagedDataAccess.Client.OracleConnection, OracleInternal.TTC.Accessors.Accessor bindAccessor, long fetchSize, Oracle.ManagedDataAccess.Types.OracleIntervalDS sessionTimeZone, string commandText, string paramPosOrName, long longFetchSize, long lobFetchSize, long [] scnFromExecution) unknown
    Oracle.ManagedDataAccess.dll! OracleInternal.ServiceObjects.OracleCommandImpl.ExtractAccessorValuesIntoParam (Oracle.ManagedDataAccess.Client.OracleParameterCollection paramColl, Oracle.ManagedDataAccess.Client.OracleConnection connection, string commandText, long longFetchSize, long lobFetchSize, long [] scnFromExecution) unknown
    Oracle.ManagedDataAccess.dll! Unknown Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(bool requery, bool fillRequest, System.Data.CommandBehavior behavior)
    Oracle.ManagedDataAccess.dll! Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader (unknown)

    > ManagedSimpleRefCursor1.exe! NoddyConsole.Program.Command_ExecuteReader_BindByName_Fails (Line 63 c#)

    Example:

    ----

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using Oracle.ManagedDataAccess.Client;

    using Oracle.ManagedDataAccess.Types;

    using System.Data;

    namespace NoddyConsole

    {

    public class Program

    {

    public static int Main (string [] args)

    {

    Error int = 0;

    Errors += Command_ExecuteReader_BindByName_Fails();

    Errors += UseReturnValue_Command_ExecuteNonQuery_BindByName_Fails();

    return errors;

    }

    public static int Command_ExecuteReader_BindByName_Fails()

    {

    Error int = 0;

    Try

    {

    var conn = new OracleConnection ("UID = USER; Password = PASS; ("Data Source = / / your-host: 1521 / yours-sid");

    var conn = new OracleConnection ("user Id = UNIT620; Password = UNIT620; ("Data Source = / / ln1apidb01:1521 / fm");

    Conn. Open();

    IRRELEVANT

    OracleGlobalization og is conn. GetSessionInfo();

    og. DateFormat = "HH24:MI:SS MON-DD-YYYY";

    Conn. SetSessionInfo (og);

    var cmd is conn. CreateCommand();

    cmd.CommandType = CommandType.Text;

    BindByName. cmd = true;

    cmd.CommandText = "START: rc: = SHAUN.recreate_issue_1 (in_code = >: in_code); END; « ;

    var prm1 is cmd. CreateParameter();

    PRM1. ParameterName = "rc";

    PRM1. Direction = ParameterDirection.ReturnValue;

    PRM1. OracleDbType = OracleDbType.RefCursor;

    cmd. Parameters.Add (prm1);

    / * SHAUN.recreate_issue_1 * /.

    var prm2 is cmd. CreateParameter();

    PRM2. ParameterName = "in_code";

    PRM2. Direction = ParameterDirection.Input;

    PRM2. OracleDbType = OracleDbType.Varchar2;

    PRM2. Value = "A";

    cmd. Parameters.Add (prm2);

    /* */

    var reader is cmd. ExecuteReader(); FAILS to System.Number.StringToNumber (String str, NumberStyles options, NumberBuffer & number, NumberFormatInfo info, Boolean parseDecimal)

    /* *-/

    OracleRefCursor orc = null;

    cmd ExecuteNonQuery()); must fail here

    ORC = cmd. Parameters ["rc"]. Value as OracleRefCursor;

    If (orc is nothing)

    throws InvalidOperationException new ("Invalid return the ref cursor type");

    var = orc player. GetDataReader();

    /* */

    While (reader. Read

    {

    var values = new object [reader. FieldCount];

    drive. GetOracleValues (values);

    for (int i = 0; i < values.) Length; (++ I)

    {

    Console.WriteLine(values[i]);

    }

    }

    drive. Dispose();

    cmd. Dispose();

    Conn. Dispose();

    }

    catch (Exception ex)

    {

    Console.Error.WriteLine (ex) Message);

    Errors ++;

    }

    Finally

    {

    Return (true);

    }

    return errors;

    }

    public static int UseReturnValue_Command_ExecuteNonQuery_BindByName_Fails()

    {

    Error int = 0;

    Try

    {

    var conn = new OracleConnection ("UID = USER; Password = PASS; ("Data Source = / / your-host: 1521 / yours-sid");

    Conn. Open();

    IRRELEVANT

    OracleGlobalization og is conn. GetSessionInfo();

    og. DateFormat = "HH24:MI:SS MON-DD-YYYY";

    Conn. SetSessionInfo (og);

    var cmd is conn. CreateCommand();

    BindByName. cmd = true; // ####

    cmd.CommandText = "START: rc: = SHAUN.recreate_issue_1 (in_code = >: in_code); END; « ;

    cmd.CommandText = "START: rc: = SHAUN.recreate_issue_2; END; « ; No params, works

    var prm1 is cmd. CreateParameter();

    PRM1. ParameterName = "rc";

    PRM1. Direction = ParameterDirection.ReturnValue;

    PRM1. OracleDbType = OracleDbType.RefCursor;

    cmd. Parameters.Add (prm1);

    / * SHAUN.recreate_issue_1 * /.

    var prm2 is cmd. CreateParameter();

    PRM2. ParameterName = "in_code";

    PRM2. Direction = ParameterDirection.Input;

    PRM2. OracleDbType = OracleDbType.Varchar2;

    PRM2. Value = "A";

    cmd. Parameters.Add (prm2);

    /* */

    var reader is cmd. ExecuteReader();

    OracleRefCursor orc = null;

    HERE does NOT cmd. BindByName = true; System.FormatException first-chance exception in at System.Number.StringToNumber (String str, NumberStyles options, NumberBuffer & number, NumberFormatInfo info, Boolean parseDecimal)

    cmd ExecuteNonQuery());

    ORC = cmd. Parameters ["rc"]. Value as OracleRefCursor;

    If (orc is nothing)

    throws InvalidOperationException new ("Invalid return the ref cursor type");

    var = orc player. GetDataReader();

    While (reader. Read

    {

    var values = new object [reader. FieldCount];

    drive. GetOracleValues (values);

    for (int i = 0; i < values.) Length; (++ I)

    {

    Console.WriteLine(values[i]);

    }

    }

    drive. Dispose();

    ORC. Dispose();

    cmd. Dispose();

    Conn. Dispose();

    }

    catch (Exception ex)

    {

    Console.Error.WriteLine (ex) Message);

    Errors ++;

    }

    Finally

    {

    Return (true);

    }

    return errors;

    }

    }

    }

    ---

    create or replace package THAT SHAUN is

    type ref_cur_type is ref cursor;

    function recreate_issue_1)

    in_code varchar2: = null

    ) return ref_cur_type;

    end SHAUN;

    /

    create or replace package body what SHAUN

    -TTS000233

    function recreate_issue_1)

    in_code varchar2: = null

    ) return ref_cur_type is ref_cur ref_cur_type;

    Start

    Open the ref_cur for

    Select UO.object_name from user_objects UO;

    Return ref_cur;

    end recreate_issue_1;

    end SHAUN;

    /

    ---

    Thanks a lot to qualify again for me Alex.  I'll try upgrading to the latest version of the provider.

    The difference in behavior between the two hosts was found to be reduced to differences in configuration VS.

    Checking 'Just my code' prevents the first chance thrown in the debugger exception. As in fact, the exception is handled in the provider, it is enough for me.

  • [ADF, JDev12.1.3] When you use create/restoreSavepoint... Restore operation is still useful? And other doubts...

    Hallo,

    Dario and Timo advised me (in this thread Re: [ADF, JDev12.1.3] Master w/playback af:form only af:tables detail: how to handle insert and edit through forms?) I make a request using the functions create/restoreSavpoint to this fragment in my application.

    The tables are read-only, and the user can insert and modify records by a form of popup.

    Each table has its own pop-up that I created using a btf executed as diaolog (*).

    Before I open the popup, I create the backup point.

    BindingContext bctx = BindingContext.getCurrent();  
    DCDataControl dcDataControl = bctx.getDefaultDataControl();  
    String sph = (String) dcDataControl.createSavepoint();  
    AdfFacesContext.getCurrentInstance().getPageFlowScope().put("AdfmSavePoint", sph); 
    

    When the popup is closed, I restore the backup point if the Cancel button was clicked...

    Object confirmOrCancel = returnEvent.getReturnValue();  
    if (((String) confirmOrCancel).equals("cancel")) {  
      String sph = (String) AdfFacesContext.getCurrentInstance().getPageFlowScope().get("AdfmSavePoint");  
      BindingContext bctx = BindingContext.getCurrent();  
      DCDataControl dcDataControl = bctx.getDefaultDataControl();  
      dcDataControl.restoreSavepoint(sph);  
    } 
    

    I have these doubts:

    1. the button "CANCEL ALL" (so far) AM restore operation is still meaningful (is always useful) when you use the check points? Or can I avoid using the restore of the AM operation, creating a backup point before you enter the fragment and restore it if the user clicks on "RESTORE ALL"?
    2. for all tables: before opening the popup insert/change the backup point is implemented pageFlowScope under the same key 'AdfmSavePoint '. Is it OK or would it be better to use a different key for each table (for example 'AdfmSavePointTable1', 'AdfmSavePointTable2',...)?
    3. If the pageFlowScope already contains a checkpoint under the "AdfmSavePoint" key... What does if I give the floor to new .put ("AdfmSavePoint", sph)? Can I be sure that the old value is overwritten?
    4. is this safe with nested savepoint? For example in my case I want to create a backup before the fragment in the image point is displayed (and restore if the user leaves the fragment by clicking "RESTORE ALL"), then within the fragment, as I said above, I would manage other points of record when inserting/editing tables.
    5. I noticed that clicking on the button "RESTORE ALL" when it relates to the AM-restore operation causes this strange thing: when before displaying the fragment I call SetCurrentRowWithKey on the master istance VO... If I click on "ROLLBACK ALL" posted master VO Records changes and 1 minutes of the main of the VO table is displayed. Why the master istance VO is not reimain in the folder I've previously selected by SetCurrentRowWithKey?
    6. With reference to the expression (*) above. The BTF 'dialogue' I created contains only the page jspx with shape and a return to activity. I also tried a) create (and restore) the backup point, b) to call createInsert inside the "dialog box" operation BTF (see images below), but the createInsert on retail VO istance called inside the 'dialogue' BTF seems not to reflect on the table as when I call createInsert by calling btf. I have to make some adjustments in the 'dialogue' of BTF?

    Thank you

    Federico

    Federico,

    (1) Yes, what should happen if a user add or edit vo1 and click ok in the dialog box but decided that ask to work must be restored?

    (2) as long as you don't have that a dialog box is open, it should work.

    (3) the flowrate range of page is a map. You can put the same key more than once. If the key already exists, the value is replaced.

    (4) in fact, I don't know, but the sounds of complicated design. I guess you can record more points, but only in the order of creation. It's as if you try to rebuild the framework. BTF yo it even for you, when worn right. Please go to ADF Architecture Square and read and watch it task flow of related things.

    (5) this behavior is as expected. A restore resets all the iterators so thagetto point at the top of he. http://www.Oracle.com/technetwork/Developer-Tools/ADF/learnmore/OCT2010-OTN-Harvest-183714.pdf 'keep the line after cancellation' shows how to handle this situation.

    (6) I suppose have you refresh the table iterator, once you close the dialog box for the new data. But that's only a guess because it depends on how the btf share control of data and the your involved.

    Timo

  • problem in the form of master-detail when you use the ADF table for detail

    Hello

    jdev version - 11.1.2.1.0


    I create master shape detail using datacontrol drag as ADF master shape secondary Table.


    Now when I create a new line in the detail table using the key CreateInsert a new empty row created on top of the secondary table.

    and other show line that the previous record data based on the master.

    problem is I want to when I click on the createInsert button all the line of the secondary table must be empty and what line to fill two or three user then validate.



    Thanks in advance

    Hello

    If a secondary table has data, then createInsert adds to them. If you want to hide the existing lines, create a new instance of the View object and set the option "extract database" to "No. Rows. Use an af:switcher to change the specified table when the user clicks the createInsert button. There is some coding needed to have this use case in the ADF, but its essentially declarative. Bottom line, is that there is no option automated other than to create new lines in a separate page or dialog box if you are bothered by existing lines

    Frank

  • Can I process Excel BIFF5 files, or simply abandon Apache POI?

    For the experienced:

    I am totally new to processing the files using Java Microsoft Excel and embarks on Apache POI. Now it seems that I might be completely out of luck because of Excel files, I'm in the process.

    Now looking back, I realize account I got what I got with Excel file (.xls file) was opened in Excel 2007 and clicked on the "Save" button. And it's all OK POI learning by the transformation of this file. Now, after all the work I've done with this file, I trashed it and got a copy of the original Excel file - as is, without first loading in Excel 2007 and recording - and run my java program on it. And I got the following error message speaks BIFF5 and BIFF8:


    C:\Oracle\Middleware\jdk160_18\bin\javaw.exe-client - classpath
    C:\apps11113\JavaExercise\. ADF; C:\apps11113\JavaExercise\Basic\classes; C:\java_lib\poi-3.7\poi-3.7-20101029.jar
    -Djavax.NET.SSL.trustStore=C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks learnjava. ExcelTest2
    Exception in thread "main" org.apache.poi.hssf.OldExcelFormatException: the provided spreadsheet seems to be in Excel 5.0/7.0 format (BIFF5).
    POI only supports the BIFF8 format (from versions of Excel 97/2000/XP/2003)


    My program, when put into production, will run the schedule and unattended and will have to treat the file as it is. I'm out of luck and need to find some other APIs that support BIFF5? Is there some these APIs?

    Thank you very much for help!


    Newman

    Where do you find excel files? Would it be possible to have the provider upgrade its machines to provide the latest files?

    You can try the 'other' Java API Excel, JXL or whatever he called to see if she can manage obsolete formats.

  • Caused by: java.lang.NoSuchMethodError: org.apache.poi.ss.SpreadsheetVersion.getMaxCellStyles () I

    Hi all

    I used poi - 3.12 in my project because I need to read xlsx files

    and installed used webcenter poi - 3.5

    I get this error in my code:

    Caused by: java.lang.NoSuchMethodError: org.apache.poi.ss.SpreadsheetVersion.getMaxCellStyles () I

    Please guide me

    Thanks in advance

    Maybe you can try with

    true

    in your weblogic.xml.

    If not enough, you should research how to replace poi next to webcenter

  • Hanging application while created workbook XSSF (Apache POI)

    Hello

    We have developed an application (using Netbeans) which, in a single windows is asking for some parameters, reading a few Oracle database data and creating a xlsx spreadsheet on the client side.

    Everything works fine, but we have only one user (among 20 using our application) who has a problem. When the application needs to start creating the file xlsx, it hangs, the file is not yet created on the client side. This only happens on a specific computer

    We cannot reproduce this behavior in our development environment, or in any other machine.

    I tried to create a file xls xlsx (using the HSSFWorkbook instead of XSSFWorkbook) and the problem is not displayed in his laptop. So the behavior seems to be specifically associated with this problem. The Apache POI library used is 3.11.

    Is it possible to track client (no right to administrator unfortunately on this machine) and see exactly what causes this problem only on this machine?

    Note that only JRE is installed on this computer.

    Kind regards.

    Alberto

    Hello

    After you find the error and cheking out how Netbeans using the path class the only problem that could cause the problem was an external library during installation of the JRE.

    For some reason any on the laptop user, there was a library external xbeans.jar (lib/ext under JRE path) including and the old version of the XmlOptions class.

    Remove the old library xbeans, jre lib/ext pot has solved the problem.

    Kind regards.

    Alberto

  • Using SQL Server with ADF BC and getting Houston - 29114 ADFContext aren't Setup error

    Hello... I work with ADF BC and my connection is with a MS SQL Server database.  I added the sqljdbc4.jar in my template project, and can't seem to connect with the DB and build an Entity/View/AppMod infrastructure.  However, once I deploy the application on the integrated WebLogic Server I get errors when ADF BC tries to connect.  I added a POJO supported data control and tried to debug but PPR reports an error when my key to call the code stripped of JDBC:

    Houston-29114 ADFContext is not configured to process this exception messages. Use the code of exception stack trace and error to investigate the root cause of this exception. Root cause error code is Houston-29000. Error messages settings are {0 = java.lang.NoClassDefFoundError, 1 = com/microsoft/sqlserver/jdbc/SQLServerException}

    ADF_FACES-60097: for more information, see the error log of the server for an entry beginning with: ADF_FACES - Exception during the PPR, #1 60096:Server

    Seems to me that the POT is not in the classpath on the WLS.  What is the problem? If Yes... How would have added that JAR, sqljdbc4.jar, the path of the WLS class.  I've done through the deployment of models, and he saw in the META-INF/lib directory that has been deployed.

    Thanks for any help!

    Do not apply the JDBC JAR (s) in the archives of application deployment. You must add the JAR to the classpath WLS JDBC (s). Change the commEnv.cmd/sh for this script:

    Using JDBC with WebLogic Server - 11g Release 1 (10.3.6) drivers

    Note that WLS is pre-configured with a number of brand WebLogic DataDirect JDBC drivers (including a SQLServer driver), so you can use it instead of adding a new driver if the DataDirect driver meets your needs:

    Using WebLogic brand DataDirect drivers - 11g Release 1 (10.3.6)

    WLS 10.3.5 documentation provides more detailed information:

    The MS SQL Server driver

    Dimitar

  • How can I disable the mouse pad when you use a mouse plug-and-play?

    How can I disable the mouse pad when you use a mouse plug-and-play? I tried to disable the driver, and nothing works.

    Hello

    Check with support of the manufacturer system, documentation online or forums that there is probably
    Shortcut keys that enable and disable the touchpad functions.

    Parameters for TouchPad located in the control panel - mouse (there may be several tabs with TouchPad entered)
    and some come with a utility that loads in the Notification area next to the clock in the bottom right.

    ==========================================

    If necessary: (make sure that you have restarted at least once, if the above did not work)

    Panel of configuration manager devices - mouse and pointing devices - Double click on the touchpad - the driver tab-
    Click on update driver (it comes may not do anything like MS is far behind the drivers of certification), now right CLICK
    on the TouchPad and UNINSTALL.

    Then go to the USB and UNINSTALL ALL controllers except the category itself (all in). RESET

    This will refresh the driver for the TouchPad and battery USB. This does not prevent the touchpad from working.

    The similar procedure on XP, Windows 7 and Vista is the same, except that we need to clear the specific device if present.
    http://support.Microsoft.com/kb/310575

    Then go to the system manufacturer's website and get the latest touchpad drivers.

    Download - SAVE - go to where you put it-click on - RUN AS ADMIN.

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • HP Officejet J5780: Stripe yellow towards the bottom of the page when you use the document feeder

    When using the document feeder copy has a yellow stripe down page @21/8 "from the left margin. NO problem when using the tray.

    Hi @GlennG1 and welcome to the Forums of HP!

    I see that you have lines in the ADF.  I would like to help!

    I recommend to remove the ink cartridges and perform a power reset.  Unplug the power cord from the printer and the power outlet, then wait 60 seconds. After 60 seconds, plug back in the printer. Make sure that you connect the printer directly to a wall outlet. Make sure to bypass any surge protector or power bar.

    I also recommend this document:

    Vertical stripes, lines or streaks on Copies, faxes or scan

    Good luck and please let me know the results of your troubleshooting operations. Thanks for posting on the HP Forums!

Maybe you are looking for

  • Not all my iPhone 6 photos when connected to iTunes/iPhoto.

    Very well done on my Photos app on my iPhone 6 under my default 'All the Photos' folder I have 343 Photos. When I connect to my Mac Air via a cable lighting iTunes opens automatically, but says only I have 67 photos to download. My question is where

  • Firefox restore closed tabs when the value "show my home page".

    I put the option when Firefox starts: "show my home page". I expect to get a tab open, showing my home page. Instead, I get a bunch of tabs that were open when I closed Firefox during reconfiguration. This includes my home page under the first tab -

  • Download El Capitan and Yosemite still shows as operating system after reboot

    Download of El Capitan, full upgrade but functioning does not appear on the computer

  • Newbie needs help on the sequence

    Hello I just try to schedule something wih a sequence but it seems that I am quite familiar with the basic things that LabView. I am therefore asking for help. I want to do is start the program wait for the button to be pressed, and then turn on the

  • WiFi turns off to physical stimulation

    Hey community,. I have a R400, model 7440DK5 who served me very well on almost 3 years at this point. However in the last month or so he had a very specific problem: wifi turns off when the laptop gets a physical stimulus, for example if I pick it up