Could not load jvm.dll while calling a java mysql udf - java

In mysql udf it says could not load jvm.dll when i am trying to call java method using javaudflauncher.dll?
I want to call a java method from Mysql on Mysql trigger. I used the sample example provided by https://dejard.bitbucket.io
I have followed the steps as documented
- Setup the enviromental variable for Java & Mysql
- Copied the dll, jar and class files to the plugin directory
- Created the Function.
Till here it works fine. But when I try to call the function it gives me the below error
"ERROR 1123 (HY000): Can't initialize function 'call_java_method'; Could not load jvm.dll"
If anyone can help me out where I am going wrong.

Related

Error loading native librarie libarrow_dataset_jni.dylib in Apache Arrow 7.0.0 Java Dataset API

I got this error when I tried to run a simple Java program that uses the Dataset API available in version 7.0.0.
The error occurred when trying to get a NativeMemoryPool using the getDefault() method.
. . .
NativeMemoryPool nativeMemoryPool = NativeMemoryPool.getDefault();
FileSystemDatasetFactory factory = new FileSystemDatasetFactory(
new RootAllocator(Long.MAX_VALUE), nativeMemoryPool, FileFormat.PARQUET, uri);
. . .
By the way, I installed all the binary libraries for my platform using the instructions available at https://arrow.apache.org/install/ and correctly assigned the property java.library.path in my Java Program. The fact is that the library libarrow_dataset_jni.dylib was not actually installed even though libarrow_dataset.700.dylib and several others were installed with the respective symlinks.

Python 3.7 connecting to HSQLDB on MAC

Trying to connect to a HSQLDB Java database using python 3.7, jaydebeapi, and jpype. I tried the following
import jaydebeapi
UserName = "SA"
Password = ""
Java_Class = "org.hsqldb.jdbcDriver"
HSQL_Driver_Path = "/Hsqldb/driver/hsqldb.jar"
Database = "jdbc:hsqldb:/Hsqldb/database/OneDatabase"
jaydebeapi.connect(Java_Class,Database,[UserName,Password],jars=HSQL_Driver_Path)
and it resulted in the following error
java.lang.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class org.hsqldb.jdbcDriver not found
google states that this is a classpath error and I need to add a class path to fix.
edit: Details of setup: Mac, anaconda, python 3.7
I tried something similar in R using the RJDBC library and was able to connect just fine.
PathDriver = "/Hsqldb/driver/hsqldb.jar"
JDBCDriver = "org.hsqldb.jdbcDriver"
drv <- JDBC(JDBCDriver,PathDriver)
# Connect to Database
DatabaseP <- "jdbc:hsqldb:file:////Hsqldb/database/OneDatabase"
Con <- dbConnect(drv,DatabaseP,"SA","")
edit: Details of setup: Mac, R, Rstudio
I separated R from Anaconda as Anaconda was blocking many of the libraries I wanted to use.
This is probably apples to oranges, but why does python need a classpath set when R performs the function just fine? and how does one set a class path for HSQLDB for python?
When starting JPype it either takes the classpath from the environment variable CLASS_PATH or from a manually specified classpath defined using the jpype.startJVM(classpath="...") command. This command is likely part of the jaydebeapi api if you don't have to call it directly from JPype.
I assume that R defines its own classpath internally so there may just be differences in the what is being seen from the JVM. This could include a different JVM is being selected, the classpath including different locations, or in some cases if the driver has a native portion such as MS SQLServer the library path may also not be correct. In order for the JDBC driver to load all piece need to be found including the jar, support jars and native shared libraries. If all else fails manually try to load the java class using Class.forname. It may provide you with further diagnostics as to which piece is missing.

Java invoke Sqoop fails on hive import

