The Message-Driven EJB unable to connect JMS Destination stating Error creating the db_connection - oracle

we have Oracle OSB 11g which is connecting to Oracle 12C DB in remote location or a different LAN.
THE WebLogic EJBs connecting to Oracle AQs via JMS/JDBC and currently we are having issues with them.
the WLS logs says:
####<Sep 21, 2018 9:15:51.083 AM GMT+00:00> <Warning> <EJB> <10.170.128.102>
<osb02_m1> <[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default
(self-tuning)'> <<anonymous>> <>
<e10b4740d6c6fa2e:-5f6b2f84:165f9d83f34:-8000-0000000000000f87>
<1537521351083> <BEA-010096> <The Message-Driven EJB:
RequestEJB3103778799539238415X86e7f92.165e6e1ae31.X725d is unable to connect
to the JMS destination or bind to JCA resource adapter: queue/ProvRequestAQ.
Connection failed after 2,609 attempts. The MDB will attempt to
reconnect/rebind every 10 seconds. This log message will repeat every 600
seconds until the condition clears.>
####<Sep 21, 2018 9:15:51.083 AM GMT+00:00> <Warning> <EJB> <10.170.128.102>
<osb02_m1> <[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default
(self-tuning)'> <<anonymous>> <>
<e10b4740d6c6fa2e:-5f6b2f84:165f9d83f34:-8000-0000000000000f87>
<1537521351083> <BEA-010061> <The Message-Driven EJB:
RequestEJB3103778799539238415X86e7f92.165e6e1ae31.X725d is unable to connect
to the JMS destination: queue/ProvRequestAQ. The Error was:
oracle.jms.AQjmsException: Error creating the db_connection
Nested exception: java.lang.UnsupportedOperationException: Remote JDBC
disabled
Nested exception: java.lang.UnsupportedOperationException: Remote JDBC
disabled>
I searched in internet and found the solution that I have to add the below parameter and add to setDomainEnv.sh and restart the WebLogic admins and managed servers, but still this issue is not resolved. I also checked that the DB User used to connect the DB has enqueue/dequeue privileges over the Oracle queues.
Parameter was
WLS_JDBC_REMOTE_ENABLED="-Dweblogic.jdbc.remoteEnabled=true"

I think the parameter must be added to the startup parameters of your managed servers from your domain console. After adding the parameter restart your managed servers.
The requested parameter might give some trouble on weblogic 12.1.3. As a matter of fact the parameter is deprecated since weblogic 10.3.6.
If you are still in trouble try the following workaround:
https://docs.oracle.com/cd/E24329_01/web.1211/e24376/rmidriver.htm#JDBCP350
Might be helpful.

Related

Why does Test Connection fail in Wildfly 20 Using SQL Anywhere sajdbc4 driver?

I had Wildfly 10 running previously and have just upgraded to Wildfly 20 (under Ubuntu 20). My configuration from Wildfly 10 no longer works when it comes to getting the Sybase SQL Anywhere 17 sajdbc4 driver working. When I "Test Connection" it fails. I am using the same configuration and testing against the exact same (SQL Anywhere High Availability) database server.
"Test Connection" on the following Datasource triggers an "Invalid ODBC handle" error:
<datasource jndi-name="java:jboss/datasources/TestDB" pool-name="TestDB" spy="true" tracking="true" enlistment-trace="true">
<connection-url>jdbc:sqlanywhere:Host=192.168.1.45:19000,192.168.1.45:19001;ServerName=TestDB</connection-url>
<driver>sajdbc4.jar</driver>
<security>
<user-name>...</user-name>
<password>...</password>
</security>
</datasource>
Connection is not valid
Caused by: java.sql.SQLException: Invalid ODBC handle
at deployment.sajdbc4.jar//sap.jdbc4.sqlanywhere.IDriver.makeODBCConnection(Native Method)
at deployment.sajdbc4.jar//sap.jdbc4.sqlanywhere.IDriver.connect(IDriver.java:809)
at org.jboss.ironjacamar.jdbcadapters#1.4.22.Final//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:321)
... 35 more
How I set this up:
I used the console to Deploy the sajdbc4.jar and that appears to work fine. I see no errors and sajdbc4 shows up as Deployed in the console and it also shows up as a JDBC Driver in the Subsystems. Here is what was created in standalone.xml after using the console:
deployment name="sajdbc4.jar" runtime-name="sajdbc4.jar">
content sha1="b690ff7a8ba1a3c2e8dd5079138b7970d969c2b9"/>
/deployment>
(I had to drop the leading angle brackets to get the previous lines to show - even when marked as Code!)
Next I had to ensure that the java.library.path and classpath included the path to the sajdbc4.jar and its support files so Wildfly can find them. To do so I added the "HACK" to the following in standalone.conf:
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
# ADDED FOLLOWING HACK
JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/opt/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main -cp .:/opt/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main/sajdbc4.jar"
echo "Java Properties Next:"
java -XshowSettings:properties -version
else
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
fi
Finally, I added the datasource block shown at the top. After starting Wildfly TestDB shows up as a Datasource in the Datasources Subsystem but when I Test Connection I get the "Invalid ODBC handle" error.
I feel confident that the driver and all its support files are "working" because I have a very simple Java test app that just makes a connection to TestDB, fetches from a table and displays the rows. Note that it uses the exact same java.library.path and classpath as I set in standalone.conf:
cd $HOME/Desktop
export LD_LIBRARY_PATH=/opt/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main
export CLASSPATH=.:/opt/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main/sajdbc4.jar
java sajdbc4DriverTest.java
Note that server.log shows no errors and in fact shows lines like:
[org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "sajdbc4.jar" (runtime-name: "sajdbc4.jar")
...
[org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0005: Deploying non-JDBC-compliant driver class sap.jdbc4.sqlanywhere.IDriver (version 4.0)
[org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0018: Started Driver service with driver-name = sajdbc4.jar
[org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) WFLYJCA0001: Bound data source [java:jboss/datasources/TestDB]
...
[org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "sajdbc4.jar" (runtime-name : "sajdbc4.jar")
Note that my connection string is for connecting to a SQL Anywhere High Availability system (hence the two URLS). In Wildfly 20 I see that there is now a new "HA URL Separator" field in the console's Datasource definition page. I tried setting that to a comma and that just changed the Test Connection error to "Unable to create connection from URL":
2020-08-25 11:45:08,378 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (External Management Request Threads -- 1) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031085: Unable to create connection from URL: jdbc:sqlanywhere:Host=192.168.1.45:19000,192.168.1.45:19001;ServerName=TestDB
at org.jboss.ironjacamar.jdbcadapters#1.4.22.Final//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getHALocalManagedConnection(LocalManagedConnectionFactory.java:381)
How do I get "Test Connection" to work?
Thank you in advance.
The problem turned out to be related to the fact that I was running Wildfly as a service and apparently my efforts above to set the java.library.path is failing. I know the reason for the error but I do not know how to set the path when running as a service.

Space Issue being caused due to Weblogic Server warning messages

We have CRM running on seven clustered servers which comprises of our Front End. We have another cluster the Process Manager Cluster comprising of two other machines. These two machines are running weblogic 8.1 windows installation and random nodes on these servers are causing zero space issue due to the logs getting full as a result of a warning message.
There is no change done to the code since ages. What can be the issue here?
####<12-Mar-2007 15:29:35 o'clock GMT> <Alert> <Log Management> <Server1> <scm1-04> <ExecuteThread: '4' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-170018> <The log file has been rotated to scm1-04.log17956. Log messages will continue to be logged in D:\logs\scm1-04.log.>
####<12-Mar-2007 15:29:35 o'clock GMT> <Warning> <EJB> <Server1> <scm1-04> <ExecuteThread: '4' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-010065> <MessageDrivenBean threw an Exception in onMessage(). The exception was:
java.lang.NoClassDefFoundError.
java.lang.NoClassDefFoundError
at com.clarify.procmgr.ejb.ProcessManagerMDB.onMessage(ProcessManagerMDB.java:58)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
>

Enable DRCP in Weblogic 12c fails

I'm trying to create a data source enabled with DRCP in Weblogic 12c installed in Linux. After providing all required values & 'Test Configuration' there is an error (cited below ). I have tried the same on Windows and it worked for same port number (also included SERVER=POOLED in 'tnsnames.ora' for client purpose in Windows).
Configurations:
Linux machine : Weblogic 12c (12.1.2)
URL : jdbc:oracle:thin:#//10.125.158.115:1521/PERF01:POOLED
oracle.jdbc.DRCPConnectionClass = myDRCPClass
Error:
<AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <> <1432019762569>
<BEA-240003> <Administration Console encountered the following error: java.sql.SQLRecoverableException:
IO Error: Invalid number format for port number
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:465)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:232)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:280)
at oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:469)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:156)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:101)
at weblogic.jdbc.common.internal.DataSourceUtil.testConnection0(DataSourceUtil.java:356)
at weblogic.jdbc.common.internal.DataSourceUtil.access$000(DataSourceUtil.java:22)
at weblogic.jdbc.common.internal.DataSourceUtil$1.run(DataSourceUtil.java:254)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.jdbc.common.internal.DataSourceUtil.testConnection(DataSourceUtil.java:251)
.
.
at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
Caused by: oracle.net.ns.NetException: Invalid number format for port number
at oracle.net.resolver.AddrResolution.resolveSimple(AddrResolution.java:512)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:409)
Change of Weblogic version (from Weblogic 12.1.2 to 12.1.3) solved this problem. Both Weblogic 12.1.1 & Weblogic 12.1.3 supports DRCP.

