Issue Details (XML | Word | Printable)

Key: BCMS-67
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Savvas Triantafyllou
Reporter: Panagiotis Kranidiotis
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
BetaCMS

create-new-repository.sh script creates invalid betacms-repositories-configuration.xml if file does not already exist

Created: 01/Sep/09 09:13 PM   Updated: 02/Sep/09 10:54 AM
Component/s: None
Affects Version/s: 2.1.0.CR1
Fix Version/s: 2.1.0.CR1

Time Tracking:
Not Specified

File Attachments: 1. XML File betacms-repositories-configuration.xml (4 kB)
2. File create-new-repository.sh (10 kB)
3. Text File log2server02092009.txt (197 kB)
4. Text File log3.txt (122 kB)
5. Text File log_my_server_ubuntu.txt (195 kB)
6. Text File log_server_fedora.txt (196 kB)

Environment: fedora 10


 Description  « Hide


in line 203

" ssh $postgresUsername@$postgresHost '/usr/bin/createdb -E UNICODE $NEW_REPOSITORY_ID' "

should be

" ssh $postgresUsername@$postgresHost '/usr/bin/createdb -E UNICODE $NEW_REPOSITORY_ID' "

the script does not create db and returns

createdb: database creation failed: ERROR: database "postgres" already exists

whitch means that for $NEW_REPOSITORY_ID

in

" ssh $postgresUsername@$postgresHost '/usr/bin/createdb -E UNICODE $NEW_REPOSITORY_ID' "

returns postgres instead of the name of repository we want to create

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Panagiotis Kranidiotis added a comment - 01/Sep/09 09:14 PM
also in line 166

if [! -n "$REPOSITORY_ALREADY_CONFIGURED" ]; then

should be

if [ ! -n "$REPOSITORY_ALREADY_CONFIGURED" ]; then

Panagiotis Kranidiotis added a comment - 01/Sep/09 09:34 PM
These 2 files are from different installations with the same scripts

using the new create-new-repository.sh

and creating manually the databases

Panagiotis Kranidiotis added a comment - 01/Sep/09 10:04 PM
The problem is here. That's why it cannot create repository

01:01:18,184 ERROR [MainDeployer] Could not create deployment: file:/opt/jboss-4.2.3.GA/server/default/deploy/betacms-repository-2.1.0-SNAPSHOT.spring
org.jboss.deployment.DeploymentException: Error creating bean with name 'repositoryDao': Autowiring of fields failed; nested exception is org.springframework
.beans.factory.BeanCreationException: Could not autowire field: private org.betaconceptframework.betacms.repository.configuration.RepositoryConfigurationLoad
er org.betaconceptframework.betacms.repository.jcr.dao.RepositoryDao.repositoryConfigurationLoader; nested exception is org.springframework.beans.factory.Bea
nCreationException: Error creating bean with name 'repositoryConfigurationLoader' defined in class path resource [cmsrepository-configuration.xml]: Invocatio
n of init method failed; nested exception is org.springframework.oxm.jaxb.JaxbUnmarshallingFailureException: JAXB unmarshalling exception: null; nested excep
tion is javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'betacmsRepository'.]; - nested throwable: (org.springframework.beans.facto
ry.BeanCreationException: Error creating bean with name 'repositoryDao': Autowiring of fields failed; nested exception is org.springframework.beans.factory.B
eanCreationException: Could not autowire field: private org.betaconceptframework.betacms.repository.configuration.RepositoryConfigurationLoader org.betaconce
ptframework.betacms.repository.jcr.dao.RepositoryDao.repositoryConfigurationLoader; nested exception is org.springframework.beans.factory.BeanCreationExcepti
on: Error creating bean with name 'repositoryConfigurationLoader' defined in class path resource [cmsrepository-configuration.xml]: Invocation of init method
 failed; nested exception is org.springframework.oxm.jaxb.JaxbUnmarshallingFailureException: JAXB unmarshalling exception: null; nested exception is javax.xm
l.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'betacmsRepository'.])

Savvas Triantafyllou added a comment - 02/Sep/09 06:40 AM
Here is the script which contains fixes for the bugs reported.

Please try it and report any inconsistencies.

Nevertheless, if you have manually corrected line 166 and have created database by your self, you should not have any problem.

Do you run script as root?

