Forum Ametys

Forum de la communauté Ametys

You are not logged in.

#1 Administration » Java Process Won't Die » 25/11/2013 23:35:46

mcdons
Replies: 1

I am having a problem with my Ametys install. I noticed that after the installation and configuration of Ametys cms and site webapplications I am running into an issue where the tomcat shutdown script doesn't actually kill the java process that it started, but it stops without an error code. It appears that Ametys creates a non-daemon task and it isn't shutting down at the time of the tomcat shutdown.sh script, thus the java process is still active. And when I run the startup.sh script afterwards, it creates another java process.

The issue goes away when I uninstall the cms and site webapplications from tomcat. Then the java process is killed by running the shutdown.sh script.

Have you had any experience with this before? Could you point me in the right direction as to how to find the exact error/proper fix?

#2 Re: Users » Creation of Custom Widget (Service?) » 14/11/2013 20:59:34

The layout of my widget is as follows:

$CATALINA_HOME
    |-- webapps
        |-- cms
            |-- spreadsheet-1.0
                |-- plugin.xml
                |-- sitemap.xmap
                |-- spreadsheet.html (html file who's resources are not loading)
                |-- resources
                    |-- scripts
                        |-- testJavaScript.js
                    |-- images
                        |-- testImage.jpg
                    |-- styles
                        |-- testCSS.css

The attempted JS scripts that have all failed are:

<script type="text/javascript" src="testJavaScript.js"></script>

<script type="text/javascript" src="scripts/testJavaScript.js"></script>

<script type="text/javascript" src="resources/scripts/testJavaScript.js"></script>

The image and css scripts follow the same pattern of failure. According to your last post I would think that the second one would work, "scripts/testJavaScript.js", but alas it does not.

As far as if it is a correctly loaded plugin or not, you can see my plugin.xml file above as corrected by Cédric Damioli. And the service is loaded, put in a page, and functioning. And I have found it in the cms/_admin app under the correct plugin extension-point. I don't know what you mean by "set the logs in "warning" to see if your plugin is NOT loaded" but I can't fine an error pointing to the loading of THIS plugin in the Ametys logs under the $CATALINA_HOME/webapps/cms/WEB-INF/logs/ directory.

There are a couple of errors for a failed plugin load but none of the url's mentioned or files pointed to are my plugin's files. And in fact when I remove my plugin and restart Ametys, the same errors are reported, thus none of them are pointing to my plugin.

#3 Re: Users » Creation of Custom Widget (Service?) » 14/11/2013 00:19:56

I got the plugin.xml file up and running and the service showed up and is rendering the html file that I declared in my file generator in the xmap file. But I am having some issues with the routing of resource requests (js, css, img files) via my xmap file.

I have a reader defined and I am matching appropriate url's, as defined in the html file I am reading through, but I am getting a "No pipeline matched request: ..." error for my JS and CSS files.

If I am reading the error correctly, it is not looking in my defined sitemap.xmap file, but instead it is reading "resource://org/ametys/runtime/kernel/sitemap.xmap" this it would not finding the <map:match> with a matching pattern I defined in my xmap file.

Is there something I am missing here? It seems like the request isn't being completely handled by the cocoon pipeline I defined for my service.

#4 Re: Users » Creation of Custom Widget (Service?) » 11/11/2013 21:02:02

As per your suggestion I tried to load the service by putting it un-packed and flattened in the 'webapp-root/plugins' directory and it tried to load the service but I am getting an error that I can't parse through myself. It is finding my service, trying to load it but something is wrong with my plugin.xml file, specifically with my <extension> tag.

java.lang.RuntimeException: Unable to access to plugin at /var/lib/tomcat7/webapps/cms/plugins/spreadsheet-1.0/plugin.xml
... ... ...
Caused by: org.xml.sax.SAXParseException; systemId: file:///var/lib/tomcat7/webapps/cms/plugins/spreadsheet-1.0/plugin.xml; lineNumber: 10; columnNumber: 51; cvc-complex-type.2.4.a: Invalid content was found starting with element 'extension'. One of '{"http://www.ametys.org/schema/plugin":config, "http://www.ametys.org/schema/plugin":extension-points,
"http://www.ametys.org/schema/plugin":feature}' is expected.
... ... ...

This is my plugin.xml file:

<?xml version="1.0" encoding="UTF-8" ?>

