Websphere Appserver v9 test Data Source connection fails - java

I have configured a sybase datasource on websphere applicaiton server 9 installed on Linux,and trying to test it. But it fails with below exception
>DSConfigurati W DSRA8201W: DataSource Configuration: DSRA8040I: Failed to
>connect to the DataSource jdbc/gbs. Encountered java.sql.SQLException: JZ006:
>Caught IOException: java.io.IOException: JZ0TS: Truncation error trying to
>send GBSëüÃÂâóýÃÂòîêðûL. DSRA0010E: SQL State = JZ006,
during data source configuration ,I have added couple of custom properties for data source and they are
> networkProtocol : Tds
> connectionProperties:
>SELECT_OPENS_CURSOR=true;applicationName=GBS«¼Æ¢ó½Ç²îª°»L
I just searched the Sybase error code JZ0TS in here infocenter.sybase.com/help/index.jsp?topic=/…, but that really dint help me .
What I observed is the custom property value GBS«¼Æ¢ó½Ç²îª°»L is getting changed to GBSëüÃÂâóýÃÂòîêðûL , during connectivity testing. How to avoid this.
Can any one help me on this.
The Environment I have used for this are ...
Websphere Application Server 9.0.0.10
Sybase Jconnect 3 jar and the
OS where the WAS 9.x installed is Linux.
I have tried the same test datasource connection verificaiton on Websphere application server version 9 installed on Windows 10 , it worked fine , without any issues.

Related

Connecting Java app with Oracle on Mac osx [duplicate]

I am trying to connect my grails project to Oracle databse(Oracle 12c) in windows(8) system. However, whenever I run my application I get following exception :
Caused by: org.apache.commons.dbcp.SQLNestedException:
Cannot create PoolableConnectionFactory (ORA-28040:
No matching authentication protocol)
Caused by:
java.sql.SQLException: ORA-28040:
No matching authentication protocol
According to internet suggestion I also tried editing my *.ora file but it is not working.
I added following snippet in sqlnet.ora file :
SQLNET.ALLOWED_LOGON_VERSION=10
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=10
SQLNET.ALLOWED_LOGON_VERSION_SERVER=10
Here i tried assigning (10,11,12) but neither of them is working.
Can anyone please help me with this ?
I deleted the ojdbc14.jar file and used ojdbc6.jar instead and it worked for me
Here is some text I found at experts-exchange:
Bug 14575666
In 12.1, the default value for the SQLNET.ALLOWED_LOGON_VERSION
parameter has been updated to 11. This means that database clients
using pre-11g JDBC thin drivers cannot authenticate to 12.1 database
servers unless theSQLNET.ALLOWED_LOGON_VERSION parameter is set to the
old default of 8.
This will cause a 10.2.0.5 Oracle RAC database creation using DBCA to
fail with the ORA-28040: No matching authentication protocol error in
12.1 Oracle ASM and Oracle Grid Infrastructure environments.
Workaround: Set SQLNET.ALLOWED_LOGON_VERSION=8 in the
oracle/network/admin/sqlnet.ora file.
This except for adding the following to sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
If you get "ORA-01017: invalid username/password; logon denied" error, then you need to re-create your password.
I resolved this issue by using ojdbc8.jar.
Oracle 12c is compatible with ojdbc8.jar
I was using eclipse and after trying all the other answers it didn't work for me.
In the end, what worked for me was moving the ojdb7.jar to top in the Build Path. This occurs when multiple jars have conflicting same classes.
Select project in Project Explorer
Right click on Project -> Build Path -> Configure Build Path
Go to Order and Export tab and select ojdbc.jar
Click button TOP to move it to top
Very old question but providing some additional information which may help someone else. I also encountered same error and I was using ojdbc14.jar with 12.1.0.2 Oracle Database. On Oracle official web page this information is listed that which version supports which database drivers. Here is the link and it appears that with Oracle 12c and Java 7 or 8 the correct version is ojdbc7.jar.
In the ojdbc6.jar is for 11.2.0.4.
Except for adding the following to sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
I also added the following to both the Client and Server, which resolved my issue
SQLNET.AUTHENTICATION_SERVICES = (NONE)
Also see post
ORA-28040: No matching authentication protocol
Adding
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
is the perfect solution
sql.ora directory
..\product\12.1.0\dbhome_1\NETWORK\ADMIN
My Initial error is : ORA-28040: No matching authentication protocol exception
My DB version is 12.2 (Solaris) and client version is 11.2 ( windows). I have added below in both server and client sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
while connecting, I have got invalid username and password hence I have recreated the password ( same password ) in database which is resolved my issue.
While for most cases replacing ojdbc driver jar will be the solution, my case was different.
If you are certain you are using correct ojdbc driver. Double check if you are actually connecting to the database you are thinking you are. In my case jdbc configuration (in Tomcat/conf) was pointing to different database that had different Oracle version.
just install ojdbc-full, That contains the 12.1.0.1 release.

JVMCFRE003 bad major version; class=org/postgresql/Driver, offset=6 while connecting db2 to postgres

Please help me to resolve this issue.. I am trying to connect postgres from Db2 using InfoSphere Federation Server:
Getting error:
JVMCFRE003 bad major version; class=org/postgresql/Driver, offset=6
I am using JDK 1.8, Postgres 12.0, jar -- postgresql-42.2.11.jar
CREATE SERVER JCSERV TYPE JDBC VERSION '12.0' WRAPPER JDBC OPTIONS (DRIVER_PACKAGE 'C:\Program Files\Java\jre1.8.0_241\lib\ext\postgresql-42.2.11.jar', DRIVER_CLASS 'org.postgresql.Driver', URL 'jdbc:postgresql://127.0.0.1:5432/SCOPEDB', JDBC_LOG 'Y');
CREATE USER MAPPING FOR SANAGARW SERVER JCSERV OPTIONS (REMOTE_AUTHID 'postgres',REMOTE_PASSWORD '****');
I have created the server with different postgres driver jar files. but its giving same issue with all the driver. I could not find the actual root cause of this issue.

