Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 813
  • Last Modified:

Setting classpath and java.lang.ClassNotFoundException

Hi,

I am trying to use cloudscape db and after setting classpath, I still get this error.

java.lang.ClassNotFoundException: COM.cloudscape.core.JDBCDriver
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:164)
      at StudentInfo.getConnect(StudentInfo.java:86)
      at StudentInfo.main(StudentInfo.java:109)

++++++++++++++
This is my classpath:

>echo %classpath%
.;C:\jakarta-tomcat-5.5.4\common\lib\servlet-api.jar; C:\jakarta-tomcat-5.5.4\co
mmon\lib\jsp-api.jar; C:\Sun\AppServer\lib\j2ee.jar; C:\jakarta-tomcat-5.5.4\web
apps\~dkim18\WEB-INF\classes.;C:\proj5\xerces.jar;C:\bea81\weblogic81\server\lib
\weblogic.jar;C:\cloudscape36\lib\cloudscape.jar;C:\cloudscape36\lib\client.jar
+++++++++++++
This is my code:

try {
                     
          String jdbcDriver = "COM.cloudscape.core.JDBCDriver";
                String dbURL = "jdbc:cloudscape:TextDB";
                String username = "username";
                      String passwd = "password";
      
                Class.forName(jdbcDriver).newInstance();      
           
                 conn = DriverManager.getConnection(dbURL, username, passwd);
               }
++++++++++++
Any clue?

thanks!
0
dkim18
Asked:
dkim18
  • 4
  • 3
1 Solution
 
CEHJCommented:
Make sure

COM.cloudscape.core.JDBCDriver

is prefectly correct (case too)
0
 
dkim18Author Commented:
I believe it is correct.