<plugin xmlns="http://www.ametys.org/schema/plugin"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.ametys.org/schema/plugin http://www.ametys.org/schema/plugin-2.0.xsd"
        runtimeVersion="2.0" version="2.0">
    
    <extensions>
        <extension point="org.ametys.web.service.ServiceExtensionPoint"
            class="org.ametys.web.service.StaticService"
            id="org.ametys.plugins.spreadsheet.Spreadsheet">
 
            <url>service/spreadsheet/spreadsheet.xhtml</url>
 
            <label i18n="false">Spreadsheet</label>
            <description i18n="false">Create Custom Spreadsheet</description>
 
        </extension>
    </extensions>
    
</plugin>

I didn't know what to put for the "id", "point", or "class" in the <extension> tag. I copied the "point" and "class" from the aforementioned google maps plugin, and for the "id" I copied the pattern used by the google maps plugin but replaced where applicable. I don't know what these attributes mean or what they point to.

#5 Re: Users » Creation of Custom Widget (Service?) » 08/11/2013 22:44:38

I noticed that the existing services distributed with Ametys are all located in the $CATALINA_HOME/webapps/cms/WEB-INF/lib folder as a pair of jar files, one with the service java classes, cocoon pipeline xmap file, plugin.xml file, etc.; the other with various resources, images, css files, js files, etc.

I have tried to create a proof of concept service following this template with no success. I followed the layout of the google maps plugin.

I created a plugin.xml file that I believe has the minimum requirements filled out:

<?xml version="1.0" encoding="UTF-8" ?>

<plugin xmlns="http://www.ametys.org/schema/plugin"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.ametys.org/schema/plugin http://www.ametys.org/schema/plugin-2.0.xsd"
        runtimeVersion="2.0" version="2.0">
    
    <extension point="org.ametys.web.service.ServiceExtensionPoint"
        class="org.ametys.web.service.StaticService"
        id="org.ametys.plugins.spreadsheet.Spreadsheet">
 
        <url>service/spreadsheet/spreadsheet.xhtml</url>
 
        <label>PLUGINS_SPREADSHEET_SERVICE_LABEL</label>
        <description>PLUGINS_SPREADSHEET_SERVICE_DESCRIPTION</description>
 
    </extension>
    
</plugin>

I am unsure what to put into the id attribute of the extension tag and I am unsure what to put into the label and description tags. It looks like the existing services use place holders that get replaced somehow but I am not sure.

I also created a cocoon pipeline with a <map:match> who's pattern matches the url from the plugin.xml file. The pipeline is very simple for proof of concept purposes. It is the default file generator with src pointing to a xhtml file with some static html on it, and the cocoon xhtml serializer, I got the declaration from the Apache Cocoon website.

I packed up these files into a jar file and put them into the $CATALINA_HOME/webapps/cms/WEB-INF/lib folder. Then I restarted Ametys and, not too surprisingly the service didn't show up. I then restarted Tomcat and the service didn't show up. What am I missing?

#6 Users » Creation of Custom Widget (Service?) » 01/11/2013 00:22:02

mcdons
Replies: 9

I have been tasked with the creation of a custom widget for our Ametys CMS instance. The desired use-case for this custom widget is as follows:

The content editor logs into the CMS.
He/She starts editing a web page.
He/She selects to add this widget to a content box on the page.
He/She is prompted with a configuration popup where a form of config settings is filled out (in this pop-up communication with internal and external servers may need to occur so some custom JS handlers will likely be necessary).
He/She saves the configuration and the content area is now populated with custom HTML and JS, which has been affected by the entered config settings.

The behavior of this widget is going to change based on the credentials of the person logged in at the time it is included in a page, in the Back End, and at the time it is viewed in the Front End.

From what I can tell this behavior looks like what is happening with a service. And I found some info about services in the Wiki, but the pages are very incomplete and don't have very useful explanation of what a service is and how to incorporate it into the CMS.


Can you give me a better explanation of what a service is and how to create a custom service to be incorporated into the CMS?

Also if there is a better option for getting the desired use-case behavior please let me know. I want to do this is proper Amertys' way.

Thanks.

#7 Re: Administration » Stuck on CMS Splash Screen » 17/10/2013 20:46:42

I have tried it on both up-to-date Firefox (v 24.0) and Chromium (v 28.0.1500.71). On both of these browsers I get the warning page that the browser is not supported though.

The demo works for both of them just fine. But my page was getting stuck on 0% on the loading page after the user login.

I have checked the log files for Tomcat and found nothing, just the list of previous successful GET requests.
I checked the log files for Ametys CMS and there was nothing listed there.
When I looked at the requests on Firebug the request was just sitting there waiting for the server but the server didn't seem to get the request at all.

