ALIADA / aliada-tool

Aliada tool implementation
GNU General Public License v3.0
35 stars 14 forks source link

Docker / Vagrant VM #123

Open agazzarini opened 9 years ago

agazzarini commented 9 years ago

As outcome of the last meeting we decided to produce such artifact (a VM) for allowing users to have a quick and rapid taste of ALIADA.

@carba: please follow the instructions that you can find in the Wiki and, in case of troubles, first, you should report that here. If we agree that the trouble is an error in the documentation, we will open a separate issue for fixing that.

AG

idoiamurua commented 9 years ago

@carba I do not know if you have already started the VM generation, if not, do not follow reading this message.

I have updated two things today:

carba commented 9 years ago

Hi Idoia, don't worry I am creating the environment locally, I haven't yet installed the part that you have changed.

idoiamurua commented 9 years ago

OK Corrado

De: carba [mailto:notifications@github.com] Enviado el: viernes, 23 de octubre de 2015 12:20 Para: ALIADA/aliada-tool CC: Murua Belacortu, Idoia Asunto: Re: [aliada-tool] Docker / Vagrant VM (#123)

Hi Idoia, don't worry I am creating the environment locally, I haven't yet installed the part that you have changed.

— Reply to this email directly or view it on GitHubhttps://github.com/ALIADA/aliada-tool/issues/123#issuecomment-150536552.

carba commented 9 years ago

Hi Idoia into the istallation guide..... Step 4: Create database tables When I try to load the first sql into virtuoso, I receive the follow message: /usr/local/virtuoso-opensource/bin/isql localhost:1111 dba dba 00-aliada-admin.sql; Connected to OpenLink Virtuoso Driver: 07.20.3214 OpenLink Virtuoso ODBC Driver

/usr/local/virtuoso-opensource/bin/isql: *\ The statement has grown too long on lines 4 - 3412. Already 234400 bytes read without encountering a semicolon or ampersand in the end of line! Goodbye!

Can you help me?

idoiamurua commented 9 years ago

Hi Corrado,

You are trying to create the MySQL tables inside Virtuoso ¿? Those scripts "*.sql" mentioned in Step 4 are MySQL tables. You should have a MySQL DB already installed and then connect to it with a admin user and load those scripts files the following way mysql -u adminusername -p < 00-aliada-admin.sql

Then it will ask you for the admin user password.

carba commented 9 years ago

With the correct mysql-syntax I receive the follow error: mysql -u root -p < 00-aliada-admin.sql Enter password: ERROR 1064 (42000) at line 4: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<!DOCTYPE html>

idoiamurua commented 9 years ago

I wonder if the 00-aliada-admin.sql file you have downloaded is correct. Check the value inside your file and the value of the file when connecting to the following UR

https://github.com/ALIADA/aliada-tool/blob/master/aliada/src/site/database/00-aliada-admin.sql

Do they have the same content? How have you downloaded those files?

carba commented 9 years ago

When I download the files sql, the browser download them in html format (I don't know why). Anyway now the loading script sql works properly. Another question: Where I can find the war user interface? Because in the installation manual there is a dead-link

idoiamurua commented 9 years ago

To download code from https://github.com/ALIADA/aliada-tool, git tool must be installed in your PC and download using it. It cannot be downloaded directly from the Web page, because they are simple HTML pages. Another option is to download 2.1 release at https://github.com/ALIADA/aliada-tool/releases/tag/2.1 , which contains all the code of aliada-tool in compressed format, including the DB script files.

You are right, the link for the WAR file is not correct. There is no generated WAR file in Github, it must be generated instead from the source code which is at the following two places:

mvn clean install
  • https://github.com/ALIADA/aliada-tool : you can download the code using git commands and then generate the WAR files using maven commands. These are the commands off git and maven you would need to execute:
## Remove code
rm -Rf /home/aliada/project_code_clone
## Get code from github
git clone https://github.com/ALIADA/aliada-tool /home/aliada/project_code_clone  
## Compile code
cd /home/aliada/project_code_clone/aliada
mvn clean install 
## Clean old wars from tomcat
rm -Rf /usr/share/tomcat/webapps/ali*.war
## Wait until undeploy wars
sleep 30
## Remove old stuff from webapps
rm -Rf /usr/share/tomcat/webapps/aliada*
## Copy wars to Tomcat webapps
find /home/aliada/project_code_clone/aliada/ -name '*.war' | xargs -i cp {} /usr/share/tomcat/webapps/

Choose the option more convenient to you from the above two mentioned options.

xmolero commented 9 years ago

Hi @carba ,

Have you finished the VM?

carba commented 9 years ago

Hi @xmolero yes, I finished the vm

idoiamurua commented 9 years ago

@agazzarini , @carba

Could you please add in the section of the Installation Guide of the wiki of Github (https://github.com/ALIADA/aliada-tool/wiki/Installation_Guide) the new option of installing aliada-tool and a link where the VM can be dowloaded from?

This new option of installation should be informed somewhere in Github. Shouldn´t it? or Am I wrong?

carba commented 9 years ago

Hi @idoiamurua, I created a docker-vm (docker-container) and not a docker-file. I need to create a docker-vm with docker-files to be shared on Git-Hub. Now I'm putting Aliada-docker-conteiner in a ftp space (about 2 Gb), and then I have to recreate the vm docker as required, including the install manual step by step.just the vm Aliada ftp is available share the resource on this bug

agazzarini commented 9 years ago

@carba I believe this option should be documented somewhere in the Wiki [1]. You should already have the edit permission, in case ask to @idoiamurua

Andrea

[1] https://github.com/ALIADA/aliada-tool/wiki/Installation_Guide

2015-11-10 16:20 GMT+01:00 carba notifications@github.com:

Hi @idoiamurua https://github.com/idoiamurua, I created a docker-vm (docker-container) and not a docker-file. I need to create a docker-vm with docker-files to be shared on Git-Hub. Now I'm putting Aliada-docker-conteiner in a ftp space (about 2 Gb), and then I have to recreate the vm docker as required, including the install manual step by step.just the vm Aliada ftp is available share the resource on this bug

— Reply to this email directly or view it on GitHub https://github.com/ALIADA/aliada-tool/issues/123#issuecomment-155449437.

carba commented 9 years ago

Hi @agazzarini and @idoiamurua waiting for the install docker-files, I put the docker vm with aliada in a space accessible through the following link ftp: address: ftp.atcult.it auth: aliada / aliada01 port: 21

agazzarini commented 9 years ago

@carba please update the wiki. As a side note, the link should be public

carba commented 9 years ago

Hi @idoiamurua, below the dockerfile for Aliada. Whereas I haven't experience with the use of Aliada, can you test aliada dockerized like a normal user and tell me if it works properly?

carba commented 9 years ago

I put the dockerfile in this path: aliada-tool/aliada/src/site/DockerFile

idoiamurua commented 9 years ago

Hi @carba I have no experience with Docker. What am I supposed to do with that file? Where do I have to place it?

osma commented 9 years ago

I'm also very interested in trying this out and can help test it. I heard about the Docker image last week at the SWIB15 conference, where Cristina Gareta presented ALIADA.

But I'm also new to Docker (though I've used other virtualization environments - VirtualBox, KVM, Xen, QEMU...) and I can't figure out what to do with the DockerFile. I also downloaded the 2GB file from the FTP server mentioned above, but I don't know what to do with it. Some documentation would be nice!

carba commented 9 years ago

Hi @osma and @idoiamurua, our objective is to test Aliada dockerized. The docker-file I posted, allows after you download and install docker server, to download and use/play Aliada dockerized for use/test it. If you are not skilled for docker, I write a mini tutorial step by step, to install docker server and download Aliada-dockerized. So you can test as any user, aliada tell me if Aliada has been installed correctly. Are you agree?

idoiamurua commented 9 years ago

Yes. It would be nice to have a mini-tutorial.

osma commented 9 years ago

A step-by-step mini-tutorial sounds excellent!

agazzarini commented 9 years ago

+1 for the tutorial. @osma many thanks for your help

osma commented 8 years ago

Hi, I decided not to wait for the tutorial and tried running this myself, while trying to learn Docker at the same time, mainly from the Docker tutorial for Linux systems. I started with my Ubuntu 12.04 LTS system and first installed the latest version of Docker using the official Ubuntu install docs.

Then (after succesfully running the Docker hello-world image) I tried the command

sudo docker run corrado/aliada

That downloaded the corrado/aliada image from Docker Hub which took a while, but actually running it didn't produce any output, it just exited immediately.

I decided that I needed to use the DockerFile as well to actually start Aliada, from the aliada github repository, so I downloaded that as well. The filename didn't match what Docker expects (it has to be "Dockerfile"), so I renamed it. Finally I was able to build and run the image, but it failed with an error message. Apparently the start_aliada.sh script doesn't exist in the image, at least not at the path where the Dockerfile expects it to be.

~/proj/aliada-docker$ wget https://github.com/ALIADA/aliada-tool/raw/master/aliada/src/site/DockerFile
~/proj/aliada-docker$ mv DockerFile Dockerfile
~/proj/aliada-docker$ sudo docker build -t docker-aliada .
Sending build context to Docker daemon 3.072 kB
Step 1 : FROM corrado/aliada
 ---> 4dbdcb410b35
Step 2 : RUN echo "LC_CTYPE="en_US.UTF-8"" >> /etc/sysconfig/i18n
 ---> Running in 772813bb34db
 ---> 9c20ef29e37a
Removing intermediate container 772813bb34db
Step 3 : RUN cd /script && ./start_aliada.sh
 ---> Running in 2f2e996aeca6
/bin/sh: ./start_aliada.sh: No such file or directory
The command '/bin/sh -c cd /script && ./start_aliada.sh' returned a non-zero code: 127

Am I doing something wrong @carba?

carba commented 8 years ago

Hi @osma probably the system doesn't see the path corretly. Can you try to replace the step 3:

remove the line "RUN cd /script && ./start_aliada.sh" and insert in the step3 the follw line RUN sh /script/start_aliada.sh

Let me know, please

osma commented 8 years ago

Thanks for the tip @carba. However, it didn't work:

$ sudo docker build -t docker-aliada .
Sending build context to Docker daemon 3.072 kB
Step 1 : FROM corrado/aliada
 ---> 4dbdcb410b35
Step 2 : RUN echo "LC_CTYPE="en_US.UTF-8"" >> /etc/sysconfig/i18n
 ---> Using cache
 ---> 9c20ef29e37a
Step 3 : RUN /script/start_aliada.sh
 ---> Running in ce05677899d5
/bin/sh: /script/start_aliada.sh: No such file or directory
The command '/bin/sh -c /script/start_aliada.sh' returned a non-zero code: 127

I will try other things like running a shell inside the container, I just need to learn a bit more Docker...

osma commented 8 years ago

Ah, the name of the script is start-aliada.sh, not start_aliada.sh. Changing that already helps, though I haven't yet figured out how to keep it running...

osma commented 8 years ago

Okay, now I almost have it working. But there appears to be a problem with Tomcat.

Here's what I did. I disregarded the Dockerfile, because it appears to be broken from the start (the filename is wrong, and the start command is wrong) and the same things can be done on the docker command line.

First, start up the Docker image in interactive mode (also exposing port 8080 to the host):

$ sudo docker run -p 8080:8080 -it corrado/aliada

Then I get a root shell in the container. From there, I start Aliada using the provided script:

[root@f5c5360cf583 /]# /script/start-aliada.sh 
CATALINA_OPTS=-server -Xms256m -Xmx1024m
Using CATALINA_BASE:   /home/apache-tomcat-7.0.22
Using CATALINA_HOME:   /home/apache-tomcat-7.0.22
Using CATALINA_TMPDIR: /home/apache-tomcat-7.0.22/temp
Using JRE_HOME:        /usr/java/jdk1.8.0_45
Using CLASSPATH:       /home/apache-tomcat-7.0.22/bin/bootstrap.jar:/home/apache-tomcat-7.0.22/bin/tomcat-juli.jar
Tomcat partito..
Starting mysqld:                                           [  OK  ]
Mysql partito..
Virtuoso Partito..
[root@f5c5360cf583 /]# nohup: appending output to `nohup.out'

Okay, so Virtuoso, MySQL and Tomcat have started and the Docker container is still running. Now I fire up a browser at http://localhost:8080/ to access Tomcat inside the container. I get this error:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 1 in the generated java file
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files

Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:644)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.22 logs.
Apache Tomcat/7.0.22

I searched around and it seems that the problem is caused by incompatibility between this version of Tomcat and Java 8 (which is the only version of Java installed in the Docker image). So you'd have to either upgrade Tomcat (for example 7.0.50 is said to work with Java 8) or use Java 7.

@carba Did you ever get the ALIADA user interface actually working with this Docker image? There seems to be a fundamental mismatch between versions.

I'll have to give up on this for now and look for other ways of trying out ALIADA. It's just that the installation guide is way too long (17 pages if I printed it). Just trying out ALIADA is very difficult at the moment.

osma commented 8 years ago

I made one more desperate attempt to get it working.

First, I installed Java 7 in the container from the CentOS repositories: yum install java-1.7.0-openjdk

Then I configured Tomcat to use Java 7 by editing /home/apache-tomcat-7.0.22/bin/start.sh like this:

export JRE_HOME=/usr/lib/jvm/jre-1.7.0

Now I can start Tomcat and the front page http://localhost:8080/ shows the Tomcat default page.

But http://localhost:8080/aliada-user-interface-2.0/ gives a 404 error.

osma commented 8 years ago

The ALIADA installation guide says "Apache Tomcat 7.0.50 or above". The version in the container is too old.

I will stop spamming this issue with further comments, I promise...

idoiamurua commented 8 years ago

Yes. That is. It is required:

  • Tomcat 7 or above
  • Java 8
osma commented 8 years ago

I made yet another desperate attempt getting @carba's Docker image to work, since I figured it would still be easier than starting from scratch.

I installed Tomcat 7.0.65 within the container in parallel to the old version (7.0.22), moved over the WARs, fixed the startup scripts, and copied the database configuration from the old server.xml to the new one.

Now I can access the ALIADA user interface but when I log in with "admin/admin", I get the error

    The database configuration is invalid
carba commented 8 years ago

Hi @osma, sorry for delay, I'm changing the container docker to solve the problem of startup services, and I am updating the tomcat. Within tuesday I share the new container Aliada for new tests.

osma commented 8 years ago

Thanks @carba. I'll wait for your new image then.

carba commented 8 years ago

Hi @osma I released the new Aliada docker with the changes. Can you download it with the follow comand: docker pull corrado/aliada

osma commented 8 years ago

Thanks @carba. That didn't quite work (you don't have a latest tag):

