Running iRods Rest in Tomcat 7 - maven

I'm trying to run iRods Rest in Tomcat 7. The only problem is that when I'm in the manager page, I have the list of application. All of them runs exept iRods Rest and if I try to push "start" I get:
FAIL - Application at context path /irods-rest could not be started
This is the steps that I had follow:
Installation of Tomcat 7 (https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-7-on-ubuntu-14-04-via-apt-get)
Installation of maven 3
git clone https://github.com/DICE-UNC/irods-rest.git
cd irods-rest
mvn package -Dmaven.test.skip=true
Upload of the .war file on the manager page host:8080
Tell me if you need more informations or the question is too specific.

I was getting the same error, but then I looked at the logs contained in /var/log/tomcat/localhost.x-x-x.log (CentOS 7):
java.io.FileNotFoundException: /etc/irods-ext/irods-rest.properties (No such file or directory)
So I created the directory and properties file:
mkdir /etc/irods-ext
vi /etc/irods-ext/irods-rest.properties
And added the following contents (found template in https://github.com/DICE-UNC/irods-rest/blob/master/docs/iRODSRESTAPIDocumentation.pdf):
irods.host=localhost
irods.port=1247
irods.zone=tempZone
utilize.packing.streams=true
auth.type=STANDARD
default.storage.resource=
web.interface.url=
cors.allow=true
Now everything seems to be working after I start the irods-rest application from the Tomcat manager page.

Related

Angular Console: Can't create library

I'm trying to create a new library using v 8.1.0 of the Angular Console on Windows. The error I get is "ENOENT: no such file or directory, mkdir "c:\path\to\my\workspace\libs\new_library_name"
"c:\path\to\my\workspace\libs" exists already
new_library_name folder should be created by Angular Console
The command run by the console is ng generate #nrwl/angular:library new_library_name.
I've tried different names/paths, running as administrator, running inside VSCode and in the standalone console. No luck with anything. This used to work.
Also, if I create the folder c:\path\to\my\workspace\libs\new_library_name and then run the console again, I get an error ENOENT: no such file or directory c:\path\to\my\workspace\libs\new_library_name\ReadMe.md. Of course the ReadMe doesn't exist - it needs to be created by the console.
What am I doing wrong or where to look?
Problem solved. I had turned on Controlled Folder Access in Windows 10 and mistakenly included my project folder as a controlled folder, which prevented applications (Angular Console, Yarn, etc) from writing to the folder. Removed it from Controlled Access and all is working again.

System cannot find the path specified yiic command

Hi i have been trying last night about this error. The error comes when i am standing in a directory and i want to access a file yiic but error comes
The System cannot find the path specified
My system:
Windows 8.1 64 bit
wamp server 3.0.06 64bit
PHP version 5.6.25(used by wamp server)
Yii 1.1.19
My file strucure:
C-->wamp64-->www->yii-->framework
Problem:
I am standing in framework folder. When i type this command to create a new yii project
C:\wamp64\www\yii\framework> yiic webapp C:\wamp64\www\testapp
I get this error
The System cannot find the path specified
Things I have tried so far:
Ran cmd as administrator but same result
unlocked the yii zipped file, I have read that on some site that windows sometimes blocks .bat files in zipped file but same result
Have you tried the following?
C:\wamp64\www\yii\framework> php yiic.php webapp C:\wamp64\www\testapp
You can find more details in an official docs:
Note: When running yiic on Mac OS, Linux or Unix, you may need to
change the permission of the yiic file so that it is executable.
Alternatively, you may run the tool as follows,
% cd WebRoot %
php YiiRoot/framework/yiic.php webapp testdrive
http://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app
I just downloaded yii and there is no framework folder and I can't execute yiic

How to run Tomcat on Mac as external tool for Intellj Idea

I'm setting up my JavaEE environment with IntelliJ Idea 2016.3.5 at my Mac, Sierra. My Tomcat live at /usr/local/3th party app/appache-tomcat-8.0.36./. I'm not able to use another Tomcat, e.g. somewhere at /User folder, where I deploy the webapp.
Error running Tomcat: Cannot run program "/usr/local/app/apache-tomcat-8.0.36/" (in directory "/usr/local/app/apache-tomcat-8.0.36/bin"): error=13, Permission denied
My question:
How can I get the access to this Tomcat folder when I set the path to tool settings for IntelliJ's external tool?
You must ensure that you are able to read your tomcat directory.
Open terminal and locate your tomcat directory. Run this command:
chmod -R 777 usr/local/app/apache-tomcat-8.0.36/
That should allow you to run the tomcat server as an external tool in IntelliJ IDEA.

Maven-Wrapper in jHipster inside Docker-Container: FileNotFoundException

I installed docker inside a vm running on lubuntu 16.4. Afterwards I pulled the container jhipster/jhipster according to this tutorial. Accessing it with docker exec -it jhipster bash works fine, also the process of creating an app via yo jhipster. But when I want to run it using the maven wrapper via ./mvnw, the following error occurs (after just under a second):
Downloading https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
Exception in thread "main" java.io.FileNotFoundException: /home/jhipster/.m2/wrapper/dists/apache-maven-3.3.9-bin/2609u9g41na2l7ogackmif6fj2/apache-maven-3.3.9-bin.zip.part (No such file or directory)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:69)
at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:60)
at org.apache.maven.wrapper.Installer.createDist(Installer.java:64)
at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:121)
at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:50)
Inside the container seems to be no maven installed, but that is what the mvnw is for, right? Anyway, it's not possible to install maven on my own (inside the container) because of lacking su rights (sudo isn't found, su works "only from terminal").
I don't get what's wrong here... Can you help?
PS: The .m2-directory is empty.
I'm assuming you mapped your maven folder in the vm to the /home/jhipster/.m2 folder in the docker container, as as per the tutorial instructions. I found that if the vm did not already have maven installed, the ~/.m2 folder in the vm was created with root owner. Not sure how or why. As a result, the jhipster user in the docker container didn't have permission to write to the /home/jhipster/.m2 folder. You should be able to fix it by changing the owner of the folder (from within the vm) to the user you are using to run docker.

