How to set Jboss Modeshape JNDI property - jboss

How can ı set jndi-name property on my local jboss modeshape repository named as a "sample"
I've just tried,
/subsystem=modeshape/repository=sample:add(jndi-name="jcr/sample") code but it fails
{
"outcome" => "failed",
"failure-description" => "JBAS014803: Duplicate resource [
(\"subsystem\" => \"modeshape\"),
(\"repository\" => \"sample\")
]",
"rolled-back" => true
}

This CLI command
/subsystem=modeshape/repository=sample:add(jndi-name="jcr/sample")
will attempt to add a repository named "sample" with the given "jndi-name" attribute. The error message indicates that you already have an existing "sample" repository, so rather than add a repository you want to just update the "jndi-name" attribute on the "sample" repository. To do this, simply use this command:
/subsystem=modeshape/repository=sample:write-attribute(name=jndi-name,value="jcr/sample")
You can read the attribute with:
/subsystem=modeshape/repository=sample:read-attribute(name=jndi-name)
and you can read the description of the repository resource with:
/subsystem=modeshape/repository=sample:read-resoure
or of the repository resource and its children resources:
/subsystem=modeshape/repository=sample:read-resoure(recursive="true")

Related

Can not create jms-queue in wildfly using jboss-cli

I started wildfly 24 server with standalone-full.xml profile, when i run following command in jboss-cli to create jms-queue i get following error
[standalone#localhost:9990 /] jms-queue --profile=full add --queue-address=foo --entries=["java:/jms/queue/foo"]
WFLYCTL0175: Resource [
("subsystem" => "messaging-activemq"),
("server" => "default")
] does not exist; a resource at address [
("subsystem" => "messaging-activemq"),
("server" => "default"),
("jms-queue" => "foo")
] cannot be created until all ancestor resources have been added
What am i missing here? Any reference docs to create the jms server, queues?
Update:
I tried to create the server using web console first
And it filed with the required capabilities are not available, any documentation refernece that indicates what are the required capabilities i need to added prior configuring JMS
Yes don't use the profile parameter which is used in domain mode.
jms-queue add --queue-address=foo --entries=["java:/jms/queue/foo"]
works properly.
The issue is i was using wildfly "WildFly Preview EE 9.1 Distribution" the correct verirsion is "Jakarta EE 8 Full & Web Distribution"

Adding smallrye tracing to Wildfly 23

I'm trying to add microprofile opentracing subsystem to Wildfly23 using thins guide: https://github.com/wildfly/wildfly/blob/main/docs/src/main/asciidoc/_admin-guide/subsystem-configuration/MicroProfile_OpenTracing_SmallRye.adoc
However, the second step fails:
[standalone#localhost:9990 /] /subsystem=microprofile-opentracing-smallrye:add
ERROR [org.jboss.as.cli.CommandContext] {
"outcome" => "failed",
"failure-description" => "WFLYCTL0369: Required capabilities are not available:
org.wildfly.microprofile.config; There are no known registration points which can provide this capability.",
"rolled-back" => true
}
I tried adding microprofile config using this model as a reference: https://docs.wildfly.org/23/wildscribe/subsystem/microprofile-config-smallrye/index.html however i get this error
[standalone#localhost:9990 /] /subsystem=microprofile-config-smallrye:add
ERROR [org.jboss.as.cli.CommandContext] {
"outcome" => "failed",
"failure-description" => "WFLYCTL0030: No resource definition is registered for address [(\"subsystem\" => \"microprofile-config-smallrye\")]",
"rolled-back" => true
}
What am i missing? The doc seems fresh enough, last updated in March on 2021...
You also need to install the extensions "org.wildfly.extension.microprofile.config-smallrye" and "org.wildfly.extension.microprofile.opentracing-smallrye" before adding the subsystems.
Also wildfly provides a standalone-microprofile.xml that can server as example.

Type error: Argument 1 passed to Jenssegers\Mongodb\Query\Builder::__construct() must be an instance of Jenssegers\Mongodb\Connection

An application which is written in Laravel using mondodb as backend where "jenssegers/laravel-mongodb" vendor used as interface. Post loading application in browser throws following error :
Type error: Argument 1 passed to
Jenssegers\Mongodb\Query\Builder::__construct() must be an instance of
Jenssegers\Mongodb\Connection, instance of
Illuminate\Database\MySqlConnection given
Solution which helped me :
In .env file which overrides the config files.
it had DB_CONNECTION=mysql.
Changing it to following, fixed this bug.
DB_CONNECTION=mongodb
Work of caution :
Please ensure to provide correct value based on your server setup for following .env variable, I've kept it as default.
DB_CONNECTION=mongodb
DB_HOST=127.0.0.1
DB_PORT=27017
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
if using two database connection together and have this problem with passport
modify setting in this Path:
vendor/laravel/passport/config/passport.php
and then change this lines:
'storage' => [
'database' => [
'connection' => env('DB_CONNECTION', 'yourdb'),
],
],

JBoss EAP 7.0.5 can not add https-listener

I am adding a new security realm and https-listener with CLI:
/core-service=management/security-realm=HTTPSRealm/:add
/core-service=management/security-realm=HTTPSRealm/server-identity=ssl:add(alias=ssl,keystore-path="/path/to/configuration/testCA.jks", keystore-password="12345678")
reload
/subsystem=undertow/server=default-server/https-listener=https:add(socket-binding="proxy-https", security-realm="HTTPSRealm")
At the last step I only get this:
{
"outcome" => "failed",
"failure-description" => undefined,
"rolled-back" => true
}
I already tried every solution I could find here. (running as batch etc)
Edit:
The listener config is added like this:
/socket-binding-group=standard-sockets/socket-binding=proxy-http:add(port=9080)
/socket-binding-group=standard-sockets/socket-binding=proxy-https:add(port=9443)
Have you created socket bindings for proxy-https ? The default binding is https. Try with it
/subsystem=undertow/server=default-server/https-listener=https:add(socket-binding=https, security-realm=HTTPSRealm)

Setup MariaDB XA on WildFly through UI

Similar to How to setup MariaDB JNDI on Wildfly 10? but specifically done through the Web UI.
I can create the non-XA data source with no issues but I am having issues creating the XA version.
I did the deployment of the mariadb-client.jar using the WildFly deploy UI with no issues. I can verify that the non-XA datasource works well.
However, when I do the same approach with the XA driver, when testing the connection I get the following error on the logs (not visible on the error dialog
Caused by: javax.resource.ResourceException: IJ031101: XADataSourceClass is undefined
at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:621))
When I try to configure the driver configuration manually I just get Unknown Error and the datasource does not even get created
"failure-description" => {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.MariaDBXA"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.PacXA is missing [jboss.jdbc-driver.MariaDBXA]",
"jboss.driver-demander.java:/PacXA is missing [jboss.jdbc-driver.MariaDBXA]"
]
The driver classes I am using are as noted in https://issues.jboss.org/browse/JBEAP-2405 where I put it in the screen that accepts them.
driver-class: org.mariadb.jdbc.Driver
xa-datasource-class: org.mariadb.jdbc.MariaDbDataSource (NOT org.mariadb.jdbc.MySQLDataSource)
Also when looking at the XML when selecting from JAR vs entering the configuration on screen, nothing gets populated on xa-datasource-class. I know I can edit the XML but like I said I wanted to do it through the administration console.
Refer https://issues.jboss.org/browse/JBEAP-2405 for sample configuration. Make sure you are providing correct driver name.