| Author |
Message |
|
|
Post subject: JBoss 4.0 can't resolve Oracle driver .jar [Closed]
Posted: Nov 26, 2004 - 06:58 PM
|
|
Veteran Member


Joined: Nov 25, 2004
Posts: 25
|
|
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. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 26, 2004 - 07:03 PM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
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... |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 26, 2004 - 07:07 PM
|
|
Veteran Member


Joined: Nov 25, 2004
Posts: 25
|
|
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. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 12:03 AM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
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
| Quote: | | 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. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 12:40 AM
|
|
Veteran Member


Joined: Nov 25, 2004
Posts: 25
|
|
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? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 01:30 AM
|
|
Veteran Member


Joined: Nov 25, 2004
Posts: 25
|
|
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....??? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 02:14 AM
|
|
Moderator


Joined: May 06, 2003
Posts: 6760
|
|
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. |
_________________ --Scott
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 03:48 AM
|
|
Veteran Member


Joined: Nov 25, 2004
Posts: 25
|
|
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. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 04:05 AM
|
|
Veteran Member


Joined: Nov 25, 2004
Posts: 25
|
|
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?? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 04:14 AM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
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? |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 07:24 PM
|
|
Veteran Member


Joined: Nov 25, 2004
Posts: 25
|
|
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. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 10:42 PM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
|
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 11:21 PM
|
|
Veteran Member


Joined: Nov 25, 2004
Posts: 25
|
|
HI Riyad,
Yes, it worked first time. Instant connect. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 11:23 PM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
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? |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2004 - 11:59 PM
|
|
Veteran Member


Joined: Nov 25, 2004
Posts: 25
|
|
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. |
|
|
| |
|
|
|
 |
|
|