facebook

JBoss 4.0 can’t resolve Oracle driver .jar [Closed]

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

    duraace
    Member

    I’m getting the following error:
    10:48:30,421 INFO [STDOUT] java.sql.SQLException: No suitable driver
    10:48:30,421 INFO [STDOUT] at java.sql.DriverManager.getConnection(DriverManager.java:532)

    I’ve got the Oracle driver .jar in my buildpath lib and I’ve added it to the prefs->JBoss 4.0 classpath. I have others .jars configured similarly, without any problems reported (i.e. it finds them). Any suggestions? I’ve also tried copying it to the file system jre->lib->ext and JBoss lib directories, without success.

    #220082 Reply

    Riyad Kalla
    Member

    duraace,
    What driver are you using and what JAR are you copying to these locations and adding to your build path? It sounds like you have done everything correctly…

    #220083 Reply

    duraace
    Member

    I’m using Oracle_80520.jar . Weird thing is, I got this to work at work, but it’s failing in my home environment. It’s the only .jar referenced that throws this exception. It makes me feel like I don’t have control over the environment, and I’m driven to find the solution. Moreover, I need this to work at home, because I occasionally work from home. I have straight Java projects that use it no problem.

    #220089 Reply

    Riyad Kalla
    Member

    duraace,
    I would suggest two things if you have this working at work:
    1) Zip up your JBoss install
    2) Zip up your Eclipse Workspace from work
    3) Burn them both to a CD, take it home
    4) Unzip it

    It makes me feel like I don’t have control over the environment, and I’m driven to find the solution.

    I know the feeling, but the conflict could be occuring at any number of places. If you do infact have this working at work, lets start there with my suggestion above and just try and work backwards. There is probably some minute difference like an external library difference between your work and home machine that is causing this not to work… but that’s impossible for me to tell from here. I’m only trying to help you troubleshoot.

    #220092 Reply

    duraace
    Member

    Thanks for the reply, but I just proved I was wrong about it working at work. I don’t why I thought that, but I’m getting the same error there too. I’ve an sapjco.jar driver it resolves fine, but the oracle_80520.jar containing the driver can’t be resolved, no matter how many obvious places I put it, but in the jdk folders and the JBoss folders. It is resolved in other eclipse projects, but not under eclipse->JBoss. Why is the 64K question at this point? How to further debug this is the question. Any suggestions?

    #220093 Reply

    duraace
    Member

    FYI The oracle_80520.jar is deployed by MyEclipse to the JBoss 4.0->server->default->deploy->project name.war->WEB-INF->classes->lib folder. Another driver, the sapjco.jar file is also deployed there, and it gets called without error, so….???

    #220094 Reply

    Scott Anderson
    Participant

    I believe the problem is that database connections have to be set up by the *server* not by your application. As a result, the jar needs to be on the server launch path rather than in the web application’s lib directory. JBoss needs to configure Oracle before it loads your application.

    So, you can add the jar on the JBoss configuration page at Window > Preferences > MyEclipse > Application Servers > JBoss 4 > Paths > Append to Classpath. You might want to also review the Application Server Quickstart in the Documentation section (http://www.myeclipseide.com/ContentExpress-display-ceid-67.html) as I believe it covers this case in more detail.

    #220097 Reply

    duraace
    Member

    I have Window->Preferences->MyEclipse->Applications Servers->JBoss 4->Paths->Append to Classpath set to point to both sapjco.jar and the Oracle .jar. Only the latter fails. I perform explicit jdbc calls in my application, and I need to explicitly load the Oracle JDBC driver. This works in all other eclipse Java projects, so I’m puzzled as to why JBoss would ignore this package. BTW This is my first .jsp / struts project (3 tier RMI Applet’s only up until now… <sigh> had to give in to the non-technical “no Applets” crowd on this one) What I did was extend the default Action servlet with my class, modified the web.xml Servel-class to point to it, and overrode the init method with my instantiated classes, methods, etc. That’s where the Oracle JDBC driver is trying to get initialized. Hope this helps.

    #220099 Reply

    duraace
    Member

    BTW I have the prefs->JBoss 4.0->JDK set to point to J2SDK1.4.2_05 and I have the Oracle drive in the JRE->lib->ext and the root lib dirs. The error I’m getting starting JBOSS is:
    INFO [STDOUT] java.sql.SQLException: No suitable driver
    Might “No suitable driver” mean it doesn’t like the driver, not that it can’t find it??

    #220101 Reply

    Riyad Kalla
    Member

    duraace,
    Have you tried using the driver with the DB Explorer to see if it works when connecting ot Oracle? Does the driver require any native resources (dll) to run?

    #220104 Reply

    duraace
    Member

    Haven’t used DB Explorer. Where do I find it? BTW The call that throws the SQL exception is:
    dbPsext = DriverManager.getConnection(
    “jdbc:oracle:thin:@buxhrrpt.bctel.com:1521:orav8q”,
    “psext”, “psext”);
    As you can see, it’s the ‘thin’ driver, so 100% java, no .dll dependency. Again, the same call works in eclipse java projects.

    #220106 Reply

    Riyad Kalla
    Member

    Window > Open Perspective > MyEclipse DB Explorer (or something to that effect)

    Please follow this doc when using it: http://www.myeclipseide.com/images/tutorials/quickstarts/dbexplorer/

    #220107 Reply

    duraace
    Member

    HI Riyad,
    Yes, it worked first time. Instant connect.

    #220108 Reply

    Riyad Kalla
    Member

    Ok and you’ve tried deploying the JAR in your WEB-INF/lib directory of your project as well as the /lib dir of your JBoss install right, and neither worked?

    #220109 Reply

    duraace
    Member

    It wasn’t in the WEB-INF/lib dir, only in the properties/buildpath/lib, so I copied to the WEB…lib dir, and once again, copied it to the JBoss/lib dir. I redeployed (just to be sure). No dice. Same error.

Viewing 15 posts - 1 through 15 (of 17 total)
Reply To: JBoss 4.0 can’t resolve Oracle driver .jar [Closed]

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