$ sudo docker pull corrado/aliada
Using default tag: latest
Pulling repository docker.io/corrado/aliada
Tag latest not found in repository docker.io/corrado/aliada

However, this worked:

$ sudo docker pull corrado/aliada:v1_2

I ran it using

docker run -it corrado/aliada:v1_2

Then in the shell I executed /script/start-aliada.sh with these results:

sh: /home/apache-tomcat-7.0.22/bin/start.sh: No such file or directory
Tomcat partito..
Starting mysqld:                                           [  OK  ]
Mysql partito..
Virtuoso Partito..
[root@ee7383f34d88 script]# nohup: appending output to `nohup.out'

The script refers to a tomcat directory that doesn't exist. I could fix this myself (the directory is really /home/apache-tomcat-7.0.67) but I don't have the time to do that right now. I will try to get back to this in January.

@carba Can you please test that your image works so that one can log into ALIADA and start using it? I don't mind if there are some problems along the way, but please at least try to make sure it works for you. Just installing the software is not enough, it must also work together.

osma commented 8 years ago

I tried once more.

I used this command to start the container:

sudo docker run -p 8080:8080 -it corrado/aliada:v1_2

To fix Tomcat startup problems first I had to change the path in /script/start-aliada.sh like this:

sh /home/apache-tomcat-7.0.67/bin/start.sh

