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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
krakatoaCommented:
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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
CEHJCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.