- This topic has 16 replies, 3 voices, and was last updated 19 years, 11 months ago by Riyad Kalla.
-
AuthorPosts
-
duraaceMemberI’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.
Riyad KallaMemberduraace,
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…
duraaceMemberI’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.
Riyad KallaMemberduraace,
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 itIt 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.
duraaceMemberThanks 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?
duraaceMemberFYI 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….???
Scott AndersonParticipantI 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.
duraaceMemberI 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.
duraaceMemberBTW 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??
Riyad KallaMemberduraace,
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?
duraaceMemberHaven’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.
Riyad KallaMemberWindow > 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/
duraaceMemberHI Riyad,
Yes, it worked first time. Instant connect.
Riyad KallaMemberOk 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?
duraaceMemberIt 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.
-
AuthorPosts