Then I had to change the paths in /home/apache-tomcat-7.0.67/bin/start.sh like this:

export CATALINA_BASE=/home/apache-tomcat-7.0.67
export CATALINA_HOME=/home/apache-tomcat-7.0.67
export CATALINA_TMPDIR=${CATALINA_BASE}/temp
export JRE_HOME=/usr/java/latest

After these changes I was able to run /script/start-aliada.sh successfully.

Now I fired up my browser at http://localhost:8080/aliada-user-interface-2.0/ and got the login form. I tried to log in with aliada/aliada and got the error message "The database configuration is invalid", just as before.

I checked the logs in /home/apache-tomcat-7.0.67/logs/ and found this exception traceback that might be relevant:

Jan 11, 2016 1:02:55 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/rdfizer.xml]: Cannot resolve reference to bean 'dataSource' while setting bean prope
rty 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [jdbc
/aliada] is not bound in this Context. Unable to find [jdbc].
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1417)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1158)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5077)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5591)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263)
        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1975)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [jdbc/aliada] is not bound in th
is Context. Unable to find [jdbc].
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        ... 28 more
Caused by: javax.naming.NameNotFoundException: Name [jdbc/aliada] is not bound in this Context. Unable to find [jdbc].
        at org.apache.naming.NamingContext.lookup(NamingContext.java:819)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:167)
        at org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
        at javax.naming.InitialContext.lookup(InitialContext.java:417)
        at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
        at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
        at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
        at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
        at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:104)
        at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
        at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:231)
        at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:217)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
        ... 35 more