Can you attach the contents of file JBOSS-HOME/server/default/conf/betacms-repositories-configuration.xml ?


 

Panagiotis Kranidiotis added a comment - 02/Sep/09 08:09 AM
<betacmsRepository
                id="kedke"
                jcr-repository-jndi-name="java:jcr/kedke"
                betacms-db-jndi-name="java:jdbc/kedke"
                jaasApplicationPolicyName="betacms"
                authenticationTokenTimeout="30"
                disableSecurity="false"
                serverAliasURL="http://localhost:8080"
                >

                <localization>
                        <localizedLabel locale="el">kedke</localizedLabel>
                        <localizedLabel locale="en">kedke</localizedLabel>
                </localization>

                <security>
                <permanentUserKeyList>
                                    <permanentUserKey userid="anonymous,SYSTEM" key="KEY"/>
                      </permanentUserKeyList>
                </security>

</betacmsRepository>


<betacmsRepository
                id="paratiritirio"
                jcr-repository-jndi-name="java:jcr/paratiritirio"
                betacms-db-jndi-name="java:jdbc/paratiritirio"
                jaasApplicationPolicyName="betacms"
                authenticationTokenTimeout="30"
                disableSecurity="false"
                serverAliasURL="http://localhost:8080"
                >

                <localization>
                        <localizedLabel locale="el">paratiritirio</localizedLabel>
                        <localizedLabel locale="en">paratiritirio</localizedLabel>
               </localization>

                <security>
                <permanentUserKeyList>
                                    <permanentUserKey userid="anonymous,SYSTEM" key="KEY"/>
                      </permanentUserKeyList>
                </security>

</betacmsRepository>

</ns:betacmsRepositories>

Savvas Triantafyllou added a comment - 02/Sep/09 08:25 AM
Unless you have made an error in copy xml contents, your betacms-repositories-configuration.xml is missing xml declaration and root element, that is

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

  Copyright (C) 2005-2009 BetaCONCEPT LP.
 
  This file is part of BetaCMS.
 
  BetaCMS is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.
 
  BetaCMS is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU Lesser General Public License for more details.
 
  You should have received a copy of the GNU Lesser General Public License
  along with BetaCMS. If not, see <http://www.gnu.org/licenses/>.
 
 -->
<ns:betacmsRepositories
xmlns:ns="http://www.betaconceptframework.org/schema/betacms/betacmsRepositories"
serverURL="http://localhost:8080"
jaasApplicationPolicyName="betacms"
authenticationTokenTimeout="30"
disableSecurity="false">


if you add the above to the beginning of the file , it should be ok.

However, I would suggest you do the following :

1. Rename existing betacms-repositories-configuration.xml to betacms-repositories-configuration_OLD.xml
2. Run install.sh again
3. Check that newly created betacms-repositories-configuration.xml is a valid XML, that is, it contains the above xml excerpt.
4. If it is not valid report back to this issue.
5. If betacms-repositories-configuration.xml is valid, run create-new-repository.sh again and check betacms-repositories-configuration.xml
6. If it is not a valid xml report back to this issue
7. If xml is valid, then for some reason you have corrupted betacms-repositories-configuration.xml prior to starting JBoss

Panagiotis Kranidiotis added a comment - 02/Sep/09 08:28 AM
The latest log file 11:27 02/09/2009

Panagiotis Kranidiotis added a comment - 02/Sep/09 10:29 AM
the latest log files after your comments.

It is crusial first to run ./install.sh and THEN the ./create-new-repository.sh in order to have valid betacms-repositories-configuration.xml

Savvas Triantafyllou added a comment - 02/Sep/09 10:52 AM
It is assumed that install.sh has been executed at least once prior to creating a new repository as described in http://www.betacms.org/portal/resource/section/installlationInstructions .

Nevertheless, script has been modified so that betacms-repositories-configuration.xml is created properly if not found.

βCMS distribution betacms-distribution-2.1.0-SNAPSHOT-20090902.134732 contains the correct script

Savvas Triantafyllou added a comment - 02/Sep/09 10:54 AM
Forgot to provide full URL for the distribution

http://www.betacms.org/nightly_builds/betacms-distribution-2.1.0-SNAPSHOT-20090902.134732/

or you can visit http://www.betacms.org and click on the Download link

Thnx!