Setting up Glassfish Datasource issue

I spent a good part of my evening setting up a Glassfish 5.0.1 server configuring a JDBC Connection Pool and deploying an application. The issue I keep running into: Unable to Connect to JDBC Connection Pool from Glassfish and GlassFish connection pool
In Glassfish for MySQL everywhere states to use the Resource Type: javax.sql.DataSource and Datasource Classname: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
The above never worked no matter where I put the MySQL Connector jar glassfish/lib or domain/domain1/bin/lib. All times I deleted the pool I had, cleared the cache and restarted the servers.
I ended up switching to java.sql.Driver and Driver Classname: com.mysql.jdbc.Driver
Question are how do I make the Datasource work?
Also, what is the difference between Driver and Datasource?
Edit
Same issue with Payara-5. I am putting the jar in lib/ext but the Driver failed in the same way and was resolved with it there.
Ping Connection Pool failed for MySQLConnPool2. Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource Please check the server.log for more details.
In the 5.0 to 8.0 release notes there is a reference to a change in the package name from com.mysql.jdbc to com.mysql.cj. Looking at mysql-connector-java-8.0.12.jar, there appears to be an undocumented change in the package for the data source to com.mysql.cj.jdbc.MysqlDataSource.
I have tested using com.mysql.cj.jdbc.MysqlDataSource in Payara 5 from the admin console, and it works :-)
I had the same problems at glassfish 5.0 with mysql-connector-8.0.16.jar. A look in the documentation of glassfish we had to place the mysql-connector-5.1.47-bin.jar into the domains/domain1/lib directory. The connector of 8.0 has no *-bin.jar file. So I tried to place the *5.1.47-bin.jar into the domain1/lib directory. After the restart of my glassfish server, I tried to define a new Connection-Pool for MySQL with a javax.sql.XADataSource and the DataSourceName com.mysql.jdbc.jdbc2.optional.MysqlXADataSource. After setting the properties as described in glassfish documentation MySQL Server Database Type 4 Driver I got a successfull ping

JMeter jdbc:mysql error

I am trying to setup a JMeter server/client instance on a remote database server. I have extracted JMeter on the server, copied the MySQL java connector into $JMETER_HOME/lib and started the JMeter-server listener. On the client (my local desktop), I have pointed the JMeterclient to the remote server (via the remote_hosts entry in $JMETER_HOME/bin/jmeter.properties). Whenever I try to run a MySQL load job on the client (Run -> Remote Start -> ), I get the following error:
Response message: java.sql.SQLException: No suitable driver found for jdbc:mysql://1.2.3.4/database
And this is on the server side:
2013/04/10 12:44:43 WARN - jmeter.protocol.jdbc.config.DataSourceElement: Could not return Connection java.sql.SQLException: No suitable driver found for jdbc:mysql://1.2.3.4/dbname at java.sql.DriverManager.getConnection(DriverManager.java:602) at java.sql.DriverManager.getConnection(DriverManager.java:185) at org.apache.avalon.excalibur.datasource.JdbcConnectionFactory.newInstance(JdbcConnectionFactory.java:185) at org.apache.avalon.excalibur.pool.ResourceLimitingPool.newPoolable(ResourceLimitingPool.java:672) at org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.newPoolable(ValidatedResourceLimitingPool.java:178) at org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcConnectionPool.newPoolable(ResourceLimitingJdbcConnectionPool.java:123) at org.apache.avalon.excalibur.pool.ResourceLimitingPool.get(ResourceLimitingPool.java:402) at org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.get(ValidatedResourceLimitingPool.java:130) at org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource.getConnection(ResourceLimitingJdbcDataSource.java:222) at org.apache.jmeter.protocol.jdbc.config.DataSourceElement$DataSourceComponentImpl.getConnection(DataSourceElement.java:286) at org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection(DataSourceElement.java:146) at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:85) at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) at java.lang.Thread.run(Thread.java:662)
Does anyone have any idea why this wouldn't work even though the Java connector is in the jmeter lib dir?
So it turns out that the Percona MySQL version that we are running required a specific version of the connector. Dropped that in and it all worked out.

FileNotFoundException while running SolrCloud on Tomcat

I have a Solr 4.2.0 server which is running under the Tomcat 7.0 container. I'm trying to wire it with my external zookeeper (actually, it doesn't work with the embdedded zookeeper too).
I tried this java opts:
-Dbootstrap_confdir=./solr/collection1/conf
-Dcollection.configName=myconf
-DzkRun
-DnumShards=2
for running the embedded zookeeper.
And also this java opts:
-Dbootstrap_confdir=./solr/collection1/conf
-Dcollection.configName=myconf
-DzkHost=localhost:2181
-DnumShards=2
For connecting to external zookeeper
In both cases I continue to get the same exception:
java.io.FileNotFoundException: File '.\solr\collection1\conf \admin-extra.html' does not exist
But the problem is that file admin-extra.html exists and it's right here. And I can't figure out what the problem is.
From your exception it seems your path has a white space after the config directory.
Try to define your bootstrap_configdir between "", like:
-Dbootstrap_confdir="./solr/collection1/conf"

Categories

Resources