I am trying to configure orientdb as a datasource for Wildfly9 and getting no where.
17:12:22,344 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "AccessControlDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:jboss/datasources/AccessControlDS is missing [jboss.jdbc-driver.orientdb]",
"jboss.driver-demander.java:jboss/datasources/AccessControlDS is missing [jboss.jdbc-driver.orientdb]"
]}
The orient jdbc driver (orientdb-jdbc-2.1.12-all.jar) is installed as a module in wildfly under wildfly/modules/system/layers/base/com/orientdb/main.
module.xml
<module xmlns="urn:jboss:module:1.3" name="com.orientdb">
<resources>
<resource-root path="orientdb-jdbc-2.1.12-all.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
standalone-full.xml
<subsystem xmlns="urn:jboss:domain:datasources:3.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/AccessControlDS" pool-name="AccessControlDS" enabled="true" use-java-context="true">
<connection-url>jdbc:orient:remote:orientdb/access-control</connection-url>
<driver>orientdb</driver>
<security>
<user-name>xxxx</user-name>
<password>yyyy</password>
</security>
</datasource>
</datasources>
<drivers>
<driver name="orientdb" module="com.orientdb">
<driver-class>com.orientchnologies.orient.jdbc.OrientJdbcDriver</driver-class>
<datasource-class>com.orientechnologies.orient.jdbc.OrientDataSource</datasource-class>
</driver>
</drivers>
</subsystem>
Querying the jboss console for data source returns:
/subsystem=datasources:read-resource(recursive=true)
{
"outcome" => "success",
"result" => {
"data-source" => {"AccessControlDS" => {
"allocation-retry" => undefined,
"allocation-retry-wait-millis" => undefined,
"allow-multiple-users" => false,
"background-validation" => undefined,
"background-validation-millis" => undefined,
"blocking-timeout-wait-millis" => undefined,
"capacity-decrementer-class" => undefined,
"capacity-decrementer-properties" => undefined,
"capacity-incrementer-class" => undefined,
"capacity-incrementer-properties" => undefined,
"check-valid-connection-sql" => undefined,
"connectable" => false,
"connection-listener-class" => undefined,
"connection-listener-property" => undefined,
"connection-properties" => undefined,
"connection-url" => "jdbc:orient:remote:orientdb/access-control",
"datasource-class" => undefined,
"driver-class" => undefined,
"driver-name" => "orientdb",
"enabled" => true,
"exception-sorter-class-name" => undefined,
"exception-sorter-properties" => undefined,
"flush-strategy" => undefined,
"idle-timeout-minutes" => undefined,
"initial-pool-size" => undefined,
"jndi-name" => "java:jboss/datasources/AccessControlDS",
"jta" => true,
"max-pool-size" => undefined,
"min-pool-size" => undefined,
"new-connection-sql" => undefined,
"password" => "yyyy",
"pool-prefill" => undefined,
"pool-use-strict-min" => undefined,
"prepared-statements-cache-size" => undefined,
"query-timeout" => undefined,
"reauth-plugin-class-name" => undefined,
"reauth-plugin-properties" => undefined,
"security-domain" => undefined,
"set-tx-query-timeout" => false,
"share-prepared-statements" => false,
"spy" => false,
"stale-connection-checker-class-name" => undefined,
"stale-connection-checker-properties" => undefined,
"statistics-enabled" => false,
"track-statements" => "NOWARN",
"tracking" => false,
"transaction-isolation" => undefined,
"url-delimiter" => undefined,
"url-selector-strategy-class-name" => undefined,
"use-ccm" => true,
"use-fast-fail" => false,
"use-java-context" => true,
"use-try-lock" => undefined,
"user-name" => "xxxx",
"valid-connection-checker-class-name" => undefined,
"valid-connection-checker-properties" => undefined,
"validate-on-match" => undefined
}},
"jdbc-driver" => {"orientdb" => {
"deployment-name" => undefined,
"driver-class-name" => "com.orientchnologies.orient.jdbc.OrientJdbcDriver",
"driver-datasource-class-name" => "com.orientechnologies.orient.jdbc.OrientDataSource",
"driver-major-version" => undefined,
"driver-minor-version" => undefined,
"driver-module-name" => "com.orientdb",
"driver-name" => "orientdb",
"driver-xa-datasource-class-name" => undefined,
"jdbc-compliant" => undefined,
"module-slot" => undefined,
"profile" => undefined,
"xa-datasource-class" => undefined
}},
"xa-data-source" => undefined
}
}
As an alternative, try using the resource adapter "orient-rar-0.3.0.rar" in WildFly8.2.0.Final. https://ops4j1.jira.com/wiki/display/ORIENT/JCA+Resource+Adapter
Related
I have created the Product's custom attributes programmatically(Setup->Installdata.php).
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'serial_code_use_customer',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Issue By Customer Group',
'input' => 'boolean',
'class' => '',
'source' => \Magento\Eav\Model\Entity\Attribute\Source\Boolean::class,
'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => '0',
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_in_product_listing' => false,
'unique' => false,
'apply_to' => 'simple,configurable,virtual,bundle,downloadable',
'group' => self::GROUP_LABEL,
'sort_order' => 3,
'note' => 'Enable automatic issuing of codes based on customer group.'
]
);
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'serial_code_customer_groups',
[
'type' => 'varchar',
'backend' => '',
'frontend' => '',
'label' => 'Select Customer Groups',
'input' => 'multiselect',
'class' => '',
'source' => \Magento\Customer\Model\Customer\Attribute\Source\Group::class,
'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => '0',
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_in_product_listing' => false,
'unique' => false,
'apply_to' => 'simple,configurable,virtual,bundle,downloadable',
'group' => self::GROUP_LABEL,
'sort_order' => 4,
'note' => 'Customers in selected groups will be issued codes automatically when product is ordered.'
]
);
I want to Hide or Show a Custom attribute based on other custom attributes in the Product detail/edit page from Adminpanel Magento 2.4.x?
For example, there is a toggle on click (yes/no) the Customer Groups will be Hide / Show.
To hide custom product attributes from the admin product detail page you need to create UpgradeData.php in the My/Catalog/Setup directory.
Code:
$eavSetup->updateAttribute(Product::ENTITY, $attrCode, 'is_visible',
'0');
What i am trying to do is to connect mongodb atlas with my codeigniter framework.
I have used this library for mongodb
https://github.com/verkhoumov/codeigniter-mongodb-library
Below is my connection code
$config['mongo_db']['default'] = [
'settings' => [
'auth' => TRUE,
'debug' => TRUE,
'return_as' => 'array',
'auto_reset_query' => TRUE
],
'connection_string' => '',
'connection' => [
'host' => 'host link',
'port' => '27017',
'user_name' => 'username',
'user_password' => 'password',
'db_name' => 'dbname',
'db_options' => []
],
'driver' => []
];
The main problem is mongodb atlas doesnt provide you the port its query string is like mongodb+srv not mongodb:27017
MongoDb Atlas provides a connection string.
You can find it under Clusters -> Connect Your Application -> Copy a connection string.
Make sure to change "test" with your database name.
Then set it in 'connection_string' in your config file. Other parameters keep default.
$config['mongo_db']['default'] = [
'settings' => [
'auth' => TRUE,
'debug' => TRUE,
'return_as' => 'array',
'auto_reset_query' => TRUE
],
'connection_string' => 'mongodb://************#cluster0-shard-00-00-5ehze.gcp.mongodb.net:27017,cluster0-shard-00-01-5ehze.gcp.mongodb.net:27017,cluster0-shard-00-02-5ehze.gcp.mongodb.net:27017/test?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true',
'connection' => [
'host' => '',
'port' => '',
'user_name' => '',
'user_password' => '',
'db_name' => '',
'db_options' => []
],
'driver' => []
];
Its my first time use compose.io as my mongodb hosting.
I was trying to configure compose.io mongodb with Laravel but ended up this error:
ConnectionTimeoutException in Collection.php line 432:
No suitable servers found (`serverSelectionTryOnce` set)
I was using https://github.com/jenssegers/laravel-mongodb package to add mongodb support to Laravel.
My mongodb config:
'mongodb' => [
'driver' => 'mongodb',
'host' => ['aws-us-east-1-portal.25.dblayer.com:20020/admin', 'aws-us-east-1-portal.26.dblayer.com:20020/admin'],
'port' => env('MONGO_DB_PORT', 27017),
'database' => env('MONGO_DB_DATABASE'),
'username' => env('MONGO_DB_USERNAME'),
'password' => env('MONGO_DB_PASSWORD'),
'options' => [
'ssl' => true,
'database' => 'admin', // sets the authentication database required by mongo 3
'replicaSet' => 'set-5939226a8aab5300121d0ef2',
'readPreference' => 'primary',
],
'driver_options' => [
'context' => stream_context_create( [
'ssl' => [
'local_cert' => base_path('mongo.pem'),
'cafile' => base_path('mongo.pem'),
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
'verify_expiry' => false,
'allow_invalid_certificates' => true
]
])
]
]
I am not also sure what is the value for MONGO_REPLICA_SET
Anyone experienced something similar?
Thanks
It works by removing replicaSet option
Final configuration:
'mongodb' => [
'driver' => 'mongodb',
'host' => ['aws-us-east-1-portal.25.dblayer.com', 'aws-us-east-1-portal.26.dblayer.com'],
'port' => env('MONGO_DB_PORT', 27017),
'database' => env('MONGO_DB_DATABASE'),
'username' => env('MONGO_DB_USERNAME'),
'password' => env('MONGO_DB_PASSWORD'),
'options' => [
'ssl' => true,
'database' => env('MONGO_DB_DATABASE'), // sets the authentication database required by mongo 3
],
'driver_options' => [
'context' => stream_context_create( [
'ssl' => [
'cafile' => base_path('mongo.pem'),
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
'verify_expiry' => false,
]
])
]
]
I've tried to add Postgres as datasource in Wildfly but keep on getting the JDBC connection error as follow :
Failed to create JDBC connection.
An internal error occurred. Details Unexpected HTTP response: 500
Request {
"name" => "PostgresDS",
"enabled" => true,
"jndi-name" => "java:/PostgresDS",
"user-name" => "admin",
"password" => "123",
"pool-name" => "PostgresDS_Pool",
"use-ccm" => false,
"jta" => false,
"connection-url" => "jdbc:postgresql://localhost:5432/postgresdb",
"driver-class" => "org.postgresql.Driver",
"driver-name" => "postgresql-9.4.1208.jar",
"valid-connection-checker-class-name" => "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker",
"background-validation" => true,
"exception-sorter-class-name" => "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter",
"operation" => "add",
"address" => [
("subsystem" => "datasources"),
("data-source" => "PostgresDS")
] }
Response
Internal Server Error {
"outcome" => "failed",
"failure-description" => "WFLYCTL0212: Duplicate resource [
(\"subsystem\" => \"datasources\"),
(\"data-source\" => \"PostgresDS\") ]",
"rolled-back" => true }
I have jboss in domain mode.
I am not able to assign the deployed war file to the main-server-cgroup.
i am getting following error.
I am able to assign it to other-server-group.
Failed to add Deployment middleware.war
Unexpected HTTP response: 500
Request
{
"operation" => "composite",enter code here
"address" => [],
"steps" => [
{
"address" => [
("server-group" => "main-server-cgroup"),
("deployment" => "middleware.war")
],
"operation" => "add"
},
{
"address" => [
("server-group" => "main-server-cgroup"),
("deployment" => "middleware.war")
],
"operation" => "deploy"
}
]
}
Response
Internal Server Error
{
"outcome" => "failed",
"result" => {
"step-1" => {"outcome" => "success"},
"step-2" => {"outcome" => "success"}
},
"failure-description" => "JBAS010839: Operation failed or was rolled back on all servers.",
"rolled-back" => true,
"server-groups" => {"main-server-cgroup" => {"host" => {"master" => {"server-1" => {"response" => {
"outcome" => "failed",
"result" => {
"step-1" => {
"outcome" => "failed",
"rolled-back" => true
},
"step-2" => {
"outcome" => "failed",
"failure-description" => {
"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./middleware" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./middleware: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"},
"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => ["jboss.deployment.unit.\"middleware.war\".deploymentCompleteService"],
"Services that may be the cause:" => ["jboss.binding.modcluster"]
}
},
"rolled-back" => true
}
},
"failure-description" => {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {
"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./middleware" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./middleware: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"},
"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => ["jboss.deployment.unit.\"middleware.war\".deploymentCompleteService"],
"Services that may be the cause:" => ["jboss.binding.modcluster"]
}
}}},
"rolled-back" => true
}}}}}}
}