Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: JDBC access to null value in J2EE
lokus44_at_ifrance.com (Yann) wrote in message news:<9ecf91fd.0404280514.15802192_at_posting.google.com>...
> RDBMS Version: 5.0.2.10.0
> Operating System and Version: Windows 2000 Pro
>
> I have this error in OC4J 9.0.4.0 :
>
> Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred
> at PC=0x80743C1
> Function=[Unknown.]
> Library=c:\j2sdk1.4.2\jre\bin\client\jvm.dll
>
> NOTE: We are unable to locate the function name symbol for the error
> just occurred. Please refer to release documentation for possible
> reason and solutions.
>
>
> Current Java thread:
> at oracle.lite.poljdbc.LiteEmbResultSet.jniGetDataString(Native
> Method)
> at oracle.lite.poljdbc.LiteEmbResultSet.getVal(Unknown Source)
> at oracle.lite.poljdbc.POLJDBCResultSet.getString(Unknown Source)
> at oracle.lite.poljdbc.POLJDBCResultSet.getString(Unknown Source)
> at fr.sigma.projetreference.test.page.TestJDBCServletSTD.doGet(TestJDBCServletSTD.java:51)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
> at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
> at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
> at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
> at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
> at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
> at java.lang.Thread.run(Thread.java:534)
>
> Dynamic libraries:
> 0x00400000 - 0x00406000 c:\j2sdk1.4.2\bin\java.exe
> ......
>
> when i execute this Servlet :
>
> public class TestJDBCServletSTD extends HttpServlet {
> public void doGet (HttpServletRequest request, HttpServletResponse
> response)
> throws ServletException, IOException {
> PrintWriter out;
> Properties props = new Properties();
>
> response.setContentType("text/html"); // then write the data of the
> response
> out = response.getWriter();
> try {
> Class.forName("oracle.lite.poljdbc.POLJDBCDriver");
> props.put("user","envstdjava");
> props.put("password","envstdjava");
> Connection conn = DriverManager.getConnection("jdbc:polite:stdoralite",
> props);
> String requeteSQL = "SELECT CSTD_MENUS.*, TRA_INTITULE,
> CSTD_TRA.LAN_CODE " + "FROM CSTD_MENUS, CSTD_TRA WHERE MNU_CODEPARENT
> IS NULL " + "AND CSTD_MENUS.INT_CODE = CSTD_TRA.INT_CODE " + "ORDER BY
> CSTD_TRA.LAN_CODE, MNU_ORDRE";
> PreparedStatement stmtPortail = conn.prepareStatement(requeteSQL);
> ResultSet rsPortail = stmtPortail.executeQuery();
> while (rsPortail.next()) {
> out.println(rsPortail.getInt("MNU_CODE") + " - " +
> rsPortail.getString("MNU_CHEMIN") + "</ br>");
> }
> rsPortail.close();
> stmtPortail.close();
> conn.close();
> out.println("Ok");
> } catch ( Exception e ) {
> out.println("Not Ok");
> out.println( "Erreur : " + e.getMessage() );
> }
> out.close();
> }
> }
>
> When getString() must get NULL value in MNU_CHEMIN column il have the
> error.
>
> I reproduce the same error with TOMCAT 4.1.19
> I reprocude the same error in JDK1.3.1_06 on OC4J 9.0.4.0 and TOMCAT
> 4.1.19
>
> If i do this in Java Application Console, i have no problem.
>
> Thanks,
>
> Yann.
Hi,
I have resolve the problem with TOMCAT but not with OC4J.
When i run my Java console in DOS prompt i have CLASSPATH set to
C:\oracle\ora90\MOBILE\CLASSES\OLITE40.JAR;
But in setclasspath.bat BAT file of TOMCAT, CLASSPATH is set to
%JAVA_HOME%\lib\tools.jar only.
When i add C:\oracle\ora90\MOBILE\CLASSES\OLITE40.JAR; i have no
problem.
OLITE40.JAR file is also in my %TOMCAT_HOME%/webapps/myapp/WEB-INF/lib
directory.
With OC4J i do (like BAT file of TOMCAT):
set JAVA_HOME=c:\j2sdk1.4.2
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;C:\oracle\ora90\MOBILE\CLASSES\OLITE40.JAR;
%JAVA_HOME%\bin\java -classpath "%CLASSPATH%" -jar oc4j.jar
But OC4J crash.
Regards Received on Fri Apr 30 2004 - 02:49:42 CDT