So there are still at least three problems with the Docker image:

  1. The startup script start-aliada.sh has an invalid path to Tomcat
  2. The Tomcat startup script start.sh has an invalid path to Tomcat and Java
  3. ALIADA doesn't work, it says "The database configuration is invalid"

I can fix 1 and 2 myself (see above how I fixed them) but 3 requires detailed knowledge of ALIADA database setup.

carba commented 8 years ago

Hi @osma, I have been fixed the points 1 and 2 a few weeks ago (I need to refresh the repository of aliada). For the jdbc error I need @idoiamurua

osma commented 8 years ago

@carba OK thanks for the update. I'll wait for a solution to the database issue then.

idoiamurua commented 8 years ago

Hi,

As mentioned in the wiki page at https://github.com/ALIADA/aliada-tool/wiki/Installation_Guide#step-5-modules-installation , ALIADA requires a datasource with a JNDI name "jdbc/aliada" defined in the Servlet Engine / Application Server. This is done in Tomcat by placing the following lines in context.xml file:

<!-- ALIADA JNDI  -->
    <Resource 
        factory="org.apache.commons.dbcp.BasicDataSourceFactory"
        name="jdbc/aliada"
        auth="Container"
        type="javax.sql.DataSource"
        username="aliada" password="aliada"
        driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost:3306/aliada"
        maxActive="2"
        maxIdle="2"/>
