facebook

MyEclipse not picking up Tomcat Library Path

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #228616 Reply

    Hi Support Team,

    I am trying to setup my new Laptop for my J2EE development. My environment is as follows.

    OS version – Windows XP – SP2
    java version – “1.5.0_02”
    tomcat version – 5.5.7
    Eclipse version – 3.0.2
    MyEclipse Plugin version – 3.8.4
    Oracle Client version – 9.2

    <b>
    My webapplication setup on tomcat is able to connect to Oracle database using Oracle OCI JDBC driver, without any issues, if i start my tomcat instance from commandline.
    </b>

    My environment variables are set as follows.

    LD_LIBRARY_PATH=C:\oracle\ora92\lib;C:\oracle\ora92\jdbc\lib
    ORACLE_HOME=C:\oracle\ora92
    Path=C:\jdk1.5.0_02\bin;C:\apache-ant-1.6.2\bin;C:\oracle\ora92\bin;C:\Program F
    iles\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\syste
    m32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Co
    ntrol Panel;C:\MySQL\MySQL Server 4.1\bin;C:\user_installs\UltraEdit;C:\Program
    Files\ssh communications security\ssh Secure Shell

    Now, I am trying to configure MyEclipseIDE to use Tomcat server and try starting tomcat from MyEclipse. These are the entries in my MyEclipse -> Application Servers -> Tomcat 5 ->path Preferences.

    Append to Library Path:
    lib – C:/oracle/ora92/jdbc/lib
    lib – C:/oracle/ora92/lib

    <b>
    After configuring MyEclipse to use tomcat, I restart my tomcat server through MyEclipse IDE. I am able to access only webapplications installed on tomcat/webapps that do not make JDBC calls. When I try to access the applications that do use JDBC OCI drivers, I get the following exception on the eclipse console.
    </b>

    <code>
    12:27:23 ERROR core.ApplicationContext (662) – StandardWrapper.Throwable
    java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
    at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    at java.lang.System.loadLibrary(System.java:992)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:262)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    </code>

    <b>
    As you can see, I did setup my library path to point to oracle libraries and I verified the OCI client setup to make sure that it did install correctly by starting tomcat from command line and checking my webapps that access JDBC.
    </b>

    Could the support team please help?

    Thanks,
    Karthik.

    #228624 Reply

    Riyad Kalla
    Member

    Karthik,
    You are doing everything exactly right you are just missing the JDBC driver itself from the Classpath. It looks like you added the necessary locations for the native library but you forgot to append the JDBC driver itself to your Classpath, try that and see if it does the trick.

    #228643 Reply

    @support-rkalla wrote:

    Karthik,
    You are doing everything exactly right you are just missing the JDBC driver itself from the Classpath. It looks like you added the necessary locations for the native library but you forgot to append the JDBC driver itself to your Classpath, try that and see if it does the trick.

    Hi Riyad,

    My understanding is that, if I place ojdbc14.jar in <TOMCAT_HOME>\common\lib directory, it will be automatically picked up by the application server class loader during server startup. So, I am not sure why I should explicitly add JDBC driver(ojdbc14.jar) to the classpath.

    I also have ojdbc14.jar inside my <TOMCAT_HOME>\webapps\<APPLICATION_CONTEXT>\WEB-INF\lib directory.

    But still, as per your suggestion, I changed my MyEclipse -> Application Servers -> Tomcat 5 ->Paths -> Append to classpath preference to, ojdbc14.jar – C:/oracle/ora92/jdbc/lib/ojdbc14.jar

    I still get the same error,

    java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
    at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    at java.lang.System.loadLibrary(System.java:992)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:262)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)

    Can you please help?

    Thanks,
    Karthik.

    #228644 Reply

    Riyad Kalla
    Member

    My understanding is that, if I place ojdbc14.jar in <TOMCAT_HOME>\common\lib directory, it will be automatically picked up by the application server class loader during server startup. So, I am not sure why I should explicitly add JDBC driver(ojdbc14.jar) to the classpath.

    Your understanding is correct, I hadn’t realized you placed it in the right area already.

    I also have ojdbc14.jar inside my <TOMCAT_HOME>\webapps\<APPLICATION_CONTEXT>\WEB-INF\lib directory.

    Try and remove it from here if it is iin your common/lib dir.

    java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path

    Are you sure you got all the directories that might possibly have resources in them that this JDBC driver needs? I don’t have Oracle here to test on, and it seems you got the hang of how it is *suppose* to be setup, so I am just guessing along here with you at this point. I do know that people use Oracle with their webapps, so atelsat we know it’s possible 😀

    #228670 Reply

    Hi Riyad –

    Try and remove it from here if it is in your common/lib dir.

    I removed my ojdbc14.jar from my <TOMCAT_HOME>\webapps\<APPLICATION_CONTEXT>\WEB-INF\lib directory and still faced the same error.

    Are you sure you got all the directories that might possibly have resources in them that this JDBC driver needs? I don’t have Oracle here to test on, and it seems you got the hang of how it is *suppose* to be setup, so I am just guessing along here with you at this point. I do know that people use Oracle with their webapps, so atelsat we know it’s possible 😀

    As per oracle docs and based on my searching on google for this particular error, I need to include only the following two directories, <ORACLE_HOME>/lib and <ORACLE_HOME>/jdbc/lib on my java.library.path during tomcat startup. I believe java.library.path for tomcat startup is setup on, MyEclipse –> Application Servers –> Tomcat 5 –> Paths –> Append to library path preference. I correctly included the above two directories on this library path preference. Still, I get the <b>java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path</b> error.

    As a last ditch try, I tried installing fresh eclipse 3.0.2 and MyEclipse 3.8.4 on a different directory location and tried setting up the webproject that accesses Oracle using JDBC OCI driver. I still get the same error on the new eclipse install. I tried putting up debug statements and was able to pinpoint the exception to one particular statement, DriverManager.getConnection(dbServer,dbLogin,dbPassword); Based on oracle docs, it looks like <b>oracle.jdbc.driver.OracleDriver</b> which was loaded successully on a previous step, tries to find native oracle libraries on java.library.path and fails to find them and raises the exception.

    Though I had provided the oracle library directories for tomcat startup on the preferences page, MyEclipse has failed to pick them up when it started Tomcat using the tomcat connector (???). Is that possible?

    Also, could it be because of the fact that I am using, JDK -1.5 and Tomcat 5.5.7, had played any role in this? I had successfully used Eclipse -3.0.1 and MyEclipse – 3.8.4 on my other desktop and was able to connect to Tomcat 4.1.31 on JDK 1.4.2_06 and was successfully connecting to Oracle using the same driver by giving the same oracle library directories on Tomcat 4 –> Paths –> Library path preferences.

    I am getting desperate now as I am running short of ideas. The only options left to me are, going back to JDK 1.4.2_06 (and if that doesn’t work), going back to Tomcat 4.1.31. But I will lose JSP debugging and whole lot of new features available on Tomcat 5 series.

    Could you please check whether I am the only one affected with this kind of exception or is it a general problem with MyEclipse that it fails to pick up library paths for tomcat 5?

    Thanks,
    Karthik.

    #228671 Reply

    Also, could it be because of the fact that I am using, JDK -1.5 and Tomcat 5.5.7, had played any role in this? I had successfully used Eclipse -3.0.1 and MyEclipse – 3.8.4 on my other desktop and was able to connect to Tomcat 4.1.31 on JDK 1.4.2_06 and was successfully connecting to Oracle using the same driver by giving the same oracle library directories on Tomcat 4 –> Paths –> Library path preferences.

    I am getting desperate now as I am running short of ideas. The only options left to me are, going back to JDK 1.4.2_06 (and if that doesn’t work), going back to Tomcat 4.1.31. But I will lose JSP debugging and whole lot of new features available on Tomcat 5 series.

    I would like to correct myself. If my JDK 1.5 or TOMCAT 5.5.7 had been corrupt or something, I should not have been able to start TOMCAT from commandline and successfully access Oracle using Oracle JDBC OCI Driver with the help of LD_LIBRARY_PATH and ORACLE_HOME environment variables.

    I strongly suspect there is some issue with setting up java.library.path for TOMCAT 5 from MyEclipse, with MyEclipse failing to setup library path based on preferences or something.

    Thanks,
    Karthik

    #228672 Reply

    Riyad Kalla
    Member

    Karthik,
    1) Makes sure your Tomcat Paths settings look good, meaning the 2 classpath boxes are empty and in the bottom library path box you just have 2 entries, hit OK
    2) Go to <eclipse dir>\workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings directory and open the file named “com.genuitec.eclipse.easie.tomcat5.prefs”, paste the contents here for me to look at. This may shed some light on the way the library paths are being processed.

    #228675 Reply

    Riyad Kalla
    Member
    #228679 Reply

    Karthik,
    1) Makes sure your Tomcat Paths settings look good, meaning the 2 classpath boxes are empty and in the bottom library path box you just have 2 entries, hit OK
    2) Go to <eclipse dir>\workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings directory and open the file named “com.genuitec.eclipse.easie.tomcat5.prefs”, paste the contents here for me to look at. This may shed some light on the way the library paths are being processed.

    Hi Riyad,

    I did exactly as per you suggested. Here is the contents of my com.genuitec.eclipse.easie.tomcat5.prefs file.

    
     #Sun Apr 24 02:42:48 PDT 2005
    TOMCAT_HOME=C\:\\jakarta-tomcat-5.5.7
    TOMCAT_TEMP=C\:\\jakarta-tomcat-5.5.7\\temp
    OPT_LIBRARYPATH1=C\:/oracle/ora92/lib;C\:/oracle/ora92/jdbc/lib
    START_IS_DEBUG=false
    LIBRARY_PATH="C\:\\jdk1.5.0_02\\bin;C\:\\jakarta-tomcat-5.5.7\\bin;C\:/oracle/ora92/lib;C\:/oracle/ora92/jdbc/lib"
    TOMCAT_BASE=C\:\\jakarta-tomcat-5.5.7
    ENDORSED_DIRS="C\:\\jakarta-tomcat-5.5.7/common/endorsed"
    eclipse.preferences.version=1
    JDK_INSTALLATION_NAME=jdk1.5.0_02
    JDK_HOME=C\:\\jdk1.5.0_02
    SERVER_ENABLEMENT=true
    

    What is the difference between OPT_LIBRARYPATH1 and LIBRARY_PATH key values on the configuration file? Also, my oracle library directories are “ESCAPED” in a different way from other directories mentioned on the config file. Could this have been the reason? May be, MyEclipse fails to pick up these wrongly ESCAPED directories when it starts TOMCAT5 server?

    I guess we are almost there.

    Thanks,
    Karthik.

    #228685 Reply

    Riyad Kalla
    Member

    Karthik,
    Thank you for this info, I will add it to the bug report ASAP. Those escape characters are strange to me as well, but I’ll let the devs decide.

    #228696 Reply

    Karthik,
    Thank you for this info, I will add it to the bug report ASAP. Those escape characters are strange to me as well, but I’ll let the devs decide.

    Riyad –

    Thank you. Hope to get some resolution soon from your developers.

    Thanks,
    Karthik

    #228823 Reply

    Karthik,
    Thank you for this info, I will add it to the bug report ASAP. Those escape characters are strange to me as well, but I’ll let the devs decide.

    Riyad –

    Any news from your developers?

    BTW, I downloaded tomcat 4.1.31 and was checking whether I can atleast setup java.library.path and connect to oracle successfully from within MyEclipse – tomcat 4.1.31 setup. I faced the same issue even with tomcat 4.1.31 connector, <b> java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path </b> Again, I am able to connect to oracle successfully outside eclipse by starting tomcat 4.1.31 from command line.

    I am copy pasting the contents of my com.genuitec.eclipse.easie.tomcat4.prefs file.

    
     #Wed Apr 27 01:10:02 PDT 2005
    TOMCAT_HOME=C\:\\jakarta-tomcat-4.1.31
    TOMCAT_TEMP=C\:\\jakarta-tomcat-4.1.31\\temp
    OPT_LIBRARYPATH1=C\:/oracle/ora92/lib;C\:/oracle/ora92/jdbc/lib
    START_IS_DEBUG=false
    LIBRARY_PATH="C\:\\jdk1.5.0_02\\bin;C\:\\jakarta-tomcat-4.1.31\\bin;C\:\\oracle\\ora92\\lib;C\:\\oracle\\ora92\\jdbc\\lib"
    TOMCAT_BASE=C\:\\jakarta-tomcat-4.1.31
    ENDORSED_DIRS="C\:\\jakarta-tomcat-4.1.31/common/endorsed"
    eclipse.preferences.version=1
    JDK_INSTALLATION_NAME=jdk1.5.0_02
    SERVER_ENABLEMENT=true
    JDK_HOME=C\:\\jdk1.5.0_02
    

    Again if u see, the escaping of “OPT_LIBRARYPATH1” property is pretty different from other properties.

    I am running MyEclipse with tomcat 4.1.31 on my other desktop and am able to connect to oracle without any issues. The only difference is, my other desktop is running on MyEclipse 3.8.3 GA on top of Eclipse 3.0.1. Could this bug be a byproduct of Myeclipse 3.8.4 GA release?

    Thanks,
    Karthik

    #228832 Reply

    Riyad Kalla
    Member

    Karthik,
    I asked a dev to take a look at this he briefly said that the escape sequences weren’t important and then added it to his todo list. I’ll ping him again today to see what might be going on.

    #228834 Reply

    Riyad Kalla
    Member

    Karthik,
    I’d like you to make some screenshots of your setup and email them to support@genuitec.com ATTN Riyad, but please do the following first:

    1) Use your Tomcat 5.5 install for this and the Tomcat 5 connector so we can normalize on a configuration
    2) Setup your Tomcat 5 > Paths > Library Path by adding those 2 libs
    3) Also add the driver’s JAR file to your classpath in the 1st box “Append to classpath”. Let’s be extra safe.
    4) Take a screenshot of this screen please
    4.5) Please take a screenshot of your Tomcat 5 connector page (the one where you set the home dir) AND the one where you select the JDK
    5) Now try and launch Tomcat, and grab a screenshot of as much of the console as you can including the exception (try and maximize the console view).
    6) Also grab a screenshot of yoru Project Properties > Java Build Path > Libraries

    For now let’s forget about Tomcat 4.1, let’s focus on your Tomcat 5.5 setup for all these screenshots. Thank you.

    #229587 Reply

    pollux
    Member

    my MyEclipse -> Application Servers -> Tomcat 4 ->path Preferences.

    Append to Library Path:

    lib – C:/oracle/ora92/jdbc/lib
    lib – C:/oracle/ora92/lib
    bin – C:/oracle/ora92/jdk/jre/bin
    bin – C:/oracle/ora92/bin

Viewing 15 posts - 1 through 15 (of 17 total)
Reply To: MyEclipse not picking up Tomcat Library Path

You must be logged in to post in the forum log in