But after 20 minutes or so of restarting and re-testing and deleting/re-checking the log files it started to work. I have no idea what make the difference that got it to work because I didn't do anything afterwards that I didn't also do before I created this thread. But the CMS is in fact working without any errors now.

#8 Administration » Stuck on CMS Splash Screen » 17/10/2013 01:02:18

mcdons
Replies: 4

I had a lot of configuration errors when I tried to initially setup the CMS but I finally got past them as per my previous Forum post

I got the administration pages to load and I created a new classic, empty website and a user that I set as the manager for said site. The next step was to go into the site's CMS back end and do the fun stuffs but this is where my issue starts.

To open the site I tried a few different ways but they all lead to the same result. One of them I tried was from the admin page url:"localhost:8080/cms/_admin/_plugins/web/administrator/sites/view.html", by selecting the site and then clicking "Open website as a contributor" button. I got the same result from going to the cms url:"localhost:8080/cms".

What is happening when it starts to load is that I get the loading splash screen, but it gets stuck at 0% and doesn't progress. I checked the network requests and it correctly loads several resources from the html page but it is stuck on a request for "1609486333-false.js" The GET request url it sent for is http://localhost:8080/cms/plugins/core/jsfilelist/1609486333-false.js

I checked my Tomcat server log files and it didn't have an entry for the GET request and has no error messages. I didn't get any errors in my browser's console. I didn't get any errors in my Ametys log either. It just appears to be stuck and no program is taking responsibility for the error so it isn't being reported and I can't find what the error is.

#9 Re: Administration » Empty Config Error Codes » 16/10/2013 22:03:34

I did discover that I should have been using on some of the scripts, the jdbc_users_auth.sql and the jdbc_fousers_auth.sql so long as I am not doing 3rd party authorization, the sql scripts differ from their non "_auth.sql" counterparts by just the 'password' field.

I dropped the 'Users' and the 'FOUsers' tables and ran the "_auth.sql" versions of the two scripts and it solved my problem. I am currently not having any issues with the CMS.

Thank you for the help and I will not hesitate to post on here again if I run into more problems.

#10 Re: Administration » Empty Config Error Codes » 16/10/2013 21:49:20

Thank you for the response and the direction towards permissions being the issue. I have thus fixed my file permissions by:
Putting my tomcat7 user, generated by apt-get install tomcat7, and the user that ametys is run on (my user) in the same group and gave that group write permissions, recursively, for the $CATALINA_HOME/webapps directory.

Now I have worked through a few of the config issues, correct variable names and more access issues, with the help of the log file's Java stack traces and various online resources including the source to jackrabbit and ametys itself.

I got the site up and running and am now having a problem with creating a user from the administrator area under users management, url:"localhost:8080/cms/_admin/_plugins/core/users/view.html". The error is a com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException with description "Unknown column 'password' in 'field list'".

When I checked out the MySQL tables created by running all of the .sql scripts located in cms/WEB-INF/scripts/mysql I found the user table but it didn't have a password field. I couldn't find any logical place where it would put the password for a user actually. I was wondering if I shouldn't have ran all the .sql scripts but should have picked particular ones to run instead because there are several that appear to be similar and I remember running into a post someone made about asking which ones to run and the response was not to run them all but just some particular ones. However every guide I have found online showed to just run them all and they didn't appear to have issues.

Could you shed light on my problem and what scripts I should run and which ones maybe I shouldn't? I am using default authentication from ametys not doing anything special with user auth such as 3rd person software, etc.

#11 Administration » Empty Config Error Codes » 15/10/2013 18:57:47

mcdons
Replies: 4

I am having problems installing Ametys CMS on my test/proof of concept environment. The error happens when I try to submit my configuration settings on the first run of the CMS, but there is no associated error code/message with the error pop-up so I have no idea what is wrong with my setup/configuration. Is there a log file or something of the sort that I can examine to see what specifically is wrong with my particular configuration settings?

A second question I have is if it is even possible to install Ametys CMS within the environment that I am using:
Linux Ubuntu 12.4.3_i386 (32 bit) (on a VM for test purposes right now)
Java JDK 7_40
Apache Tomcat 7.0.42
MySQL 5.5.32
MySQL Connector J 5.1.26
Modern Browser (FF or Chrome, most recent version, or IE10)

I require the use of a Linux OS and Apache Tomcat 7.x and running the CMS on a modern FF or Chrome or IE10. The DB and JDBC driver used can be changed if they are incompatible.

Board footer

Powered by FluxBB