<!--  ALIADA: Params to create the sub_jobs properties files of aliada-links-discovery app: BEGIN -->
    <Parameter name="ddbb.username" value="aliada"
         override="false"/>
    <Parameter name="ddbb.password" value="aliada"
         override="false"/>
    <Parameter name="ddbb.driverClassName" value="com.mysql.jdbc.Driver"
         override="false"/>
    <Parameter name="ddbb.url" value="jdbc:mysql://localhost:3306/aliada"
         override="false"/>
<!--  ALIADA: Params to create the sub_jobs properties files: END -->
osma commented 8 years ago

@idoiamurua Thanks for the clarification. The instructions in the wiki are a bit unclear:

  1. The wiki page says that the snippet can go in either server.xml or context.xml, but is that right? You're saying they should be placed in context.xml. @carba had placed the snippet in server.xml inside the <Host> element near the bottom of the file. Should it instead be placed inside the <GlobalNamingResources> element or does that matter?
  2. Your snippet above isn't exactly the same as the one in the wiki. The wiki version lacks the comments and the attribute factory="org.apache.commons.dbcp.BasicDataSourceFactory". Also the wiki version has `name="jdbc/aliada"``while you have the name without any asterisks. I'm not sure whether these differences are significant or not.

I've edited my context.xml file according to the instructions you gave in the previous comment:

<Context>

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->
<!-- ALIADA JNDI  -->
    <Resource
        factory="org.apache.commons.dbcp.BasicDataSourceFactory"
        name="jdbc/aliada"
        auth="Container"
        type="javax.sql.DataSource"
        username="aliada" password="aliada"
        driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost:3306/aliada"
        maxActive="2"
        maxIdle="2"/>
<!--  ALIADA: Params to create the sub_jobs properties files of
aliada-links-discovery app: BEGIN -->
    <Parameter name="ddbb.username" value="aliada"
         override="false"/>
    <Parameter name="ddbb.password" value="aliada"
         override="false"/>
    <Parameter name="ddbb.driverClassName" value="com.mysql.jdbc.Driver"
         override="false"/>
    <Parameter name="ddbb.url" value="jdbc:mysql://localhost:3306/aliada"
         override="false"/>
<!--  ALIADA: Params to create the sub_jobs properties files: END -->

</Context>

However, after restarting Tomcat, the ALIADA login form still says "The database configuration is invalid" and I get a Java traceback in /home/apache-tomcat-7.0.67/logs/localhost.2016-01-21.log saying javax.naming.NameNotFoundException: Name [jdbc/aliada] is not bound in this Context. Unable to find [jdbc]. so changing this didn't help the situation.

Possibly another problem is that MySQL hasn't been set up to accept the aliada user with password aliada:

# mysql -u aliada -p aliada
Enter password: (I typed "aliada" here)
ERROR 1045 (28000): Access denied for user 'aliada'@'localhost' (using password: YES)

Is there any chance of getting a working Docker image of ALIADA soon? I've tried to make this work several times but I feel that I'm not making much progress...

carba commented 8 years ago

Hi @idoiamurua and @osma I will be busy until tomorrow to other projects. Monday I will be available to check Aliada into docker until aliada works properly into docker

carba commented 8 years ago

Hi @osma, this piece of code was implemented in the server.xml file rather than in the file context.xml. Is also necessary to put a reference in the file /etc/hosts like this: 127.0.0.1 localhost aliada

<Resource name="jdbc/aliada" auth="Container" type="javax.sql.DataSource" username="admin" password="admin" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://aliada:3306/aliada" maxActive="2" maxIdle="2"/>

Another thing, I can't connect with "aliada" user on the db. on this issue I'll know tomorrow

osma commented 8 years ago

Thanks for the update @carba! I look forward to trying a new version of the image.

carba commented 8 years ago

as soon as I finish these changes and the I test them, I put a new version of Aliada and I warn you ;)

osma commented 8 years ago

@carba Any news about this?

carba commented 8 years ago

Hi @osma as soon as possible I put the new docker image in the repository. Sorry for delay

idoiamurua commented 8 years ago

@carba I have just uploaded some changes of the aliada-ckan-datahub-page-creation module to Github. It is related to issue #171 . The reason for these changes are that the CKAN API URL has changed from: http://datahub.io/api/action To: https://datahub.io/api/action

The new URL has been updated in the ckan_api_url column of the organization DB table. The CKAN module code has also been updated, so that an SSL connection is stablished