I have a Java Program which run a Sqoop operation by Sqoop.runTool() method. Until now, I can successfully run this operation to get data from oracle to HDFS.
but when I add the parameter --hive-import, it reports an warning in hive's log file in /tmp/root/hive.log:
hive-site.xml not found on CLASSPATH
Mean while I noticed that,run by JavaAPI and by plain sqoop Command,the console message have a different output:
Logging initialized musing configuration in jar:file:/opt/cloudera/parcels/CDH/jars/hive-exec-1.1.0!hive-log4j.properties
Logging initialized musing configuration in jar:file:/opt/cloudera/parcels/CDH/jars/hive-common-1.1.0!hive-log4j.properties
Will be grateful for any help.

websphere - CWWKE0054E error unable to open file

i am trying run the websphere liberty profile server from the command line. I am following the steps told here : https://developer.ibm.com/wasdev/downloads/liberty-profile-using-non-eclipse-environments/
I have created the server with the name server1.
But when the extraction completes and I try to start the server using the command : server start server1
the server throws an error : CWWKE0054E: Unable to open file C:\wlp\wlp\usr\servers\server1\logs\C:\Users\Furquan\AppData\Local\Temp\\ihp_custom_batches.log.. Now I know this cant be a valid path, but I dont know where and how to change it. Please help !!
This error is related to the LOG_FILE environment variable that you have defined in your environment by some other program. To solve that, you have the following opions:
Remove LOG_FILE env variable, if it is no longer needed by your system
If you cant do that, override it via server.env file, that you can create in the wlp\usr\servers\serverName directory with the following content:
LOG_FILE=console.log
As last resort (this is not recommended, will make your installation NOT SUPPORTED and in certain installations might get overwritten by updates) - modify the server.bat command line script - in the script find the following section:
if not defined LOG_FILE (
set X_LOG_FILE=console.log
) else (
set X_LOG_FILE=!LOG_FILE!
)
And after the line set X_LOG_FILE=!LOG_FILE! just add another line that will override it with the default like this set X_LOG_FILE=console.log
In general, I'd recommend second solution (with the server.env file), as it is the most portable and will work in any environment.
I have the similar problem for IBM Support Assistant V5. After I deleted %LOG_FILE% from Environment Variables, it worked.

How to access *.mv.db file of H2 database?

I have created database with my own program and it appeared as mydatabase.mv.db file.
But when I tried to access the same database with DbVisualizer, with apparently same parameters, it created two files mydatabase.lock.db and celebrity.h2.db and didn't see tables, created in the program.
What was the incompatibility?
UPDATE
both setups are follows:
In H2 version 1.3.x, the database file <databaseName>.h2.db is the default. (The storage engine "PageStore" is used).
In H2 version 1.4.x, the database file <databaseName>.mv.dbis the default. (The storage engine "MVStore" is used). The MVStore is still beta right now (November 2014). But you can disable the MVStore by appending ;mv_store=false to the database URL.
The accepted answer is now several years old and since others may be looking for a more "current" solution...
To get it to work just update the H2 JDBC driver that DBVizualizer uses. Basically download the "Platform-Independent Zip" from http://www.h2database.com/html/download.html and copy the h2/bin/h2-X.X.X.jar file to ~/.dbvis/jdbc/ and then restart DBVizualizer so it can pick up the updated driver.
Also, make sure you remove .mv.db from the file name when setting the Database file name in DBVizualizer.
For Windows Users:
The excellent way to read a *.db.mv file would be locally installing the h2 database and then running that database locally with the java command.
Then your path to the file will definitely show the data from your table until and unless any errors occur.
You can download the h2 database form:
http://www.h2database.com/html/download-archive.html
Note: choose the database version for H2 which supports your file.
You can install the H2 database by installing the downloaded .exe file would be around 7 MB.
then in the bin directory of H2 open a command prompt and run the command
java -jar in my case it is
command: java -jar h2-1.4.200.jar
It will show the console of the H2 database on the browser
Provide the database details:
Driver Class: org.h2.Driver JDBC
URL: jdbc:h2:~/h2 "file path"
User Name: "blank by default"
Password: "blank by default"
Refer SS below
enter image description here

Categories

Resources