Results 1 to 2 of 2
  1. #1
    Gideonzx is offline Member
    Join Date
    Jul 2009
    Posts
    7
    Rep Power
    0

    Default NoClassDefFound (via classpath entry could not be found)

    I am using Eclipse 3.3.2 on WIndows.

    I am writing a server application that acts as a JDBC client to an Oracle DB on another machine.

    I wrote a program that is having a NoClassDefFound problem. It can not find the class associated with the following line:

    Java Code:
    OracleDataSource ods = new OracleDataSource();
    Below is a snippet of the relevant code:

    Java Code:
    import java.sql.*;
    import java.net.URL;
    import oracle.jdbc.pool.*;
    
    public class PerfEvent_StepCache {
    	private String customerId   = "";
    	private String strikePrice  = "";
    	private String stock        = "";
    	private String lastPrice    = "";
    	private String currentPrice = "";
    	private String isCall       = ""; 
    	private String priceChange  = "";
    	private String system       = "";
    	private String timestamp    = "";
    	private String loginfo      = ""; 
    	private String eventName    = "";
    	
    	public void searchForPreviousCustomerID() {
    		String tempCustId = this.customerId;
    		Boolean invalidateAction = true;
    		
    		// Set up the connection
    		try { 
    			System.out.println("----------------------------------- BEFORE ODS");
    			[B]OracleDataSource ods = new OracleDataSource();[/B]
    			System.out.println("----------------------------------- AFTER ODS ");
    I placed the following file into the buildpath, and it now compiles correctly (including the import)

    Java Code:
    Y:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar
    I went to the MANIFEST.MF tab in Eclipse, and then hit the Runtime tab, to enter the appropriate plug-in.

    The required plug-in is classes12.jar. This is an oracle jar that provide jdbc access to oracle on Windows. (confirmed on the Oracle Forum).

    On the "Classpath" entry box on the right, I hit the "Add" button, and enter the following:

    Java Code:
    Y:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar
    I confirmed this location is correct using a directory statement and cutting and pasting the location into the command.

    When I deploy the application to the server, I get the following Warning:

    Java Code:
    WARNING: [Jun 8, 2009 12:37:33 PM] FrameWorkLogger: Bundle PerfEvent_StepCache: Warning: org.osgi.framework.BundleException: The bundle class path entry "Y:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar" could not be found for the bundle "file:/C:/bea/user_projects/domains/CEP_1/defaultserver/applications/PerfEvent_StepCache/PerfEvent_StepCache.jar"
    org.osgi.framework.BundleException: The bundle class path entry "Y:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar" could not be found for the bundle "file:/C:/bea/user_projects/domains/CEP_1/defaultserver/applications/PerfEvent_StepCache/PerfEvent_StepCache.jar"
    	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassPathEntry(ClasspathManager.java:161)
    	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.buildClasspath(ClasspathManager.java:138)
    	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.initialize(ClasspathManager.java:72)
    	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.initialize(DefaultClassLoader.java:177)
    	at org.eclipse.osgi.framework.internal.core.BundleLoader.createBCL(BundleLoader.java:714)
    	at org.eclipse.osgi.framework.internal.core.BundleLoader.createBCLPrevileged(BundleLoader.java:689)
    	at org.eclipse.osgi.framework.internal.core.BundleLoader.createClassLoader(BundleLoader.java:318)
    	at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:289)
    	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
    	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1269)
    	at org.springframework.osgi.extender.internal.activator.SpringTypeCompatibilityChecker.isTypeAvailable(SpringTypeCompatibilityChecker.java:107)
    	at org.springframework.osgi.extender.internal.activator.SpringTypeCompatibilityChecker.checkCompatibility(SpringTypeCompatibilityChecker.java:64)
    	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener.maybeCreateApplicationContextFor(ContextLoaderListener.java:721)
    	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$ContextBundleListener.handleEvent(ContextLoaderListener.java:230)
    	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$BaseListener.bundleChanged(ContextLoaderListener.java:173)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:1210)
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:195)
    	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:141)
    	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1558)
    	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1509)
    	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:355)
    	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
    	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
    	at org.springframework.osgi.bundle.BundleFactoryBean.executeAction(BundleFactoryBean.java:184)
    	at org.springframework.osgi.bundle.BundleFactoryBean.afterPropertiesSet(BundleFactoryBean.java:137)
    	at com.bea.wlevs.deployment.DeploymentFactoryBean.ensureStarted(DeploymentFactoryBean.java:76)
    	at com.bea.wlevs.deployment.DeploymentFactoryBean.afterPropertiesSet(DeploymentFactoryBean.java:71)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)
    	at com.bea.wlevs.deployment.DeploymentImpl.update(DeploymentImpl.java:326)
    	at com.bea.wlevs.deployment.cluster.ClusterDeploymentImpl.update(ClusterDeploymentImpl.java:174)
    	at com.bea.wlevs.deployment.mbean.AppDeployment.updateDeployedApplication(AppDeployment.java:140)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
    	at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
    	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
    	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
    	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
    	at javax.management.StandardMBean.invoke(StandardMBean.java:391)
    	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
    	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
    	at com.bea.core.jmx.server.Server$WrappedServer.invoke(Server.java:538)
    	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
    	at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
    	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
    	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1366)
    	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
    	at sun.rmi.transport.Transport$1.run(Transport.java:159)
    	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    	at java.lang.Thread.run(Thread.java:619)
    When I send a message to the code (triggering the jdbc connection), I get the following error:

    Java Code:
    ------ setLogInfo method
    ------ setLogInfo before setting loginfo value
    ------ setLogInfo AFTER setting loginfo value
    ------ setLogInfo before calling searchForPreviousCustomerID()
    ----------------------------------- BEFORE ODS
    <Jun 8, 2009 12:39:35 PM EDT> <Warning> <com.bea.core.asyncbeans.internal.DefaultMessageListenerContainer> <BEA-000000> <Execution of JMS message listener failed
    java.lang.IllegalArgumentException: Error occurred while attempting to set 'logInfo' property of PerfEvent_StepCache to value of -loginfo_text-: null
    	at com.bea.wlevs.cep.event.BeanEventType$BeanEventBuilder.put(BeanEventType.java:630)
    	at com.bea.wlevs.adapters.jms.InboundJmsAdapter$MapConverter.convert(InboundJmsAdapter.java:194)
    	at com.bea.wlevs.adapters.jms.InboundJmsAdapter.onMessage(InboundJmsAdapter.java:108)
    	at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
    	at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
    	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
    	at com.bea.core.asyncbeans.internal.DefaultMessageListenerContainer.receiveAndExecute(DefaultMessageListenerContainer.java:45)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:868)
    	at com.bea.core.asyncbeans.internal.WorkManagerTaskExecutor$1.run(WorkManagerTaskExecutor.java:32)
    	at weblogic.work.commonj.CommonjWorkManagerImpl$WorkWithListener.run(CommonjWorkManagerImpl.java:196)
    	at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
    	at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)
    	at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
    	at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
    	at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022)
    	at com.bea.wlevs.cep.event.EventBeanUtility.setProperty(EventBeanUtility.java:52)
    	at com.bea.wlevs.cep.event.BeanEventType$BeanEventBuilder.put(BeanEventType.java:627)
    	at com.bea.wlevs.adapters.jms.InboundJmsAdapter$MapConverter.convert(InboundJmsAdapter.java:194)
    	at com.bea.wlevs.adapters.jms.InboundJmsAdapter.onMessage(InboundJmsAdapter.java:108)
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
    	at com.bea.core.asyncbeans.internal.DefaultMessageListenerContainer.receiveAndExecute(DefaultMessageListenerContainer.java:45)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:945)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:868)
    	at com.bea.core.asyncbeans.internal.WorkManagerTaskExecutor$1.run(WorkManagerTaskExecutor.java:33)
    	at weblogic.work.commonj.CommonjWorkManagerImpl$WorkWithListener.run(CommonjWorkManagerImpl.java:196)
    	at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    java.lang.NoClassDefFoundError: oracle/jdbc/pool/OracleDataSource
    	at com.bea.wlevs.event.example.helloworld.PerfEvent_StepCache.searchForPreviousCustomerID(PerfEvent_StepCache.java:28)
    	at com.bea.wlevs.event.example.helloworld.PerfEvent_StepCache.setLogInfo(PerfEvent_StepCache.java:211)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
    	at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1761)
    	at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
    	at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1679)
    	at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022)
    	at com.bea.wlevs.cep.event.EventBeanUtility.setProperty(EventBeanUtility.java:53)
    	at com.bea.wlevs.cep.event.BeanEventType$BeanEventBuilder.put(BeanEventType.java:627)
    	at com.bea.wlevs.adapters.jms.InboundJmsAdapter$MapConverter.convert(InboundJmsAdapter.java:194)
    	at com.bea.wlevs.adapters.jms.InboundJmsAdapter.onMessage(InboundJmsAdapter.java:108)
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
    	at com.bea.core.asyncbeans.internal.DefaultMessageListenerContainer.receiveAndExecute(DefaultMessageListenerContainer.java:45)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:945)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:868)
    	at com.bea.core.asyncbeans.internal.WorkManagerTaskExecutor$1.run(WorkManagerTaskExecutor.java:33)
    	at weblogic.work.commonj.CommonjWorkManagerImpl$WorkWithListener.run(CommonjWorkManagerImpl.java:196)
    	at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    It looks like the warning during the deploy is the issue:

    Java Code:
    The bundle class path entry "Y:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar" could not be found for the bundle "file:/C:/bea/user_projects/domains/CEP_1/defaultserver/applications/PerfEvent_StepCache/PerfEvent_StepCache.jar"
    Does anyone know how I can resolve this issue ?

    Thanks

  2. #2
    Gideonzx is offline Member
    Join Date
    Jul 2009
    Posts
    7
    Rep Power
    0

    Default

    Should I use the Dependencies tab of the MANIFEST.MF tab in Eclipse.

    If so, how would I do this ?

    Thanks

Similar Threads

  1. Save data entry
    By tiger100plus in forum NetBeans
    Replies: 2
    Last Post: 12-08-2009, 03:53 PM
  2. Entry in table
    By Harsh_Verma in forum New To Java
    Replies: 2
    Last Post: 07-01-2009, 03:07 PM
  3. java.lang.NoClassDefFound --Any way to handle this
    By sunny_sykes in forum Advanced Java
    Replies: 1
    Last Post: 03-30-2009, 09:29 AM
  4. Need Help On Entry Validation
    By obdi in forum New To Java
    Replies: 3
    Last Post: 07-25-2008, 07:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •