Page 1 of 1

Role setup gone wrong

PostPosted:Thu Dec 29, 2011 1:20 pm
by esuntu
Hello,

Before reading documentation about the AdminRole and UserRole, I deleted the AdminRole and created my own "Administrator" at the adminitration panel. After that I've got 403 error at login (for okmAdmin user). Then I changed the default role names at "/server/default/deploy/OpenKM.war/WEB-INF.web.xml" as follows:
Code: Select all
...
<security-constraint>
    <web-resource-collection>
      <web-resource-name>OpenKM Protected Area</web-resource-name>
      
      <!-- GWT -->
      <url-pattern>/frontend/*</url-pattern>
      
      <!-- JSPs -->
      <url-pattern>/admin/*</url-pattern>
      <url-pattern>/mobile/*</url-pattern>
      <url-pattern>/mobile-nt/*</url-pattern>
      
      <!-- Servlets -->
	  <url-pattern>/RepositoryStartup</url-pattern>
	  <url-pattern>/TextToSpeech</url-pattern>
	  <url-pattern>/Test</url-pattern>
	  <url-pattern>/frontend/*</url-pattern>
	  <url-pattern>/extension/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
	  <role-name>Administrator</role-name>
	  <role-name>UserRole</role-name>
   	</auth-constraint>
   	<user-data-constraint>
      <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
  </security-constraint>

  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>OpenKM</realm-name> 
    <form-login-config>
      <form-login-page>/login.jsp</form-login-page>
      <form-error-page>/login.jsp?error=1</form-error-page>
    </form-login-config>
  </login-config>

  <security-role>
    <description>Admin user access</description>
    <role-name>Administrator</role-name>
  </security-role>

  <security-role>
    <description>General user access</description>
    <role-name>UserRole</role-name>
  </security-role>



Now I can login, but after login I get error "OKM-012015(GetRootFolder): path doesnt exist" and nothing else is loading.
As how much i understand - somewhere something is wrong with the role name "Administrator" and "AdminRole".

How can I fix this situation (for e.g. change the roles back to AdminRole or)? No files or directories are made, so I would be fine even with data reset (users and files). I dont really want to reinstall everything.

Re: Role setup gone wrong

PostPosted:Sun Jan 01, 2012 9:42 pm
by jllort
You should change in database ( configuration parameter ) the parameter default.admin.role in table OKM_CONFIG

Re: Role setup gone wrong

PostPosted:Mon Jan 02, 2012 7:03 am
by esuntu
Thanks, but how can i do that?

Iam runnng the latest OpenKm 5.1.8 bundle with jBoss running the default database on a CentOs machine without GUI.

The Browsing embedded database is not working (as my server has no gui). Can i change the parameter in some other way (via command line, a database client)?

Re: Role setup gone wrong

PostPosted:Mon Jan 02, 2012 8:12 am
by esuntu
Ok, I have now achieved to connect remotely to hsqldb with the RazorSQL client (I editted the /server/default/deploy/hsqldb-ds.xml file to server mode).
The connection via 1701 port is ok, but i got an error:
Code: Select all
ERROR: An error occurred while trying to make a connection to
the database: 

JDBC URL: jdbc:hsqldb:hsql://62.63.152.7:1701/OKM_APP

S1000
General error java.lang.RuntimeException:
database alias does not exist
If I connect to "jdbc:hsqldb:hsql://62.63.152.7:1701/", the connection is made, but there are no information about databases or something else.

Am I doing something wrong?

Re: Role setup gone wrong

PostPosted:Tue Jan 03, 2012 12:11 pm
by jllort
Browsing embeded database only will run in openkm server not in network one

The most simply way for doing it is:
stop jboss
open JBOSS_HOME/server/default/data/hypersonic/OKM_APP.script there're are all inserts, simply modify
start jboss

I don't know why do you need this kind of change ? why you can not survive with default UserRole and AdminRole names ?

Re: Role setup gone wrong

PostPosted:Tue Jan 03, 2012 12:20 pm
by esuntu
Thanks, that worked!

I can live with them. Its just I changed them from the web panel and after that I couldn't get on it again (so no possibility to change them back).

Re: Role setup gone wrong

PostPosted:Mon Jan 09, 2012 6:19 pm
by pavila
Is better to configure a "real" database like MySQL or PostgreSQL.

Re: Role setup gone wrong

PostPosted:Mon Nov 26, 2012 3:26 am
by rmm
how to view the embedded database in the new release (v.6)?

Re: Role setup gone wrong

PostPosted:Mon Nov 26, 2012 7:44 pm
by jllort
Simply configure hsql ( file ) via jdbc using some application like for example datastudio ( take a look at server.xml to see the jdbc connection url this will give to you some idea how configure with application ). Important if openkm is started you can not connect to hsql database only one connection is allowed.