This definitely looks like a CLASSPATH error.

Where did you get the mysql.jar from ? Can you open it up and make sure that
it includes the com.mysql.jdbc.Driver namespace ?

I am guessing the mysql.jar is not the one that you need. you can download a
new one from the mysql website.

To be clear, I don't even have a mysql jar in my /lib folder under hive. I
only have it under my hadoop /lib folder and the name of the file
is mysql-connector-java-5.0.8-bin.jar

-Viral

On Wed, Mar 2, 2011 at 10:14 AM, Ajo Fod <ajo....@gmail.com> wrote:

> Hi Bennie,
>
> Thanks for the response !
>
> I had CLASSPATH set to include
> /usr/share/java/mysql.jar
> ... in addition, I just copied the mysql.jar to the lib directory of hive.
>
> I still get the same bug.
>
> Any other ideas?
>
> Thanks,
> -Ajo
>
>
>
>
> On Wed, Mar 2, 2011 at 7:01 AM, Bennie Schut <bsc...@ebuddy.com> wrote:
>
>>  Usually this is caused by not having the mysql jdbc driver on the
>> classpath (it's not default included in hive).
>> Just put the mysql jdbc driver in the hive folder under "lib/"
>>
>> On 03/02/2011 03:15 PM, Ajo Fod wrote:
>>
>> I've checked the mysql connection with a separate java file with the same
>> string.
>>
>> Also, I've checked the code works by running it against the original derby
>> metastore.
>>
>> Thanks,
>> Ajo.
>>
>> Some of the variables set:
>> javax.jdo.option.ConnectionURL = jdbc:mysql://
>> 192.168.1.5/metastore?createDatabaseIfNotExist=true
>> javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
>> javax.jdo.option.ConnectionUserName=username
>> javax.jdo.option.ConnectionPassword=password
>>
>> Here is the stack trace: ...
>>
>> org.apache.hadoop.hive.ql.metadata.HiveException:
>> javax.jdo.JDOFatalInternalException: Error creating transactional connection
>> factory
>> NestedThrowables:
>> java.lang.reflect.InvocationTargetException
>>         at
>> org.apache.hadoop.hive.ql.metadata.Hive.getTablesByPattern(Hive.java:919)
>>         at
>> org.apache.hadoop.hive.ql.metadata.Hive.getTablesByPattern(Hive.java:904)
>>         at
>> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeCreateTable(SemanticAnalyzer.java:7098)
>>         at
>> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:6576)
>>         at
>> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:238)
>>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:340)
>>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:773)
>>         at
>> org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:209)
>>         at
>> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:286)
>>         at
>> org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:307)
>>         at
>> org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:314)
>>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:487)
>>         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.hadoop.util.RunJar.main(RunJar.java:186)
>> Caused by: javax.jdo.JDOFatalInternalException: Error creating
>> transactional connection factory
>> NestedThrowables:
>> java.lang.reflect.InvocationTargetException
>>         at
>> org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:425)
>>         at
>> org.datanucleus.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:601)
>>         at
>> org.datanucleus.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:286)
>>         at
>> org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:182)
>>         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 javax.jdo.JDOHelper$16.run(JDOHelper.java:1958)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at javax.jdo.JDOHelper.invoke(JDOHelper.java:1953)
>>         at
>> javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1159)
>>         at
>> javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:803)
>>         at
>> javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
>>         at
>> org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:234)
>>         at
>> org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:261)
>>         at
>> org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:196)
>>         at
>> org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:171)
>>         at
>> org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)
>>         at
>> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
>>         at
>> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:352)
>>         at
>> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.executeWithRetry(HiveMetaStore.java:306)
>>         at
>> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:449)
>>         at
>> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:232)
>>         at
>> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.<init>(HiveMetaStore.java:197)
>>         at
>> org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:108)
>>         at
>> org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:1855)
>>         at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:1865)
>>         at
>> org.apache.hadoop.hive.ql.metadata.Hive.getTablesByPattern(Hive.java:917)
>>         ... 16 more
>> Caused by: java.lang.reflect.InvocationTargetException
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>         at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>         at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>         at
>> org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:588)
>>         at
>> org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:324)
>>         at
>> org.datanucleus.store.AbstractStoreManager.registerConnectionFactory(AbstractStoreManager.java:215)
>>         at
>> org.datanucleus.store.AbstractStoreManager.<init>(AbstractStoreManager.java:190)
>>         at
>> org.datanucleus.store.mapped.MappedStoreManager.<init>(MappedStoreManager.java:137)
>>         at
>> org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:253)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>         at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>         at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>         at
>> org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:588)
>>         at
>> org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:300)
>>         at
>> org.datanucleus.ObjectManagerFactoryImpl.initialiseStoreManager(ObjectManagerFactoryImpl.java:161)
>>         at
>> org.datanucleus.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:583)
>>         ... 43 more
>> Caused by: org.datanucleus.exceptions.NucleusException: Attempt to invoke
>> the "DBCP" plugin to create a ConnectionPool gave an error : The specified
>> datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH.
>> Please check your CLASSPATH specification, and the name of the driver.
>>         at
>> org.datanucleus.store.rdbms.ConnectionFactoryImpl.initDataSourceTx(ConnectionFactoryImpl.java:165)
>>         at
>> org.datanucleus.store.rdbms.ConnectionFactoryImpl.<init>(ConnectionFactoryImpl.java:84)
>>         ... 61 more
>> Caused by:
>> org.datanucleus.store.rdbms.datasource.DatastoreDriverNotFoundException: The
>> specified datastore driver ("com.mysql.jdbc.Driver") was not found in the
>> CLASSPATH. Please check your CLASSPATH specification, and the name of the
>> driver.
>>         at
>> org.datanucleus.store.rdbms.datasource.dbcp.DBCPDataSourceFactory.makePooledDataSource(DBCPDataSourceFactory.java:80)
>>         at
>> org.datanucleus.store.rdbms.ConnectionFactoryImpl.initDataSourceTx(ConnectionFactoryImpl.java:144)
>>         ... 62 more
>> FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Error
>> creating transactional connection factory
>> NestedThrowables:
>> java.lang.reflect.InvocationTargetException
>> FAILED: Execution Error, return code 1 from
>> org.apache.hadoop.hive.ql.exec.DDLTask
>>
>>
>>
>

Reply via email to