Jersey Library errors (NoSuchMethod then IncompatibleClassChangeError)

We just upgraded from Weblogic 10 to Weblogic 12 and started to get this error
<Error> <com.sun.jersey.spi.container.ContainerResponse> <hostname> <nodename> <[ACTIVE] ExecuteThread: '21' for queue: 'weblogic.kernel.Default (self-tuning)'> <ws_user> <> <> <140123234234> <BEA-000000> <The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoSuchMethodError: com.sun.jersey.client.apache.ApacheHttpClientHandler.getRequestEntityWriter(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriter
After little bit digging, I realized that Jersey library (com.sun.jersey.contribs) needs to be upgraded to 1.18.1 version from 1.2. I did that change and then started to get following error
weblogic.application.ModuleException: java.lang.IncompatibleClassChangeError: com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider and com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$Wadl disagree on InnerClasses attribute
a little digging in it i learned that my JSR311-api (javax.ws.rs) has to be 1.1.1 and it is already that. Now i am lost what else shall i change to have these errors fixed
I had a similar issue when updating the Jersey library. In the end it turned out that the old jar was still in the /lib folder. Make sure that you have completely removed the previous version.
Hope that helps.

Weblogic AdminServer achieves state 'RUNNING' only when network connection is disabled (localhost)

Running WebLogic 10.3.6 on localhost with nothing deployed yet, the state of the AdminServer is always 'SHUTDOWN' and I get this console message:
<08-Aug-2013 12:24:06 o'clock IST> <Warning> <Log Management> <BEA-170011> <The LogBroadcaster on this server failed to broadcast log messages to the admin server. The Admin server may not be running. Message broadcasts to the admin server will be disabled.>
<08-Aug-2013 12:24:07 o'clock IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<08-Aug-2013 12:24:07 o'clock IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
When I disconnect from the network, the AdminServer state is 'RUNNING', but I get an exception because my remote jdbc connection can't be achieved.
<08-Aug-2013 12:28:28 o'clock IST> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'JDBC Data Source-0' due to error weblogic.application.ModuleException: .
weblogic.application.ModuleException:
at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:327)
Caused By: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: IO Error: Unknown host specified
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:283)
Followed by the same notice that the server is 'Running'
<08-Aug-2013 12:28:41 o'clock IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
Why is it that I get issues for jdbc or the AdminServer but cannot have both working simultaneously? Also, what does the message that the 'Server state has changed to RUNNING' when in the WL Console it says that AdminServer is not running?

Resources