JDBC Connector for MySQL not working in JMeter - java

As per the problems this person was having;
JDBC Connector not working
I'm running Debian 9.1
I installed Java via the package manager
I added Java to the path in /etc/config & added JAVA_HOME to the path in /etc/environment
I then installed jmeter via the package manager
I then downloaded the mysql-connector-java-5.1.44-bin.jar and copied this to /usr/share/jmeter/lib
But after all this, I still dont get the JDBC connection option under Add->Config Element within JMeter, nor do i get any options for JDBC within JMeter.
Can anyone help me as to what im doing wrong?
While I am new to JMeter, I have successfully run simple "Hello World" HTTP requests queried from a PHP Script & a NodeJS script so far.
Update
Added JMeter log by request
Jmeter log

I have no idea what the problem was with Jmeter on my Debian machine... (as prior to this I was trying to use it on Ubuntu Server, and it had the same issue as Debian);
But anyway, I just installed the Oracle JDK & JMeter for Windows, on my old Windows 7 laptop, dropped in the JDBC connector to the lib directory - & immediately it had the option for 'JDBC Connection', which never appeared on either the Ubuntu or Debian installs.
So if anyone else runs into this issue on Ubuntu or Debian ~ I might suggest trying a Windows 7 VM for running it.
Note here
This was the JMeter I installed on Windows (I didn't get it from Apache):
JMeter for Windows

For some reason I cannot find JMeter JDBC components either in Debian or in Ubuntu repositories, maybe it wasn't included by maintainers.
So instead of installing JMeter using package manager you can just download the latest JMeter version (which is JMeter 3.2 as of now while in repositories you have much older versions, 2.11/2.13) from the official website. JMeter is pure Java-based application so all you will need to do in order to be able to use it is to install Java 8 or above.
Alternative option would be downloading jmeter-jdbc JAR appropriate to your JMeter version and dropping it under /usr/share/jmeter/lib/ext folder (super-user privileges might be required), this way you will get JDBC test elements.

Related

java spring boot mircoservices wont start on one pc but it will on others

I'm working on a java program made using microservices, when launching my config service I'm getting an error that me or my friends do not get on different devices.
I've tried to clean and repackage the jar file, I'm using the same version of intelij as the other pc's, and I'm using the same jdk, language level. Also I have checked if the jar files are the same size the only difference i am seeing is that on the pc i am using i'm using a slightly newer version of apache maven 3.8.1 (not working pc) instead of 3.6.1(working pc), could this be the issue or would it be something else since these things tend to be backwards compatible.
how I launch my config service: java -jar config-service/target/config-service-0.0.1-SNAPSHOT.jar --spring.profiles.active=native
link to error: https://pastebin.com/UDRxZUkh
After reinstalling my windows it worked, but I did however install my windows on my HDD instead of my m.2 SSD and after then again reinstalling windows to my m.2 SSD have been getting the same error yet again.
So I'm not sure if this is actually an issue but it seems not to want to work on the my m.2 SSD (FYI this is the m.2: Kingston NV1 NVMe PCIe SSD 1000GBM.2 2280)

Installing Oracle REST Data Services (ORDS) on Tomcat

I have installed JDK and Tomcat 8 on the server. Now I need to install ORDS and connect it to Tomcat. I went through various documentation and downloaded ORDS on the server. Now I have a couple of questions as all this stuff is new to me and documentation is not very clear most of the time.
There is java.exe in the directory to which I installed JDK and there is java.exe in the directory where all the ORDS files are unzipped. Does it matter which one I use to run the installation?
java -jar ords.war standalone --port 8090
Now my second question is do I run standalone ORDS installation and specify port 8090 and then copy ords.war file into Tomcat diirectory Tomcat/webapp and make sure Tomcat is running and it will install ords on its own? That's where I am confused...
My third question is how do I check if ORDS has been installed correctly? Would going to http://localhost:8090/ords suffice?
P.S. Oracle database installed on another server, I have all the passwords, hostname, port, and service name. APEX is also installed on another server.
Appex is the old name for ORDS. After the ORDS version 3.x you don't need to install apex.
ORDS 3.0 is able to deploy WITHOUT Application Express. It has its own database schema now.
Answers for your questions:
It doesn't matter. But make sure it is java 7+. You can instead install java globally and just run: java -jar ords.war command. You can follow this tutorial to install java on your machine: https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html
When you run java -jar ords.war command then at this stage it starts installation of ORDS on your system. Before installation it asks for the oracle server hostname, oracle port, SID, and sysdba username and password to connect. Once you provide all the details and the type of installation you want, then it starts installation to the specific database server. Your tomcat/WLS/glassfish server will act as a rest endpoint between the database server and the clients.
Once installed ORDS on your database, if you right click on your connection in SQL Developer then you can see the Rest Service options. And yes the other way is like you mentioned: http:<host-name>:<port-name>/<schema-alias>/<object-alias>/ and see the result.
If you want to know the detail architecture, I would suggest to follow this oracle document: http://www.oracle.com/technetwork/developer-tools/rest-data-services/overview/index.html
I have recently installed the ORDS in production environment successfully. Actually there are two ways you can install ORDS:
Standalone mode:
Using sql developer you can easily configure the standalone mode: http://www.thatjeffsmith.com/archive/2015/04/deploying-oracle-rest-data-services-from-oracle-sql-developer/
But if you would like to use the terminal you can use the following steps:
https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-standalone-mode
Advanced mode:
https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-3-installation-on-tomcat-7.
In the advanced mode ORDS supports Tomcat, WebLogic, and Glassfish application servers
When to use which:
Use Advanced Mode for production
Use Standalone Mode for Development and Testing. You can use Advanced Mode for development and testing but since the standalone mode is quite easy for installation, it is recommended one.
For querying:
http://www.toadworld.com/platforms/oracle/w/wiki/11471.more-oracle-rest-data-services-features
https://svgonugu.com/2015/11/21/adf-bc-rest-services-i/
Note: If your database is PDB you could have some problem installing it and there are some tricks to solve it depending on the problem. Please let me know I would love to answer.

CQLSH Protocol Error proceeding from apparent version conflicts

I am running Cassandra 3.7 on an Ubuntu Server 16.04 LTS 32bit machine that I'm re-purposing from storage. I managed to properly configure the JVM to operate within the 32 bit environment. Nodetool status works fine. But I am having a hard time getting CQLSH to work. I end up with the following error:
('Unable to connect to any servers', {'127.0.0.1': ProtocolError("cql_version '3.4.2' is not supported by remote (w/ native protocol). Supported versions: [u'3.4.0']",)})
Obviously there is some version conflict here but I'm confused as to why and how to fix it. I had a previous 3.0 install of Cassandra that I configured cassanda-env.sh to properly start the JVM. I kept that .sh file when I installed up to 3.7. I updated cassandra.yaml with the new install.
So my question here is: does Cassandra 3.7 support CQL 3.4.2? If not then why does it appear to ship with it? If it does not, what do I need to do to downgrade to CQL 3.4.0? If it does support it and my configuration files are wrong then what's the error and how do I fix it? Or, is there another configuration that I'm completely missing here?
Here are my current configurations:
cassandra-env.sh: https://www.dropbox.com/s/dcs99hgry5behqd/cassandra-env.sh?dl=0
cassandra.yaml:https://www.dropbox.com/s/boi8bh7gin0390f/cassandra.yaml?dl=0
Any assistance greatly appreciated.
EDIT: Figured out, with the help of the first answer, that I had an older instance of the server running. I couldn't get it to start with the correct version...so then I deleted cassandra from /etc/init.d and now I can't get the debian package to automatically register the service.
EDIT2: Downloaded cassandra script from git repo and now cassandra will start again after rebooting. Now cassandra -v shows me:
3.7
Which what I wanted to see and solved my issue pertaining to the version conflict. But now unfortunately I see a new error:
Connection error: ('Unable to connect to any servers', {'127.0.0.1': TypeError('ref() does not take keyword arguments',)})
This problem is addressed in: cqlsh connection error: 'ref() does not take keyword arguments'
It looks like you're running the 3.7 cqlsh against an older server instance. First, be sure you are actually running Cassandra 3.7 (you can probably just check the jar path or look in the logs).
If you want to connect using the advertised cql_version there is a command line option:
https://github.com/apache/cassandra/blob/cassandra-3.7/bin/cqlsh.py#L222
select release_version, cql_version from system.local;
(or just look at the cqlsh welcome header) to see what these parameters are.

Java and jdbc - exe runnable file

I have made a simple java task to make query to Ms sql DB on windows, using jdbc library.
The program runs perfectly on my eclipse. I want to use it as an exe file (so I can send it to friend so he can use that as well).
I made a jar (using the export option on eclipse) so he can execute it as an exe file on windows. The problem is when he runs the jar file on windows for some reason the results of the query are empty. I am not sure what exactly is the problem.
It's not on localhost. This is how I connect -
String connectionUrl = "jdbc:sqlserver://**.***.***.***;" + "databaseName=&&&&&&&&;user=&&&&&&&&&&&;password=$$$$$$$$";
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection(connectionUrl);
This is the error I get - not sure how to handle it:
java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.8 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0
I have sqljdbc4.jar and sqljdbc4.jar files on that folder.
Any thoughts?
Thanks!
It sounds like you need to modify your program so that it captures and prints out all runtime errors and warnings.
It also sounds like you want to add a "check health" feature to verify:
the program runs on your friend's PC,
the program connects to the MSSQL server,
the expected database is found on the server, and
the expected data exists in the database.
==================================================
ADDENDUM:
Thank you for updating your post and sharing the real problem:
This is the error I get - not sure how to handle it:
java.lang.UnsupportedOperationException: Java Runtime Environment
(JRE) version 1.8 is not supported by this driver. Use the
sqljdbc4.jar class library, which provides support for JDBC 4.0
It sounds like you compiled on an older version of Java (that's fine), with an older MSSQL/JDBC driver (that's fine, too) ...
... but your friend has a NEW JRE 1.8 which won't work with the new driver.
TWO SOLUTIONS:
Have your friend uninstall his JRE and then do a clean install of your Java version. For example, you can find older JRE 1.7 here:
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html
Update your MSSQL driver to a current version (sqljdbc 4.2 is a good choice), verify that it works for you, then have your friend install the same MSSQL driver. You can download it here:
https://msdn.microsoft.com/en-us/library/mt484311%28v=sql.110%29.aspx
PS:
A third option - perhaps best - is for both of you to install the same version of Java and the same version of the MSSQL JDBC driver.
PPS: In the future, if you have an error message, please copy/paste it verbatim in your original post. A good error message is very often enough to resolve the problem immediately.

Possible bug in Java Web Start

I am using Ubuntu operating system with Java version 1.7.0_15 (Iced Tea). I am unable to access the Java web start application. Every time I start it I get message that Java web start requesting JRE 1.7 and then says that it is unable to install so manually install and then it failed to install the JRE. I do not know what to do.
Here is my java version
Here is few important information
1. I have validated JNLP file using JaNeLa and there is no error.
2. Ubuntu is opening Application with JRE 1.6 perfectly fine.
3. On Windows every version is running perfectly fine.
4. I have tried with deployment tool kit but the always redirect me to the Sun page to download the linux version of JRE and even after installing that it again redirect me to the download page.
Please let me know if I can provide more information.
So finally after working whole day I have found the problem with my system. I am not sure why my question got -3 but it was valid question. The problem was with the Java plugin in the Firefox browser. Although I have installed jdk 7 on my machine but the firefox plugin was still pointing to the jre6 so giving error. So I have to manually create the link for the jre 7 in my machine
ln -s /usr/lib/jvm/<<location of jre 7>>/jre/lib/i386/libnpjp2.so ~/.mozzilla/plugins
Then I restarted the browser and make sure that I have the latest plugin and it started working, So it was not the java installed but it was firefox plugin.
Just FYI, oracle has stopped it support for java plugin for linux due to some licensing so you have to install it manually. Thanks
You can check the installed plug-in by typing 'about:plugins' in your address bar of firefox
IMHO OpenJDK 7 is not a JRE 7.
You may uninstall it before install oracle jre. Otherwise you have to use sudo update-alternatives to define the default java version
See https://askubuntu.com/questions/67909/how-do-i-install-oracle-jdk-6

Categories

Resources