try {
                   
         String jdbcDriver = "COM.cloudscape.core.JDBCDriver";
...
...
...
0
 
CEHJCommented:
Can you post the output of

jar tf C:\cloudscape36\lib\cloudscape.jar

?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
dkim18Author Commented:
COM/cloudscape/aggregates/AggregateDefinition.class
COM/cloudscape/aggregates/Aggregator.class
COM/cloudscape/authentication/Interface/AuthenticationException.clas
COM/cloudscape/authentication/Interface/AuthenticationScheme.class
COM/cloudscape/authentication/util/SimpleAuthenticationScheme.class
COM/cloudscape/core/AbstractDataSource.class
COM/cloudscape/core/BaseConnectionHandle.class
COM/cloudscape/core/BasicDataSource.class
COM/cloudscape/core/BootStrap.class
COM/cloudscape/core/CloudscapeServer.class
COM/cloudscape/core/CloudscapeServerTie.class
COM/cloudscape/core/DataSourceFactory.class
COM/cloudscape/core/GetUniqueIDInterface.class
COM/cloudscape/core/JDBCBoot.class
COM/cloudscape/core/JDBCDriver.class
COM/cloudscape/core/LocalConnectionPoolDataSource.class
COM/cloudscape/core/LocalPooledConnection.class
COM/cloudscape/core/modules.properties
COM/cloudscape/core/MonitorBoot.class
COM/cloudscape/core/MonitorLog.class
COM/cloudscape/core/PrintStreamMonitorLog.class
COM/cloudscape/core/RemoteXaDataSource.class
COM/cloudscape/core/RmiJdbcDriver.class
COM/cloudscape/core/WebLogicCloudscapeServerTie.class
COM/cloudscape/core/XaDataSource.class
COM/cloudscape/database/ConnectionInfo.class
COM/cloudscape/database/ConsistencyChecker.class
COM/cloudscape/database/Database.class
COM/cloudscape/database/Factory.class
COM/cloudscape/database/JavaSQLException.class
COM/cloudscape/database/JBMSException.class
COM/cloudscape/database/OptimizerTrace.class
COM/cloudscape/database/PropertyInfo.class
COM/cloudscape/database/TriggerExecutionContext.class
COM/cloudscape/database/UserUtility.class
COM/cloudscape/info/DBMS.properties
COM/cloudscape/info/license.properties
COM/cloudscape/info/LocaleNames.class
COM/cloudscape/info/ProductGenusNames.class
COM/cloudscape/info/ProductVersionHolder.class
COM/cloudscape/info/ProductVersionHolderJava2.class
COM/cloudscape/info/PropertyNames.class
COM/cloudscape/info/sysinfo.properties
COM/cloudscape/system/System.class
COM/cloudscape/system/UUIDFactory.class
COM/cloudscape/tools/dbclasses.class
COM/cloudscape/tools/FileExport.class
COM/cloudscape/tools/FileImport.class
COM/cloudscape/tools/ImportExportSQLException.class
COM/cloudscape/tools/sysinfo.class
COM/cloudscape/types/AliasInfo.class
COM/cloudscape/types/DatabaseInstant.class
COM/cloudscape/types/DefaultInfo.class
COM/cloudscape/types/DependableFinder.class
COM/cloudscape/types/ErrorInfo.class
COM/cloudscape/types/IndexDescriptor.class
COM/cloudscape/types/Inspectable.class
COM/cloudscape/types/JBMSExceptionSeverity.class
COM/cloudscape/types/ReferencedColumnsDescriptor.clas
COM/cloudscape/types/RunTimeStatistics.class
COM/cloudscape/types/TypeDescriptor.class
COM/cloudscape/types/TypeFactory.class
COM/cloudscape/types/UUID.class
COM/cloudscape/util/BitUtil.class
COM/cloudscape/util/DBClassLoad.class
COM/cloudscape/util/DriverUtil.class
COM/cloudscape/util/KeyGen.class
COM/cloudscape/vti/CloudscapeLogReader.class
COM/cloudscape/vti/ConglomerateNumToContainerId.class
COM/cloudscape/vti/ConglomerateNumToContainerIdHelper
COM/cloudscape/vti/ConglomerateNumToContainerIdMetaDa
COM/cloudscape/vti/ConglomInfo.class
COM/cloudscape/vti/ContainerIdToConglomerateNum.class
COM/cloudscape/vti/ContainerIdToConglomerateNumHelper
COM/cloudscape/vti/ContainerIdToConglomerateNumMetaDa
COM/cloudscape/vti/ErrorMessages.class
COM/cloudscape/vti/ErrorMessagesMetaData.class
COM/cloudscape/vti/ExternalQuery.class
COM/cloudscape/vti/GetProcColsMetaData.class
COM/cloudscape/vti/GetProcedureColumns.class
COM/cloudscape/vti/LockTable.class
COM/cloudscape/vti/LockTableMetaData.class
COM/cloudscape/vti/LogReaderMetaData.class
COM/cloudscape/vti/SpaceTable.class
COM/cloudscape/vti/SpaceTableMetaData.class
COM/cloudscape/vti/StatementDuration.class
COM/cloudscape/vti/StatementDurationMetaData.class
COM/cloudscape/vti/TransactionTable.class
COM/cloudscape/vti/TransactionTableMetaData.class
COM/cloudscape/vti/TriggerNewTransitionRows.class
COM/cloudscape/vti/TriggerOldTransitionRows.class
COM/cloudscape/vti/UpdatableVTITemplate.class
COM/cloudscape/vti/VTICosting.class
COM/cloudscape/vti/VTIEnvironment.class
COM/cloudscape/vti/VTIException.class
COM/cloudscape/vti/VTIMetaDataTemplate.class
COM/cloudscape/vti/VTITemplate.class
COM/cloudscape/vti20/UpdatableVTITemplate.class
COM/cloudscape/vti20/VTIMetaDataTemplate.class
COM/cloudscape/vti20/VTITemplate.class
COM/objectspace/jgl/Allocator.class
COM/objectspace/jgl/ArrayAdapter.class
COM/objectspace/jgl/BidirectionalIterator.class
COM/objectspace/jgl/BinaryFunction.class
COM/objectspace/jgl/BinaryPredicate.class
COM/objectspace/jgl/ArrayAdapter.class
COM/objectspace/jgl/BidirectionalIterator.class
COM/objectspace/jgl/BinaryFunction.class
COM/objectspace/jgl/BinaryPredicate.class
COM/objectspace/jgl/Comparing.class
COM/objectspace/jgl/Container.class
COM/objectspace/jgl/Counting.class
COM/objectspace/jgl/DList$DListNode.class
COM/objectspace/jgl/DList.class
COM/objectspace/jgl/DListIterator.class
COM/objectspace/jgl/EqualTo.class
COM/objectspace/jgl/Finding.class
COM/objectspace/jgl/ForwardIterator.class
COM/objectspace/jgl/HashComparator.class
COM/objectspace/jgl/Hashing.class
COM/objectspace/jgl/InputIterator.class
COM/objectspace/jgl/InsertIterator.class
COM/objectspace/jgl/IntArray.class
COM/objectspace/jgl/IntIterator.class
COM/objectspace/jgl/InvalidOperationException.class
COM/objectspace/jgl/MinusNumber.class
COM/objectspace/jgl/NumberHelper.class
COM/objectspace/jgl/OutputIterator.class
COM/objectspace/jgl/Pair.class
COM/objectspace/jgl/PlusNumber.class
COM/objectspace/jgl/Printing.class
COM/objectspace/jgl/Queue.class
COM/objectspace/jgl/RandomAccessIterator.class
COM/objectspace/jgl/Replacing.class
COM/objectspace/jgl/Sequence.class
COM/objectspace/jgl/SList$SListNode.class
COM/objectspace/jgl/SList.class
COM/objectspace/jgl/SListIterator.class
COM/objectspace/jgl/Sorting.class
COM/objectspace/jgl/UnaryPredicate.class
c8e/a/b.class
c8e/a/c.class
c8e/a/d.class
c8e/aa/a.class
c8e/aa/b.class
c8e/aa/c.class
c8e/ab/a.class
c8e/ab/b.class
c8e/ab/c.class
c8e/ab/d.class
c8e/ab/e.class
c8e/ab/f.class
c8e/ab/g.class
c8e/ab/h.class
c8e/ab/i.class
c8e/ab/j.class
c8e/ab/k.class
..
...
...
c8e/z/metadata.properties
c8e/z/n.class
c8e/z/o.class
c8e/z/p.class
c8e/z/q.class
c8e/z/r.class
c8e/z/s.class
0
 
CEHJCommented:
That's in order. Please post the command you're using to run
0
 
dkim18Author Commented:
the problem has been solved. i was running this app by using eclipse and didn't set classpath. my bad...
0
 
CEHJCommented:
:-)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now