NoClassDefFoundError oracle/sql/BfileDBAccess

Hi all,

I am trying to access oracle db using jndi pool name.  I have ojdbc14.jar and weblogic.jar in my client classpath. i successfully get the datasource  but when i execute getConnection method I get error below.

java.lang.NoClassDefFoundError: oracle/sql/BfileDBAccess
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
      at java.lang.Class.privateGetPublicMethods(Class.java:2519)
      at java.lang.Class.privateGetPublicMethods(Class.java:2529)
      at java.lang.Class.getMethods(Class.java:1406)
      at weblogic.rmi.utils.Utilities.getRemoteMethods(Utilities.java:278)
      at weblogic.rmi.utils.Utilities.getRemoteRMIMethods(Utilities.java:258)
      at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:99)
      at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:74)
      at weblogic.rmi.internal.StubGenerator.hotCodeGenClass(StubGenerator.java:809)
      at weblogic.rmi.internal.StubGenerator.getStubClass(StubGenerator.java:699)
      at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:748)
      at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:735)

Hashtable props = new Hashtable();
		   props.put(InitialContext.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
		   props.put(InitialContext.PROVIDER_URL, "t3://" + Parameters.getInstance().ORACLE_DATASOURCE_IP);
		   Context ctx = new InitialContext(props);
		   DataSource ds = (DataSource) ctx.lookup(Parameters.getInstance().ORACLE_DATASOURCE_JNDI_NAME);
		   conn = ds.getConnection();

Open in new window

CegerXunAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
CEHJConnect With a Mentor Commented:
Make sure that on of those jars, which you say are in your classpath contains that class. On Windows, check with

jar tf <name of jar>.jar | find "BfileDBAccess"
0
 
CegerXunAuthor Commented:
sorry it hasnt helped. i am still facing that issue.
I have weblogic.jar and ojdbc5.jar(also try ojdbc14) in my CLASSPATH. Also i change the order of ojdbc jar to the first as they said there...

any other idea pls?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
krakatoaCommented:
0
 
CegerXunAuthor Commented:
i read that thread. his problem was solved by removing his jar from %JAVA_HOME%\jre\lib\ext directory. but when i remove the weblogic.jar file from that directory this time i get "Cannot instantiate class: weblogic.jndi.WLInitialContextFactory" classnotfoundexception.
0
 
CegerXunAuthor Commented:
i tried that command and find that ojdbc5.jar contains that class.
0
 
CEHJCommented:
>>i tried that command and find that ojdbc5.jar contains that class.

OK, although that's not a jar you mentioned earlier. Make sure that one's in your classpath, which you can determine by the debug priint:
System.out.println(System.getProperty("java.class.path"));

Open in new window

0
 
CegerXunAuthor Commented:
the result of that command is:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar;C:\Program Files\Java\jdk1.5.0_09\lib\tools.jar
0
 
CegerXunAuthor Commented:
the confusing thing is that, I dont get that error anymore since this morning. the error message has changed. i desrcibe the new one at:
http://www.experts-exchange.com/Programming/Languages/Java/Q_23125652.html
0
 
CEHJCommented:
OK, i've posted in that question too

>>
the result of that command is:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar;C:\Program Files\Java\jdk1.5.0_09\lib\tools.jar
>>

That can't be and shouldn't be your classpath inside your web container. If it were, Weblogic wouldn't run at all
0
 
CegerXunAuthor Commented:
unfortunately it is.

by the way i use eclipse and lomboz plugin for my struts project. in my project i try to connect oracle database through jdbc connection pool defined on a weblogic server. as I say my connection pool is defined on another weblogic server.

just to make it cleaner i ve taken print screen of my project tree and attached it. may be it make sence.
project-tree.jpeg
0
 
CEHJCommented:
>>in my project i try to connect oracle database through jdbc connection pool defined on a weblogic server.

OK. I take it that you're in a web app when you do that as opposed to a normal Java J2SE app?
0
 
CegerXunAuthor Commented:
yes cehj you take it right
0
 
CEHJCommented:
OK, then for debugging the classpath as i suggested, you need to be looking in the container's log file normally. Where did you look for the result of System.out.println(<CLASSPATH>)?
0
 
CegerXunAuthor Commented:
i looked at the result on the eclipse console
0
 
CEHJCommented:
You need to do that inside the webapp and then look in the log file
0
 
CEHJCommented:
:-)
0
 
CegerXunAuthor Commented:
I know it is not the solution. I abandon connectiong by jndi pool. Now I am using the direct access.  I selected that post just to close the thread.
0
 
CEHJCommented:
OK thanks
0
All Courses

From novice to tech pro — start learning today.