WSO2 Application Server wont start via jenkins post steps shell script

I am using jenkins CI to build my project. After the build I had post steps shell script copy the war to WSO2 application servers /repository/deployment/server/webapps/ folder. But what I observed was sometimes ( not always ), the server failed to redeploy the web application. Most of the times the web application would be redeployed using the new war file copied by jenkins into the webapps folder. But sometimes this did not happen. At such times the only solution was to stop the wso2as server, delete the web applications folder leaving only the new war file in wenapps directory and start the wso2as server again. This deployed the new war file and testing could proceed.
But we need to run automated selenium tests. So for the tests to run we need the new war file to be deployed reliably on every jenkins build.
So I wrote a little script in the jenkins post step like below :
#!/bin/bash
/home/kk/wso2as-5.0.1/bin/wso2server.sh stop &&
sleep 1m &&
rm -rf /home/kk/wso2as-5.0.1/repository/deployment/server/webapps/Duster_App1* &&
cp /home/kk/.jenkins/workspace/Dusters_App1/target/Duster_App1-${MAVEN_VERSION}.war /home/kk/wso2as-5.0.1/repository/deployment/server/webapps/Duster_App1.war &&
/home/kk/wso2as-5.0.1/bin/wso2server.sh start &&
echo Starting wso2as
This script runs. The wso2as server is stopped, the webapp folder is deleted, the new war file is copied corectly in place, I get the 'Starting wso2as' message on jenkins console output, BUT the wso2as server does not start. It remains in the stopped state. I introduced the sleep 1m line after the wso2server.sh stop command thinking the server may be taking time to shut down and hence fails to start again by the time the wso2server.sh start command is run. But no. The server is stopped cleanly before the start command is run as I have verified by following the log file as well as by ps aux command.
So what could be preventing the server from starting again?
IMO writing a script to delete webapp folder and restart the server from time to time would not be a good idea. I would suggest you to do following steps and then try the deployment from your jenkins build server to AppServer repository/deployment/server/webapps.
1.) Stop the server
2.) Open the [AS_HOME]/repository/conf/tomcat/catalina-server.xml config file
3.) Now make the unpackWARs attribute in Host element "false"
4.) restart the server
By default AppServer would extract the WAR file inside webapps, and it is possible that this could cause intermittent issues when deploying the same webapp again and again. Please try this way and see.
The WSO2 servers are OSGI based. The modules offer also web services for all tasks you can do in the admin console. If you start the server as ./wso2server.sh -DosgiConsole and you can list all service interaces with osgi> listAdminServices. You will find i.e. interfaces to upload WAR, CAR and AAR archives. The upload is one stateless call, but the handling of the artifact upload is a little bit tricky and you have also to deal with the self signed certificates of the WSO2 server. You can do the upload in a script language of your choice or make a simple Jenkins plugin and integrate this into your build job.
If you want comfort and don't do it yourself, use this Jenkins post-build plug-in to deploy the WAR into the WSO2 AS via the deployment web service API: https://github.com/ma-ha/Jenkins-WSO2AS-Deployer

Resources