Wildfly CLI XA-Datasource missing property - database

I have searched in the official Wildfly 10 documentation and searched the net but strangely I didn't find the solution to my problem. When I run the CLI and try to configure an XA-Datasource I can't configure the property xa-datasource-property.
These are the commands I have tried:
/subsystem=datasources/xa-data-source=TestDataSource/:add(driver-name=XA-Oracle,jndi-name=java:jboss/datasources/testDS,background-validation=false,enlistment-trace=false,flush-strategy=FailingConnectionOnly,max-pool-size=20,min-pool-size=10,no-recovery=false,password=TEST,pool-prefill=true,query-timeout=10,same-rm-override=false,statistics-enabled=true,track-statements=NOWARN,url-property=jdbc:oracle:thin:#TEST:orcl,user-name=USERNAME,validate-on-match=false,enabled=true,allow-multiple-users=false,xa-datasource-properties={"URL"=>{"value"=>"jdbc:oracle:thin"}})
/subsystem=datasources/xa-data-source=TestDataSource/:add(driver-name=XA-Oracle,jndi-name=java:jboss/datasources/testDS,background-validation=false,enlistment-trace=false,flush-strategy=FailingConnectionOnly,max-pool-size=20,min-pool-size=10,no-recovery=false,password=TEST,pool-prefill=true,query-timeout=10,same-rm-override=false,statistics-enabled=true,track-statements=NOWARN,url-property=jdbc:oracle:thin:#TEST:orcl,user-name=USERNAME,validate-on-match=false,enabled=true,allow-multiple-users=false,xa-datasource-properties={"name"=>"URL","value"=>"jdbc:oracle:thin"})
/subsystem=datasources/xa-data-source=TestDataSource/:add(driver-name=XA-Oracle,jndi-name=java:jboss/datasources/testDS,background-validation=false,enlistment-trace=false,flush-strategy=FailingConnectionOnly,max-pool-size=20,min-pool-size=10,no-recovery=false,password=TEST,pool-prefill=true,query-timeout=10,same-rm-override=false,statistics-enabled=true,track-statements=NOWARN,url-property=jdbc:oracle:thin:#TEST:orcl,user-name=USERNAME,validate-on-match=false,enabled=true,allow-multiple-users=false,xa-datasource-property={"name"=>"URL","value"=>"jdbc:oracle:thin"})
/subsystem=datasources/xa-data-source=TestDataSource/:add(driver-name=XA-Oracle,jndi-name=java:jboss/datasources/testDS,background-validation=false,enlistment-trace=false,flush-strategy=FailingConnectionOnly,max-pool-size=20,min-pool-size=10,no-recovery=false,password=TEST,pool-prefill=true,query-timeout=10,same-rm-override=false,statistics-enabled=true,track-statements=NOWARN,url-property=jdbc:oracle:thin:#TEST:orcl,user-name=USERNAME,validate-on-match=false,enabled=true,allow-multiple-users=false,xa-datasource-property={"URL"=>{"value"=>"jdbc:oracle:thin"}})
No matter which type of configuration I try it will tell me the property xa-datasource-properties or xa-datasource-property is unknown. When using TAB to get code completion it will offer my a lot of properties but the required one is not to be found.
Additionally if I leave it out it will say:
{
"outcome" => "failed",
"failure-description" => "WFLYJCA0069: At least one xa-datasource-property is required for an xa-datasource",
"rolled-back" => true
}
What am I missing?

For some weird reason it was only possible using a different syntax which looks like this:
xa-data-source add --name=Test --allow-multiple-users=false --connectable=true --driver-name=XA-Oracle --enabled=true --interleaving=false --jndi-name=java:jboss/datasources/test --max-pool-size=20 --min-pool-size=10 --no-tx-separate-pool=false --pad-xid=false --password=PASSWORD --pool-prefill=true --use-ccm=true --use-java-context=true --user-name=USERNAME --wrap-xa-resource=true --xa-datasource-properties=URL=jdbc:oracle:thin
I don't understand why the preferred method of cli syntax was not working but using this method it will be configurable.
If somebody knows a way to make it work in the other syntax I would really appreciate it.

On Wildfly 10 this works:
/subsystem=datasources/xa-data-source=TestDataSource/:add(driver-name=XA-Oracle,jndi-name=java:jboss/datasources/testDS,background-validation=false,enlistment-trace=false,flush-strategy=FailingConnectionOnly,max-pool-size=20,min-pool-size=10,no-recovery=false,password=TEST,pool-prefill=true,query-timeout=10,same-rm-override=false,statistics-enabled=true,track-statements=NOWARN,url-property=jdbc:oracle:thin:#TEST:orcl,user-name=USERNAME,validate-on-match=false,enabled=true,allow-multiple-users=false,xa-datasource-class=oracle.jdbc.xa.client.OracleXADataSource)
Note the last property, which is required otherwise testing the connection may fail.
Also, there was apparently a bug in Wildfly 13, where it fails to interpret the # symbol and reports an error that
at least one or more xa-datasource-property is required.
A fix was supposed to be put into Wildfly 14. However, I am seeing that the problem persists.

Even WildFly 18 have this problem. I used a sample command like this below..
To do the xa-datasource creation with xa-datasource-properties
xa-data-source add --jndi-name=java:/jdbc/TesteOracle --name=TesteOracle --driver-name=oracle --password=usuario --user-name=senha
--xa-datasource-properties=URL=jdbc:oracle:thin:#localhost:1521:HE

it seems that the datasource MUST be disabled at creation time ..
it work for me as
xa-data-source add \
--name=talentia-xxxxx\
--driver-name=sqlserver \
--jndi-name=java:jboss/datasources/xxxxx \
--user-name=xxxxx \
--password=xxxx \
--min-pool-size=10 \
--max-pool-size=20 \
--enabled=false \
--use-java-context=true
/subsystem=datasources/xa-data-source=xxxxxx/xa-datasource-properties=URL:add( \
value=jdbc:sqlserver://xxxxxxxx \
)
/subsystem=datasources/xa-data-source=xxxxxxx:write-attribute( \
name=valid-connection-checker-class-name, \
value=org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker \
)
/subsystem=datasources/xa-data-source=xxxxx:write-attribute( \
name=background-validation, \
value=true \
)
/subsystem=datasources/xa-data-source=xxxxx:write-attribute( \
name=same-rm-override, \
value=true \
)
xa-data-source enable --name = xxxxx

It can be done interactively via CLI by declaring all properties with data source in a batch for example:
[standalone#localhost:9990 /] batch
[standalone#localhost:9990 / #] /subsystem=datasources/xa-data-source=MariaDBXADS:add(driver-name=mariadb-xa, jndi-name=java:jboss/datasources/MariaDBXADS, user-name=jdv_user, password=jdv_pass, use-java-context=true)
[standalone#localhost:9990 / #] /subsystem=datasources/xa-data-source=MariaDBXADS/xa-datasource-properties=test:add(value=test-value)
[standalone#localhost:9990 / #] run-batch
The batch executed successfully

Related

Selenium: ERR_PROXY_CONNECTION_FAILED

options = webdriver.ChromeOptions()
options.add_argument('--proxy-server=%s' % proxy_list[proxytumb])
driver = webdriver.Chrome(options=options)
driver.get(url="https://lzt.market")
! Message: unknown error: net::ERR_TUNNEL_CONNECTION_FAILED
(Session info: chrome=109.0.5414.76)
I don't know what the problem is
Seems like your proxy doesn't work. Check the following:
Does the proxy require authentification? If yes, you might consider using Selenium-Profiles, since authentificated proxies aren't supported for chrome by default.
check, if your proxy is good. You can do that, for example by using curl -x "http://user:password#proxy_host:port" "http://httpbin.org/ip" or curl -x "http://user:password#proxy_host:port" "http://httpbin.org/ip".

Robot Framework Parameterizing using yaml file

Hi can anybody help me parameterize the string word so it will fetch from my yaml. I tried to run however I'm getting an error it shows failed: Using YAML variable files requires PyYAML module to be installed. Typically you can install it by running pip install pyyaml. but I already install pyyaml on my local machine. your response is highly appreciated. Thank you so much
Expected Result: ${String} parameter should get the value from my robot.yaml (Ralph) value
VS Terminal Screenshot:
.robot screenshot
robot.yaml file screenshot:
CMD Screenshot:
In robot.yaml define PYTHONPATH like this:
PYTHONPATH:
- .
- string: "RALPH"
Make sure you have installed PyYAML, then include robot.yaml and collections library in the robot file:
Variables path_to_file/robot.yaml
Library Collections
After this you can extract string value inside the test like this:
${value} = pop from dictionary ${PYTHONPATH[1]} string
log to console ${value}
This will print:
RALPH
Second item in PYTHONPATH list is a dictionary, so you first need to access ${PYTHONPATH[1]} and then pop the needed key (in your case string) in order to return its value.

Why is my if statement not working: Unexpected ! after ||

My text editor and php says unexpected ! after the || someone know this bug ? This is very weird
foreach($data as $pile->data)
if(!is_float($data) || ! is_int($data))
die('Pile::sort() invalid $pile data');
I use VS code as text editor and
PHP 7.2.24-0ubuntu0.18.04.2 (cli) (built: Jan 13 2020 18:39:59) ( NTS )
Sometimes, old versions are unable to distinguish multiple scenarios and spaces if added intentionally.
first of all, use this modified code.
foreach($data as $pile->data)
if((!is_float($data)) || (!is_int($data)))
die('Pile::sort() invalid $pile data');
Otherwise, please try to update to the latest version or do perform multiple checks. If the issue is still there, please do contact the official tool sport or read the official documentation.
I already had this error, I had to update my editor and download the last version of Wamp.
Not sure why but it worked for me. Maybe you should try it
I updated my php and now this is working.

WAMP doesn't refresh files

I've been working with WAMP for 2 years now and it's the first time I got this problem. I created a new website base with Symfony, and now I'm adding some files to it in Windows (by creating a bundle in a console) but it doesn't appear in the browser in localhost even I refresh it, so when I go in /web, I got those errors like these :
( ! ) Fatal error: Uncaught Error: Class 'SNS\PlatformBundle\SNSPlatformBundle' not found in D:\wamp\www\sns_symfony\sns_symfony\app\AppKernel.php on line 20
( ! ) Error: Class 'SNS\PlatformBundle\SNSPlatformBundle' not found in D:\wamp\www\sns_symfony\sns_symfony\app\AppKernel.php on line 20
Call Stack
# Time Memory Function Location
1 0.0010 385736 {main}( ) ...\app.php:0
2 0.0070 418000 AppKernel->handle( ) ...\app.php:19
3 0.0070 418000 AppKernel->boot( ) ...\Kernel.php:195
4 0.0070 418000 AppKernel->initializeBundles( ) ...\Kernel.php:132
5 0.0070 417952 AppKernel->registerBundles( ) ...\Kernel.php:492
Can someone help me please ? ^^'
I'll explain myself more. I used the bundle generator of Symfony so I dind't write anything, juste used the console. By the way there is some folders that WAMP can't see (I don't see them in the browser in localhost) and the file he's looking for are in those folders he can't see. There is the problem.
First of all, double check if the bundle really exists on your hard drive. You're on Windows, so just go to D:\wamp\www\sns_symfony\sns_symfony\src and check if there's a PlatformBundle\SNSPlatformBundle.php in your src dir. If not - now you know the generator didn't generate anything. Maybe accidentally aborted?
Then check if you have right PSR-0 or PSR-4 (most likely ) namespace in your composer.json file. You can run php composer validate to see warnings.
And as the last step run composer dump-autoload which updates the autoload file
Finally I found the solution after hours of deeps researches. Here it is :
Create the bundle
Edit your app/config/config.yml file like (add templating: engines ['twig'] in framework:)
framework:
templating:
engines: ['twig']
Thanks for help people ! :D
SOLVED !

R - error installing caret package

> Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),
> versionCheck = vI[[j]]) : namespace ‘pbkrtest’ 0.4-2 is being
> loaded, but >= 0.4.4 is required
> Error: package or namespace load
> failed for ‘caret’
Caret was working fine until I tried to load Rcpp and it messed everything up.
I searched the answers for a similar problem with caret but the solutions posted did not seem to work on mine. I followed:
install.packages("caret", dependencies = TRUE)
But it did not work.
I would suggest you to check the R version. I updated the version to 3.5.1 and it works perfectly :)
Mac only – use updateR
Similar to installr, updateR is the package to help updating R on Mac OS.
The R code you will need are the following 5 lines:
install.packages('devtools') #assuming it is not already installed
library(devtools)
install_github('andreacirilloac/updateR')
library(updateR)
updateR(admin_password = 'Admin user password')
I have the same problem with my dynlm package. I get the same error. But as R states pbkrtest is required. This package isn't available under R 3.2.3.
However you can download the package online, look a bit further on this site, the question is already asked on stackoverflow and they gave a site where you can find the packages. Then write the following code:
install.packages("...",repos = NULL, type="source")
install.packages("pbkrtest", dependencies = TRUE)
In the first line, here I wrote the 3 dots you need to write the path to the file where you placed the pbkrtest-package.
I also faced the same problem with caret package and I could solve it as the following:
install.packages("lme4", dependencies = TRUE)
library(lme4)
methods(sigma)
install.packages("pbkrtest", dependencies = TRUE)
library(caret)
This worked for me!
Try
install.packages('DEoptimR')
and followed by
install.packages("caret", dependencies = TRUE)
I had the same issues. Both of these commands worked for me.
I faced the same error with caret and none of the above suggestions helped. My R version was 3.2 and current version is 3.4.
I installed the new version and the issue was resolved
I have faced this issue and tried many ways but followed r console about error thrown and started downloading packages one by one. steps noted down what i did for this. y r studio version is "R version 3.4.4"
First install.packages("caret"), install.packages("ggplot2"), install.packages("lattice"), install.packages("lava")..
then load library(ggplot2) then library(lattice) then library(lava) and then finally library(caret).
What i believe that caret have these packages dependency so once caret is installed ideally 'install.packages('caret', dependencies = TRUE)' should work but it was not working in my R version so i did the step as given above and it worked for me.
hope it may work if someone get this issue
I did try all the above mentioned ways to install and activate caret but none worked for me.
finally what I did was to go to my drive location where R libraries are located. I removed a folder called "caret" and then in R studio I run "remove.packeges("caret")" to remove the caret package.
then I reinstalled the package.
install.packages("caret")
library(caret)
it worked for me.
I'm in R 3.6.1 and got the same error today.
I used this code:
install.packages("caret",dep = TRUE)
install.packages("ggplot2")
install.packages("lattice")
install.packages("lava")
install.packages("purrr")
library(ggplot2)
library(lattice)
library(lava)
library(purrr)
library(caret)
And now it works fine for me. It's all about dependencies that you should install with caret.
Use this:
install.packages(c("ggplot2", "lattice", "lava", "purrr", "caret"))
library(c("ggplot2", "lattice", "lava", "purrr", "caret"))
If that doesn't work, create a folder (R_LIB in this case) on your computer (documents in this case) and include the folder location as follow:
install.packages(c("ggplot2", "lattice", "lava", "purrr", "caret"), lib = "C:/documents/R_LIB")
library(c("ggplot2", "lattice", "lava", "purrr", "caret"), lib = "C:/documents/R_LIB")

Resources