I just got started with SBT.
To add a custom action, I made a following task and add that .scala file to 'project' folder as SBT wiki guides.
//MyProject.scala
import sbt._
class HelloWorldProject(info: ProjectInfo) extends DefaultProject(info)
{
lazy val hi = task { println("Hello World"); None }
}
after adding the scala src file for configuration, layout of the project folder look like this.
/development/scala/SomeScalaProject/
|~lib/
|~project/
| |~boot/
| | |~scala-2.7.7/
| | | |~lib/
| | | | |-scala-compiler.jar [RO]
| | | | `-scala-library.jar [RO]
| | | `~org.scala-tools.sbt/
| | | `~sbt/
| | | `+0.7.4/
| | |~scala-2.8.1/
| | | `~lib/
| | | |-scala-compiler.jar [RO]
| | | `-scala-library.jar [RO]
| | `-sbt.boot.lock
| |-build.properties
| |
| `-MyProject.scala //here
|
|+src/
But even after 'reload' or 'update', running the hi task in SBT is not available at all. what am i missing?
D:\development\scala\SBEStudy>java -Xmx512M -jar "D:\development\.common\sbt-la
nch-0.7.4.jar" update
[info] Building project SomeScalaProject 1.0 against Scala 2.8.1
[info] using sbt.DefaultProject with sbt 0.7.4 and Scala 2.7.7
[info]
[info] == update ==
[warn] No dependency configuration found, using defaults.
[info] :: retrieving :: nephilim.practice#scalabyexample_2.8.1 [sync]
[info] confs: [default]
[info] 0 artifacts copied, 0 already retrieved (0kB/391ms)
[info] == update ==
[success] Successful.
[info]
[info] Total time: 1 s, completed 2010. 12. 8 오후 7:14:39
[info]
[info] Total session time: 2 s, completed 2010. 12. 8 오후 7:14:39
[success] Build completed successfully.
> reload
[info] Building project SomeScalaProject 1.0 against Scala 2.8.1
[info] using sbt.DefaultProject with sbt 0.7.4 and Scala 2.7.7
> hi
[error] No action named 'hi' exists.
[info] Execute 'help' for a list of commands or 'actions' for a list of availab
e project actions and methods.
It was my mistake. :(
"MyProject.scala" should be located under /project/build directory instead of /project directory.
Related
I am newbie with drupal. My Drupal 9.4.3 sit dev.xyz.in created with composer is ready for deployment. I have a linux based shared hosting plan.
My Local web development environment/IDE is :
OS Ubuntu 18.04LTS
php 7.4.3
mariaDB 15.1
local server nginx
My website directory structure – var/www/dev.xyz.in
dev.xyz.in
| - config
| | - sync
| | | - .htaccess
| - drush
| | - Commands
| | - sites
| | - drush.yml
| | - README.md
| - scripts
| | - composer
| - vendor
| | - composer
| | - drush
| | - bin
| | - twig
| | - symphony
| | - …. more
| - web
| | - core
| | - modules
| | | - contrib
| | | - ds
| | - profiles
| | - sites
| | | - default
| | | - default.services.yml
| | | - default.settings.php
| | | - settings.local.php
| | | - settings.php
| | - themes
| | | - contrib
| | | - custom
| | - update.php
| | - .htaccess
| | - …. more
| - .github
| - composer.json
| - composer.lock
| - load.environment.php
| - phpunit.xml.dist
| - README.md
| - .editorconfog
| - .env.example
| - gitattributes
| - .gitignore
I have changed some settings locally on settings.php as given below:
if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
include $app_root . '/' . $site_path . '/settings.local.php';
}
and
$settings['trusted_host_patterns'] = [
'^localhost',
];
I have changed some settings locally on settings.local.php as given below:
$settings['rebuild_access'] = TRUE;
changed it to
$settings['rebuild_access'] = FALSE;
How can I deploy my website to linux based shared hosting using ftp (filezilla) and what necessary change will taken before deployment of local website? please help me!
I have a question about dependencies between roles in a collection.
In general, I am concerned if it is possible to define dependencies between roles in a collection - local dependencies like a relative path.
I would like to implement scenarios:
roleB depends on roleA
default scenario of roleC should use roleA in prepare.yml to set up the environment
or
default scenario of roleC should use roleA in converge.yml
I would like to get these dependencies as local dependencies.
For case 2, I tried to use the requriments.yml file
with the appropriate entry in molecule.yml
---
dependency:
name: galaxy
driver:
name: docker
platforms:
.. ...
provisioner:
name: ansible
# env:
# ANSIBLE_ROLES_PATH: "../../roles"
playbooks:
prepare: prepare.yml
config_options:
defaults:
remote_user: ansible
dependency:
name: galaxy
options:
ignore-certs: True
ignore-errors: True
requirements-file: requirements.yml
verifier:
name: ansible
But unfortunately I can't solve the error:
ERROR [1m[0;34mUsing /etc/ansible/ansible.cfg as config file[1m[0m
Starting galaxy role install process
- downloading role from file://../../tool-box
[1m[0;31m [ERROR]: failed to download the file: <urlopen error [Errno 2] No such file or[1m[0m
[1m[0;31mdirectory: '/../tool-box'>[1m[0m
[1m[1;35m[WARNING]: - tool-box was NOT installed successfully.[1m[0m
[1m[0;31mERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.[1m[0m
Structure of collection with roles:
mynamespace
|
|-- mycollection
|
| --roles
|
| -- roleA --
| |--molecule
| |
| |--default
|
| -- roleB --
| |--molecule
| |
| |--default
|
| -- roleC --
| |--molecule
| |
| |--default
Thank you.
Update:
See request issue in ansible/galaxy:
https://github.com/ansible/galaxy/issues/2719
I added this because I don't think there is such functionality.
I am getting error while executing OpenStack simple mistral workflow on OpenStack(wallaby) devstack environment. While I can execute the workflow from CLI command and got success But it fails if I try the same thing with GUI
root#openstack:~# openstack workflow definition show test_get
---
version: '2.0'
test_get:
description: Test Get.
tasks:
my_task:
action: std.http
input:
url: http://www.google.com
root#openstack:~# openstack workflow execution create test_get
+--------------------+--------------------------------------+
| Field | Value |
+--------------------+--------------------------------------+
| ID | 482e3803-45ef-411e-a0f4-1427abfc8649 |
| Workflow ID | 9dc0d4a4-8c5b-4288-8126-e1147da3bd02 |
| Workflow name | test_get |
| Workflow namespace | |
| Description | |
| Task Execution ID | <none> |
| Root Execution ID | <none> |
| State | RUNNING |
| State info | None |
| Created at | 2021-06-21 16:58:54 |
| Updated at | 2021-06-21 16:58:54 |
| Duration | ... |
+--------------------+--------------------------------------+
But while executing in GUI I get **
Execution is missing field "workflow_identifier"
**
Faced the same issue in Yoga release. Spent a few hours to investigate it and found interesting thing:
/usr/local/lib/python3.8/dist-packages/mistralclient/api/v2/executions.py
class ExecutionManager(base.ResourceManager):
resource_class = Execution
def create(self, wf_identifier='', namespace='',
workflow_input=None, description='', source_execution_id=None,
**params):
self._ensure_not_empty(
workflow_identifier=wf_identifier or source_execution_id
)
But! in the webform we are using workflow_identifier instead of wf_identifier
/usr/local/lib/python3.8/dist-packages/mistraldashboard/workflows/forms.py
def handle(self, request, data):
try:
data['workflow_identifier'] = data.pop('workflow_name')
data['workflow_input'] = {}
for param in self.workflow_parameters:
value = data.pop(param)
if value == "":
value = None
data['workflow_input'][param] = value
ex = api.execution_create(request, **data)
FIX is to rename workflow_identifier to wf_identifier in the form like
data['wf_identifier'] = data.pop('workflow_name')
After that mistral-dashboard works fine with execution creating.
I'm trying to create authentication mechanism on WSO2 IS and I have a trouble as following :
- I implemented to remote_user as the below link and the result is OK. I can login and access WSO API from console
https://svn.wso2.org/repos/wso2/people/asela/user-mgt/remote-user-api/4.2.X/
But When I tried on webpage , I can't authenticate to WSO IS. the following is my code for this :
public void init() throws AxisFault{
userName = HDConstants.USER_NAME;
password = HDConstants.PASSWORD;
backEndServerURL = HDConstants.SERVER_URL;
setKeyStore();
configCtx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
}
public void setKeyStore() {
System.setProperty("javax.net.ssl.trustStore", HDConstants.TRUST_STORE_PATH);
System.setProperty("javax.net.ssl.trustStorePassword", HDConstants.TRUST_STORE_PASSWORD);
System.setProperty("javax.net.ssl.trustStoreType", HDConstants.TRUST_STORE_TYPE);
}
public boolean authenticateUser(String userName, String password) throws Exception {
String serviceURL = null;
ServiceClient client = null;
Options option = null;
boolean isAuthenticated = false;
AuthenticationAdminStub authStub = null;
serviceURL = backEndServerURL + "AuthenticationAdmin";
authStub = new AuthenticationAdminStub(configCtx, serviceURL);
client = authStub._getServiceClient();
option = client.getOptions();
option.setManageSession(true);
option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, authCookie);
isAuthenticated = authStub.login(userName, password, HDConstants.APP_ID);
authCookie = (String) authStub._getServiceClient().getServiceContext()
.getProperty(HTTPConstants.COOKIE_STRING);
System.out.println(" Auth Cookie ==== " + authCookie);
return isAuthenticated;
}
`
and the in the controller I used below code to call authenticate method:
AuthenticationServiceClient authenticationServiceClient = new AuthenticationServiceClient();
authenticationServiceClient.init();
authenticationServiceClient.authenticateUser("admin", "admin");
But the result is not good. The system inform that :
at org.apache.axis2.deployment.AxisConfigBuilder.processTransportSenders(AxisConfigBuilder.java:688)
at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:124)
at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:887)
at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:116)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:210)
at com.home.hduser.wsois.AuthenticationServiceClient.init(AuthenticationServiceClient.java:29)
I don't know why I can authenticate on console but can't on webapp
and the full trace error attached in the file below :
https://drive.google.com/open?id=0B9zEqmu0HBunSlp3X0dpWC1YU0E
I appreciate your help in this case.
Thanks
Just change this dependency in pom.xml file, set provided scope:
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<artifactId>org.wso2.carbon.um.ws.api</artifactId>
<version>${carbon.identity.version}</version>
<scope>provided</scope>
</dependency>
To remove the tomcat dependencies:
[INFO] +- org.wso2.carbon.identity:org.wso2.carbon.um.ws.api:jar:4.5.4:provided
[INFO] | +- org.wso2.carbon:org.wso2.carbon.user.core:jar:4.4.1:provided
[INFO] | | +- org.wso2.carbon:javax.cache.wso2:jar:4.4.1:provided
[INFO] | | | \- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1:provided
[INFO] | | +- commons-dbcp.wso2:commons-dbcp:jar:1.4.0.wso2v1:provided
[INFO] | | +- org.apache.tomcat.wso2:jdbc-pool:jar:7.0.34.wso2v2:provided
[INFO] | | | \- org.apache.tomcat:tomcat-jdbc:jar:7.0.47:provided
[INFO] | | \- commons-collections.wso2:commons-collections:jar:3.2.0.wso2v1:provided
[INFO] | +- org.wso2.carbon.identity:org.wso2.carbon.user.mgt.common:jar:4.5.4:provided
[INFO] | +- org.wso2.carbon:org.wso2.carbon.core:jar:4.4.1:provided
[INFO] | | +- org.wso2.orbit.com.hazelcast:hazelcast:jar:3.5.0.wso2v1:provided
[INFO] | | | \- com.hazelcast:hazelcast-all:jar:3.5:provided
[INFO] | | | +- com.eclipsesource.minimal-json:minimal-json:jar:0.9.2:provided
[INFO] | | | \- org.freemarker:freemarker:jar:2.3.22:provided
[INFO] | | +- org.eclipse.equinox:org.eclipse.equinox.http.helper:jar:1.1.0.wso2v1:provided
[INFO] | | \- org.apache.tomcat:tomcat-catalina-ha:jar:7.0.59:provided
[INFO] | | +- org.apache.tomcat:tomcat-juli:jar:7.0.59:provided
[INFO] | | +- org.apache.tomcat:tomcat-tribes:jar:7.0.59:provided
[INFO] | | +- org.apache.tomcat:tomcat-catalina:jar:7.0.59:provided
[INFO] | | | +- org.apache.tomcat:tomcat-annotations-api:jar:7.0.59:provided
[INFO] | | | \- org.apache.tomcat:tomcat-api:jar:7.0.59:provided
[INFO] | | \- org.apache.tomcat:tomcat-util:jar:7.0.59:provided
[INFO] | +- org.wso2.carbon:org.wso2.carbon.authenticator.proxy:jar:4.4.1:provided
[INFO] | | \- org.wso2.carbon:org.wso2.carbon.core.common:jar:4.4.1:provided
[INFO] | +- org.wso2.carbon:org.wso2.carbon.registry.core:jar:4.4.1:provided
[INFO] | | +- commons-io.wso2:commons-io:jar:2.0.0.wso2v2:provided
[INFO] | | +- net.sourceforge.findbugs:annotations:jar:1.3.2:provided
[INFO] | | +- org.wso2.carbon:org.wso2.carbon.registry.xboot:jar:4.4.1:provided
[INFO] | | +- org.compass-project.wso2:compass:jar:2.0.1.wso2v2:provided
[INFO] | | +- org.apache.abdera.wso2:abdera:jar:1.0.0.wso2v3:provided
[INFO] | | +- org.apache.poi.wso2:poi-scratchpad:jar:3.9.0.wso2v1:provided
[INFO] | | | \- org.apache.poi:poi-scratchpad:jar:3.9:provided
[INFO] | | | \- org.apache.poi:poi:jar:3.9:provided
[INFO] | | \- commons-pool.wso2:commons-pool:jar:1.5.6.wso2v1:provided
[INFO] | | \- commons-pool:commons-pool:jar:1.5.6:provided
[INFO] | \- org.wso2.carbon.identity:org.wso2.carbon.um.ws.api.stub:jar:4.5.4:provided
EDIT: I had to set IS_HOME path absolute.
EDIT 2: To use relative path:
This method return the path to the wso2carbon.jks file:
public String setKeyStorePath(){
String path = System.getProperty("carbon.home") + File.separator +
"repository" + File.separator + "resources" +
File.separator + "security" +
File.separator + "wso2carbon.jks";
System.out.println("wso2carbon.jks path: " + path);
return path;
}
Modify the setKeyStore to use setKeyStorePath()
public void setKeyStore() {
System.setProperty("javax.net.ssl.trustStore", setKeyStorePath());
System.setProperty("javax.net.ssl.trustStorePassword", HDConstants.TRUST_STORE_PASSWORD);
System.setProperty("javax.net.ssl.trustStoreType", HDConstants.TRUST_STORE_TYPE);
}
I assume you're deploying your webapp in IS itself. I can see a lot of jars are packed in your war file. Most of them are already available in IS server.
Above error can happen due to dependency conflicts. See this for more information.
To get rid of the error, you can try setting <scope>provided</scope> to dependencies which are already available in the server.
I am trying to apply an outOfOrder migration using maven on a "production support" branch (i.e. V3.1). The 3.1 branch has 12 migrations 3.1.0.1 through 3.1.0.12. The first 11 have been applied and in my development environment I have two migrations from the next release 3.3 already applied. the info looks like this:
+----------------+----------------------------+---------------------+---------+
| Version | Description | Installed on | State |
+----------------+----------------------------+---------------------+---------+
| 1 | > | 2013-08-16 16:35:22 | Success |
| 3.1.0.1 | CCI DDL | 2013-08-16 16:41:04 | Success |
| 3.1.0.2 | Update 1 | 2013-08-19 12:17:43 | Success |
| 3.1.0.3 | Add SVT ITEM HISTORY | 2013-08-21 16:24:28 | Success |
| 3.1.0.4 | Drop Col Event Key From ED | 2013-08-27 14:15:36 | Success |
| 3.1.0.5 | Add Job Begin Time COL | 2013-10-10 14:59:14 | Success |
| 3.1.0.6 | Update SVT Column Lengths | 2013-10-23 10:25:33 | Success |
| 3.1.0.7 | Add Seq Number to EDC ECRF | 2013-12-03 14:59:31 | Success |
| 3.1.0.8 | Set EDC ECRF ITEM Seq Numb | 2013-12-03 15:27:08 | Success |
| 3.1.0.9 | Add Table EDC USV FORM | 2013-12-03 15:37:47 | Success |
| 3.1.0.10 | Add Table SVT USV FORM MAP | 2013-12-03 15:52:24 | Success |
| 3.1.0.11 | Add Tables SUBJECT VISIT Q | 2014-04-29 17:09:13 | OutOrde |
| 3.1.0.12 | Add Table BOGUS ERIC TEST | | Ignored |
| 3.3.0.1 | Insert iMedidata CRS Info | 2014-04-24 10:50:38 | Future |
| 3.3.0.2 | Insert Study OBJECT TYPE | 2014-04-24 11:14:37 | Future |
+----------------+----------------------------+---------------------+---------+
I run the following command in my mvn build output folder in the V3.1 branch:
mvn flyway:migrate -Dflyway.outOfOrder=true -P
and I get the following output:
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:3.0:migrate (default-cli) on project mdmws: org.flywaydb.core.api.FlywayException: Validate failed. Found differences between applied migrations and available migrations: Detected applied migration missing on the classpath: 3.3.0.1 -> [Help 1]
It seems to want to find the 3.3 migrations that have already been applied to the database in the same classpath target/db/migrations folder, but of course these files exist in a later release branch. Either I am missing some configuration setting or I do not understand the way the outOfOrder works. I do not want to pull these files back from the V3.3 branch to the V3.1 branch.
Can somebody please help explain?
My pom inherits the following from a parent pom and most of the configuration values are passed in from the profile:
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<driver>${flyway.driver}</driver>
<url>${flyway.url}</url>
<user>${flyway.user}</user>
<password>${flyway.password}</password>
<outOfOrder>${flyway.outOfOrder}</outOfOrder>
</configuration>
<dependencies>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
</dependencies>
</plugin>
Set validateOnMigrate to false and you should be OK. By default it will check whether the resolved and the applied migrations match. In your specific situation this won't work, so you have to disable it.
That's my solution. I configured flyway in Java code. Yes, I set validateOnMigrate - false.
#Bean(name = "flyway")
#Lazy(false)
public Flyway buildConfiguredFlyway() {
Flyway flyway = configure();
if (!validate(flyway)) {
migrate(flyway);
}
return flyway;
}
private Flyway configure() {
Flyway flyway = new Flyway();
flyway.setDataSource(datasource);
flyway.setBaselineOnMigrate(true);//Create meta-data table if it did not exist.
flyway.setValidateOnMigrate(false);
return flyway;
}
private boolean validate(Flyway flyway) {
try {
flyway.validate();
return true;
} catch (FlywayException o) {
return false;
}
}
private void migrate(Flyway flyway) {
try {
int result = flyway.migrate();
LOGGER.info("Number of DB mirgations successfully applied: " + result);
} catch (FlywayException e) {
LOGGER.error(e.getMessage(), e);
((ConfigurableApplicationContext) applicationContext).stop();
}
}