Re: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER
Moving this back on the list. In general it's a good idea to keep the discussion (and the solution) on the mailing list. That way everyone benefits (and everyone can help). Comments are surrounded with COMMENT On 8/9/2012 4:18 AM, CHRISTOS STAVRINOU wrote: Thank you for your answer that solved the problem. But now I get the error below that [Sybase][ODBC Driver Manager] Unable to load resource file I can't understand what happens and how to fix it. Please help if you have any answer. Thanks a lot. org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: [Sybase][ODBC Driver Manager] Unable to load resource file org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:548) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:456) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) root cause javax.servlet.ServletException: java.sql.SQLException: [Sybase][ODBC Driver Manager] Unable to load resource file org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:911) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:840) org.apache.jsp.sybread_jsp._jspService(sybread_jsp.java:157) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) root cause java.sql.SQLException: [Sybase][ODBC Driver Manager] Unable to load resource file ianywhere.ml.jdbcodbc.jdbc3.IDriver.makeODBCConnection(Native Method) ianywhere.ml.jdbcodbc.jdbc3.IDriver.connect(IDriver.java:768) java.sql.DriverManager.getConnection(DriverManager.java:579) java.sql.DriverManager.getConnection(DriverManager.java:221) org.apache.jsp.sybread_jsp._jspService(sybread_jsp.java:95) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) COMMENT This looks like you are placing the SQL inside of a JSP page. In general, this is not best practice. I am not sure that this list is the place to discuss DAO (data access object) architecture, although the following blog post by Christopher Schultz is quite instructive: http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling-pooled-jdbc-connections/ COMMENT On Wed, Aug 8, 2012 at 7:46 PM, Mark Eggers its_toas...@yahoo.com wrote: On 8/8/2012 6:06 AM, CHRISTOS STAVRINOU wrote: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER At what path I must copy the file dbjodbc12.so? What is the correct configuration? How I can configure the java.library.path under under centos 6 and tomcat 7 in order to fix the problem? Please help me. If you have any answers please email me to stavr...@gmail.com Thanks in advance The connection string is as follows: jdbc:ianywhere:driver=libdbodbc12.so;ENG=host;DBN=database COMMENT According to a discussion on the SQL Anywhere forum, you no longer need to put driver and DBN=database (shouldn't that be DSN=database) in the connection string. However, they're using sajdbc4.jar - sybase.jdbc4.sqlanywhere.IDriver and you appear to be using the jdbc3 driver? Here's the discussion link: http://sqlanywhere-forum.sybase.com/questions/8551/sybasejdbc4sqlanywhereidriver-problems-java-hangs-when-connecting COMMENT But when running the program, I get the following exception (with the relevant stack trace) - Exception in thread main java.lang.UnsatisfiedLinkError: no dbjodbc12 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at ianywhere.ml.jdbcodbc.IDriver.try_load(IDriver.java:247) at ianywhere.ml.jdbcodbc.IDriver.clinit(IDriver.java:216) at java.lang.Class.forName0(Native Method) at
RE: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER
Mark did JAVA_OPTS=-Djava.library.path=directory-with-libdbodbc12.so export JAVA_OPTS work? What does Sybase say? Martin __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Thu, 9 Aug 2012 07:53:19 -0700 From: its_toas...@yahoo.com To: users@tomcat.apache.org Subject: Re: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER Moving this back on the list. In general it's a good idea to keep the discussion (and the solution) on the mailing list. That way everyone benefits (and everyone can help). Comments are surrounded with COMMENT On 8/9/2012 4:18 AM, CHRISTOS STAVRINOU wrote: Thank you for your answer that solved the problem. But now I get the error below that [Sybase][ODBC Driver Manager] Unable to load resource file I can't understand what happens and how to fix it. Please help if you have any answer. Thanks a lot. org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: [Sybase][ODBC Driver Manager] Unable to load resource file org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:548) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:456) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) root cause javax.servlet.ServletException: java.sql.SQLException: [Sybase][ODBC Driver Manager] Unable to load resource file org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:911) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:840) org.apache.jsp.sybread_jsp._jspService(sybread_jsp.java:157) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) root cause java.sql.SQLException: [Sybase][ODBC Driver Manager] Unable to load resource file ianywhere.ml.jdbcodbc.jdbc3.IDriver.makeODBCConnection(Native Method) ianywhere.ml.jdbcodbc.jdbc3.IDriver.connect(IDriver.java:768) java.sql.DriverManager.getConnection(DriverManager.java:579) java.sql.DriverManager.getConnection(DriverManager.java:221) org.apache.jsp.sybread_jsp._jspService(sybread_jsp.java:95) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) COMMENT This looks like you are placing the SQL inside of a JSP page. In general, this is not best practice. I am not sure that this list is the place to discuss DAO (data access object) architecture, although the following blog post by Christopher Schultz is quite instructive: http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling-pooled-jdbc-connections/ COMMENT On Wed, Aug 8, 2012 at 7:46 PM, Mark Eggers its_toas...@yahoo.com wrote: On 8/8/2012 6:06 AM, CHRISTOS STAVRINOU wrote: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER At what path I must copy the file dbjodbc12.so? What is the correct configuration? How I can configure
Re: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER
On 8/9/2012 3:06 PM, Martin Gainty wrote: Mark did JAVA_OPTS=-Djava.library.path=directory-with-libdbodbc12.so export JAVA_OPTS work? What does Sybase say? Martin __ Date: Thu, 9 Aug 2012 07:53:19 -0700 From: its_toas...@yahoo.com To: users@tomcat.apache.org Subject: Re: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER Moving this back on the list. In general it's a good idea to keep the discussion (and the solution) on the mailing list. That way everyone benefits (and everyone can help). Comments are surrounded with COMMENT On 8/9/2012 4:18 AM, CHRISTOS STAVRINOU wrote: Thank you for your answer that solved the problem. But now I get the error below that [Sybase][ODBC Driver Manager] Unable to load resource file I can't understand what happens and how to fix it. Please help if you have any answer. Thanks a lot. org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: [Sybase][ODBC Driver Manager] Unable to load resource file org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:548) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:456) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) root cause javax.servlet.ServletException: java.sql.SQLException: [Sybase][ODBC Driver Manager] Unable to load resource file org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:911) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:840) org.apache.jsp.sybread_jsp._jspService(sybread_jsp.java:157) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) root cause java.sql.SQLException: [Sybase][ODBC Driver Manager] Unable to load resource file ianywhere.ml.jdbcodbc.jdbc3.IDriver.makeODBCConnection(Native Method) ianywhere.ml.jdbcodbc.jdbc3.IDriver.connect(IDriver.java:768) java.sql.DriverManager.getConnection(DriverManager.java:579) java.sql.DriverManager.getConnection(DriverManager.java:221) org.apache.jsp.sybread_jsp._jspService(sybread_jsp.java:95) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) COMMENT This looks like you are placing the SQL inside of a JSP page. In general, this is not best practice. I am not sure that this list is the place to discuss DAO (data access object) architecture, although the following blog post by Christopher Schultz is quite instructive: http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling-pooled-jdbc-connections/ COMMENT On Wed, Aug 8, 2012 at 7:46 PM, Mark Eggers its_toas...@yahoo.com wrote: On 8/8/2012 6:06 AM, CHRISTOS STAVRINOU wrote: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER At what path I must copy the file dbjodbc12.so? What is the correct configuration? How I can configure the java.library.path under under centos 6 and tomcat 7 in order to fix the problem? Please help me. If you have any answers please email me to stavr...@gmail.com Thanks in advance The connection string is as follows: jdbc:ianywhere:driver=libdbodbc12.so;ENG=host;DBN=database COMMENT According to a discussion on the SQL Anywhere forum, you no longer need to put driver and DBN=database (shouldn't that be DSN=database) in the connection string. However, they're using sajdbc4.jar - sybase.jdbc4.sqlanywhere.IDriver and you appear to be using the jdbc3 driver? Here's the discussion link: http://sqlanywhere-forum.sybase.com/questions/8551/sybasejdbc4sqlanywhereidriver-problems-java-hangs-when-connecting COMMENT But when running the program, I get the following exception (with the relevant stack trace) - Exception in thread main java.lang.UnsatisfiedLinkError: no dbjodbc12 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682
Re: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER
I use SQLA12, though on windows rather than Linux, and I think you have the wrong value for your driver clause. I think you need ianywhere.ml.jdbcodbc.IDriver, rather than the file name. The driver file should usually be in your WEB-INF/lib directory. I'd also suggest using the sybase newsgroups rather than tomcat for this. On 8/8/2012 9:06 AM, CHRISTOS STAVRINOU wrote: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER At what path I must copy the file dbjodbc12.so? What is the correct configuration? How I can configure the java.library.path under under centos 6 and tomcat 7 in order to fix the problem? Please help me. If you have any answers please email me to stavr...@gmail.com Thanks in advance The connection string is as follows: jdbc:ianywhere:driver=libdbodbc12.so;ENG=host;DBN=database But when running the program, I get the following exception (with the relevant stack trace) - Exception in thread main java.lang.UnsatisfiedLinkError: no dbjodbc12 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at ianywhere.ml.jdbcodbc.IDriver.try_load(IDriver.java:247) at ianywhere.ml.jdbcodbc.IDriver.clinit(IDriver.java:216) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER
2012/8/8 David kerber dcker...@verizon.net: I use SQLA12, though on windows rather than Linux, and I think you have the wrong value for your driver clause. I think you need ianywhere.ml.jdbcodbc.IDriver, rather than the file name. The driver file should usually be in your WEB-INF/lib directory. I'd also suggest using the sybase newsgroups rather than tomcat for this. 1. A native library (.so/.dll) cannot be in WEB-INF/lib, because it can be loaded int JVM only once, and web applications can be restarted, undeployed etc. 2. Call System.getProperty(java.library.path); and print its value. On 8/8/2012 9:06 AM, CHRISTOS STAVRINOU wrote: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER At what path I must copy the file dbjodbc12.so? What is the correct configuration? How I can configure the java.library.path under under centos 6 and tomcat 7 in order to fix the problem? Please help me. If you have any answers please email me to stavr...@gmail.com Thanks in advance The connection string is as follows: jdbc:ianywhere:driver=libdbodbc12.so;ENG=host;DBN=database But when running the program, I get the following exception (with the relevant stack trace) - Exception in thread main java.lang.UnsatisfiedLinkError: no dbjodbc12 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at ianywhere.ml.jdbcodbc.IDriver.try_load(IDriver.java:247) at ianywhere.ml.jdbcodbc.IDriver.clinit(IDriver.java:216) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER
On 8/8/2012 10:41 AM, Konstantin Kolinko wrote: 2012/8/8 David kerberdcker...@verizon.net: I use SQLA12, though on windows rather than Linux, and I think you have the wrong value for your driver clause. I think you need ianywhere.ml.jdbcodbc.IDriver, rather than the file name. The driver file should usually be in your WEB-INF/lib directory. I'd also suggest using the sybase newsgroups rather than tomcat for this. 1. A native library (.so/.dll) cannot be in WEB-INF/lib, because it can be loaded int JVM only once, and web applications can be restarted, undeployed etc. Yeah, I had forgotten that I'm using the java drivers, not the native ones. But the OP still has the wrong entry in his connection string, I believe. 2. Call System.getProperty(java.library.path); and print its value. On 8/8/2012 9:06 AM, CHRISTOS STAVRINOU wrote: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER At what path I must copy the file dbjodbc12.so? What is the correct configuration? How I can configure the java.library.path under under centos 6 and tomcat 7 in order to fix the problem? Please help me. If you have any answers please email me to stavr...@gmail.com Thanks in advance The connection string is as follows: jdbc:ianywhere:driver=libdbodbc12.so;ENG=host;DBN=database But when running the program, I get the following exception (with the relevant stack trace) - Exception in thread main java.lang.UnsatisfiedLinkError: no dbjodbc12 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at ianywhere.ml.jdbcodbc.IDriver.try_load(IDriver.java:247) at ianywhere.ml.jdbcodbc.IDriver.clinit(IDriver.java:216) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER
On 8/8/2012 6:06 AM, CHRISTOS STAVRINOU wrote: Problem with tomcat 7 and java ld_library_path under centos 6 using IANYWHERE JDBC DRIVER At what path I must copy the file dbjodbc12.so? What is the correct configuration? How I can configure the java.library.path under under centos 6 and tomcat 7 in order to fix the problem? Please help me. If you have any answers please email me to stavr...@gmail.com Thanks in advance The connection string is as follows: jdbc:ianywhere:driver=libdbodbc12.so;ENG=host;DBN=database But when running the program, I get the following exception (with the relevant stack trace) - Exception in thread main java.lang.UnsatisfiedLinkError: no dbjodbc12 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at ianywhere.ml.jdbcodbc.IDriver.try_load(IDriver.java:247) at ianywhere.ml.jdbcodbc.IDriver.clinit(IDriver.java:216) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) I just did a quick yum search on a CentOS 6 machine, and I guess you're running a self-installed version of Tomcat 7 from tomcat.apache.org. If that's the case, you can do the following to add to your java.library.path. 1. Create a file called setenv.sh in $CATALINA_BASE/bin 2. Add the following lines JAVA_OPTS=-Djava.library.path=directory-with-libdbodbc12.so export JAVA_OPTS 3. Restart Tomcat Technically you could place this in CATALINA_OPTS instead, and the path would only be available to Tomcat (and not the separate shutdown JVM). For memory parameters, this is important. For java.library.path, probably not as much. If you've installed Tomcat 7 from a third party RPM, then you'll have to find the bin directory and create the file as above. Hopefully the packager didn't alter catalina.sh so that it doesn't parse setenv.sh. I've not tried this since I use pure Java drivers for databases, and have not used this database. I do load the APR native library this way. . . . . just my 2 cents. /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org